/* =====================================================================
   Sistem E-Voting BPD Desa — desain ulang: nuansa "dokumen resmi" formal,
   dipadukan dengan tata muka digital modern untuk kios TPS & panel admin.
   Palet marun (identitas pemilihan) + navy (kewibawaan) + emas (aksen
   tanda-tangan/segel), di atas warna kertas hangat — merujuk langsung ke
   jejak audit kertas (VVPAT) yang menjadi inti sistem ini.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --maroon-900: #4c1119;
    --maroon-800: #611821;
    --maroon-700: #7c202a;
    --maroon-600: #942836;
    --maroon-100: #f8e8e6;
    --navy-900: #101d30;
    --navy-800: #17293f;
    --navy-700: #21374f;
    --navy-100: #e7ecf3;
    --gold-600: #a97f16;
    --gold-500: #c69a2e;
    --gold-300: #e3c168;
    --gold-100: #f7edd2;
    --paper: #f4f6f8;
    --paper-dim: #ebf0f4;
    --surface: #ffffff;
    --ink: #1a1e23;
    --ink-soft: #5b6571;
    --ink-faint: #8a96a3;
    --border: #dbe0e5;
    --border-strong: #c2c9d1;
    --success: #0d8246;
    --success-bg: #e6f6ed;
    --success-border: #b1e0c6;
    --danger: #c92a2a;
    --danger-bg: #fcedec;
    --danger-border: #f0c3c3;
    --warning: #b7791f;
    --warning-bg: #fdf6e3;
    --warning-border: #f3e0b5;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    animation: fadeInPage 0.4s ease-out forwards;
}
@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
a { color: var(--navy-700); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--ink); }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
code { font-family: 'SFMono-Regular', Consolas, Menlo, monospace; background: var(--paper-dim); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 40px 70px; flex: 1 0 auto; }
.muted { color: var(--ink-soft); }
.icon { flex-shrink: 0; display: inline-block; vertical-align: -4px; }

:focus-visible { outline: 2.5px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------- App Layout & Sidebar ---------------------------- */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--maroon-800), var(--maroon-900));
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    height: 100%;
    z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15.5px; color: #fff; padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.sidebar-brand-mark {
    width: 42px; height: 42px; flex-shrink: 0;
    object-fit: contain;
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.sidebar-brand-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-text small { font-weight: 500; font-size: 11px; opacity: .72; }

