/* ============================================================
   MTQ 2026 – Sistem Admin Kecamatan Tamansari
   Central Stylesheet (index.html, dashboard.html, settings.html, auth.html)
   ============================================================ */

/* ============ BASE ============ */
/* Reset minimum agar halaman tampil sama persis baik sebelum
   maupun sesudah Tailwind CDN selesai dimuat (menggantikan preflight) */
*,
::before,
::after {
    box-sizing: border-box;
}

body {
    background-color: #f3f7f6;
    color: #1f2937;
    margin: 0;
}

/* ============ SECTION PAGES (SPA) ============ */
.section-page {
    display: none;
}

.section-page.active {
    display: block;
}

/* ============ SIDEBAR CONTAINER (Preload for smooth loading) ============ */
#sidebar-container {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    flex: 0 0 240px;
    height: 100%;
    background-color: #113f36;
    overflow: hidden;
    position: relative;
}

/* ============ SIDEBAR ============ */
/* PENTING: Seluruh nilai di blok ini sengaja mencerminkan utilitas Tailwind
   yang dipakai markup sidebar di ketiga halaman (w-[240px], py-5 px-3, gap-3,
   mb-8, text-lg, dst.) agar sidebar tampil IDENTIK di index.html,
   dashboard.html, dan settings.html — bahkan saat Tailwind CDN belum termuat. */
.sidebar {
    background-color: #113f36;
    /* Kunci ukuran secara mutlak agar lebar sidebar MUSTAHIL berbeda
       antar halaman, sekalipun ada utility Tailwind/cache yang bentrok */
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 20px 12px; /* py-5 px-3 */
}

/* --- Baris logo --- */
.sidebar > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;              /* gap-3 */
    padding: 0 12px;        /* px-3 */
    margin-bottom: 32px;    /* mb-8 */
}

.sidebar > div:first-child > div:first-child {
    width: 32px;            /* w-8 h-8 */
    height: 32px;
    flex-shrink: 0;
    border-radius: 4px;     /* rounded */
    background: rgba(38, 197, 150, 0.2); /* bg-vizora-accent/20 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar > div:first-child > div:first-child i {
    color: #26c596;         /* text-vizora-accent */
    font-size: 18px;        /* text-lg */
}

.sidebar h2 {
    margin: 0;
    font-size: 18px;        /* text-lg */
    line-height: 28px;
    font-weight: 700;       /* font-bold */
    color: #ffffff;
    letter-spacing: 0.025em;/* tracking-wide */
}

.sidebar h2 span {
    font-size: 14px;        /* text-sm */
    line-height: 20px;
    font-weight: 400;       /* font-normal */
    margin-left: 4px;       /* ml-1 */
    color: #8baca3;         /* text-vizora-textMuted */
}

/* --- Global Context Switcher (pemilih tahun di bawah judul) ---
   Fallback statis agar dropdown tampil rapi bahkan sebelum Tailwind CDN
   selesai dimuat; nilainya selaras dengan utilitas Tailwind di sidebar.html. */
.year-select {
    width: 100%;
    background-color: rgba(38, 197, 150, 0.15); /* bg-vizora-accent/15 */
    color: #ffffff;
    font-size: 12px;             /* text-xs */
    font-weight: 600;            /* font-semibold */
    text-align: center;          /* text-center */
    border: 1px solid rgba(255, 255, 255, 0.2); /* border-white/20 */
    border-radius: 6px;          /* rounded-md */
    padding: 6px 32px;           /* py-1.5 px-8 */
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease;
}

.year-select:hover {
    background-color: rgba(38, 197, 150, 0.25); /* hover:bg-vizora-accent/25 */
}

.year-select:focus {
    box-shadow: 0 0 0 2px rgba(38, 197, 150, 0.5); /* focus:ring-2 ring-vizora-accent */
}

/* Daftar opsi dropdown native tetap terbaca (latar putih dari browser) */
.year-select option {
    color: #111827;              /* text-gray-900 */
    background-color: #ffffff;
    letter-spacing: normal;
    font-weight: 500;
}

