/* ============================================================
   RAB DK KOI — design system
   ============================================================ */
:root {
    --brand: #F26B3A;
    --brand-dark: #D2551F;
    --brand-soft: #FEF1EA;
    --brand-ring: rgba(242, 107, 58, .28);

    --ink-900: #0F172A;
    --ink-800: #1E293B;
    --ink-700: #334155;
    --ink-500: #64748B;
    --ink-400: #94A3B8;
    --ink-300: #CBD5E1;

    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --surface-2: #FAFBFC;
    --line: #E6E9EF;
    --line-strong: #D6DBE4;

    --success: #16A34A;  --success-soft: #E9F7ED;
    --warning: #D97706;  --warning-soft: #FEF4E4;
    --danger:  #DC2626;  --danger-soft:  #FDEDED;
    --info:    #2563EB;  --info-soft:    #ECF2FE;
    --violet:  #7C3AED;  --violet-soft:  #F3ECFE;
    --sky:     #0891B2;  --sky-soft:     #E5F5FA;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -14px rgba(15, 23, 42, .22);
    --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);

    --sidebar-w: 264px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink-800);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; color: var(--ink-900); letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0; }
small { font-size: 12px; }

.muted { color: var(--ink-500); }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; color: var(--ink-900); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Shell ------------------------------------------------ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(178deg, #131C2E 0%, #0B1120 100%);
    color: #C7D0DE;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    background: linear-gradient(135deg, var(--brand) 0%, #F2A03A 100%);
    display: grid; place-items: center;
    box-shadow: 0 8px 20px -8px rgba(242, 107, 58, .8);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: #7F8CA3; letter-spacing: .06em; text-transform: uppercase; }

.nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-label {
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: #64728A; padding: 14px 10px 7px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: 10px; margin-bottom: 2px;
    color: #C0C9D8; font-weight: 500; font-size: 13.5px;
    transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, rgba(242,107,58,.22), rgba(242,107,58,.10)); color: #fff; box-shadow: inset 0 0 0 1px rgba(242,107,58,.28); }
.nav-item.active svg { opacity: 1; color: var(--brand); }
.nav-count { margin-left: auto; font-size: 11px; color: #7F8CA3; font-variant-numeric: tabular-nums; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-link { border-radius: 10px; padding: 4px; margin: -4px; transition: background .15s ease; min-width: 0; }
.user-link:hover { background: rgba(255, 255, 255, .07); }

.avatar {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
    background: rgba(255,255,255,.09); display: grid; place-items: center;
    color: #fff; font-weight: 650; font-size: 13px;
}

/* ---- Main / topbar ---------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
    display: flex; align-items: center; gap: 14px;
}
.topbar h1 { font-size: 18px; }
.topbar-sub { font-size: 12.5px; color: var(--ink-500); }

.hamburger {
    display: none; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; cursor: pointer;
    align-items: center; justify-content: center; color: var(--ink-700);
}

.content {
    padding: 24px 28px; max-width: 1700px; width: 100%;
    /* Tata letak menyesuaikan lebar yang benar-benar tersedia, bukan lebar
       layar. Jadi saat sidebar dilipat, isi dashboard ikut melebar. */
    container-type: inline-size;
    container-name: isi;
}

/* ---- Cards ------------------------------------------------ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 16px 18px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-body { padding: 18px; }
.card-body.tight { padding: 14px 18px; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(198px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }

/* ---- Stat cards ------------------------------------------- */
.stat {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--accent, var(--brand)); opacity: .9;
}
.stat-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.stat-icon {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: var(--accent-soft, var(--brand-soft)); color: var(--accent, var(--brand));
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-label { font-size: 12px; color: var(--ink-500); font-weight: 550; letter-spacing: .01em; }
.stat-value { font-size: 23px; font-weight: 700; color: var(--ink-900); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-note { font-size: 12px; color: var(--ink-500); margin-top: 5px; }
.stat-note b { color: var(--ink-700); font-weight: 600; }

/* ---- Progress --------------------------------------------- */
.progress { height: 7px; border-radius: 99px; background: #EDF0F5; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--bar, var(--brand)); transition: width .5s cubic-bezier(.2,.8,.3,1); }
.progress.thin { height: 5px; }

/* ---- Badges ----------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
    background: #F1F3F7; color: var(--ink-700);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .75; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-soft); color: #12803C; }
.badge-warning { background: var(--warning-soft); color: #B45309; }
.badge-danger  { background: var(--danger-soft);  color: #B91C1C; }
.badge-info    { background: var(--info-soft);    color: #1D4ED8; }
.badge-violet  { background: var(--violet-soft);  color: #6D28D9; }
.badge-sky     { background: var(--sky-soft);     color: #0E7490; }
.badge-neutral { background: #F1F3F7; color: var(--ink-600, #475569); }
.badge-brand   { background: var(--brand-soft); color: var(--brand-dark); }

/* ---- Buttons ---------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: var(--brand); color: #fff;
    font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease, transform .06s ease;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-700); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-300); color: var(--ink-900); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: #FBE3D6; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #B91C1C; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803D; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- Forms ------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-8 { grid-column: span 8; }

label.lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
label.lbl .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%; padding: 9px 12px; font-family: inherit; font-size: 13.5px;
    color: var(--ink-900); background: #fff;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 88px; resize: vertical; }
.select {
    appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input[readonly] { background: var(--surface-2); color: var(--ink-700); }
.hint { font-size: 11.5px; color: var(--ink-500); }
.hint.money { color: var(--brand-dark); font-weight: 600; font-variant-numeric: tabular-nums; }
.err { font-size: 11.5px; color: var(--danger); font-weight: 550; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-700); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.radio-card {
    position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    padding: 11px 13px; cursor: pointer; background: #fff; transition: all .15s ease;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .rc-title { font-weight: 650; font-size: 13.5px; color: var(--ink-900); display: flex; align-items: center; gap: 7px; }
.radio-card .rc-desc { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.radio-card:hover { border-color: var(--ink-300); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }

.file-drop {
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
    padding: 18px; text-align: center; background: var(--surface-2);
    cursor: pointer; transition: all .15s ease;
}
.file-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-drop input { display: none; }
.file-drop .fd-title { font-weight: 600; font-size: 13px; color: var(--ink-700); }
.file-drop .fd-sub { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; }
.file-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-pill { font-size: 11.5px; background: #EEF1F6; color: var(--ink-700); padding: 4px 9px; border-radius: 99px; }

/* ---- Toolbar / filters ------------------------------------ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { grid-column: auto; min-width: 150px; flex: 0 1 auto; gap: 5px; }
.toolbar .field.grow { flex: 1 1 240px; }

.search {
    position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--ink-400); pointer-events: none; }
.search .input { padding-left: 34px; }

.segmented { display: inline-flex; background: #EEF1F6; border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a {
    padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-500);
    transition: all .15s ease; white-space: nowrap;
}
.segmented a:hover { color: var(--ink-800); }
.segmented a.active { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 99px; background: #fff;
    border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--ink-700); font-weight: 550;
}
.chip .dot { width: 8px; height: 8px; border-radius: 99px; }

/* ---- Label kategori di dalam tabel ------------------------- */
.cat { display: inline-flex; align-items: flex-start; gap: 7px; font-weight: 550; color: var(--ink-700); line-height: 1.35; }
.cat .dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; margin-top: 5px; }

/* ---- Topbar pada layar kecil ------------------------------- */
@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; row-gap: 10px; }
    .hamburger { order: 1; }
    .topbar .grow { order: 2; }
    .topbar h1 { font-size: 16px; line-height: 1.3; }
    .topbar-actions { order: 3; flex: 1 0 100%; gap: 8px; }
    .topbar-actions .btn { flex: 1 1 0; }
}