.sidebar-links { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; flex: 1; overflow-y: auto; }
.sidebar-links a { color: rgba(255,255,255,.82); padding: 12px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 12px; transition: background .15s, color .15s; }
.sidebar-links a .icon { opacity: .8; }
.sidebar-links a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-links a.active { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-links a.active .icon { opacity: 1; color: var(--gold-300); }

.sidebar-footer { padding: 16px 20px 0; border-top: 1px solid rgba(255,255,255,.1); margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-user { display: flex; flex-direction: column; line-height: 1.3; }
.sidebar-user-name { font-weight: 700; font-size: 14px; color: #fff; }
.sidebar-user-role { color: var(--gold-300); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.btn-logout { background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; gap: 8px; justify-content: center; padding: 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; transition: background .15s; text-decoration: none; border: none; cursor: pointer; }
.btn-logout:hover { background: var(--danger); color: #fff; }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; background: var(--paper); height: 100%; }
.sidebar-toggle { display: none; }

@media (max-width: 880px) {
    .app-wrapper { flex-direction: column; height: auto; overflow: visible; }
    .sidebar { width: 100%; height: auto; padding: 16px; position: static; }
    .sidebar-brand { border-bottom: none; padding: 0; margin-bottom: 0; }
    .sidebar-links { display: none; padding: 16px 0 0; }
    .sidebar-links.open { display: flex; }
    .sidebar-footer { display: none; }
    .sidebar-footer.open { display: flex; }
    .sidebar-toggle { display: inline-flex; margin-left: auto; background: rgba(255,255,255,.1); border: none; color: #fff; padding: 8px; border-radius: 8px; cursor: pointer; }
    .main-content { height: auto; overflow-y: visible; }
    .container { padding: 20px 20px 60px; }
}

/* ---------------------------- Action Buttons (Tables) & Modals ---------------------------- */
.btn-action { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.btn-action.btn-blue { background: #e0f2fe; color: #0369a1; box-shadow: inset 0 -2px 0 rgba(2, 132, 199, 0.2); }
.btn-action.btn-blue:hover { background: #bae6fd; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2), inset 0 -2px 0 rgba(2, 132, 199, 0.2); }
.btn-action.btn-yellow { background: #fef9c3; color: #a16207; box-shadow: inset 0 -2px 0 rgba(161, 98, 7, 0.2); }
.btn-action.btn-yellow:hover { background: #fef08a; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(161, 98, 7, 0.2), inset 0 -2px 0 rgba(161, 98, 7, 0.2); }
.btn-action.btn-red { background: #fee2e2; color: #b91c1c; box-shadow: inset 0 -2px 0 rgba(185, 28, 28, 0.2); }
.btn-action.btn-red:hover { background: #fecaca; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(185, 28, 28, 0.2), inset 0 -2px 0 rgba(185, 28, 28, 0.2); }

@keyframes modalPop {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------------------------- Buttons ---------------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--paper); }
.auth-side {
    background:
        radial-gradient(circle at 18% 15%, rgba(198,154,46,.28), transparent 45%),
        linear-gradient(155deg, var(--maroon-900), var(--navy-900) 78%);
    color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 52px 48px;
}
.auth-side-mark { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.auth-side h1 { color: #fff; font-size: 30px; max-width: 380px; margin-top: 26px; }
.auth-side p { color: rgba(255,255,255,.72); max-width: 380px; }
.auth-feature-list { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-list li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.88); font-size: 14px; }
.auth-feature-list .icon { color: var(--gold-300); margin-top: 1px; }
.auth-side-foot { color: rgba(255,255,255,.5); font-size: 12.5px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px 38px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 22px; }
.auth-card form { text-align: left; margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.auth-card label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-top: 12px; }
.auth-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--maroon-700); background: var(--maroon-100); padding: 5px 11px; border-radius: 20px; margin-bottom: 14px; }

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-side { 
        display: flex; 
        padding: 40px 24px 70px; 
        align-items: center; 
        text-align: center; 
    }
    .auth-side h1 { font-size: 22px; max-width: 100%; margin-top: 16px; }
    .auth-side p { max-width: 100%; font-size: 14px; }
    .auth-feature-list { display: none; }
    .auth-side-foot { display: none; }
    .auth-main { 
        padding: 0 20px 40px; 
        align-items: flex-start; 
        margin-top: -50px; 
    }
    .auth-card { box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
}

/* ---------------------------- Forms & buttons ---------------------------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    width: 100%;
    font-family: var(--font);
    background: var(--surface);
    color: var(--ink);
    transition: all .2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
input[type=file] {
    padding: 9px 12px;
    background: var(--paper-dim);
    border: 1px dashed rgba(0,0,0,0.15);
    cursor: pointer;
}
input[type=file]::file-selector-button {
    background: var(--navy-800);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    margin-right: 12px;
    transition: background 0.2s;
}
input[type=file]::file-selector-button:hover {
    background: var(--navy-900);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--maroon-600);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(124, 32, 42, 0.12), inset 0 1px 2px rgba(0,0,0,0.02);
    outline: none;
}

.btn {
    background: linear-gradient(180deg, var(--maroon-600), var(--maroon-800));
    color: #fff;
    border: 1px solid var(--maroon-900);
    border-bottom: 3px solid #521219;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all .1s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.btn:hover { 
    background: linear-gradient(180deg, var(--maroon-600), var(--maroon-700)); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3); 
    transform: translateY(-1px); 
}
.btn:active { 
    transform: translateY(2px); 
    border-bottom-width: 1px; 
    margin-bottom: 2px; 
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.3); 
}
.btn:disabled { opacity: .55; cursor: not-allowed; border-bottom-width: 1px; transform: translateY(2px); margin-bottom: 2px; }
.btn-block { width: 100%; margin-top: 14px; }

.btn-secondary { background: linear-gradient(180deg, var(--navy-700), var(--navy-800)); border-color: var(--navy-900); border-bottom-color: #0b1424; }
.btn-secondary:hover { background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); }

.btn-success { background: linear-gradient(180deg, #2bb147, #1d7b32); border-color: #155c25; border-bottom-color: #0b3614; }
.btn-success:hover { background: linear-gradient(180deg, #2fc24f, #186629); }

.btn-danger { background: linear-gradient(180deg, #df3737, #b32121); border-color: #8c1919; border-bottom-color: #590f0f; }
.btn-danger:hover { background: linear-gradient(180deg, #e84545, #a31c1c); }

.btn-ghost { background: transparent; color: var(--maroon-700); box-shadow: none; border: 1.5px solid var(--border-strong); border-bottom-width: 3px; text-shadow: none; }
.btn-ghost:hover { background: var(--maroon-100); }

.btn-gold { background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--maroon-900); border-color: #c48f0a; border-bottom-color: #8a6404; text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-300), var(--gold-600)); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-big { font-size: 20px; padding: 22px 30px; margin: 8px; border-radius: 14px; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.btn-link-danger {
    background: linear-gradient(180deg, #ffffff, #fdf2f2);
    border: 1px solid #facaca;
    border-bottom: 3px solid #eba4a4;
    color: var(--danger);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.1s;
    box-shadow: 0 4px 8px rgba(201, 42, 42, 0.12), inset 0 1px 0 #fff;
    text-shadow: 0 1px 0 #fff;
}
.btn-link-danger:hover {
    background: linear-gradient(180deg, #fdf2f2, #fae6e6);
    box-shadow: 0 6px 12px rgba(201, 42, 42, 0.2), inset 0 1px 0 #fff;
    transform: translateY(-1px);
}
.btn-link-danger:active {
    background: #fae6e6;
    transform: translateY(2px);
    border-bottom-width: 1px;
    margin-bottom: 2px; /* prevent layout jump */
    box-shadow: inset 0 3px 5px rgba(201, 42, 42, 0.15);
}

.alert { padding: 12px 15px; border-radius: 10px; margin: 12px 0; display: flex; align-items: center; gap: 10px; font-size: 14px; border: 1.5px solid transparent; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }

/* ---------------------------- Stats & dashboard ---------------------------- */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; justify-content: space-between; }
.page-head-title { display: flex; align-items: center; gap: 14px; }
.page-head-title h1, .page-head-title h2 { margin: 0; font-size: 26px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.5px; }
.page-head-title .icon-badge { width: 48px; height: 48px; border-radius: 14px; background: rgba(136, 19, 55, 0.08); color: var(--maroon-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin: 22px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--maroon-600)); }
.stat-card.accent-gold { --accent: var(--gold-500); }
.stat-card.accent-navy { --accent: var(--navy-700); }
.stat-card.accent-success { --accent: var(--success); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-label { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.stat-card .icon { color: var(--accent, var(--maroon-600)); opacity: .8; }
.progress-bar { background: var(--border); border-radius: 20px; height: 12px; overflow: hidden; max-width: 650px; }
.progress-fill { background: linear-gradient(90deg, var(--maroon-600), var(--gold-500)); height: 100%; transition: width .5s; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-top: 18px; }
.menu-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; text-align: left; font-weight: 700; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: 12px; }
.menu-card .icon-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--maroon-100); color: var(--maroon-700); display: flex; align-items: center; justify-content: center; }
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.menu-card span.desc { font-weight: 500; font-size: 12.5px; color: var(--ink-soft); }

/* ---------------------------- Cards / tables ---------------------------- */
.card { background: var(--surface); border: 1px solid rgba(0,0,0,0.05); border-radius: var(--radius-lg); padding: 26px; margin: 18px 0; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s; transform: translateZ(0); }
.card:hover { transform: translateY(-4px) scale(1.005) translateZ(0); box-shadow: 0 20px 40px -12px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,1); }
.danger-zone { border-color: var(--danger-border); background: linear-gradient(180deg, #fff, var(--danger-bg) 320%); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.08); }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-size: 13px; vertical-align: middle; }
.table th:last-child, .table td:last-child { border-right: none; }
.table th { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); font-weight: 600; color: #ffffff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; text-align: center; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.1); }
.table tr:nth-child(even) td { background: #fafbfc; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--paper-dim); }
.row-winner td { background: var(--success-bg); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: var(--paper-dim); color: var(--ink-soft); }

.tabs { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; border-bottom: 1.5px solid var(--border); padding-bottom: 0; }
.tab { padding: 10px 18px; border-radius: 10px 10px 0 0; background: transparent; border: none; color: var(--ink-soft); font-weight: 600; font-size: 14px; margin-bottom: -1.5px; border-bottom: 2.5px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--maroon-700); border-bottom-color: var(--maroon-700); }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 150px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.stack-form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy-900); margin-bottom: 6px; margin-top: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; justify-content: space-between; }

.footer { flex-shrink: 0; text-align: center; color: var(--ink-faint); font-size: 12.5px; padding: 34px 0 10px; }

/* ---------------------------- Scan box (Registrasi / Pleno) ---------------------------- */
.scan-box { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 30px; text-align: center; max-width: 540px; margin: 20px 0; box-shadow: var(--shadow-sm); }
.scan-box-icon { width: 50px; height: 50px; border-radius: 50%; background: var(--maroon-100); color: var(--maroon-700); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.scan-box label { display: block; margin-bottom: 10px; font-weight: 700; }
.scan-box input { font-size: 19px; text-align: center; padding: 15px; border-width: 2px; }
.scan-box .scan-modes { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.scan-box .scan-modes-or { color: var(--ink-faint); font-size: 12.5px; }
.scan-source-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-faint); font-size: 12px; margin-top: 12px; }

.result-panel { max-width: 540px; border-radius: var(--radius); padding: 22px; margin-top: 16px; border: 1.5px solid; }
.result-panel h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.result-panel.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.result-panel.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.result-panel.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.result-panel p { color: var(--ink); }

.flash-msg { max-width: 760px; border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; font-size: 17px; font-weight: 700; min-height: 22px; display: flex; align-items: center; gap: 10px; border: 1.5px solid transparent; }
.flash-msg.success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.flash-msg.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.flash-msg.alarm { background: var(--danger); color: #fff; animation: pulse-alarm 0.7s infinite alternate; }
@keyframes pulse-alarm { from { box-shadow: 0 0 0 0 rgba(178,51,39,.5); } to { box-shadow: 0 0 0 10px rgba(178,51,39,0); } }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); display: inline-block; animation: live-blink 1.4s infinite; }
@keyframes live-blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.tally-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.tally-section h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tally-row { display: grid; grid-template-columns: 1fr 3fr 46px; align-items: center; gap: 12px; margin: 12px 0; }
.tally-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--paper-dim); color: var(--ink-soft); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-right: 6px; }
.tally-row.is-leading .tally-rank { background: var(--gold-100); color: var(--gold-600); }
.tally-label { font-size: 14px; font-weight: 600; display: flex; align-items: center; }
.tally-bar-bg { background: var(--paper-dim); border-radius: 10px; overflow: hidden; height: 22px; }

/* ---------------------------- Global UI Overlay & Toasts ---------------------------- */
#global-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(4px);
    z-index: 99999; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#global-loader.active { opacity: 1; pointer-events: all; }

.loader-logo-wrapper {
    position: relative;
    width: 80px; height: 80px;
    margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center;
}
.loader-logo {
    width: 45px; height: 45px;
    object-fit: contain;
    animation: logoPulse 1.5s ease-in-out infinite alternate;
}
@keyframes logoPulse {
    from { transform: scale(0.9); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}

#global-loader .loader-spinner-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 4px solid var(--maroon-100);
    border-top-color: var(--maroon-700);
    border-bottom-color: var(--maroon-700);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
@keyframes spin { to { transform: rotate(360deg); } }
#global-loader .loader-text { font-weight: 800; color: var(--navy-900); font-size: 14px; letter-spacing: 0.15em; }

#toast-container {
    position: fixed; top: 25px; right: 25px; z-index: 99998;
    display: flex; flex-direction: column; gap: 12px; pointer-events: none;
}
.toast {
    background: var(--surface); border-left: 5px solid var(--navy-600);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15); border-radius: 8px;
    padding: 18px 24px; min-width: 300px; display: flex; align-items: center; gap: 14px;
    transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600; color: var(--ink); pointer-events: all; border-right: 1px solid var(--border);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.toast.show { transform: translateX(0); }
.tally-bar-fill { background: linear-gradient(90deg, var(--navy-700), var(--navy-900)); height: 100%; transition: width .5s; }
.tally-row.is-leading .tally-bar-fill { background: linear-gradient(90deg, var(--gold-500), var(--gold-600)); }
.tally-count { text-align: right; font-weight: 800; font-size: 15px; }

/* ---------------------------- Bilik Suara (Premium Kios Mode) ---------------------------- */
body.bilik-page {
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
    color: #f8fafc;
    min-height: 100vh;
    overscroll-behavior-y: none; /* MEMATIKAN PULL-TO-REFRESH DI HP/TABLET */
}
.bilik-page .app-wrapper, .bilik-page .main-content {
    background: transparent !important;
}
.bilik-page main.container { 
    max-width: 900px; 
    padding-top: 60px;
}

/* Animations */
@keyframes bilik-stage-in { 
    from { opacity: 0; transform: translateY(20px) scale(0.98); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(234, 179, 8, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

/* Typography Overrides for Dark Mode */
.bilik-page h1 { font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.bilik-page h2 { font-size: 28px; color: #fff; }
.bilik-page p.muted { color: #cbd5e1; font-size: 15px; }

/* Stage Management */
.bilik-stage { display: none; text-align: center; padding-top: 20px; }
.bilik-stage.active { display: block; animation: bilik-stage-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* Steps Indicator */
.bilik-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 40px; }
.bilik-steps .step { 
    width: 36px; height: 36px; border-radius: 50%; 
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); 
    font-weight: 800; font-size: 14px; 
    display: flex; align-items: center; justify-content: center; 
    transition: all 0.3s;
    border: 2px solid transparent;
}
.bilik-steps .step.done { 
    background: #10b981; color: #fff; 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.bilik-steps .step.now { 
    background: transparent; color: #fbbf24; 
    border-color: #fbbf24;
    animation: pulse-glow 2s infinite;
}
.bilik-steps .line { width: 40px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; transition: 0.3s; }
.bilik-steps .step.done + .line { background: #10b981; }

/* Standby Stage (Scanner) */
#stage-standby .scan-box-icon { width: 80px; height: 80px; background: rgba(255,255,255,0.1); color: #fff; }
#stage-standby input { 
    font-size: 24px; padding: 22px; text-align: center; max-width: 520px; 
    margin: 22px auto 8px; display: block; 
    background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.2); 
    color: #fff; border-radius: 16px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}
#stage-standby input:focus { border-color: #fbbf24; background: rgba(255,255,255,0.1); }
#stage-standby input::placeholder { color: rgba(255,255,255,0.3); }

#bilikScannerReader {
    border: 4px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Confirm Box */
.confirm-box { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 24px; padding: 40px; max-width: 640px; margin: 30px auto; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}
.confirm-box p { font-size: 18px; color: #e2e8f0; margin-bottom: 12px; }
.confirm-box b { color: #fbbf24; font-size: 22px; display: inline-block; margin-left: 8px; }

/* Kandidat Grid */
.kandidat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 24px; max-width: 900px; margin: 30px auto; }
.kandidat-card { 
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%); 
    border: 2px solid rgba(255,255,255,0.1); 
    border-radius: 20px; padding: 40px 20px; 
    cursor: pointer; font-size: 20px; 
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}
.kandidat-card:hover { 
    border-color: #fbbf24; 
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%); 
    box-shadow: 0 20px 40px rgba(251, 191, 36, 0.2); 
    transform: translateY(-8px) scale(1.02);
}
.kandidat-card:active { transform: scale(0.96); }
.kandidat-nomor { 
    font-size: 64px; font-weight: 900; 
    background: linear-gradient(180deg, #fbbf24, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 10px rgba(217, 119, 6, 0.3));
}
.kandidat-nama { font-weight: 800; font-size: 24px; color: #fff; letter-spacing: 0.5px; }

/* ---------------------------- Camera scan modal ---------------------------- */
.scan-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; }
.scan-modal.is-open { display: flex; }
.scan-modal-backdrop { position: absolute; inset: 0; background: rgba(16,12,10,.6); backdrop-filter: blur(2px); }
.scan-modal-panel { position: relative; background: var(--surface); border-radius: var(--radius-lg); width: 92%; max-width: 440px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.scan-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.scan-modal-head h3 { margin: 0; font-size: 16px; }
.scan-modal-close { background: var(--paper-dim); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.scan-modal-body { padding: 18px 20px 22px; }
.scan-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.scan-toolbar select { flex: 1; }
.scan-reader-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #0c0c0c; aspect-ratio: 4/3; }
.scan-reader-frame #scanReaderEl, .scan-reader-frame #scanReaderEl video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-reader-frame #scanReaderEl > div { border: none !important; }
.scan-reticle { position: absolute; inset: 14%; pointer-events: none; }
.scan-reticle span { position: absolute; width: 22px; height: 22px; border: 3px solid var(--gold-400, #e3c168); }
.scan-reticle span:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; }
.scan-reticle span:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; }
.scan-reticle span:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; }
.scan-reticle span:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; }
.scan-hint { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }
.scan-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--ink-faint); font-size: 12px; }
.scan-divider::before, .scan-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.scan-upload-btn { display: block; cursor: pointer; }
.scan-status { text-align: center; font-size: 13px; margin-top: 12px; min-height: 16px; }
.scan-status.success { color: var(--success); font-weight: 600; }
.scan-status.error { color: var(--danger); font-weight: 600; }
body.scan-modal-lock { overflow: hidden; }

/* ---------------------------- Printable receipt (thermal 80mm) ---------------------------- */
#strukPrint { display: none; }
.struk { width: 72mm; font-family: 'Courier New', monospace; font-size: 12px; }
.struk-center { text-align: center; margin: 2px 0; }
.struk hr { border: none; border-top: 1px dashed #000; }

@media print {
    .navbar, .footer, .no-print { display: none !important; }
}
body.bilik-page { }
@media print {
    body.bilik-page * { visibility: hidden; }
    body.bilik-page #strukPrint, body.bilik-page #strukPrint * { visibility: visible; }
    body.bilik-page #strukPrint { display: block; position: absolute; top: 0; left: 0; width: 80mm; }
}

.invitation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 920px; margin: 0 auto; }
.card-undangan { border: 1.5px solid var(--border-strong); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--surface); position: relative; }
.card-undangan::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--gold-300); border-radius: calc(var(--radius) - 4px); pointer-events: none; }
.undangan-header { font-size: 11px; letter-spacing: 1.5px; color: var(--maroon-700); font-weight: 700; }
.undangan-footer { font-size: 10.5px; color: var(--ink-faint); margin-top: 10px; }
@media print {
    .card-undangan::before { border-color: #999; }
    .invitation-grid { grid-template-columns: repeat(2, 1fr); }
    .card-undangan { break-inside: avoid; }
}

.kiosk-mode {
    padding-top: 30px;
    background: var(--paper);
}
.kiosk-mode .sidebar { display: none !important; }
.kiosk-mode .app-wrapper { display: block; }
.bilik-page .app-wrapper { display: block; }
.bilik-page .sidebar { display: none !important; }

@media (max-width: 640px) {
    .container { padding: 20px 14px 60px; }
    h1 { font-size: 21px; }
    .tally-row { grid-template-columns: 1fr; text-align: left; }
    .tally-count { text-align: left; }
    .invitation-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 30px 24px; }
    .kpu-stat-grid { grid-template-columns: 1fr; }
    .kpu-banner { padding: 24px 20px; }
    .kpu-banner h1 { font-size: 22px; }
}

/* ---------------------------- KPU Style Dashboard Redesign ---------------------------- */
.kpu-banner {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    color: #fff;
    padding: 34px 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(23, 41, 63, 0.5), inset 0 2px 0 rgba(255,255,255,0.15);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--gold-500);
    transform: translateZ(0);
}
.kpu-banner::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(198,154,46,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.kpu-banner-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}
.kpu-banner-icon {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    color: var(--gold-300);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpu-banner h1 {
    font-size: 28px;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpu-banner p.subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14.5px;
    margin: 4px 0 16px 0;
    letter-spacing: 0.5px;
}
.kpu-banner-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
}
.kpu-banner-user span.role {
    color: var(--gold-300);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    margin-left: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.kpu-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kpu-stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.7);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
.kpu-stat-card:hover {
    transform: translateY(-4px) scale(1.02) translateZ(0);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15), 0 5px 8px -3px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,1);
    z-index: 10;
}
.kpu-stat-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpu-stat-header.blue { background: var(--navy-800); color: #fff; }
.kpu-stat-header.gold { background: var(--gold-600); color: #fff; }
.kpu-stat-header.green { background: var(--success); color: #fff; }
.kpu-stat-header.maroon { background: var(--maroon-700); color: #fff; }
.kpu-stat-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.kpu-stat-body .stat-num {
    font-size: 42px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 4px;
}
.kpu-stat-body .stat-label {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}

.kpu-section-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy-900);
    margin-top: 36px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.kpu-section-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--maroon-700);
    border-radius: 4px;
}

.kpu-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.kpu-menu-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, border-color 0.25s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}
.kpu-menu-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--border-strong);
    transition: background 0.2s;
}
.kpu-menu-card:hover {
    transform: translateY(-5px) scale(1.015) translateZ(0);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.12), 0 5px 8px -3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,1);
    border-color: var(--border-strong);
    z-index: 10;
}
.kpu-menu-card:hover::before {
    background: var(--maroon-600);
}
.kpu-menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--paper-dim);
    color: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.kpu-menu-card:hover .kpu-menu-icon {
    background: var(--maroon-100);
    color: var(--maroon-700);
}
.kpu-menu-content {
    display: flex;
    flex-direction: column;
}
.kpu-menu-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--navy-900);
}
.kpu-menu-desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.4;
}