/* --- Label seksi (hook class agar tidak bergantung pada posisi item) --- */
.sidebar-label {
    font-size: 10px;        /* text-[10px] */
    font-weight: 700;
    letter-spacing: 0.05em; /* tracking-wider */
    text-transform: uppercase;
    color: #8baca3;
    padding: 0 12px;        /* px-3 */
    margin-bottom: 8px;     /* mb-2 */
}

/* --- Wrapper akun di dasar sidebar (anak terakhir) --- */
.sidebar > div:last-child {
    margin-top: auto;           /* mt-auto */
    padding: 24px 4px 0;        /* pt-6 px-1 */
    border-top: 1px solid rgba(30, 80, 68, 0.5); /* border-vizora-active/50 */
}

.sidebar > div:last-child > div:first-child {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8baca3;
    padding: 0 8px;             /* px-2 */
    margin-bottom: 8px;         /* mb-2 */
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: #8baca3;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    position: relative;
}

.sidebar-item:hover {
    background-color: rgba(30, 80, 68, 0.5);
    color: white;
}

.sidebar-item.active {
    background-color: #1e5044;
    color: white;
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    right: 0px;
    top: 15%;
    height: 70%;
    width: 3px;
    background-color: #26c596;
    border-radius: 4px 0 0 4px;
}

.sidebar-item i {
    font-size: 20px;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #8baca3;
}