/* ---- Tables ----------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
    text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-500);
    padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
    white-space: nowrap;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid #F1F3F7; vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background .12s ease; }
table.table tbody tr:hover { background: #FAFBFD; }
table.table tfoot td { padding: 12px 14px; background: var(--surface-2); font-weight: 650; color: var(--ink-900); border-top: 1px solid var(--line); }
.td-title { font-weight: 600; color: var(--ink-900); }
.td-sub { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.row-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* ---- Alerts ----------------------------------------------- */
.alert {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 12px 15px; border-radius: var(--radius-sm);
    font-size: 13.5px; border: 1px solid transparent; margin-bottom: 16px;
}
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert-success { background: var(--success-soft); color: #14532D; border-color: #BBEBCB; }
.alert-warning { background: var(--warning-soft); color: #7C2D12; border-color: #FBD9A5; }
.alert-danger  { background: var(--danger-soft);  color: #7F1D1D; border-color: #F7C5C5; }
.alert-info    { background: var(--info-soft);    color: #1E3A8A; border-color: #C5D8FC; }
.alert ul { margin: 5px 0 0; padding-left: 17px; }

/* ---- Empty state ------------------------------------------ */
.empty { padding: 46px 22px; text-align: center; }
.empty-icon {
    width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 14px;
    background: var(--brand-soft); color: var(--brand); display: grid; place-items: center;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 5px; }
.empty p { color: var(--ink-500); max-width: 380px; margin: 0 auto 16px; font-size: 13px; }

/* ---- Breakdown bars --------------------------------------- */
.bar-row { padding: 11px 0; border-bottom: 1px solid #F1F3F7; }
.bar-row:last-child { border-bottom: none; }
.bar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.bar-name { display: flex; align-items: center; gap: 8px; font-weight: 550; font-size: 13px; color: var(--ink-800); min-width: 0; }
.bar-name .dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.bar-val { font-size: 13px; font-weight: 650; color: var(--ink-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 99px; background: #EEF1F6; overflow: hidden; position: relative; }
.bar-track > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; display: block; }
.bar-track > i.paid { background: rgba(15, 23, 42, .55); mix-blend-mode: normal; }
.bar-meta { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11.5px; color: var(--ink-500); }

/* ---- Donut (conic-gradient) ------------------------------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 156px; height: 156px; border-radius: 50%; position: relative; flex: 0 0 156px; }
.donut::after {
    content: ""; position: absolute; inset: 28px; border-radius: 50%;
    background: #fff; box-shadow: inset 0 0 0 1px var(--line);
}
.donut-center {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2;
}
.donut-center .dc-val { font-size: 15px; font-weight: 700; color: var(--ink-900); line-height: 1.1; }
.donut-center .dc-lbl { font-size: 10.5px; color: var(--ink-500); }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.legend-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend-row .lg-name { color: var(--ink-700); }
.legend-row .lg-val { margin-left: auto; font-weight: 650; color: var(--ink-900); font-variant-numeric: tabular-nums; }

/* ---- Timeline (riwayat pembayaran) ------------------------ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 99px;
    background: #fff; border: 2.5px solid var(--brand); box-shadow: 0 0 0 3px #fff;
}
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-amount { font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.tl-meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* ---- Bukti / galeri foto ---------------------------------- */
.proofs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.proof {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 4 / 3;
}
.proof img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.proof .doc { display: grid; place-content: center; height: 100%; gap: 6px; text-align: center; padding: 8px; color: var(--ink-500); }
.proof .doc svg { width: 26px; height: 26px; margin: 0 auto; }
.proof .doc span { font-size: 10.5px; word-break: break-all; line-height: 1.3; }
.proof-del {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
    border-radius: 8px; border: none; background: rgba(15, 23, 42, .62); color: #fff;
    display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s ease;
}
.proof:hover .proof-del { opacity: 1; }
.proof-del svg { width: 13px; height: 13px; }

.lightbox {
    position: fixed; inset: 0; background: rgba(8, 12, 20, .88); z-index: 90;
    display: none; align-items: center; justify-content: center; padding: 28px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-close {
    position: absolute; top: 18px; right: 20px; width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255, 255, 255, .14); border: none; color: #fff; cursor: pointer;
    display: grid; place-items: center;
}

/* ---- Pagination ------------------------------------------- */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination span {
    min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 600; color: var(--ink-600, #475569);
    border: 1px solid var(--line); background: #fff;
}
.pagination a:hover { border-color: var(--ink-300); background: var(--surface-2); }
.pagination .active span, .pagination span[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled span { opacity: .45; }
.pagination svg { width: 14px; height: 14px; }

/* ---- Login ------------------------------------------------ */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(900px 460px at 12% -8%, rgba(242, 107, 58, .18), transparent 62%),
        radial-gradient(760px 420px at 92% 8%, rgba(37, 99, 235, .13), transparent 60%),
        linear-gradient(178deg, #0F172A 0%, #0B1120 100%);
}
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-hint { margin-top: 18px; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-500); }

/* ---- Responsive ------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 12, 20, .5); z-index: 35; display: none; }
.overlay.open { display: block; }

@container isi (max-width: 1060px) {
    .split { grid-template-columns: minmax(0, 1fr); }
}

/* Cadangan untuk peramban lama yang belum mendukung container query */
@supports not (container-type: inline-size) {
    @media (max-width: 1200px) {
        .split { grid-template-columns: minmax(0, 1fr); }
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .26s cubic-bezier(.2,.8,.3,1);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .hamburger { display: inline-flex; }
    .content { padding: 16px; }
    .topbar { padding: 11px 16px; }
    .form-grid { gap: 13px; }
    .col-6, .col-4, .col-3, .col-8 { grid-column: span 12; }
}

@media (max-width: 640px) {
    h1, .topbar h1 { font-size: 16px; }
    .stat-value { font-size: 20px; }
    .card-body { padding: 14px; }
    .card-head { padding: 13px 14px; }
    .toolbar .field { min-width: 0; flex: 1 1 100%; }

    /* Tabel jadi kartu bertumpuk */
    table.stack thead { display: none; }
    table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
    table.stack tr {
        border: 1px solid var(--line); border-radius: var(--radius-sm);
        margin-bottom: 10px; padding: 6px 2px; background: #fff;
    }
    table.stack td { border: none; padding: 7px 13px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
    table.stack td::before {
        content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
        color: var(--ink-500); font-weight: 650; flex: 0 0 auto;
    }
    table.stack td.cell-main { display: block; padding-top: 11px; }
    table.stack td.cell-main::before { display: none; }
    table.stack td.cell-actions { justify-content: flex-end; padding-bottom: 11px; }
    table.stack td.cell-actions::before { display: none; }
    table.stack tfoot { display: none; }
}

/* ---- Print ------------------------------------------------ */
@media print {
    .sidebar, .topbar, .no-print, .btn, .pagination { display: none !important; }
    body { background: #fff; }
    .content { padding: 0; max-width: none; }
    .card { border: 1px solid #DDD; box-shadow: none; break-inside: avoid; }
}

/* ---- Pemilih event di sidebar ------------------------------ */
.event-switch { padding: 14px 16px 4px; }
.event-switch .es-label {
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: #64728A; font-weight: 600; margin-bottom: 7px;
}
.event-switch select {
    width: 100%; padding: 9px 30px 9px 11px; font-family: inherit; font-size: 13px; font-weight: 550;
    color: #fff; background-color: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
.event-switch select:focus { outline: none; border-color: var(--brand); }
.event-switch select option { color: #0F172A; background: #fff; }
.event-meta { font-size: 11.5px; color: #7F8CA3; margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.event-meta svg { width: 13px; height: 13px; }

/* ---- Halaman detail --------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crumb { font-size: 12.5px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.crumb a:hover { color: var(--brand); }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.meta-item .mi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); font-weight: 650; }
.meta-item .mi-value { font-size: 14px; color: var(--ink-900); font-weight: 600; margin-top: 3px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-500); }
.kv .v { font-weight: 650; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.kv.total { border-top: 1px solid var(--line-strong); border-bottom: none; margin-top: 4px; padding-top: 12px; }
.kv.total .v { font-size: 16px; }

/* ---- Banner event ------------------------------------------ */
.event-card { overflow: hidden; }
.event-banner {
    position: relative; height: 132px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); overflow: hidden;
}
.event-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-banner .placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: flex-start; justify-content: flex-end;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--brand) 0%, #F2A03A 55%, #EF8354 100%);
    /* Inisial dipasang sebagai watermark di pojok supaya tidak menabrak
       nama event yang tertulis di bagian bawah banner. */
    color: rgba(255, 255, 255, .38); font-size: 42px; font-weight: 800; letter-spacing: .02em;
    line-height: 1;
}
.event-banner .badge-float {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .18);
}
.event-banner::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 52px;
    background: linear-gradient(to top, rgba(8, 12, 20, .38), transparent);
    pointer-events: none;
}
.event-banner .caption {
    position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 2; color: #fff;
}
.event-banner .caption h2 { color: #fff; font-size: 17px; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.event-banner .caption .sub { font-size: 11.5px; opacity: .92; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }

.banner-preview {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--line); height: 150px; background: var(--surface-2);
}
.banner-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sampul tipis di atas dashboard */
.dash-cover {
    position: relative; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); height: 122px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.dash-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8, 12, 20, .62), rgba(8, 12, 20, .12));
}
.dash-cover .inner { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 22px; z-index: 2; }
.dash-cover h2 { color: #fff; font-size: 20px; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.dash-cover .sub { color: rgba(255, 255, 255, .9); font-size: 12.5px; margin-top: 3px; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }

@media (max-width: 640px) {
    .event-banner { height: 112px; }
    .dash-cover { height: 104px; }
    .dash-cover h2 { font-size: 16px; }
}

/* ---- Layar pilih event (tanpa sidebar) ---------------------- */
.picker-body { background: var(--bg); min-height: 100vh; }
.picker-inner { max-width: 1180px; margin: 0 auto; width: 100%; }
.picker-top {
    background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line); padding: 13px 24px; position: sticky; top: 0; z-index: 20;
}
.picker-brand-name { font-weight: 700; font-size: 15px; color: var(--ink-900); letter-spacing: -.01em; }
.picker-brand-sub { font-size: 11px; color: var(--ink-500); letter-spacing: .06em; text-transform: uppercase; }
.picker-user {
    display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px;
    border: 1px solid var(--line-strong); border-radius: 99px; background: #fff;
    font-size: 13px; font-weight: 600; color: var(--ink-700); transition: all .15s ease;
}
.picker-user:hover { border-color: var(--brand); color: var(--brand-dark); }
.picker-user .avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 99px; font-size: 12px; }

.picker-main { padding: 34px 24px 60px; }
.picker-head { margin-bottom: 22px; }
.picker-head h1 { font-size: 26px; letter-spacing: -.02em; }
.picker-head p { color: var(--ink-500); font-size: 14px; margin-top: 6px; }

@media (max-width: 640px) {
    .picker-top { padding: 11px 16px; }
    .picker-main { padding: 22px 16px 40px; }
    .picker-head h1 { font-size: 20px; }
    .picker-head p { font-size: 13px; }
    .picker-user span:not(.avatar) { display: none; }
    .picker-user { padding: 5px; }
}

/* ===========================================================
   Sidebar bisa dilipat (desktop) + transisi halus
   =========================================================== */
:root { --sidebar-w-collapsed: 76px; }

.sidebar {
    transition: width .28s cubic-bezier(.2, .8, .3, 1),
                flex-basis .28s cubic-bezier(.2, .8, .3, 1),
                transform .26s cubic-bezier(.2, .8, .3, 1);
    will-change: width;
}

/* Tombol lipat di pojok atas sidebar */
.sidebar-collapse {
    position: absolute; top: 26px; right: -11px; z-index: 45;
    width: 22px; height: 22px; border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: #1B2436; color: #C0C9D8;
    display: grid; place-items: center; cursor: pointer; padding: 0;
    box-shadow: 0 2px 8px rgba(8, 12, 20, .5);
    transition: background .15s ease, color .15s ease, transform .28s cubic-bezier(.2,.8,.3,1);
}
.sidebar-collapse:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.sidebar-collapse svg { width: 13px; height: 13px; }

html.sidebar-collapsed .sidebar {
    width: var(--sidebar-w-collapsed);
    flex: 0 0 var(--sidebar-w-collapsed);
}
html.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }

/* Yang disembunyikan saat terlipat */
html.sidebar-collapsed .sidebar .brand > div:not(.brand-mark),
html.sidebar-collapsed .sidebar .nav-label,
html.sidebar-collapsed .sidebar .nav-item span,
html.sidebar-collapsed .sidebar .event-switch,
html.sidebar-collapsed .sidebar .user-link > .grow {
    opacity: 0; visibility: hidden; width: 0; height: 0;
    margin: 0; padding: 0; overflow: hidden; pointer-events: none;
}

/* Saat terlipat, avatar dan tombol keluar ditumpuk supaya keduanya
   tetap bisa diklik. */
html.sidebar-collapsed .sidebar .user-chip {
    flex-direction: column; gap: 10px; justify-content: center;
}
html.sidebar-collapsed .sidebar .nav-item {
    justify-content: center; padding: 11px 0; gap: 0;
}
html.sidebar-collapsed .sidebar .brand { justify-content: center; padding: 20px 0 18px; gap: 0; }
html.sidebar-collapsed .sidebar .nav { padding: 14px 10px; }
html.sidebar-collapsed .sidebar .sidebar-foot { padding: 14px 0; }
html.sidebar-collapsed .sidebar .user-chip { justify-content: center; }
html.sidebar-collapsed .sidebar .user-link { padding: 0; margin: 0; justify-content: center; }

/* Isi sidebar ikut memudar supaya perpindahannya tidak mengejut */
.sidebar .nav-label,
.sidebar .nav-item span,
.sidebar .event-switch {
    transition: opacity .18s ease;
}

/* Tombol lipat hanya relevan di layar lebar */
@media (max-width: 900px) {
    .sidebar-collapse { display: none; }
    html.sidebar-collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
}

/* Mematikan transisi sesaat saat halaman dimuat */
html.no-anim .sidebar,
html.no-anim .sidebar * { transition: none !important; }
