:root {
    --green-deep: #1B4332;
    --green-mid: #2D6A4F;
    --green-light: #52B788;
    --gold: #C9A84C;
    --gold-light: #E8C96B;
    --cream: #F9F5EC;
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --red: #DC2626;
    --blue: #2563EB;
    --purple: #7C3AED
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: 'Inter', sans-serif;
    background: #F1F5F2;
    color: #1A1A1A
}

/* LOGIN */
#loginPage {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--green-deep) 0%, var(--green-mid) 55%, #40916C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden
}

#loginPage::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23C9A84C' fill-opacity='0.06'%3E%3Cpath d='M30 0L36 12L48 6L42 18L54 24L42 30L48 42L36 36L30 48L24 36L12 42L18 30L6 24L18 18L12 6L24 12Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.8rem 2.4rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .2);
    position: relative;
    z-index: 1
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem
}

.login-title {
    font-family: 'Lora', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--green-deep);
    text-align: center;
    margin-bottom: .3rem
}

.login-sub {
    text-align: center;
    font-size: .82rem;
    color: #6B7280;
    margin-bottom: 2rem
}

.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .4rem
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 7px;
    border: 1.5px solid #E5E7EB;
    transition: border-color .2s, box-shadow .2s
}

.form-control:not(.form-control-sm):not(.form-control-lg) {
    font-size: .875rem;
    padding: .65rem .9rem;
}

.form-select:not(.form-select-sm):not(.form-select-lg) {
    padding: .65rem 2.25rem .65rem .9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .12)
}

/* SELECT 2 */
.select2-container--bootstrap-5 .select2-selection--single {
    border: 1.5px solid #E5E7EB;
    border-radius: 7px;
    transition: border-color .2s, box-shadow .2s;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    font-size: .875rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection--single,
.select2-container--bootstrap-5.select2-container--open .select2-selection--single,
.select2-dropdown.select2-dropdown--below,
.select2-dropdown.select2-dropdown--below .select2-search__field,
.select2-dropdown.select2-dropdown--above,
.select2-dropdown.select2-dropdown--above .select2-search__field {
    border-color: var(--green-mid) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .12) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    border: 1.5px solid #E5E7EB;
    border-radius: 7px;
    transition: border-color .2s, box-shadow .2s;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection--multiple {
    border-color: var(--green-mid) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .12) !important;
}

.select2-container--bootstrap-5.select2-container--open .select2-selection--single {
    border-color: var(--green-mid) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .12) !important;
}

.select2-results__option--highlighted {
    background-color: var(--green-mid) !important;
    color: #fff !important;
}

.select2-results__option--selected {
    background-color: var(--green-mid) !important;
    color: #fff !important;
}

.btn-login {
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    color: #fff;
    border: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: .9rem;
    padding: .75rem;
    width: 100%;
    transition: opacity .2s, transform .2s
}

.btn-login:hover {
    opacity: .92;
    transform: translateY(-1px);
    color: #fff
}

.btn-primary-c {
    background: var(--green-deep);
    color: #fff;
    font-weight: 600;
    border: none;
}

.btn-primary-c:hover {
    background: var(--green-mid);
    color: #fff;
}

.login-hint {
    background: var(--cream);
    border-radius: 7px;
    padding: .7rem 1rem;
    font-size: .78rem;
    color: #555;
    margin-top: 1.2rem;
    border-left: 3px solid var(--gold)
}

/* SHELL */
#adminShell {
    display: block;
    min-height: 100vh
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--green-deep);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s
}

.sidebar-brand {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: .8rem
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: rgba(201, 168, 76, .18);
    border: 1px solid var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.1rem
}

.sidebar-brand-text {
    font-family: 'Lora', serif;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2
}

.sidebar-brand-sub {
    font-size: .66rem;
    color: var(--gold-light);
    letter-spacing: .1em;
    text-transform: uppercase
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0
}

.nav-section-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
    padding: .9rem 1.4rem .4rem
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.4rem;
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    font-size: .855rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .18s;
    cursor: pointer
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    border-left-color: var(--gold)
}

.sidebar-link.active {
    color: #fff;
    background: rgba(201, 168, 76, .14);
    border-left-color: var(--gold)
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center
}

.badge-nav {
    margin-left: auto;
    font-size: .65rem;
    background: var(--gold);
    color: var(--green-deep);
    border-radius: 20px;
    padding: .15rem .55rem;
    font-weight: 700
}

.sidebar-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, .08)
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-deep);
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0
}

.sidebar-username {
    font-size: .82rem;
    font-weight: 600;
    color: #fff
}

.sidebar-role {
    font-size: .7rem;
    color: var(--gold-light)
}

/* SIDEBAR DROPDOWN ANIMASI */
.sidebar-submenu {
    background: rgba(255, 255, 255, .03);
    margin-left: 0;
    padding-left: 1.8rem;
    border-left: 2px solid rgba(255, 255, 255, .08);
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
    max-height: none;
    transition: transform .2s ease, opacity .2s ease;
}


