/*
   SIM Tahfidz v8 Ultimate - Bootstrap 5 UI
   Bootstrap dan Bootstrap Icons digunakan secara lokal dari assets/vendor.
*/
:root {
    --app-primary: #198754;
    --app-primary-dark: #0f5132;
    --app-primary-soft: #d1e7dd;
    --app-accent: #0d6efd;
    --app-bg: #f3f7f5;
    --app-card: #ffffff;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-border: #dbe5df;
    --app-sidebar: #12392d;
    --app-sidebar-2: #0b2f25;
    --app-sidebar-active: rgba(255, 255, 255, .14);
    --app-shadow: 0 10px 30px rgba(15, 81, 50, .08);
    --app-radius: 1rem;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: radial-gradient(circle at top left, rgba(25, 135, 84, .12), transparent 30%), var(--app-bg);
    color: var(--app-text);
    font-size: 14px;
}

a { color: var(--app-primary); text-decoration: none; }
a:hover { color: var(--app-primary-dark); }

/* Layout utama */
.layout {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 28px;
    margin-left: 250px;
    transition: margin-left .25s ease;
}

.content > h1,
.content > h2 {
    color: #12392d;
    font-weight: 800;
    letter-spacing: -.025em;
    margin: 0 0 20px;
}
.content > h1 { font-size: clamp(1.55rem, 2vw, 2.1rem); }
.content > h2 { font-size: clamp(1.35rem, 1.8vw, 1.85rem); }

/* Sidebar Bootstrap-style */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1035;
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--app-sidebar), var(--app-sidebar-2));
    color: #fff;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(8, 47, 35, .28);
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 12px;
}
.sidebar-brand-icon,
.user-avatar,
.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255,255,255,.16);
    color: #d1e7dd;
    font-size: 1.25rem;
}
.sidebar-brand h2 {
    margin: 0;
    font-size: .98rem;
    font-weight: 800;
    color: #fff;
}
.sidebar-brand p {
    margin: 2px 0 0;
    font-size: .72rem;
    color: rgba(255,255,255,.68);
}
.sidebar-close-button {
    display: none;
    margin-left: auto;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.12);
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    color: #d1e7dd;
    font-size: 1.15rem;
}
.user-info p {
    margin: 0;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}
.user-info strong {
    display: block;
    margin-top: 2px;
    font-size: .66rem;
    letter-spacing: .04em;
    color: rgba(255,255,255,.64);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link,
.sidebar-group-title,
.sidebar-logout-button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 11px;
    padding: 8px 10px;
    color: rgba(255,255,255,.82);
    background: transparent;
    font-size: .84rem;
    font-weight: 650;
    text-align: left;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-link:hover,
.sidebar-group-title:hover,
.sidebar-logout-button:hover,
.sidebar-link.is-active {
    color: #fff;
    background: var(--app-sidebar-active);
    transform: translateX(2px);
}
.sidebar-link.is-active { box-shadow: inset 3px 0 0 #75b798; }
.sidebar-link-label { flex: 1; min-width: 0; }
.menu-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #b7e4c7;
    background: rgba(255,255,255,.08);
    font-size: 1rem;
}
.sidebar-submenu .menu-icon { width: 24px; height: 24px; font-size: .86rem; }
.sidebar-notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
}
.submenu-arrow { margin-left: auto; transition: transform .2s ease; color: rgba(255,255,255,.55); }
.sidebar-menu-group.is-open .submenu-arrow { transform: rotate(180deg); }
.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 0 0 12px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,.12);
    
    /* Efek transisi smooth (Slide & Fade) */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.35s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.4s ease-in-out, 
                margin 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                visibility 0.35s;
}