.sidebar-item.active .sidebar-badge {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

/* ============ RESPONSIVE (Mobile & Tablet) ============ */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

@media (max-width: 1023px) {
    /* Sidebar menjadi drawer off-canvas di layar kecil */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        z-index: 100;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    /* Wrapper sidebar dilepas dari alur layout pada mode drawer:
       .sidebar sudah position:fixed, jadi wrapper tidak boleh menyisakan
       kolom kosong selebar 240px yang memampatkan area konten (topbar,
       kartu, dan footer aksi seperti tombol Simpan Pengaturan Kategori).
       !important diperlukan untuk mengalahkan style inline 240px. */
    #sidebar-container {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        flex: 0 0 0 !important;
        overflow: visible !important;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 1024px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

/* Tabel lebih padat di layar kecil */
@media (max-width: 640px) {
    th {
        padding: 10px 12px;
        font-size: 11px;
    }

    td {
        padding: 12px;
        font-size: 13px;
    }
}

/* ============ TABLES ============ */
.table-wrap {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

tbody tr:hover {
    background-color: #f9fafb;
}

td .name {
    font-weight: 600;
    color: #111827;
    display: block;
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.age-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.age-status.valid {
    background: #ecfdf5;
    color: #059669;
}

.age-status.invalid {
    background: #fef2f2;
    color: #dc2626;
}

.age-status.empty {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============ TABS ============ */
/* Tab vertikal menu Pengaturan (settings.html #verticalTabs).
   Nilai fallback di bawah sengaja MENCERMINKAN utility Tailwind yang dipakai
   markup agar tampil identik bahkan saat Tailwind CDN belum termuat:
   - non-aktif : border-r-4 border-transparent text-gray-500 hover:text-gray-900
                 hover:border-gray-200 hover:bg-gray-50 rounded-l-lg pl-4 pr-4 py-2
                 transition-all
   - aktif     : border-emerald-500 text-emerald-700 font-bold bg-emerald-50
   Indikator garis bawah animasi (::after) versi lama sudah dihapus. */
.tab-btn {
    display: block;
    width: 100%;
    padding: 8px 16px;              /* py-2 pl-4 pr-4 */
    font-family: inherit;
    font-size: 14px;                /* text-sm */
    font-weight: 500;               /* font-medium */
    text-align: left;               /* text-left */
    color: #6b7280;                 /* text-gray-500 */
    background-color: transparent;
    border: 0;
    border-right-width: 4px;        /* border-r-4 */
    border-right-style: solid;
    border-right-color: transparent;/* border-transparent */
    border-radius: 8px 0 0 8px;     /* rounded-l-lg */
    cursor: pointer;
    white-space: nowrap;
    transition-property: all;       /* transition-all */
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.tab-btn:hover {
    color: #111827;                 /* hover:text-gray-900 */
    border-right-color: #e5e7eb;    /* hover:border-gray-200 */
    background-color: #f9fafb;      /* hover:bg-gray-50 */
}

/* Item aktif ditulis SETELAH :hover agar tetap menonjol saat di-hover */
.tab-btn.active {
    color: #047857;                 /* text-emerald-700 */
    font-weight: 700;               /* font-bold */
    background-color: #ecfdf5;      /* bg-emerald-50 */
    border-right-color: #10b981;    /* border-emerald-500 */
}

/* ============ FORMS ============ */
input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
    outline: none;
    color: #111827;
}

/* Tinggi seragam untuk kontrol satu baris (kolom input & dropdown Asal Desa/Kategori sama persis) */
input[type="text"],
input[type="date"],
input[type="number"],
#fDesa,
#fGolongan {
    height: 42px;
}

/* Dropdown Asal Desa & Kategori Lomba: hilangkan panah bawaan OS agar tampilan
   identik dengan input, ganti dengan panah custom di sisi kanan */
#fDesa,
#fGolongan {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

/* Kotak pencarian peserta (ikon kaca pembesar di kiri): rule global input[type=text]
   lebih kuat dari utility Tailwind (pl-9/pr-4/py-2/w-56), sehingga perlu override
   spesifik agar teks tidak tertimpa ikon dan lebarnya sesuai desain */
input#pesertaSearch {
    width: 100%;               /* lebar mengikuti kontainer toolbar (relative w-full sm:w-64) */
    height: auto;              /* tinggi kompak mengikuti py-2, bukan 42px */
    padding-left: 2.25rem;     /* pl-9: ruang ikon kaca pembesar (ikon di left-3) */
    padding-right: 1rem;       /* pr-4 */
    padding-top: 0.5rem;       /* py-2 */
    padding-bottom: 0.5rem;    /* py-2 */
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #26c596;
    box-shadow: 0 0 0 3px rgba(38, 197, 150, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    font-family: inherit;
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid #d1d5db;
    border-radius: 0.25em;
    display: grid;
    place-content: center;
    cursor: pointer;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    background-color: white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
    background-color: #26c596;
    border-color: #26c596;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* ============ MODALS & EXPORT ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
    animation: overlayIn 0.25s ease both;
}

/* Saat menutup: overlay memudar, kartu turun + mengecil */
.modal-overlay.closing {
    animation: overlayOut 0.22s ease both;
}

.modal {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    will-change: transform, opacity;
}

/* Saat dibuka: kartu naik + membesar dengan easing "spring" yang halus */
.modal-overlay.open .modal {
    animation: modalIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-overlay.closing .modal {
    animation: modalOut 0.22s ease-in both;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes overlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.96); }
}

/* Badge ikon konfirmasi (Hapus = merah, Simpan = hijau vizora) dengan efek pop */
.confirm-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.confirm-icon.is-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.confirm-icon.is-save {
    background: rgba(38, 197, 150, 0.12);
    color: #0f9d78;
    border: 1px solid rgba(38, 197, 150, 0.4);
}

.modal-overlay.open .confirm-icon {
    animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

/* Ring pulsa halus di sekeliling badge ikon */
.modal-overlay.open .confirm-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid currentColor;
    animation: iconPulse 1.8s ease-out 0.6s infinite;
    pointer-events: none;
}

@keyframes iconPop {
    0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
    70%  { transform: scale(1.08) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes iconPulse {
    0%   { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Tombol tutup (X) di pojok kanan atas modal */
.modal-close-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
}

.modal-close-x:hover {
    background: #f3f4f6;
    color: #374151;
}

/* State loading tombol konfirmasi */
.modal button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Hormati preferensi pengguna yang mematikan animasi */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay.open,
    .modal-overlay.closing,
    .modal-overlay.open .modal,
    .modal-overlay.closing .modal,
    .modal-overlay.open .confirm-icon,
    .modal-overlay.open .confirm-icon::after {
        animation: none !important;
    }
}

/* ============ TOAST NOTIFIKASI (sukses/gagal mengambang) ============ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 300; /* di atas modal-overlay (200) */
    display: flex;
    flex-direction: column;
    align-items: center; /* toast tampil di tengah layar */
    gap: 10px;
    pointer-events: none;
    padding: 0 20px;
}

.toast {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 360px;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px; /* sudut kotak membulat */
    padding: 14px 14px 16px;
    box-shadow: 0 12px 32px -8px rgba(17, 24, 39, 0.18), 0 2px 8px rgba(17, 24, 39, 0.06);
    overflow: hidden;
    animation: toastIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Saat menutup: toast meluncur kembali ke atas sambil memudar */
.toast.toast-out {
    animation: toastOut 0.28s ease-in both;
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(38, 197, 150, 0.12);
    color: #0f9d78;
    border: 1px solid rgba(38, 197, 150, 0.35);
}

.toast-error .toast-icon {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 15px;
    transition: background 0.15s, color 0.15s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Progress bar tipis di dasar toast: menandakan sisa waktu sebelum tertutup otomatis */
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #26c596;
    animation: toastProgress linear forwards;
}

.toast-error .toast-progress {
    background: #dc2626;
}

/* Timer berhenti saat kursor berada di atas toast */
.toast.paused .toast-progress {
    animation-play-state: paused;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-120%) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-120%) scale(0.94); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

@media (max-width: 480px) {
    .toast-container {
        top: 16px;
        padding: 0 16px;
        align-items: stretch;
    }

    .toast {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.toast-out,
    .toast-progress {
        animation: none !important;
    }
}

.export-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 50;
    display: none;
    overflow: hidden;
    padding: 4px;
}

.export-menu.open {
    display: block;
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-weight: 500;
}

.export-menu-item:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ============ UTILITY HELPERS ============ */
/* Dipakai settings.html: scrollbar tipis untuk daftar notifikasi */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============ PRINT LAYOUT OVERRIDES ============ */
@media print {
    @page {
        size: 210mm 330mm; /* F4 paper */
        margin: 0mm !important; /* Force removal of browser headers/footers */
    }

    body {
        margin: 0 !important;
        padding: 15mm !important; /* Apply physical margin to content instead */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;

        /* Netralisir kelas layar (h-screen/flex/overflow-hidden) agar multi-halaman tercetak penuh */
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }

    body > :not(#printArea) {
        display: none !important;
    }

    #printArea {
        display: block !important;
        width: 100%;
        box-sizing: border-box !important;
    }

    #printArea table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 10pt !important;
        margin-bottom: 20px !important;
        table-layout: fixed !important;
        box-sizing: border-box !important;
    }

    #printArea th,
    #printArea td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        color: #000 !important;
        vertical-align: middle !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    #printArea th {
        text-align: center !important;
        font-weight: bold !important;
        background-color: #f3f4f6 !important;
    }

    #printArea tr {
        page-break-inside: avoid;
    }
}

/* ============ AUTH (dipakai auth.html di root) ============ */
/* Background netral gelap (fallback bila gambar latar gagal dimuat),
   tanpa tint hijau agar background tetap netral */
body.auth-page {
    background-color: #18181b;
    color: #1f2937;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f9fafb inset !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827;
    transition: background-color 9999s ease-out 0s;
}

/* =====================================================
   SMOOTH PAGE TRANSITION (Fallback CSS)
   Area konten utama memudar & bergeser halus saat halaman
   dimuat; sidebar tetap diam agar tidak ada kedipan.
   ===================================================== */

/* Animasi khusus untuk area konten utama, sidebar tetap diam */
main {
    animation: fadeInContent 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

