:root {
    --bg: #f1f5f4;
    --bg-card: #ffffff;
    --bg-sidebar: #04231b;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(16,185,129,0.18);
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #94a8a0;
    --text-sidebar-active: #34d399;
    --border: #e2e8f0;
    --border-light: #eef2f1;
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --primary-soft: #ecfdf5;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 1px 3px rgba(15,23,42,0.05), 0 1px 2px rgba(15,23,42,0.03);
    --shadow-md: 0 6px 18px rgba(15,23,42,0.06);
    --shadow-lg: 0 18px 48px rgba(15,23,42,0.10);
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --bottomnav-height: 68px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
svg { max-width: 100%; max-height: 100%; }

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ================================================================
 * APP LAYOUT
 * ================================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* SIDEBAR (Desktop) */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #e6eee9;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform .25s ease;
}
.sidebar-brand {
    padding: 22px 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.brand-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
    overflow: hidden;
}
.brand-icon svg { width: 22px; height: 22px; }
.brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; color: #f8faf9; letter-spacing: -0.3px; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--text-sidebar); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-menu { list-style: none; padding: 12px 10px 24px; overflow-y: auto; flex: 1; }
.nav-menu::-webkit-scrollbar { width: 6px; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.nav-section-label {
    padding: 14px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
.nav-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-sidebar-hover); color: #e6eee9; }
.nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--primary);
}
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: var(--text-sidebar);
}
.sidebar-footer .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}
.sidebar-footer .uname { color: #f8faf9; font-weight: 600; font-size: 13px; }
.sidebar-footer .urole { font-size: 11px; text-transform: capitalize; }
.sidebar-footer .logout-btn {
    margin-left: auto;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    color: var(--text-sidebar);
    background: rgba(255,255,255,0.04);
    transition: all .15s ease;
}
.sidebar-footer .logout-btn:hover { background: var(--danger); color: #fff; }
.sidebar-footer .logout-btn svg { width: 16px; height: 16px; }

/* MAIN */
.main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }

/* TOPBAR */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(1.1) blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 26px;
    z-index: 30;
}
.topbar h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.topbar-spacer { flex: 1; }
.topbar .chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--primary-light);
    display: inline-flex; align-items: center; gap: 6px;
}
.topbar .chip svg { width: 14px; height: 14px; }
.menu-btn {
    display: none;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    place-items: center;
}
.menu-btn svg { width: 20px; height: 20px; }

/* CONTENT */
.content { padding: 24px 26px 40px; }
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.6px; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin-top: 2px; }
.page-header-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ================================================================
 * MOBILE NAV (bottom + top)
 * ================================================================ */
.mobile-drawer { display: none; }
.mobile-bottom-nav { display: none; }