.sidebar-menu-group.is-open .sidebar-submenu { 
    max-height: 800px; /* Batas tinggi maksimal saat menu terbuka */
    opacity: 1;
    margin: 4px 0 6px 12px;
    visibility: visible;
}
.sidebar-divider { height: 1px; background: rgba(255,255,255,.12); margin: 10px 4px; }
.sidebar-logout-form { margin: 0; }
.sidebar-logout-button { color: #fecaca; }
.sidebar-logout-button .menu-icon { color: #fecaca; }

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1040;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: #fff;
    background: var(--app-primary);
    box-shadow: 0 10px 25px rgba(25,135,84,.28);
    font-weight: 700;
}
.mobile-sidebar-toggle .menu-icon { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
}

/* Komponen umum */
.card,
.filter-compact-card,
.belum-filter-card,
.table-card,
.notice-card,
.reset-password-panel,
.tasmi-finish-box,
.tasmi-juz-panel,
.tasmi-score-input-panel {
    background: var(--app-card);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    padding: 18px;
    margin-bottom: 18px;
}
.card h3,
.filter-compact-card h3,
.notice-card h3,
.table-card h3 {
    font-size: 1.02rem;
    font-weight: 800;
    color: #12392d;
    margin: 0 0 14px;
}
.card p { margin-bottom: .75rem; }

.stats,
.belum-setoran-stats,
.tasmi-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stats .card,
.belum-setoran-stats .card,
.stat-card-link,
.tasmi-stats .card {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    margin: 0;
    padding: 17px;
    border-radius: 18px;
    border: 1px solid rgba(25, 135, 84, .15);
    background: linear-gradient(135deg, #ffffff, #f6fffa);
    box-shadow: 0 10px 28px rgba(15,81,50,.08);
}
.stats .card::after,
.stat-card-link::after {
    content: '';
    position: absolute;
    top: -26px;
    right: -24px;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: rgba(25, 135, 84, .1);
}
.stats .card h3,
.stat-card-link h3,
.belum-setoran-stats h3,
.tasmi-stats h3 {
    margin: 0 0 10px;
    color: var(--app-muted);
    font-size: .84rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.stats .card p,
.stat-card-link p,
.belum-setoran-stats p,
.tasmi-stats p {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1;
    font-weight: 850;
    color: var(--app-primary-dark);
}
.stat-card-link { display: block; color: inherit; text-decoration: none; }
.stat-card-link:hover { transform: translateY(-2px); color: inherit; border-color: rgba(25,135,84,.35); }

/* Form dan filter */
.form-grid,
.filter-form,
.compact-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    align-items: end;
}
.form-full { grid-column: 1 / -1; }
.filter-field,
.santri-field,
.unit-field,
.tasmi-score-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
label {
    font-weight: 700;
    color: #30443a;
    font-size: .88rem;
}
.form-control,
.form-select,
input[type="text"], input[type="password"], input[type="date"], input[type="month"], input[type="number"], input[type="email"], input[type="file"], select, textarea {
    border-radius: 12px !important;
    border: 1px solid #cfdcd4 !important;
    min-height: 40px;
    font-size: .92rem;
}
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .18) !important;
}
textarea { min-height: 110px; }
.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 2px;
}
.form-note,
.muted,
.muted-text,
.text-muted,
.small {
    color: var(--app-muted) !important;
    font-size: .86rem;
}

