body { 
    font-family: 'Inter', sans-serif; 
    background-color: #0f172a; 
    background-image: radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.12) 0px, transparent 40%),
                      radial-gradient(at 100% 100%, rgba(37, 99, 235, 0.12) 0px, transparent 40%);
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.modal-active { overflow: hidden; }
.toast { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* Dark Mode Scrollbar */
.custom-scrollbar::-webkit-scrollbar, ::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Print CSS - Forces White Background for printing */
@media print {
    /* Ukuran & margin kertas diatur dari export.js (printHtmlDocument): A4, margin tipis seragam */
    html, body { margin: 0 !important; padding: 0 !important; width: 100% !important; height: auto !important; overflow: visible !important; background: white !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body * { visibility: hidden; }
    #print-area, #print-area * { visibility: visible; color: black !important; }
    #print-area { position: absolute; left: 0; top: 0; width: 100%; margin: 0 !important; padding: 0 !important; background: white; box-sizing: border-box; }
    /* pembungkus laporan: tanpa padding/lebar tambahan supaya isi memenuhi lebar kertas */
    #print-area > div { padding: 0 !important; margin: 0 !important; max-width: none !important; width: 100% !important; box-sizing: border-box; }
    #print-area table { width: 100% !important; }
    #print-area thead { display: table-header-group; }
    #print-area tr { page-break-inside: avoid; }
}

.animate-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Auto-fill fix */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* LIGHT MODE CSS OVERRIDES */
body.light-mode { background-color: #f8fafc; background-image: none; color: #0f172a; }
body.light-mode .text-white { color: #0f172a !important; }
body.light-mode .text-slate-200, body.light-mode .text-slate-300 { color: #334155 !important; }
body.light-mode .text-slate-400 { color: #64748b !important; }

body.light-mode .bg-slate-900, 
body.light-mode .bg-slate-800, 
body.light-mode .bg-slate-900\/50,
body.light-mode .bg-slate-900\/80,
body.light-mode .bg-slate-800\/80 { background-color: #ffffff !important; border-color: #e2e8f0 !important; }

body.light-mode .bg-white\/5 { background-color: #f1f5f9 !important; border-color: #e2e8f0 !important; }
body.light-mode .border-white\/10, body.light-mode .border-white\/5, body.light-mode .border-white\/20 { border-color: #e2e8f0 !important; }

body.light-mode input, body.light-mode select { color: #0f172a !important; background-color: #ffffff !important; border-color: #cbd5e1 !important; }
body.light-mode input::placeholder { color: #94a3b8 !important; }

body.light-mode .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: #e2e8f0 !important; }

/* Light Mode Custom Settings */
body.light-mode .card-container { background-color: #ffffff !important; border-color: #cbd5e1 !important; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important; }
body.light-mode .card-progress-bg { background-color: #e2e8f0 !important; }
body.light-mode .card-section-mid { background-color: transparent !important; border-color: #cbd5e1 !important; }
body.light-mode .card-section-right { background-color: #f8fafc !important; border-color: #cbd5e1 !important; }
body.light-mode .text-main-header { color: #0f172a !important; }
body.light-mode .text-sub-header { color: #4338ca !important; }
body.light-mode input:-webkit-autofill { -webkit-box-shadow: 0 0 0 30px #ffffff inset !important; -webkit-text-fill-color: #0f172a !important; }

/* ===== Sidebar desktop: bisa diciutkan (hanya logo + ikon) ===== */
#sidebar { transition: width .25s ease; }
.scan-drop { border: 2px dashed rgba(129, 140, 248, .45); transition: all .15s; }
.scan-drop:hover, .scan-drop:focus, .scan-drop.drag { border-color: #818cf8; background: rgba(99, 102, 241, .12); outline: none; }
.batch-group td { background: rgba(99, 102, 241, .12); }
body.light-mode .batch-group td { background: #eef2ff !important; }
.field-error { border-color: #f43f5e !important; box-shadow: 0 0 0 2px rgba(244, 63, 94, .35); }
.row-changed td { background: rgba(245, 158, 11, .08); }
body.light-mode .row-changed td { background: #fffbeb !important; }
.mic-pulse { animation: micPulse 1.2s infinite; }
@keyframes micPulse { 0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, .6); } 70% { box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); } }
input[type="date"] { color-scheme: dark; }
body.light-mode input[type="date"] { color-scheme: light; }
body.light-mode textarea { color: #0f172a !important; background-color: #ffffff !important; border-color: #cbd5e1 !important; }

/* Form Input Biaya: halaman (banyak registrasi) vs modal Detail Proyek (1 registrasi) */
.batch-table { min-width: 1250px; }
#batch-input-root.single-reg .col-reg { display: none; }
#batch-input-root.single-reg .batch-table { min-width: 1050px; }
#batch-input-root:not(.single-reg) .only-modal { display: none; }
#batch-input-root.single-reg .only-page { display: none; }
.reg-item:hover, .reg-item.active { background: rgba(99, 102, 241, .25); }


/* =====================================================================
   TAMPILAN TEAL — sidebar pil, blob header, kartu pastel (mengikuti desain referensi)
   Ditulis sebagai CSS biasa (tidak perlu build ulang Tailwind).
   Terang = bawaan; gelap = pilihan lewat tombol Mode Tampilan.
   ===================================================================== */
body {
    --card: #1e293b; --ink: #f1f5f9; --muted: #94a3b8; --line: rgba(255,255,255,.08);
    --shadow: 0 10px 40px rgba(0,0,0,.28);
    --kpi-lav: #272f55; --kpi-cream: #38321f; --kpi-white: #1e293b; --kpi-pink: #3a2740;
    --accent: #2dd4bf; --accent-dark: #14b8a6; --track: rgba(255,255,255,.1);
}
body.light-mode {
    --card: #ffffff; --ink: #1f2a44; --muted: #7b8499; --line: #eef1f5;
    --shadow: 0 10px 40px rgba(20,60,90,.07);
    --kpi-lav: #eef1fc; --kpi-cream: #fff6dd; --kpi-white: #ffffff; --kpi-pink: #fdeaf1;
    --accent: #2bb5ad; --accent-dark: #0d9488; --track: #e6ecf2;
}
body.light-mode { background-color: #f6f9fc; }

/* ---- Warna aksen: indigo -> teal (semua halaman, mode terang) ---- */
body.light-mode .text-indigo-300, body.light-mode .text-indigo-400, body.light-mode .text-sub-header { color: #0d9488 !important; }
body.light-mode .bg-indigo-600, body.light-mode .bg-indigo-600\/80 { background-color: #14a79c !important; color: #fff !important; }
body.light-mode .hover\:bg-indigo-500:hover { background-color: #0f9488 !important; }
body.light-mode .bg-indigo-500\/20, body.light-mode .bg-indigo-500\/10, body.light-mode .hover\:bg-indigo-500\/10:hover { background-color: rgba(20,167,156,.12) !important; }
body.light-mode .border-indigo-500\/30, body.light-mode .border-indigo-400\/30, body.light-mode .border-indigo-400\/20 { border-color: rgba(20,167,156,.35) !important; }
body.light-mode .focus\:ring-indigo-500:focus { --tw-ring-color: #14b8a6 !important; }
body.light-mode .from-indigo-600 { --tw-gradient-from: #2bb5ad var(--tw-gradient-from-position); --tw-gradient-to: rgb(43 181 173 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
body.light-mode .to-blue-500 { --tw-gradient-to: #5ed8d0 var(--tw-gradient-to-position); }
body.light-mode .bg-slate-800\/80, body.light-mode .bg-slate-800 { box-shadow: 0 10px 40px rgba(20,60,90,.06); border-color: #eef1f5 !important; }

/* ---- Sidebar desktop: pil teal, hanya ikon ---- */
@media (min-width: 768px) {
    body #sidebar {
        position: fixed; left: 1.25rem; top: 1.25rem; bottom: 1.25rem; width: 4.75rem; height: auto; z-index: 30;
        display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem 0;
        border: 0 !important; border-radius: 999px;
        background-color: transparent !important;
        background-image: linear-gradient(180deg, #25aea6 0%, #4fc9c1 55%, #8ee3dd 100%) !important;
        box-shadow: 0 16px 40px rgba(34,160,152,.35) !important;
    }
    #main-content { margin-left: 7.25rem !important; }
}
.sb-nav, .sb-foot { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.sb-nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: .25rem 0; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-link {
    width: 3rem; height: 3rem; flex: none; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.95); font-size: 1.1rem; transition: background .15s, color .15s, transform .15s;
}
.sb-link:hover { background: rgba(255,255,255,.22); }
.sb-link.sb-link-on { background: #fff; color: #17a198; box-shadow: 0 8px 18px rgba(0,70,70,.22); }
.sb-link i { width: auto !important; }
.sb-link.hidden { display: none; }

/* ---- Blob teal di belakang header Dashboard ---- */
#app-screen::before {
    content: ''; position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none;
    width: min(56vw, 880px); height: min(46vh, 430px);
    background: linear-gradient(135deg, #2fbfb7 0%, #52d3cb 60%, #6fdcd5 100%);
    border-bottom-right-radius: 100% 100%;
}
@media (max-width: 767px) { #app-screen::before { width: 100%; height: 15rem; border-bottom-right-radius: 60% 40%; } }

/* ---- Dashboard ---- */
.dash:not(.hidden) { display: flex; flex-direction: column; gap: 1.5rem; }
.dash.hidden { display: none; }
.dash-filter {
    display: flex; align-items: center; gap: .6rem; padding: .35rem 1.1rem; border-radius: 999px;
    background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--accent-dark);
}
.dash-filter input, body.light-mode .dash-filter input {
    background: transparent !important; border: 0 !important; outline: none; box-shadow: none !important;
    width: 13.5rem; padding: .6rem 0; font-size: .85rem; font-weight: 700; color: var(--ink) !important; cursor: pointer;
}
/* Pilihan tahun (Dashboard, Detail Biaya, Kategori Biaya, Riwayat Biaya, Master Laporan) */
.year-pill {
    display: inline-flex; align-items: center; gap: .45rem; height: 2.3rem; padding: 0 .55rem 0 .95rem; border-radius: 999px; flex: none;
    background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--accent-dark); cursor: pointer;
}
.year-pill select, body.light-mode .year-pill select, body:not(.light-mode) .year-pill select {
    background: transparent !important; border: 0 !important; box-shadow: none !important; outline: none !important;
    font-size: .8rem; font-weight: 700; color: var(--ink) !important; cursor: pointer; padding: 0 .25rem; height: 100%; min-width: 6.4rem;
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; margin-top: .5rem; }
@media (min-width: 1100px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { border-radius: 28px; padding: 1.6rem 1.75rem; box-shadow: var(--shadow); border: 1px solid var(--line); min-width: 0; }
.kpi-lav { background: var(--kpi-lav); } .kpi-cream { background: var(--kpi-cream); }
.kpi-white { background: var(--kpi-white); } .kpi-pink { background: var(--kpi-pink); }
.kpi-label { color: var(--muted); font-size: .9rem; font-weight: 500; }
.kpi-value { color: var(--ink); font-size: 2.2rem; line-height: 1.15; font-weight: 800; margin: .35rem 0 .2rem; overflow-wrap: anywhere; }
.kpi-money { font-size: clamp(1.4rem, 1.9vw, 2.1rem); }
.kpi-sub { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kpi-sub b { color: #12a38e; font-weight: 800; } .kpi-sub b.neg { color: #e11d48; }
.kpi-ring { display: flex; align-items: center; gap: 1rem; }
.ring { width: 5.6rem; height: 5.6rem; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: var(--track); }
.ring-bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-bar.neg { stroke: #f43f5e; }
.kpi-ring-text { min-width: 0; }
.kpi-ring .kpi-value { margin: .15rem 0; }

.dgrid2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 1000px) { .dgrid2 { grid-template-columns: 1fr 1.3fr; } }
.dcard { background: var(--card); border-radius: 28px; padding: 1.75rem; box-shadow: var(--shadow); border: 1px solid var(--line); min-width: 0; }
.dcard-title { color: var(--ink); font-size: 1.3rem; font-weight: 800; margin-bottom: 1.1rem; }

.legend { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.legend li { display: flex; align-items: center; gap: .7rem; font-size: .95rem; }
.chart-donut { position: relative; height: 13rem; }
.legend .ldot { width: .7rem; height: .7rem; border-radius: 99px; flex: none; }
.legend b { color: var(--ink); font-weight: 600; }
.legend small { color: var(--muted); font-size: .8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .lval { color: var(--ink); font-weight: 700; font-size: .85rem; white-space: nowrap; }

.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.ritem { display: flex; align-items: center; gap: .9rem; cursor: pointer; border-radius: 16px; transition: background .15s; }
.ritem:hover { background: var(--line); }
.ravatar { width: 2.9rem; height: 2.9rem; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--kpi-lav); color: var(--accent-dark); font-weight: 800; }
.rbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rbody b { color: var(--ink); font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbody small { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbadge { padding: .3rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.rbadge.ok { background: #e1f7ea; color: #129a5a; } .rbadge.done { background: #e3efff; color: #2b6cc4; } .rbadge.bad { background: #fde1e1; color: #c81e3c; }
body:not(.light-mode) .rbadge.ok { background: rgba(16,185,129,.18); color: #6ee7b7; }
body:not(.light-mode) .rbadge.done { background: rgba(59,130,246,.2); color: #93c5fd; }
body:not(.light-mode) .rbadge.bad { background: rgba(244,63,94,.2); color: #fda4af; }
.ramount { color: var(--ink); font-weight: 800; font-size: .95rem; white-space: nowrap; }
.rempty { color: var(--muted); font-size: .9rem; padding: 1rem 0; text-align: center; }

/* ---- Tambah Proyek (tabel banyak baris) ---- */
.pb-table { min-width: 1180px; }
.pb-table input { min-width: 0; }

/* ---- Mode terang: tombol berwarna tetap berteks putih; kotak berlatar transparan jadi pastel ---- */
body.light-mode .bg-rose-600, body.light-mode .bg-emerald-600, body.light-mode .bg-slate-600,
body.light-mode .hover\:bg-rose-500:hover, body.light-mode .hover\:bg-emerald-500:hover { color: #fff !important; }
body.light-mode .bg-rose-600 { background-color: #e11d48 !important; }
body.light-mode .bg-emerald-600 { background-color: #0e9f6e !important; }
body.light-mode .bg-slate-900\/30 { background-color: #f8fafc !important; border-color: #e6ecf2 !important; }
body.light-mode .bg-indigo-900\/30 { background-color: #ecfbf9 !important; border-color: rgba(20,167,156,.3) !important; }
body.light-mode .bg-rose-900\/20 { background-color: #fff1f3 !important; border-color: rgba(225,29,72,.25) !important; }
body.light-mode .text-rose-300 { color: #e11d48 !important; }


/* =====================================================================
   KOMPONEN RINGKAS — dipakai semua menu (judul, toolbar, tombol, pilihan mode)
   ===================================================================== */
body { --seg-bg: rgba(255,255,255,.06); --shadow-sm: none; }
body.light-mode { --seg-bg: #eef2f6; --shadow-sm: 0 2px 8px rgba(20,60,90,.06); }

/* Judul halaman: putih di atas blob teal (sama di semua menu) */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .75rem; }
.page-title { font-size: 1.9rem; line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,80,80,.15); }
.page-sub { margin-top: .25rem; color: rgba(255,255,255,.93); font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.page-tools .relative { width: 15rem !important; }
.page-tools input[type="text"], .page-tools select { height: 2.3rem; padding-top: 0 !important; padding-bottom: 0 !important; border-radius: 999px !important; font-size: .8rem !important; }
.page-tools .relative > span { padding-left: .9rem; }
.page-tools input[type="text"] { padding-left: 2.3rem !important; }

/* Tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 2.3rem; padding: 0 .95rem; border-radius: 999px; border: 1px solid transparent; font-size: .8rem; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn-soft { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-soft:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-teal { background: var(--accent-dark); color: #fff; }
.btn-teal:hover { filter: brightness(1.08); }
.btn-green { background: #0e9f6e; color: #fff; }
.btn-green:hover { background: #0b8a5f; }
.btn-amber { background: #fff4d6; color: #a15c07; border-color: #f7dc9a; }
body:not(.light-mode) .btn-amber { background: rgba(245,158,11,.15); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.btn-ico { width: 2.3rem; padding: 0; }
.btn.hidden, .btn-ico.hidden { display: none; }
@media (max-width: 640px) { .btn .lbl { display: none; } .btn:has(.lbl) { width: 2.3rem; padding: 0; } }

/* Pilihan mode Manual | Scan | Suara (segmented) */
.seg { display: inline-flex; padding: .2rem; border-radius: 999px; background: var(--seg-bg); border: 1px solid var(--line); flex: none; }
.seg-btn { height: 2rem; padding: 0 .95rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; transition: all .15s; white-space: nowrap; }
.seg-btn:hover { color: var(--accent-dark); }
.seg-btn.seg-on { background: var(--accent-dark); color: #fff; box-shadow: 0 4px 10px rgba(13,148,136,.3); }

/* Bar isian di atas tabel (mode + isian global) */
.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; }
.bar-field { display: flex; align-items: center; gap: .4rem; }
.bar-field > span { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.bar-in { height: 2.1rem; width: 8.5rem; padding: 0 .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700; min-width: 0; }
.bar-in.sm { width: 4rem; text-align: center; padding: 0 .3rem; }
.bar-in.date { width: 9.3rem; }
.bar-field .btn { height: 2.1rem; }

/* Kotak pemindai / suara lebih ramping */
.mini-panel { padding: .9rem 1rem !important; border-radius: 18px !important; }
.mini-panel .scan-drop { padding: .9rem 1rem; }
.hint { font-size: .75rem; color: var(--muted); }
details.hint summary { cursor: pointer; font-weight: 700; color: var(--accent-dark); }

/* Kepadatan umum di semua halaman (tabel, kartu, tombol aksi, kolom pencarian) */
#main-content .p-6 { padding: 1rem !important; }
#main-content .rounded-\[2rem\] { border-radius: 22px !important; }
#main-content table th, #main-content table td { padding-top: .5rem !important; padding-bottom: .5rem !important; }
#main-content table th.p-4, #main-content table td.p-4 { padding-left: .7rem !important; padding-right: .7rem !important; }
#main-content button.px-5.py-2\.5, #main-content button.px-6.py-3, #main-content button.py-3.px-6, #main-content button.py-3.px-5 {
    padding: 0 1rem !important; height: 2.3rem; font-size: .8rem !important; border-radius: 999px !important; box-shadow: none !important; display: inline-flex; align-items: center; gap: .4rem;
}
#main-content .space-y-6 > * + * { margin-top: 1rem !important; }
#main-content .text-3xl.font-bold { font-size: 1.9rem; }

/* ---- Mode terang: kotak transparan jadi pastel bersih & teks status terbaca ---- */
body.light-mode .bg-slate-900\/40, body.light-mode .bg-slate-900\/50, body.light-mode .bg-slate-900\/60,
body.light-mode .bg-slate-800\/40, body.light-mode .bg-slate-800\/50 { background-color: #f8fafc !important; }
body.light-mode .bg-rose-900\/20 { background-color: #fff1f3 !important; }
body.light-mode .text-rose-400 { color: #e11d48 !important; }
body.light-mode .text-blue-300 { color: #2563eb !important; }
body.light-mode .text-emerald-400 { color: #0e9f6e !important; }
body.light-mode .text-amber-300 { color: #b45309 !important; }
body.light-mode .bg-slate-900.sticky, body.light-mode thead.bg-slate-900 { background-color: #ffffff !important; }

/* =====================================================================
   KEJELASAN — kolom isian, tabel, kartu (terang & gelap)
   ===================================================================== */
/* ---- TERANG: isian putih, garis tegas, fokus teal ---- */
body.light-mode input[class]:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.light-mode select[class], body.light-mode textarea[class] {
    background-color: #ffffff !important; color: #0f172a !important;
    border: 1.5px solid #9db0c4 !important; box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
}
body.light-mode input[class]:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
body.light-mode select[class]:hover, body.light-mode textarea[class]:hover { border-color: #6f87a1 !important; }
body.light-mode input[class]:focus, body.light-mode select[class]:focus, body.light-mode textarea[class]:focus {
    border-color: #0d9488 !important; box-shadow: 0 0 0 3px rgba(13,148,136,.22) !important; outline: none !important;
}
body.light-mode input::placeholder, body.light-mode textarea::placeholder { color: #7a889b !important; opacity: 1; }
body.light-mode .dash-filter input { border: 0 !important; box-shadow: none !important; background: transparent !important; }
body.light-mode .field-error { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgba(225,29,72,.18) !important; }
/* tabel & kartu */
body.light-mode .overflow-hidden.bg-slate-900\/50, body.light-mode .bg-slate-900\/50.border { background-color: #eef3f8 !important; border-color: #c9d6e3 !important; }
body.light-mode thead { background-color: #e2eaf3 !important; }
body.light-mode thead th { color: #334155 !important; }
body.light-mode .divide-white\/5 > :not([hidden]) ~ :not([hidden]), body.light-mode tbody tr { border-color: #d3deea !important; }
body.light-mode .bg-slate-800\/80, body.light-mode .bg-slate-800 { border: 1px solid #d5e0ec !important; }
body.light-mode .text-slate-400, body.light-mode .text-slate-500 { color: #536278 !important; }
body.light-mode .text-slate-300 { color: #3b4a5f !important; }
body.light-mode .border-white\/10, body.light-mode .border-white\/5 { border-color: #d3deea !important; }
body.light-mode .btn-soft { border-color: #c4d2e0; }
body.light-mode .seg { border-color: #c4d2e0; background: #e8eef5; }

/* ---- GELAP: isian lebih terang dari latar, teks pudar dinaikkan ---- */
body:not(.light-mode) input[class]:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body:not(.light-mode) select[class], body:not(.light-mode) textarea[class] {
    background-color: rgba(255,255,255,.08) !important; color: #f8fafc !important; border: 1.5px solid rgba(255,255,255,.24) !important;
}
body:not(.light-mode) input[class]:hover, body:not(.light-mode) select[class]:hover, body:not(.light-mode) textarea[class]:hover { border-color: rgba(255,255,255,.4) !important; }
body:not(.light-mode) input[class]:focus, body:not(.light-mode) select[class]:focus, body:not(.light-mode) textarea[class]:focus {
    border-color: #2dd4bf !important; box-shadow: 0 0 0 3px rgba(45,212,191,.25) !important; outline: none !important;
}
body:not(.light-mode) input::placeholder, body:not(.light-mode) textarea::placeholder { color: #8e9bb0 !important; opacity: 1; }
body:not(.light-mode) .dash-filter input { border: 0 !important; background: transparent !important; box-shadow: none !important; }
body:not(.light-mode) .text-slate-400 { color: #b3bfd1 !important; }
body:not(.light-mode) .text-slate-500 { color: #8e9bb0 !important; }
body:not(.light-mode) .border-white\/10 { border-color: rgba(255,255,255,.2) !important; }
body:not(.light-mode) .border-white\/5 { border-color: rgba(255,255,255,.12) !important; }
body:not(.light-mode) thead th { color: #cbd5e1 !important; }
body:not(.light-mode) .btn-soft { border-color: rgba(255,255,255,.2); }
body:not(.light-mode) .seg { border-color: rgba(255,255,255,.18); }

/* ---- GELAP: kartu solid (tidak tembus blob) + aksen teal sama seperti mode terang ---- */
body:not(.light-mode) .bg-slate-800\/80, body:not(.light-mode) .bg-slate-800 { background-color: #17202f !important; border: 1px solid rgba(255,255,255,.12) !important; }
body:not(.light-mode) .text-indigo-300, body:not(.light-mode) .text-indigo-400 { color: #5eead4 !important; }
body:not(.light-mode) .bg-indigo-600, body:not(.light-mode) .bg-indigo-600\/80 { background-color: #0f9488 !important; color: #fff !important; }
body:not(.light-mode) .hover\:bg-indigo-500:hover { background-color: #14b8a6 !important; }
body:not(.light-mode) .bg-indigo-900\/30 { background-color: rgba(20,184,166,.12) !important; border-color: rgba(45,212,191,.3) !important; }
body:not(.light-mode) .bg-rose-900\/20 { background-color: rgba(244,63,94,.12) !important; }
body:not(.light-mode) .btn-soft { background: #1f2a3d; color: #e8eef7; }

/* =====================================================================
   SIDEBAR DESKTOP: terbuka (logo + tulisan) <-> diciutkan (hanya logo + ikon)
   ===================================================================== */
@media (min-width: 768px) {
    body #sidebar {
        width: 15.5rem; align-items: stretch; padding: 1.1rem .85rem; border-radius: 2.4rem;
        transition: width .25s ease;
    }
    body #main-content { margin-left: 18.25rem !important; transition: margin-left .25s ease; }
    body.sb-collapsed #sidebar { width: 4.75rem; padding: 1.1rem 0; align-items: center; }
    body.sb-collapsed #main-content { margin-left: 7.25rem !important; }
}
.sb-brand { display: flex; align-items: center; gap: .8rem; padding: 0 .35rem; margin-bottom: .9rem; cursor: pointer; user-select: none; flex: none; }
.sb-logo {
    width: 3rem; height: 3rem; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
    background: #f9c846; color: #fff; font-size: 1.25rem; box-shadow: 0 6px 14px rgba(0,0,0,.15);
}
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; white-space: nowrap; }
.sb-brand-text b { color: #fff; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.sb-brand-text small { color: rgba(255,255,255,.85); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
body #sidebar .sb-nav, body #sidebar .sb-foot { align-items: stretch; }
body #sidebar .sb-link { width: 100%; justify-content: flex-start; gap: .9rem; padding: 0 .95rem; font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-align: left; font-family: inherit; }
body #sidebar .sb-link i { width: 1.3rem !important; flex: none; text-align: center; font-size: 1.1rem; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-foot { padding-top: .5rem; border-top: 1px solid rgba(255,255,255,.28); margin: 0 .35rem; }

/* diciutkan: tinggal logo + ikon */
body.sb-collapsed .sb-brand { padding: 0; justify-content: center; }
body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-label { display: none; }
body.sb-collapsed #sidebar .sb-nav, body.sb-collapsed #sidebar .sb-foot { align-items: center; }
body.sb-collapsed #sidebar .sb-link { width: 3rem; padding: 0; justify-content: center; }
body.sb-collapsed .sb-foot { margin: 0; border-top: 0; padding-top: 0; }

/* tombol panah di tepi pil */
.sb-toggle {
    position: absolute; right: -.85rem; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 1.7rem; height: 1.7rem; border-radius: 999px; border: 1px solid #bfe6e2; background: #fff; color: #0d9488;
    display: flex; align-items: center; justify-content: center; font-size: .7rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,60,60,.25); transition: background .15s, color .15s;
}
.sb-toggle:hover { background: #0d9488; color: #fff; }
.sb-toggle i { transition: transform .25s; }
body.sb-collapsed .sb-toggle i { transform: rotate(180deg); }
body #sidebar { overflow: visible; }
@media (max-width: 767px) { .sb-toggle { display: none !important; } }

/* =====================================================================
   MODE MAINTENANCE — pilihan mode, input gaji, Summary Gaji
   (CSS biasa; tidak perlu build ulang Tailwind)
   ===================================================================== */
/* elemen khusus Maintenance disembunyikan di mode Proyek */
body:not(.mode-maintenance) .maint-only { display: none !important; }

/* form Input Biaya: tabel biaya umum <-> tabel gaji */
#batch-input-root.kind-gaji .when-umum { display: none !important; }
#batch-input-root:not(.kind-gaji) .when-gaji { display: none !important; }
.gaji-table { min-width: 980px; }
#batch-input-root.single-reg .gaji-table { min-width: 800px; }

/* pilihan mode di Dashboard */
.mode-seg { box-shadow: var(--shadow-sm); }
.mode-seg .seg-btn { height: 2.1rem; }

/* baris Gaji di Detail Proyek */
.badge-gaji { background: rgba(16,185,129,.14); color: #047857; border-color: rgba(16,185,129,.35); }
body:not(.light-mode) .badge-gaji { color: #6ee7b7; background: rgba(16,185,129,.18); }
.gaji-breakdown { margin-top: .15rem; color: var(--muted); font-size: .7rem; font-weight: 600; }

/* Summary Gaji */
.gj-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; margin-bottom: 1.1rem; }
.gj-field { display: flex; align-items: center; gap: .4rem; }
.gj-field > span { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gj-in { height: 2.1rem; width: 13rem; padding: 0 .9rem; border-radius: 999px; font-size: .8rem; font-weight: 700; min-width: 0; }
.gj-in.gj-year { width: 6.2rem; }
select.gj-in { width: 12rem; cursor: pointer; }
select.gj-in.gj-year { width: 6.2rem; }
/* Pilihan banyak registrasi / outlet */
.gj-multi { position: relative; }
.gj-multi-btn {
    height: 2.1rem; min-width: 14rem; max-width: 22rem; padding: 0 .9rem; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    font-size: .8rem; font-weight: 700; cursor: pointer; background: #fff; color: var(--ink); border: 1.5px solid #9db0c4;
}
body:not(.light-mode) .gj-multi-btn { background: rgba(255,255,255,.08); color: #f8fafc; border-color: rgba(255,255,255,.24); }
.gj-multi-btn:hover, .gj-multi-btn[aria-expanded="true"] { border-color: var(--accent-dark); }
.gj-multi-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gj-multi-btn i { font-size: .65rem; color: var(--muted); flex: none; }
.gj-multi-panel {
    position: absolute; z-index: 40; top: calc(100% + .4rem); left: 0; width: min(26rem, 88vw); padding: .7rem; border-radius: 18px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem;
}
body.light-mode .gj-multi-panel { border-color: #d5e0ec; box-shadow: 0 14px 40px rgba(20,60,90,.18); }
.gj-multi-panel.hidden { display: none; }
.gj-multi-search.gj-in { width: 100%; }
.gj-multi-actions { display: flex; justify-content: space-between; gap: .5rem; }
.gj-multi-actions button { border: 0; background: transparent; color: var(--accent-dark); font-size: .75rem; font-weight: 700; cursor: pointer; padding: .25rem .5rem; border-radius: 8px; }
.gj-multi-actions button:hover { background: var(--seg-bg); }
.gj-multi-list { max-height: 15rem; overflow-y: auto; display: flex; flex-direction: column; }
.gj-multi-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; cursor: pointer; font-size: .8rem; }
.gj-multi-item:hover { background: var(--seg-bg); }
.gj-multi-item input { accent-color: var(--accent-dark); width: 1rem; height: 1rem; flex: none; cursor: pointer; }
.gj-multi-item b { color: var(--ink); font-weight: 800; white-space: nowrap; }
.gj-multi-item small { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.gj-multi-empty { padding: .8rem .5rem; color: var(--muted); font-size: .8rem; text-align: center; }
.gj-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.gj-card { border-radius: 18px; padding: .9rem 1.1rem; border: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.gj-card:nth-child(1) { background: var(--kpi-lav); } .gj-card:nth-child(2) { background: var(--kpi-cream); } .gj-card:nth-child(3) { background: var(--kpi-pink); }
.gj-card small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.gj-card b { color: var(--ink); font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.gj-card b.neg { color: #e11d48; }
.gj-table th:first-child, .gj-table td:first-child { position: sticky; left: 0; z-index: 1; }
.gj-table th:first-child { background: inherit; }
.gj-table tbody td:first-child { background: var(--card); }
.gj-table td, .gj-table th { font-variant-numeric: tabular-nums; }
.gj-zero { color: var(--muted); opacity: .55; }
.gj-total td { border-top: 2px solid var(--line); background: var(--seg-bg); }
.gj-total td:first-child { background: var(--card); }

/* =====================================================================
   LOGIN — panel merek (kiri) + formulir (kanan). CSS biasa; tidak perlu build ulang Tailwind.
   ===================================================================== */
.lg-screen { flex: 1; display: flex; min-height: 0; width: 100%; position: relative; z-index: 10; background: var(--card); overflow-y: auto; }
.lg-screen.hidden { display: none; }
.lg-brand {
    flex: 0 0 46%; max-width: 40rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 2.5rem 3rem; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(155deg, #0b7f78 0%, #14a79c 55%, #43c6bd 100%);
}
.lg-brand::before, .lg-brand::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.lg-brand::before { width: 26rem; height: 26rem; right: -9rem; top: -8rem; }
.lg-brand::after { width: 20rem; height: 20rem; left: -8rem; bottom: -7rem; }
.lg-brand > * { position: relative; z-index: 1; }
.lg-brand-top { display: flex; align-items: center; gap: .9rem; }
.lg-logo { width: 3.2rem; height: 3.2rem; border-radius: 16px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.lg-brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.lg-brand-name b { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.lg-brand-name small { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.lg-brand-body h2 { font-size: 1.9rem; line-height: 1.25; font-weight: 800; margin: 0 0 .8rem; letter-spacing: -.01em; }
.lg-brand-body > p { margin: 0 0 1.6rem; font-size: .95rem; line-height: 1.6; opacity: .92; max-width: 30rem; }
.lg-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.lg-points li { display: flex; align-items: center; gap: .9rem; }
.lg-points li > span { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.lg-points b { display: block; font-size: .9rem; font-weight: 700; }
.lg-points small { display: block; font-size: .78rem; opacity: .85; margin-top: .1rem; }
.lg-brand-foot { font-size: .75rem; opacity: .75; }

.lg-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; min-width: 0; }
.lg-card { width: 100%; max-width: 26rem; }
.lg-card-head h1 { margin: 0; font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.lg-card-head p { margin: .45rem 0 1.8rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.lg-label { display: block; margin: 0 0 .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lg-field { position: relative; margin-bottom: 1.2rem; }
.lg-field > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.lg-field .lg-input { width: 100%; height: 3rem; padding: 0 1rem 0 2.8rem; border-radius: 14px; font-size: .92rem; font-weight: 500; outline: none; }
.lg-field .lg-input-pw { padding-right: 6.2rem; }
.lg-pw-toggle { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent-dark); font-size: .75rem; font-weight: 700; cursor: pointer; padding: .4rem .6rem; border-radius: 8px; }
.lg-pw-toggle:hover { background: var(--seg-bg); }
.lg-error { margin: -.3rem 0 1rem; padding: .7rem .9rem; border-radius: 12px; font-size: .82rem; font-weight: 600; color: #be123c; background: #fff1f3; border: 1px solid #fecdd3; }
body:not(.light-mode) .lg-error { color: #fda4af; background: rgba(244,63,94,.12); border-color: rgba(244,63,94,.35); }
.lg-error.hidden { display: none; }
.lg-submit {
    width: 100%; height: 3.1rem; border: 0; border-radius: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: .4rem;
    font-size: .95rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0d9488, #14b8a6); box-shadow: 0 10px 24px rgba(13,148,136,.32); transition: filter .15s, transform .1s;
}
.lg-submit:hover { filter: brightness(1.06); }
.lg-submit:active { transform: scale(.985); }
.lg-submit:disabled { opacity: .7; cursor: progress; }
.lg-note { margin: 1.6rem 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

@media (max-width: 900px) {
    .lg-screen { flex-direction: column; }
    .lg-brand { flex: none; max-width: none; padding: 1.4rem 1.5rem; gap: 0; }
    .lg-brand-body, .lg-brand-foot { display: none; }
    .lg-form-wrap { align-items: flex-start; padding-top: 1.8rem; }
}

/* =====================================================================
   REVISI: ikon aksi di pojok kanan atas Dashboard, tombol cara-input berupa ikon,
   pilihan bulan registrasi, tampilan sisa profit (CSS biasa; tidak perlu build ulang Tailwind)
   ===================================================================== */
/* Mode Tampilan / Pengaturan / Keluar: pojok kanan atas Dashboard (desktop). Di HP sudah ada di header atas & menu. */
.dash-top-actions { display: none; }
@media (min-width: 768px) {
    .dash { position: relative; }
    .dash-top-actions { display: flex; align-items: center; gap: .5rem; position: absolute; top: 0; right: 0; z-index: 5; }
    #dashboard-view > .page-head { padding-right: 8.75rem; }
}

/* Manual / Scan Foto / Suara: hanya ikon */
.seg-icons .seg-btn { width: 2.6rem; padding: 0; justify-content: center; gap: 0; }
.seg-icons .seg-btn i { font-size: .95rem; }

/* Pilihan bulan registrasi (Input Biaya, Maintenance) */
.bar-in.month { width: 8.5rem; }
#batch-input-root.single-reg .bar-month { display: none !important; }

/* Sisa profit: di bawah No Registrasi tiap baris & di daftar pilihan registrasi */
.row-reg-profit { margin-top: .1rem; }
.reg-profit { margin-left: auto; flex: none; padding-left: .5rem; font-size: .68rem; font-weight: 800; white-space: nowrap; }


/* =====================================================================
   REVISI TATA LETAK — rapi di semua lebar layar (zoom 100%) saat sidebar dilebarkan / diciutkan
   Kartu angka memakai container query: huruf mengecil mengikuti lebar kartu, nominal tidak turun ke baris bawah.
   ===================================================================== */
/* Menu "Registrasi" tidak punya mode: tampil sama di Proyek & Maintenance. Elemen khusus mode Proyek: */
body.mode-maintenance .proyek-only { display: none !important; }

/* Sidebar terbuka lebih ramping + ruang isi lebih lega */
@media (min-width: 768px) {
    body #sidebar { width: 13.5rem; padding: 1.1rem .7rem; }
    body #main-content { margin-left: 16.25rem !important; padding-left: 1.5rem; padding-right: 1.5rem; }
    body.sb-collapsed #sidebar { width: 4.75rem; padding: 1.1rem 0; }
    body.sb-collapsed #main-content { margin-left: 7.25rem !important; }
}
body #sidebar .sb-link { height: 2.9rem; padding: 0 .8rem; gap: .75rem; font-size: .88rem; }
.sb-brand { gap: .65rem; padding: 0 .2rem; }
.sb-brand-text b { font-size: 1.15rem; }
.sb-brand-text small { font-size: .6rem; letter-spacing: .04em; }
body.sb-collapsed #sidebar .sb-link { height: 3rem; padding: 0; }

/* Judul & alat di bagian atas halaman: boleh turun baris, tidak saling menimpa */
.page-title { font-size: clamp(1.45rem, 1.2rem + .8vw, 1.9rem); }
.page-head > div:first-child { min-width: 0; }
.page-tools { min-width: 0; max-width: 100%; }
.dash-filter input, body.light-mode .dash-filter input { width: 13.2rem; text-overflow: ellipsis; }

/* ---- Dashboard: kartu angka ---- */
.dash { container-type: inline-size; container-name: dash; }
.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@container dash (min-width: 860px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container dash (max-width: 460px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }
.kpi { container-type: inline-size; padding: 1.25rem 1.25rem; border-radius: 24px; }
.kpi-label { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: clamp(1.5rem, 13cqw, 2.2rem); white-space: nowrap; overflow-wrap: normal; }
.kpi-money { font-size: clamp(.85rem, 9.4cqw, 2.1rem); white-space: nowrap; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ring { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .8rem; row-gap: .35rem; }
.kpi-ring .ring { width: 4.2rem; height: 4.2rem; }
.kpi-ring .kpi-value { font-size: clamp(1.4rem, 12cqw, 2rem); }
.kpi-ring-sub { grid-column: 1 / -1; font-size: .78rem; }
.kpi-ring-sub b { display: block; font-size: clamp(.8rem, 7.2cqw, 1rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
@container dash (max-width: 859px) { .dgrid2 { grid-template-columns: 1fr; } }
.dcard { padding: 1.4rem; }
.dcard-title { font-size: 1.15rem; }
.ramount { font-size: .9rem; }

/* ---- Detail Biaya: lihat blok REVISI v17 di bagian paling bawah ---- */

/* ---- Detail Proyek: tiga kotak ringkasan mengikuti lebar isi, angka tidak patah ---- */
#project-detail-view .grid.md\:grid-cols-3 { container-type: inline-size; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
#project-detail-view .grid.md\:grid-cols-3 > div { min-width: 0; }
#project-detail-view .grid.md\:grid-cols-3 .flex.justify-between span:last-child { white-space: nowrap; margin-left: .5rem; }
#detail-profit { font-size: clamp(1.3rem, 2.2vw, 1.9rem) !important; white-space: nowrap; max-width: 100%; }

/* ---- Isi halaman lain ---- */
#main-content table { font-size: .82rem; }
#main-content .overflow-x-auto { max-width: 100%; }
.gj-cards { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.gj-card b { font-size: clamp(1rem, 1.6vw, 1.3rem); white-space: nowrap; }
.gj-multi-btn.gj-month-btn { min-width: 11rem; }
.gj-multi-panel.gj-month-panel { width: min(16rem, 88vw); }
.gj-multi-panel.gj-month-panel .gj-multi-list { max-height: none; overflow: visible; }
.gj-month-panel .gj-multi-actions button { white-space: nowrap; }
.page-tools .year-pill select { min-width: 6.4rem; }
.page-tools .year-pill:has(#filter-month) select { min-width: 8.2rem; }
@media (max-width: 1280px) and (min-width: 768px) {
    .page-tools .relative { width: 12.5rem !important; }
    .batch-bar { gap: .5rem .8rem; }
}

/* Nama kelas .ring bentrok dengan utilitas Tailwind "ring" (kotak biru): matikan bayangannya */
svg.ring { box-shadow: none !important; --tw-ring-shadow: 0 0 #0000 !important; }

/* =====================================================================
   REVISI v15 — logo perusahaan, filter tahun tanpa ikon, rentang tanggal hanya ikon, tanpa kolom No PR (Maintenance)
   ===================================================================== */
/* Logo perusahaan (gambar bulat putih) */
.sb-logo, .lg-logo { background: #fff !important; overflow: hidden; padding: 0; }
.sb-logo img, .lg-logo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.lg-logo { border: 0; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.brand-img { border-radius: 50%; object-fit: cover; flex: none; background: #fff; }

/* Tahun: tanpa ikon kalender */
.year-pill { padding: 0 .45rem 0 .75rem; }

/* Rentang tanggal: hanya ikon kalender; kolom aslinya tak terlihat tetapi menutupi ikon agar bisa diklik */
.dash-filter { position: relative; width: 2.3rem; height: 2.3rem; padding: 0; justify-content: center; flex: none; cursor: pointer; }
.dash-filter i.fa-calendar-days { font-size: .95rem; pointer-events: none; }
body .dash-filter input, body.light-mode .dash-filter input, body:not(.light-mode) .dash-filter input {
    position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; padding: 0 !important;
    opacity: 0; cursor: pointer; border-radius: 999px !important;
}
.dash-filter.has-value { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.dash-filter-clear {
    display: none; position: absolute; top: -.3rem; right: -.3rem; z-index: 3; width: 1.05rem; height: 1.05rem; border-radius: 999px; border: 0;
    background: #e11d48; color: #fff; font-size: .55rem; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.dash-filter.has-value .dash-filter-clear { display: inline-flex; }

/* Maintenance: kolom No PR di Input Biaya disembunyikan */
body.mode-maintenance .col-pr { display: none !important; }
body.mode-maintenance .batch-table { min-width: 1120px; }
body.mode-maintenance #batch-input-root.single-reg .batch-table { min-width: 920px; }

/* Summary Gaji: pilihan tanpa tulisan di sampingnya */
.gj-field { gap: 0; }

/* =====================================================================
   REVISI v16 — baris alat Dashboard sejajar lurus: Proyek/Maintenance, Tahun, Rentang tanggal, Mode, Pengaturan, Keluar
   ===================================================================== */
@media (min-width: 768px) {
    .dash-top-actions { position: static; display: flex; align-items: center; gap: .5rem; }
    #dashboard-view > .page-head { padding-right: 0; }
}
#dashboard-view .page-tools { flex-wrap: nowrap; align-items: center; gap: .5rem; }
@media (max-width: 1250px) and (min-width: 768px) { #dashboard-view .page-tools { flex-wrap: wrap; justify-content: flex-end; } }
#dashboard-view .mode-seg .seg-btn { height: 1.9rem; }
#dashboard-view .year-pill, #dashboard-view .dash-filter, #dashboard-view .dash-top-actions .btn-ico { height: 2.5rem; margin: 0; }
#dashboard-view .dash-filter, #dashboard-view .dash-top-actions .btn-ico { width: 2.5rem; }
#dashboard-view .mode-seg { height: 2.5rem; box-sizing: border-box; align-items: center; }
/* kotak tahun: tanpa bingkai ganda (pilihan di dalamnya tidak berbingkai sendiri) */
body .year-pill select.year-sel, body.light-mode .year-pill select.year-sel, body:not(.light-mode) .year-pill select.year-sel {
    border: 0 !important; box-shadow: none !important; background-color: transparent !important; outline: none !important;
}

/* =====================================================================
   REVISI v17 — kartu angka Dashboard lebih berwarna & angka lebih besar, kotak Total/Margin lebih sempit,
   Detail Biaya rapi sejajar (grid kolom tetap), sidebar lebih ramping
   ===================================================================== */

/* ---- 1. Warna kartu angka: lebih pekat (tidak samar) ---- */
body .kpi-lav   { background: linear-gradient(135deg, #3b4a9c, #2f3b80); }
body .kpi-cream { background: linear-gradient(135deg, #7a6218, #5e4b14); }
body .kpi-white { background: linear-gradient(135deg, #12776e, #0e5c56); }
body .kpi-pink  { background: linear-gradient(135deg, #8a2d5c, #6b2248); }
body.light-mode .kpi-lav   { background: linear-gradient(135deg, #b9c5ff, #dbe2ff); }
body.light-mode .kpi-cream { background: linear-gradient(135deg, #ffdf8a, #ffefbd); }
body.light-mode .kpi-white { background: linear-gradient(135deg, #a9ecdf, #d3f7f0); }
body.light-mode .kpi-pink  { background: linear-gradient(135deg, #ffb8d0, #ffdbe8); }
body .kpi { border-color: rgba(255,255,255,.14); }
body.light-mode .kpi { border-color: rgba(255,255,255,.7); box-shadow: 0 10px 28px rgba(20,60,90,.12); }
body .kpi-label { color: #dbe3f1; font-weight: 600; }
body .kpi-sub   { color: #b9c4d8; font-weight: 600; }
body.light-mode .kpi-label { color: #34415f; }
body.light-mode .kpi-sub   { color: #4a5878; }
body .kpi-ring .ring-track { stroke: rgba(255,255,255,.22); }
body.light-mode .kpi-ring .ring-track { stroke: rgba(255,255,255,.85); }
body.light-mode .kpi-ring .ring-bar { stroke: #0d9488; }
body .kpi-ring-sub b { color: #7ff0dd; }
body.light-mode .kpi-ring-sub b { color: #0a6b63; }

/* ---- 2 & 3. Lebar kotak: Total & Margin lebih sempit, Nilai PO & Total Keluar lebih lebar + angka lebih besar ---- */
@container dash (min-width: 860px) {
    .kpi-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.5fr) minmax(0, .95fr) minmax(0, 1.5fr); }
}
.kpi-money { font-size: clamp(1rem, 10cqw, 2.4rem); font-weight: 800; }
/* Margin Profit: judul di atas, cincin + persen sebaris, est. profit di bawah (muat di kotak sempit) */
.kpi-ring { column-gap: .7rem; row-gap: .3rem; }
.kpi-ring-text { display: contents; }
.kpi-ring .kpi-label { grid-row: 1; grid-column: 1 / -1; }
.kpi-ring .ring { grid-row: 2; grid-column: 1; width: 3.6rem; height: 3.6rem; }
.kpi-ring .kpi-value { grid-row: 2; grid-column: 2; font-size: clamp(1.2rem, 14cqw, 2rem); }
.kpi-ring-sub { grid-row: 3; grid-column: 1 / -1; }

/* ---- 4. Detail Biaya: semua kartu sejajar, kolom lebar tetap ---- */
#projects-grid { container-type: inline-size; container-name: pgrid; }
#projects-grid .card-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex-direction: unset; }
#projects-grid .pc-name { grid-column: 1 / -1; min-width: 0; border: 0; }
#projects-grid .pc-job { grid-column: 1 / -1; }
#projects-grid .pc-cell { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; min-width: 0; border-top: 1px solid rgba(255,255,255,.08); }
#projects-grid .pc-cell > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#projects-grid .pc-money > i { width: 1.4rem; text-align: center; flex: none; }
#projects-grid .pc-money > div { min-width: 0; }
#projects-grid .pc-money .leading-none { font-variant-numeric: tabular-nums; white-space: nowrap; }
#projects-grid .card-container h4 { font-size: 1rem; }
@container pgrid (min-width: 900px) {
    #projects-grid .card-container { grid-template-columns: minmax(12rem, 1.5fr) 9rem 7.6rem minmax(8rem, 1fr) 11rem 11rem; }
    #projects-grid .pc-name, #projects-grid .pc-job { grid-column: auto; }
    #projects-grid .pc-cell { border-top: 0; border-left: 1px solid rgba(255,255,255,.08); }
}

/* ---- 5. Sidebar: lebar pas dengan tulisan menu ---- */
@media (min-width: 768px) {
    body #sidebar { width: 11.8rem; padding: 1.1rem .6rem; }
    body #main-content { margin-left: 14.4rem !important; }
}
body #sidebar .sb-link { padding: 0 .7rem; gap: .65rem; }

/* =====================================================================
   REVISI v18 — angka Total Maintenance/Proyek & Margin Profit diperbesar
   ===================================================================== */
.kpi-lav .kpi-value { font-size: clamp(2.2rem, 30cqw, 3.6rem); line-height: 1.05; }
.kpi-ring .ring { width: 3.3rem; height: 3.3rem; }
.kpi-ring .kpi-value { font-size: clamp(1.4rem, 18cqw, 2.4rem); }


/* =====================================================================
   REVISI v23 — Kategori Biaya: tabel muat penuh (tanpa geser ke samping)
   CSS biasa; tidak perlu build ulang Tailwind.
   ===================================================================== */
/* Kategori Biaya: kolom berbagi lebar, teks boleh turun baris. Layar sempit -> tiap registrasi jadi kartu (tetap tanpa geser). */
.kat-wrap { container-type: inline-size; container-name: kat; width: 100%; }
.kat-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.kat-table th, .kat-table td { white-space: normal; overflow-wrap: anywhere; vertical-align: middle; line-height: 1.3; }
.kat-table td.kat-num, .kat-table th.text-right { font-variant-numeric: tabular-nums; }
#main-content .kat-table th.p-4, #main-content .kat-table td.p-4 { padding-left: .45rem !important; padding-right: .45rem !important; }
#main-content .kat-table th.p-4:first-child, #main-content .kat-table td.p-4:first-child { padding-left: .3rem !important; padding-right: .3rem !important; }
.kat-table td { font-size: .8rem; }
.kat-table th { font-size: .68rem; letter-spacing: .02em; }
@container kat (max-width: 880px) {
    .kat-table colgroup, .kat-table thead { display: none; }
    .kat-table, .kat-table tbody { display: block; }
    .kat-table tbody tr { display: block; margin: 0 0 .75rem; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--seg-bg); }
    #main-content .kat-table tbody td.p-4 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .3rem 0 !important; text-align: right; border: 0; }
    .kat-table td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
    .kat-table td[data-label="No"] { display: none !important; }
    .kat-table td[data-label="No. Reg"] { font-size: .95rem; }
    .kat-table td.kat-empty { display: block !important; text-align: center; }
    .kat-table td.kat-empty::before { content: none; }
}


/* REVISI v24 — Riwayat Biaya & Master Laporan memakai tata letak Kategori Biaya (muat penuh, tanpa geser ke samping) */
.kat-table tfoot td { white-space: normal; }
@container kat (max-width: 880px) {
    .kat-table .hidden { display: none !important; }
    #main-content .kat-table tbody td.p-4[data-label="Aksi"] { justify-content: flex-end; }
    .kat-table tfoot, .kat-table tfoot tr { display: block; }
    .kat-table tfoot tr { margin: 0 0 .75rem; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--seg-bg); }
    .kat-table tfoot td { display: block; padding: .2rem 0 !important; text-align: right !important; }
    .kat-table tfoot td:empty { display: none; }
}

.kat-table .pick-col input[type=checkbox] { vertical-align: middle; }
/* Ceklis Kategori Biaya / Riwayat Biaya / Master Laporan: tersembunyi sampai ada teks di kolom pencarian */
.kat-table.pick-off .pick-col { display: none !important; }
/* Nama lokasi / outlet selalu huruf besar */
#edit-proj-loc, .pb-loc { text-transform: uppercase; }