.sidebar-submenu.show {
    padding-top: .3rem;
    padding-bottom: .3rem;
    transform: scaleY(1);
    opacity: 1;
}

.sidebar-submenu .sidebar-link {
    padding: .55rem 1.2rem;
    font-size: .82rem;
    color: rgba(255, 255, 255, .65);
    transition: background .2s, color .2s;
}

.sidebar-submenu .sidebar-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-left-color: var(--gold);
}

.sidebar-submenu .sidebar-link.active {
    background: rgba(201, 168, 76, .14);
    color: #fff;
    border-left-color: var(--gold);
}

/* Icon caret animasi */
.sidebar-link.dropdown-toggle::after {
    margin-left: auto;
    transition: transform .3s ease;
}

.sidebar-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}


/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 999;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06)
}

.topbar-title {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green-deep);
    flex: 1
}

.topbar-title span {
    font-family: 'Inter', sans-serif;
    font-size: .78rem;
    color: #9CA3AF;
    font-weight: 400;
    margin-left: .5rem
}

.btn-topbar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    cursor: pointer;
    transition: all .18s;
    font-size: 1rem;
    text-decoration: none
}

.btn-topbar:hover {
    border-color: var(--green-mid);
    color: var(--green-mid)
}

/* MAIN */
.main-content {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh
}

.content-area {
    padding: 1.8rem
}

.page {
    display: block;
}

.page-head {
    margin-bottom: 1.4rem;
}

.page-head h1 {
    font-family: 'Lora', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--green-deep);
}

.page-head .crumb {
    font-size: .8rem;
    color: #9CA3AF;
}

/* CARDS */
.dash-stat {
    background: #fff;
    border-radius: 10px;
    padding: 1.4rem 1.5rem;
    border-top: 4px solid var(--gold);
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform .2s, box-shadow .2s
}

.dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1)
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem
}

.dash-stat-num {
    font-family: 'Lora', serif;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1
}

.dash-stat-label {
    font-size: .78rem;
    color: #6B7280;
    margin-top: .25rem
}

.dash-stat-trend {
    font-size: .72rem;
    font-weight: 600;
    margin-top: .2rem
}

.trend-up {
    color: #059669
}

.admin-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
    overflow: hidden
}

.admin-card-header {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.admin-card-title {
    font-weight: 700;
    font-size: .92rem;
    color: var(--green-deep);
    display: flex;
    align-items: center;
    gap: .5rem
}

.admin-card-title i {
    color: var(--gold)
}

.admin-card-body {
    padding: 1.4rem
}

/* TABLES */
.tbl {
    font-size: .845rem
}

.tbl.table-sm thead th {
    padding: .45rem .75rem;
}

.tbl.table-sm tbody td {
    padding: .45rem .75rem;
}

.tbl thead th {
    background: var(--green-deep) !important;
    color: #fff;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    padding: .85rem 1rem;
    border: none
}

.tbl tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    border-color: #F3F4F6
}

.tbl tbody tr:hover {
    background: #FAFAFA
}

/* BADGES */
.bdg {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    padding: .22rem .65rem;
    border-radius: 4px
}

.bdg-aktif {
    background: #D1FAE5;
    color: #065F46
}

.bdg-verif {
    background: #FEF3C7;
    color: #92400E
}

.bdg-nonaktif {
    background: #FEE2E2;
    color: #991B1B
}

.bdg-super {
    background: #EDE9FE;
    color: #5B21B6
}

.bdg-operator {
    background: #DBEAFE;
    color: #1E40AF
}

.bdg-viewer {
    background: #F3F4F6;
    color: #374151
}

/* ACTION BTN */
.btn-act {
    border: none;
    border-radius: 6px;
    padding: .3rem .6rem;
    font-size: .75rem;
    cursor: pointer;
    transition: opacity .15s
}

.btn-act:hover {
    opacity: .82
}

.btn-edit {
    background: #DBEAFE;
    color: var(--blue)
}

.btn-del {
    background: #FEE2E2;
    color: var(--red)
}

.btn-view {
    background: #D1FAE5;
    color: #065F46
}

.btn-gold {
    background: var(--gold);
    color: var(--green-deep);
    font-weight: 600;
    font-size: .8rem;
}

.btn-gold:hover {
    background: var(--gold-light);
    color: var(--green-deep);
}

/* MODAL */
.modal-header {
    background: var(--green-deep);
    color: #fff
}

.modal-title {
    font-family: 'Lora', serif;
    font-size: 1rem
}

.modal-header .btn-close {
    filter: invert(1)
}

.form-label-sm {
    font-size: .79rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .3rem
}

.note-editor.note-invalid {
    border: 1px solid #dc3545;
    border-radius: .25rem;
}

.note-editor.note-valid {
    border: 1px solid #28a745;
    border-radius: .25rem;
}


.label-status-on {
    font-size: .85rem;
    font-weight: 500;
    color: #059669;
}

.label-status-off {
    font-size: .85rem;
    font-weight: 500;
    color: #991B1B;
}

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999
}

.toast-custom {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .14);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 280px;
    border-left: 4px solid var(--green-mid);
    animation: slideIn .3s ease
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