/* Tombol */
.btn,
.btn-small,
button,
input[type="submit"] {
    border-radius: 12px;
    font-weight: 750;
    min-height: 38px;
}
.btn,
.btn-small,
a.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid transparent;
    background: var(--app-primary);
    color: #fff !important;
    text-decoration: none;
    line-height: 1.2;
    box-shadow: 0 8px 18px rgba(25,135,84,.16);
}
.btn:hover,
.btn-small:hover { background: #157347; color: #fff !important; }
.btn-secondary,
a.btn-secondary { background: #6c757d !important; border-color: #6c757d !important; }
.btn-danger,
.danger,
a.danger { background: #dc3545 !important; border-color: #dc3545 !important; color:#fff !important; }
.btn-warning,
.warning,
a.warning { background: #ffc107 !important; border-color: #ffc107 !important; color: #212529 !important; }
.secondary,
a.secondary { background: #6c757d !important; border-color: #6c757d !important; color:#fff !important; }
.inline-action,
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Alert */
.alert,
.success {
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.success { color: #0f5132; background: #d1e7dd; border-color: #badbcc; }
.alert:not(.alert-info):not(.alert-success):not(.alert-warning):not(.alert-danger) { color: #842029; background: #f8d7da; border-color: #f5c2c7; }
.alert-info { color: #055160; background: #cff4fc; border-color: #b6effb; }

/* Tabel */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
}
th, td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf2ef;
    vertical-align: middle;
    font-size: .9rem;
}
th {
    background: #f1f8f4;
    color: #12392d;
    font-weight: 800;
    white-space: nowrap;
}
tbody tr:hover { background: #f8fbf9; }
tbody tr:last-child td { border-bottom: 0; }
.row-selected { background: #eaf7ef !important; }
.text-center, .center { text-align: center !important; }

/* Badge */
.badge,
.badge-jenis-setoran,
.badge-role,
.notif-new-badge,
.ringkasan-notifikasi-baru {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .35rem .62rem;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
    border: 1px solid transparent;
}
.badge { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.badge-baru { background: #d1e7dd !important; color: #0f5132 !important; }
.badge-jadid { background: #cfe2ff !important; color: #084298 !important; }
.badge-qadim { background: #e2d9f3 !important; color: #432874 !important; }
.badge-role { background: #e7f1ff; color: #084298; }
.notif-new-badge,
.ringkasan-notifikasi-baru { background: #dc3545; color: #fff; }
.inline-icon-title { display: inline-flex; align-items: center; gap: 8px; }
.inline-icon-title .ui-icon { color: var(--app-primary); }

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 18px 0 0;
}
.pagination a,
.pagination span {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: #fff;
    padding: 6px 10px;
    color: var(--app-primary-dark);
    font-weight: 700;
}
.pagination .active,
.pagination a.active,
.pagination span.active { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }

/* |--------------------------------------------------------------------------
| HALAMAN LOGIN (DIPERBARUI)
|--------------------------------------------------------------------------
*/
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    /* Latar belakang dibuat jauh lebih terang, bersih, dan modern */
    background: radial-gradient(circle at top left, #f3f7f5 0%, #e2f0e9 50%, #cce0d6 100%);
}

.login-box {
    width: min(400px, 100%);
    background: #ffffff;
    border: 1px solid rgba(25, 135, 84, 0.15);
    border-radius: 24px;
    padding: 38px 32px;
    box-shadow: 0 20px 45px rgba(15, 81, 50, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Garis hijau manis di bagian atas kotak login */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #198754, #20c997);
}

/* Memperbaiki logo yang lonjong / kaku */
.login-logo {
    width: auto;
    height: auto;
    max-width: 140px;
    max-height: 110px;
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
    background-color: transparent;
    /* Trik agar background putih pada logo otomatis hilang/menyatu dengan latar */
    mix-blend-mode: multiply; 
}

.login-logo-placeholder {
    width: 86px;
    height: 86px;
    margin: 0 auto 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d1e7dd;
    color: var(--app-primary-dark);
    font-size: 2.3rem;
}

.login-box h2 { 
    font-size: 1.55rem; 
    font-weight: 850; 
    color: #12392d; 
    margin: 0 0 6px; 
}

.login-subtitle { 
    color: #198754; 
    font-weight: 700; 
    margin-bottom: 24px; 
    font-size: 0.95rem; 
}

.login-box input { 
    width: 100%; 
    margin-bottom: 14px; 
    padding: 12px 14px; 
    background: #f8fbf9; 
}

.login-box button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #198754, #157347);
    color: #fff;
    border: 0;
    padding: 13px 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    margin-top: 8px;
    box-shadow: 0 8px 16px rgba(25, 135, 84, 0.2);
    transition: all 0.3s ease;
}

.login-box button[type="submit"]:hover { 
    background: linear-gradient(135deg, #157347, #0f5132);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(25, 135, 84, 0.25);
} { background: #157347; }

/* Modal konfirmasi custom dengan rasa Bootstrap */
/* Animasi untuk kotak modal */
@keyframes modalPop {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.85); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Animasi untuk latar belakang gelap (backdrop) */
@keyframes backdropFade {
    0% { opacity: 0; backdrop-filter: blur(0px); }
    100% { opacity: 1; backdrop-filter: blur(3px); }
}

/* Terapkan animasi ke elemen modal */
.app-modal {
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.app-modal-backdrop {
    animation: backdropFade 0.3s ease-out forwards;
}

/* Tambahkan efek interaktif pada tombol modal */
.app-modal-actions button {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-modal-actions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(2px);
}
.app-modal {
    position: fixed;
    z-index: 2010;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(430px, calc(100% - 32px));
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 24px 65px rgba(15, 23, 42, .25);
    text-align: center;
}
.app-modal-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 14px;
    font-size: 1.8rem;
}
.app-modal-icon.danger { color: #dc3545; background: #f8d7da; }
.app-modal-icon.info { color: #0d6efd; background: #cfe2ff; }
.app-modal h3 { font-weight: 850; font-size: 1.2rem; margin-bottom: 8px; }
.app-modal p { color: var(--app-muted); }
.app-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.app-modal-confirm,
.app-modal-cancel {
    border: 0;
    padding: 9px 16px;
    border-radius: 12px;
    font-weight: 800;
}
.app-modal-confirm { background: #dc3545; color: #fff; }
.app-modal-icon.info ~ .app-modal-actions .app-modal-confirm { background: var(--app-primary); }
.app-modal-cancel { background: #e9ecef; color: #212529; }
body.modal-open { overflow: hidden; }

/* Reset password panel */
.reset-password-panel-header { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:flex-start; margin-bottom: 12px; }
.reset-password-meta { color: var(--app-muted); font-size: .88rem; }
.reset-password-copy-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.reset-password-code {
    display:inline-block;
    padding: 10px 12px;
    border-radius: 12px;
    background:#f1f8f4;
    border:1px dashed var(--app-primary);
    color:#12392d;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight:800;
}
.copy-password-btn.copied { background:#0d6efd !important; }
.copy-password-feedback { margin-top: 10px; font-weight: 700; color: var(--app-muted); }
.copy-password-feedback.is-success { color:#0f5132; }
.copy-password-feedback.is-error { color:#842029; }
.reset-password-note { margin-top:10px; color:var(--app-muted); font-size:.86rem; }

/* Checklist & security */
.checkbox-group,
.checklist-grid,
.tasmi-juz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.checkbox-item,
.check-card,
.jenjang-mode-item,
.tasmi-juz-check {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
}
.security-toggle-form { display: block; }
.security-toggle-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    text-align: left;
    margin-bottom: 10px;
}
.security-toggle-actions { display:flex; justify-content:flex-start; }
.security-maintenance-message { margin-top: 10px; }

/* Tasmi */
.tasmi-score-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tasmi-score-list.compact { gap:4px; }
.tasmi-average,
.tasmi-average-preview { font-weight: 850; color: var(--app-primary-dark); margin-top: 10px; }
.tasmi-juz-header { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom: 10px; }
.tasmi-score-input-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* Filter ringkas */
.filter-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom: 12px; }
.filter-chip { display:inline-flex; align-items:center; gap:6px; border-radius:999px; background:#f1f8f4; color:#0f5132; padding:6px 10px; font-weight:700; font-size:.8rem; }

/* Surat search */
.surat-search-wrapper { display: flex; flex-direction: column; gap: 8px; }
.surat-search-input { margin-bottom: 0; }
.surat-search-wrapper.is-filtering select { border-color: var(--app-primary) !important; }

/* Print/export pages retain basic styles */
.kop { text-align: center; margin-bottom: 16px; }
.kop-logo { max-width: 84px; max-height: 84px; object-fit: contain; }
.judul { font-weight: 800; text-align: center; margin: 18px 0; }
.footer { color: var(--app-muted); font-size: .85rem; margin-top: 18px; }
.excel-text { mso-number-format: "\\@"; }

/* Mobile */
@media (max-width: 980px) {
    .content {
        margin-left: 0;
        padding: 76px 16px 22px;
    }
    .mobile-sidebar-toggle { display: inline-flex; }
    .sidebar {
        transform: translateX(-105%);
        transition: transform .25s ease;
        width: min(300px, 86vw);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .sidebar-close-button { display: inline-flex; align-items:center; justify-content:center; }
}

@media (max-width: 576px) {
    body { font-size: 13px; }
    .content { padding-left: 12px; padding-right: 12px; }
    .card,
    .filter-compact-card,
    .belum-filter-card,
    .table-card,
    .notice-card { padding: 14px; border-radius: 16px; }
    .stats,
    .belum-setoran-stats,
    .tasmi-stats { grid-template-columns: 1fr; }
    .form-grid,
    .filter-form,
    .compact-filter-grid { grid-template-columns: 1fr; }
    th, td { padding: 9px 10px; font-size: .84rem; }
    .filter-actions { flex-direction: column; align-items: stretch; }
    .filter-actions .btn,
    .filter-actions .btn-small,
    .filter-actions a { width: 100%; }
}

/* Dashboard interaktif Bootstrap */
.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, #12392d, #198754);
    color: #fff;
    box-shadow: 0 18px 42px rgba(15, 81, 50, .18);
    overflow: hidden;
    position: relative;
}
.dashboard-hero::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    right: -60px;
    top: -70px;
    background: rgba(255,255,255,.12);
}
.dashboard-hero-main { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.dashboard-hero-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 1.65rem;
    flex: 0 0 auto;
}
.dashboard-hero h1 { margin: 0 0 6px; font-size: clamp(1.45rem, 2vw, 2rem); color: #fff; font-weight: 850; }
.dashboard-hero p { margin: 0; color: rgba(255,255,255,.82); font-weight: 600; }
.dashboard-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; position: relative; z-index: 1; }
.dashboard-hero-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-weight: 750;
    font-size: .82rem;
}
.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.dashboard-stat-card {
    display: block;
    position: relative;
    min-height: 128px;
    padding: 17px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-stat-card:hover {
    transform: translateY(-3px);
    color: inherit;
    border-color: rgba(25, 135, 84, .38);
    box-shadow: 0 18px 38px rgba(15, 81, 50, .14);
}
.dashboard-stat-card::after {
    content: '';
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 999px;
    right: -30px;
    top: -28px;
    background: rgba(25, 135, 84, .10);
}
.dashboard-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 135, 84, .12);
    color: var(--app-primary-dark);
    font-size: 1.25rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.dashboard-variant-info .dashboard-stat-icon { background: rgba(13, 110, 253, .12); color: #084298; }
.dashboard-variant-warning .dashboard-stat-icon { background: rgba(255, 193, 7, .16); color: #664d03; }
.dashboard-variant-danger .dashboard-stat-icon { background: rgba(220, 53, 69, .12); color: #842029; }
.dashboard-variant-secondary .dashboard-stat-icon { background: rgba(108, 117, 125, .12); color: #343a40; }
.dashboard-variant-purple .dashboard-stat-icon { background: rgba(111, 66, 193, .12); color: #3d0a91; }
.dashboard-stat-title,
.dashboard-stat-subtitle {
    display: block;
    color: var(--app-muted);
    font-weight: 750;
    font-size: .82rem;
    position: relative;
    z-index: 1;
}
.dashboard-stat-title { text-transform: uppercase; letter-spacing: .04em; }
.dashboard-stat-value {
    display: block;
    margin: 7px 0 4px;
    color: #12392d;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    line-height: 1;
    font-weight: 900;
    position: relative;
    z-index: 1;
}
.dashboard-stat-subtitle { font-size: .78rem; font-weight: 650; }
.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 12px;
}
.dashboard-section-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #12392d;
    font-size: 1.08rem;
    font-weight: 850;
}
.dashboard-section-header h2 span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--app-primary-soft);
    color: var(--app-primary-dark);
}
.dashboard-section-header p { margin: 5px 0 0; color: var(--app-muted); font-weight: 600; }
.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}
.dashboard-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff, #f8fffb);
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dashboard-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(25, 135, 84, .35);
    box-shadow: 0 12px 28px rgba(15, 81, 50, .10);
    color: inherit;
}
.dashboard-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary-soft);
    color: var(--app-primary-dark);
    font-size: 1.25rem;
    flex: 0 0 auto;
}
.dashboard-action-text { flex: 1; min-width: 0; }
.dashboard-action-text strong { display: block; font-weight: 850; color: #12392d; }
.dashboard-action-text small { display: block; margin-top: 2px; color: var(--app-muted); font-weight: 600; line-height: 1.35; }
.dashboard-action-arrow { color: var(--app-muted); transition: transform .18s ease; }
.dashboard-action-card:hover .dashboard-action-arrow { transform: translateX(3px); color: var(--app-primary); }
.dashboard-progress-wrap { margin-top: 10px; }
.dashboard-progress-label { display:flex; justify-content:space-between; gap:10px; color: var(--app-muted); font-weight:750; font-size:.82rem; margin-bottom:6px; }
.dashboard-progress { height: 9px; border-radius: 999px; background: #e8f2ed; }
.dashboard-progress .progress-bar { background: linear-gradient(90deg, var(--app-primary), #20c997); border-radius: 999px; }
.dashboard-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 18px;
    align-items: start;
}
.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.dashboard-list-item {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding: 11px 12px;
    border-radius: 14px;
    background:#f8fffb;
    border: 1px solid var(--app-border);
}
.dashboard-list-item strong { color:#12392d; }
.dashboard-list-item small { color: var(--app-muted); font-weight: 650; }
.table-dashboard tbody tr { cursor: pointer; }
@media (max-width: 992px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
    .dashboard-hero-chips { justify-content: flex-start; }
    .dashboard-two-column { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .dashboard-hero { padding: 16px; border-radius: 18px; }
    .dashboard-hero-icon { width: 48px; height: 48px; border-radius: 16px; font-size: 1.35rem; }
    .dashboard-action-grid,
    .dashboard-stat-grid { grid-template-columns: 1fr; }
}

/* |--------------------------------------------------------------------------
| EFEK ANIMASI PAGE TRANSITION
|--------------------------------------------------------------------------
*/

/* Animasi untuk konten utama (Geser dari bawah ke atas + Memudar masuk) */
@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animasi untuk sidebar (Memudar masuk perlahan) */
@keyframes simpleFadeIn {
    0% { 
        opacity: 0; 
    }
    100% { 
        opacity: 1; 
    }
}

/* 1. Terapkan ke area konten utama */
.content {
    animation: slideUpFadeIn 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 2. Terapkan ke Sidebar (Khusus layar desktop agar tidak mengganggu toggle sidebar mobile) */
@media (min-width: 981px) {
    .sidebar {
        animation: simpleFadeIn 0.6s ease-in-out forwards;
    }
}

/* 3. Terapkan juga ke Halaman Login */
.login-box {
    animation: slideUpFadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 4. Efek animasi berurutan (Staggered) pada Dashboard Cards (Opsional tapi sangat bagus) */
.dashboard-stat-card,
.dashboard-action-card {
    animation: slideUpFadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.dashboard-stat-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-stat-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-stat-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-stat-card:nth-child(4) { animation-delay: 0.4s; }

.dashboard-action-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-action-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-action-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-action-card:nth-child(4) { animation-delay: 0.4s; }

/* |--------------------------------------------------------------------------
| PROFIL LEMBAGA LOGO PREVIEW
|--------------------------------------------------------------------------
*/
.profil-logo-preview {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid var(--app-border);
    padding: 8px;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(15, 81, 50, 0.06);
    display: block;
}