/* ---------------------------- Modern Soft UI Update ---------------------------- */
.modern-banner {
    background: linear-gradient(120deg, #162233 0%, #1a2a40 50%, #21131c 100%);
    padding: 20px 28px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
    margin-bottom: 24px;
}
.modern-banner .banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.modern-banner .banner-icon-ring {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}
.modern-banner .kpu-banner-icon {
    background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
    color: #fff;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(198, 154, 46, 0.4);
}
.modern-banner h1 {
    font-size: 20px;
    letter-spacing: 0;
    text-transform: none;
}
.modern-banner p.subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.8;
}
.modern-banner .kpu-banner-user {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 14px 6px 6px;
    border-radius: 40px;
    backdrop-filter: blur(10px);
}
.modern-banner .user-avatar {
    background: var(--surface);
    color: var(--navy-900);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modern-banner .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.modern-banner .user-info .name {
    font-size: 13px;
    font-weight: 700;
}
.modern-banner .user-info .role {
    font-size: 10px;
    color: var(--gold-300);
    border-left: none;
    padding-left: 0;
    margin-left: 0;
}

.modern-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.modern-stat-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 8px 24px -8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    transform: translateZ(0);
}
.modern-stat-card:hover {
    transform: translateY(-4px) scale(1.02) translateZ(0);
    box-shadow: 0 16px 32px -8px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.04);
}
.stat-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-badge.maroon { background: var(--maroon-100); color: var(--maroon-700); }
.stat-icon-badge.blue { background: var(--navy-100); color: var(--navy-800); }
.stat-icon-badge.gold { background: var(--warning-bg); color: var(--warning); }
.stat-icon-badge.green { background: var(--success-bg); color: var(--success); }

.stat-content {
    flex: 1;
    min-width: 0;
}
.modern-stat-card .stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 4px;
}
.stat-num-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.modern-stat-card .stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}
.modern-stat-card .stat-unit {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-faint);
}
.progress-bar.mini-bar {
    height: 6px;
    margin-top: 8px;
    max-width: 100%;
}
@media (max-width: 768px) {
    .modern-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