.toast-icon {
    font-size: 1.15rem;
    color: var(--green-mid);
    margin-top: 1px
}

.toast-msg {
    font-size: .845rem;
    font-weight: 500
}

.toast-sub {
    font-size: .76rem;
    color: #6B7280;
    margin-top: .1rem
}

/* LOG */
.log-item {
    display: flex;
    gap: .9rem;
    padding: .75rem 0;
    border-bottom: 1px solid #F3F4F6
}

.log-item:last-child {
    border-bottom: none
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0
}

.log-msg {
    font-size: .82rem;
    color: #374151
}

.log-time {
    font-size: .72rem;
    color: #9CA3AF;
    margin-top: .15rem
}

.mini-bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    margin-top: .5rem
}

.mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--green-deep), var(--green-light))
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 2rem;
    font-weight: 700
}

@media(max-width:991px) {
    .sidebar {
        transform: translateX(-100%)
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .main-content {
        margin-left: 0
    }

    .topbar {
        left: 0
    }
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px
}

/* ══ SWEETALERT2 — TEMA HIJAU/EMAS ══ */
.swal2-popup.swal-theme {
    border-radius: 14px !important;
    font-family: 'Inter', sans-serif !important;
    padding: 1.6rem 1.4rem 1.8rem !important;
}

.swal-theme .swal2-title {
    font-family: 'Lora', serif !important;
    font-size: 1.25rem !important;
    color: var(--green-deep) !important;
    font-weight: 700 !important;
    padding-top: .4rem !important;
}

.swal-theme .swal2-html-container {
    font-size: .86rem !important;
    color: #6B7280 !important;
}

.swal-theme .swal2-icon {
    border-color: var(--gold) !important;
}

.swal-theme .swal2-icon.swal2-success {
    border-color: var(--green-mid) !important;
}

.swal-theme .swal2-icon.swal2-success [class^="swal2-success-line"] {
    background-color: var(--green-mid) !important;
}

.swal-theme .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(45, 106, 79, .3) !important;
}

.swal-theme .swal2-icon.swal2-warning {
    color: var(--gold) !important;
    border-color: var(--gold) !important;
}

.swal-theme .swal2-icon.swal2-error {
    border-color: var(--red) !important;
    color: var(--red) !important;
}

.swal-theme .swal2-icon.swal2-question {
    border-color: var(--green-mid) !important;
    color: var(--green-mid) !important;
}

.swal-btn-confirm {
    background: var(--green-deep) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    border-radius: 7px !important;
    padding: .55rem 1.4rem !important;
    box-shadow: none !important;
}

.swal-btn-confirm:hover {
    background: var(--green-mid) !important;
}

.swal-btn-confirm:focus {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .25) !important;
}

.swal-btn-danger {
    background: var(--red) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    border-radius: 7px !important;
    padding: .55rem 1.4rem !important;
    box-shadow: none !important;
}

.swal-btn-danger:hover {
    background: #B91C1C !important;
}

.swal-btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .25) !important;
}

.swal-btn-cancel {
    background: #fff !important;
    color: #374151 !important;
    border: 1.5px solid #E5E7EB !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    border-radius: 7px !important;
    padding: .55rem 1.4rem !important;
    box-shadow: none !important;
}

.swal-btn-cancel:hover {
    background: #F9FAFB !important;
}

/* Toast SweetAlert2 */
.swal-toast-theme {
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .14) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal-toast-theme .swal2-title {
    font-family: 'Inter', sans-serif !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
    color: #1A1A1A !important;
}

.swal-toast-theme .swal2-html-container {
    font-size: .76rem !important;
    color: #6B7280 !important;
}

.swal-toast-theme.swal2-icon-success {
    border-left: 4px solid var(--green-mid) !important;
}

.swal-toast-theme.swal2-icon-error {
    border-left: 4px solid var(--red) !important;
}

.swal-toast-theme.swal2-icon-warning {
    border-left: 4px solid var(--gold) !important;
}

.swal-toast-theme .swal2-success-ring {
    border-color: rgba(45, 106, 79, .3) !important;
}

.swal-toast-theme [class^="swal2-success-line"] {
    background-color: var(--green-mid) !important;
}

.swal-toast-theme .swal2-icon.swal2-error {
    border-color: var(--red) !important;
    color: var(--red) !important;
}

.swal-toast-theme .swal2-timer-progress-bar {
    background: var(--gold) !important;
}

/* ACTION BUTTTON DROPDOWN ON DATATABLES */
.action-menu {
    position: fixed;
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    z-index: 1055;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
    transform: translateY(-10px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all .15s ease;
}

.action-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.action-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 10px 14px;
    font-size: .9rem;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
}

.action-item:hover {
    background: #f1f5f9;
}

.action-item.text-danger:hover {
    background: #fee2e2;
}

.detail-group {
    margin-bottom: 1rem;
}

.detail-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail-group div {
    font-size: .95rem;
    color: #111827;
}

.status-card {
    display: flex;
    justify-content: end;
}

.status-card .badge {
    font-size: .8rem;
    padding: .6rem .9rem;
}