/* ================================================================
 * CARDS / GRID
 * ================================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.2px; }
.card-sub { font-size: 12.5px; color: var(--text-secondary); }
.card-body { padding: 18px 20px; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-2-7-3 { grid-template-columns: 2fr 1fr; }
.grid-2-6-4 { grid-template-columns: 1fr 2fr; }

/* ACCOUNT LIST ROW (dipakai di dashboard & tempat lain) */
.acc-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; transition: background .15s ease; }
.acc-row:hover { background: #f8fafc; }
.acc-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.acc-ic svg { width: 18px; height: 18px; }
.acc-ic-kas     { background: var(--primary-soft); color: var(--primary); }
.acc-ic-bank    { background: var(--info-light);   color: var(--info); }
.acc-ic-lainnya { background: #f1f5f9;             color: var(--text-secondary); }
.acc-info { flex: 1; min-width: 0; overflow: hidden; }
.acc-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-meta { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.acc-amount { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; flex-shrink: 0; }

/* STAT CARDS */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .ic {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.stat-card .ic svg { width: 22px; height: 22px; }
.stat-card .label { font-size: 12px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.2px; text-transform: uppercase; }
.stat-card .value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; margin-top: 3px; }
.stat-card .delta { font-size: 11.5px; font-weight: 600; margin-top: 6px; display: inline-flex; gap: 4px; align-items: center; }

.stat-primary .ic { background: var(--primary-soft); color: var(--primary); }
.stat-success .ic { background: var(--success-light); color: var(--success); }
.stat-warning .ic { background: var(--warning-light); color: var(--warning); }
.stat-danger  .ic { background: var(--danger-light); color: var(--danger); }
.stat-info    .ic { background: var(--info-light); color: var(--info); }
.stat-accent  .ic { background: var(--accent-light); color: var(--accent); }

/* Hero gradient stat */
.hero-card {
    background: linear-gradient(135deg, #065f46 0%, #059669 45%, #10b981 100%);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(5,150,105,0.35);
}
.hero-card::before, .hero-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}
.hero-card::before { width: 240px; height: 240px; right: -60px; top: -80px; }
.hero-card::after { width: 160px; height: 160px; right: 30%; bottom: -80px; }
.hero-card .hc-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; font-weight: 600; }
.hero-card .hc-value { font-size: 2rem; font-weight: 800; letter-spacing: -1px; margin-top: 6px; }
.hero-card .hc-sub { font-size: 13px; opacity: .85; margin-top: 4px; }
.hero-card .hc-right { position: absolute; right: 22px; top: 22px; display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,0.18); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }

/* ================================================================
 * BUTTONS
 * ================================================================ */
.btn {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 9px 16px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #b91c1c; }
.btn-info    { background: var(--info); color: #fff; border-color: var(--info); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f1f5f9; border-color: var(--border); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ================================================================
 * FORMS
 * ================================================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-row-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(5,150,105,0.12);
}
.form-textarea { resize: vertical; min-height: 88px; font-family: inherit; }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}
.input-with-prefix { display: flex; align-items: stretch; }
.input-with-prefix .prefix {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 600;
    color: var(--text-secondary);
}
.input-with-prefix .form-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ================================================================
 * TABLES
 * ================================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    background: #fff;
    min-width: 640px;
}
.table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky; top: 0;
}
.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tbody tr:hover { background: #f8fafc; }
.table .num, .table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table .text-center { text-align: center; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn { padding: 5px 8px; font-size: 11.5px; }
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.empty-state svg { width: 56px; height: 56px; color: var(--text-muted); margin-bottom: 12px; }
.empty-state h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ================================================================
 * BADGES
 * ================================================================ */
.badge {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-success { background: var(--success-light); color: #14532d; }
.badge-danger  { background: var(--danger-light);  color: #7f1d1d; }
.badge-warning { background: var(--warning-light); color: #78350f; }
.badge-info    { background: var(--info-light);    color: #0c4a6e; }
.badge-neutral { background: #f1f5f9; color: var(--text-secondary); }

.amount-in  { color: var(--success); font-weight: 700; }
.amount-out { color: var(--danger);  font-weight: 700; }

/* ================================================================
 * FLASH / ALERT
 * ================================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
}
.alert svg { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }
.alert-success { background: var(--success-light); border-color: var(--success); color: #14532d; }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: #7f1d1d; }
.alert-error   { background: var(--danger-light);  border-color: var(--danger);  color: #7f1d1d; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #78350f; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #0c4a6e; }
.alert .close { margin-left: auto; opacity: .6; cursor: pointer; }

/* ================================================================
 * FILTER BAR
 * ================================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}
.filter-bar .form-input, .filter-bar .form-select { padding: 8px 10px; font-size: 13px; min-width: 130px; }

/* ================================================================
 * LOGIN
 * ================================================================ */
.login-page { background: #04231b; min-height: 100vh; }
.login-scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1100px 600px at 10% -10%, rgba(16,185,129,0.25), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(5,150,105,0.35), transparent 55%),
        linear-gradient(180deg, #04231b 0%, #032017 100%);
    position: relative;
    overflow: hidden;
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; pointer-events: none; }
.login-orb-1 { width: 420px; height: 420px; background: #10b981; top: -10%; left: -6%; }
.login-orb-2 { width: 360px; height: 360px; background: #f59e0b; bottom: -12%; right: -6%; }
.login-card {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    overflow: hidden;
    backdrop-filter: blur(22px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    position: relative;
    z-index: 2;
}
.login-left {
    padding: 44px 38px;
    color: #f8faf9;
    background: linear-gradient(145deg, rgba(16,185,129,0.12), rgba(245,158,11,0.05));
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; justify-content: center;
}
.login-logo {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 12px 32px rgba(16,185,129,0.5);
    margin-bottom: 20px;
    overflow: hidden;
}
.login-logo svg { width: 30px; height: 30px; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.6px; line-height: 1.2; }
.login-subtitle { font-size: 13.5px; color: #c4e3d7; margin-top: 10px; line-height: 1.55; max-width: 360px; }
.login-features { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.login-feature { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #d7ebe1; }
.login-feature svg { width: 18px; height: 18px; color: #34d399; flex-shrink: 0; }

.login-right {
    padding: 44px 38px;
    background: rgba(255,255,255,0.98);
    display: flex; flex-direction: column; justify-content: center;
}
.login-right h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.3px; }
.login-right .sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; margin-bottom: 22px; }

/* ================================================================
 * REPORT / PRINT AREA
 * ================================================================ */
.report-paper {
    background: #fff;
    margin: 24px auto;
    max-width: 900px;
    padding: 40px 48px 48px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    color: #1f2937;
}
.rp-header {
    display: flex; gap: 20px; align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 3px double #0f766e;
    margin-bottom: 18px;
}
.rp-logo { width: 78px; height: 78px; flex-shrink: 0; }
.rp-logo img { width: 100%; height: 100%; object-fit: contain; }
.rp-org { flex: 1; text-align: center; line-height: 1.35; }
.rp-org h1 { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin: 0; }
.rp-org h2 { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; margin: 4px 0 0; }
.rp-org p  { font-size: 12px; color: #4b5563; margin-top: 4px; }
.rp-title {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 14px 0 4px;
    text-decoration: underline;
}
.rp-period { text-align: center; font-size: 12.5px; color: #4b5563; margin-bottom: 16px; }

.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-bottom: 18px;
}
.rp-table th, .rp-table td {
    border: 1px solid #94a3b8;
    padding: 8px 10px;
    vertical-align: top;
}
.rp-table thead th {
    background: #f1f5f9;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11.5px;
}
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-table tfoot td { background: #f8fafc; font-weight: 700; }
.rp-table tr.tot td { background: #fef3c7; font-weight: 700; }

.rp-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
    padding-top: 8px;
}
.rp-sign-col { text-align: center; }
.rp-sign-col .t1 { font-size: 12.5px; }
.rp-sign-col .t2 { font-size: 12.5px; margin-top: 4px; }
.rp-sign-area {
    position: relative;
    height: 100px;
    margin: 10px 0;
    display: grid; place-items: center;
}
.rp-sign-area img.ttd { max-height: 90px; max-width: 180px; }
.rp-sign-area img.stempel {
    position: absolute;
    max-height: 110px;
    max-width: 130px;
    opacity: .82;
    mix-blend-mode: multiply;
    left: 50%;
    top: 50%;
    transform: translate(-40%, -40%);
}
.rp-sign-col .name { font-weight: 700; text-decoration: underline; font-size: 13px; }
.rp-sign-col .sub { font-size: 12px; color: #4b5563; }

.rp-footer-note {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px dashed #94a3b8;
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

.print-toolbar {
    max-width: 900px;
    margin: 18px auto 0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 8px;
}

/* ================================================================
 * MODAL
 * ================================================================ */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(2,6,23,0.55);
    backdrop-filter: blur(4px);
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.modal-card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.modal-card p  { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: center; }

/* ================================================================
 * UTIL
 * ================================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }

/* Mobile preview pill (on login) */
.dev-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed var(--border);
    text-align: center;
}

/* ================================================================
 * RESPONSIVE — MOBILE UI
 * ================================================================ */
@media (max-width: 960px) {
    :root { --sidebar-width: 0px; }

    .sidebar {
        transform: translateX(-100%);
        width: 276px;
        box-shadow: 8px 0 30px rgba(0,0,0,0.3);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgba(2,6,23,0.6);
        backdrop-filter: blur(3px);
        z-index: 39;
        display: none;
    }
    .sidebar-backdrop.open { display: block; }

    .main { margin-left: 0; padding-bottom: calc(var(--bottomnav-height) + 20px); }

    .menu-btn { display: grid; }
    .topbar { padding: 0 16px; }
    .topbar h1 { font-size: 1rem; }
    .topbar .chip { display: none; }

    .content { padding: 16px 14px 24px; }
    .page-header { margin-bottom: 14px; gap: 10px; }
    .page-title { font-size: 1.2rem; }
    .page-subtitle { font-size: 12.5px; }
    .page-header-actions { width: 100%; margin-left: 0; }
    .page-header-actions .btn { flex: 1; justify-content: center; }

    .grid { gap: 12px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .grid-2, .grid-2-7-3, .grid-2-6-4 { grid-template-columns: 1fr !important; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }

    .stat-card { padding: 13px 14px; gap: 10px; }
    .stat-card .value { font-size: 1.05rem; }
    .stat-card .label { font-size: 10.5px; letter-spacing: .3px; line-height: 1.35; }
    .stat-card .delta { font-size: 11px; margin-top: 4px; }
    .stat-card .ic { width: 36px; height: 36px; border-radius: 10px; }
    .stat-card .ic svg { width: 18px; height: 18px; }

    .hero-card { padding: 16px 18px; border-radius: 16px; }
    .hero-card::before { width: 160px; height: 160px; right: -40px; top: -60px; }
    .hero-card::after  { width: 110px; height: 110px; right: 20%;  bottom: -60px; }
    .hero-card .hc-label { font-size: 10.5px; letter-spacing: .7px; }
    .hero-card .hc-value { font-size: 1.55rem; margin-top: 4px; }
    .hero-card .hc-sub   { font-size: 11.5px; margin-top: 4px; }
    .hero-card .hc-right {
        position: static;
        display: inline-flex;
        margin-bottom: 10px;
        background: rgba(255,255,255,0.22);
        font-size: 10.5px;
        padding: 4px 10px;
    }
    .hero-card .hc-right svg { width: 12px; height: 12px; }

    /* Card head stacks rapi di mobile */
    .card-head { flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px; }
    .card-head .card-title { font-size: 0.98rem; }
    .card-head .card-sub { font-size: 11.5px; }
    .card-head-actions { margin-left: 0; width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }

    /* MOBILE BOTTOM NAV */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 10px; right: 10px; bottom: 10px;
        height: var(--bottomnav-height);
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(14px);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 6px;
        box-shadow: 0 20px 48px rgba(2,6,23,0.18);
        z-index: 35;
        justify-content: space-around;
    }
    .mb-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-secondary);
        font-size: 10.5px;
        font-weight: 600;
        border-radius: 14px;
        padding: 4px 0;
        transition: all .15s ease;
    }
    .mb-nav-item svg { width: 20px; height: 20px; }
    .mb-nav-item.active { color: var(--primary); background: var(--primary-soft); }
    .mb-nav-center {
        position: relative;
        margin-top: -24px;
        width: 54px; height: 54px;
        border-radius: 50%;
        background: var(--primary-gradient);
        color: #fff !important;
        box-shadow: 0 12px 28px rgba(16,185,129,0.5);
        flex: 0 0 54px;
    }
    .mb-nav-center svg { width: 24px; height: 24px; }
    .mb-nav-center span { display: none; }

    /* Topbar on login */
    .login-card { grid-template-columns: 1fr; max-width: 440px; }
    .login-left { padding: 28px 24px; text-align: center; align-items: center; }
    .login-features { align-items: flex-start; text-align: left; }
    .login-right { padding: 28px 24px; }

    .card-head { padding: 14px 16px; }
    .card-body { padding: 14px 16px; }
    .table { font-size: 12.5px; }
    .table thead th { padding: 9px 10px; font-size: 10.5px; }
    .table tbody td { padding: 10px; }

    .filter-bar { padding: 12px; gap: 8px; }
    .filter-bar .form-input, .filter-bar .form-select { flex: 1 1 140px; min-width: 0; }

    /* Transaksi sebagai kartu di mobile */
    .tx-card-list { display: flex; flex-direction: column; gap: 10px; }
    .tx-card {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 12px 14px;
        display: flex; gap: 12px;
        align-items: flex-start;
    }
    .tx-card .ic {
        width: 38px; height: 38px;
        border-radius: 10px;
        display: grid; place-items: center;
        flex-shrink: 0;
    }
    .tx-card.in  .ic { background: var(--success-light); color: var(--success); }
    .tx-card.out .ic { background: var(--danger-light);  color: var(--danger); }
    .tx-card .ic svg { width: 18px; height: 18px; }
    .tx-card .body { flex: 1; min-width: 0; }
    .tx-card .t1 { font-weight: 700; font-size: 13.5px; letter-spacing: -0.1px; }
    .tx-card .t2 { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
    .tx-card .amount { font-weight: 800; font-size: 14px; white-space: nowrap; }
    .tx-card.in  .amount { color: var(--success); }
    .tx-card.out .amount { color: var(--danger); }
    .tx-card .actions { display: flex; gap: 4px; margin-top: 6px; }

    .report-paper { padding: 22px 18px; margin: 12px 6px; font-size: 12px; }
    .rp-header { flex-direction: column; align-items: center; text-align: center; }
    .rp-logo { width: 64px; height: 64px; }
    .rp-signatures { grid-template-columns: 1fr; gap: 24px; }
    .print-toolbar { flex-wrap: wrap; padding: 0 10px; }
}

/* Hide desktop-only on small */
@media (max-width: 960px) {
    .desktop-only { display: none !important; }
}
@media (min-width: 961px) {
    .mobile-only { display: none !important; }
}

/* EXTRA SMALL — single column */
@media (max-width: 480px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 10px; }
    .hero-card .hc-value { font-size: 1.45rem; }
    .page-header-actions { flex-direction: column; }
    .page-header-actions .btn { width: 100%; }
}

/* ================================================================
 * PRINT
 * ================================================================ */
@media print {
    @page { size: A4; margin: 14mm 12mm; }
    html, body { background: #fff !important; }
    .sidebar, .topbar, .mobile-bottom-nav, .sidebar-backdrop,
    .print-toolbar, .no-print, .page-header, .page-header-actions,
    .filter-bar, .btn {
        display: none !important;
    }
    .main { margin-left: 0 !important; padding: 0 !important; }
    .content { padding: 0 !important; }
    .report-paper {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        max-width: none !important;
        font-size: 11.5pt;
    }
    .rp-header { border-bottom-color: #000 !important; }
    .rp-table th, .rp-table td { border-color: #000 !important; }
    .rp-table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rp-table tr.tot td { background: #fef3c7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    tr, td, th { page-break-inside: avoid; }

    /* Tanda tangan WAJIB dua kolom berdampingan di kertas A4,
       apapun lebar viewport saat browser mencetak */
    .rp-signatures {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
        margin-top: 28px !important;
        page-break-inside: avoid;
    }
    .rp-sign-col { text-align: center !important; }
    .rp-sign-area { height: 100px !important; }
    .rp-sign-area img.ttd { max-height: 90px !important; max-width: 180px !important; }
    .rp-sign-area img.stempel {
        max-height: 110px !important;
        max-width: 130px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
