/* =========================================================
   SIPASTI - AURORA GLASS SKIN
   Full version with scroll fix + 15 columns support
   ========================================================= */

/* ================= TEMA WARNA ================= */
:root {
    --bg-dark: #050914;
    --bg-panel: rgba(10, 20, 45, 0.75);
    --bg-panel-solid: #0d1730;
    --neon-blue: #38bdf8;
    --neon-blue-glow: rgba(56, 189, 248, 0.5);
    --neon-red: #ff4d6d;
    --neon-red-glow: rgba(255, 77, 109, 0.5);
    --neon-green: #34e5a0;
    --neon-green-glow: rgba(52, 229, 160, 0.5);
    --neon-purple: #a78bfa;
    --neon-orange: #ff9f43;
    --neon-gold: #ffd166;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --border-color: rgba(56, 189, 248, 0.25);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Poppins', sans-serif;
    /* ---- Warna teks adaptif (otomatis mengikuti skin & mode terang/gelap) ----
       Ganti warna HURUF memakai var(--txt-*) agar selalu terbaca:
       di mode gelap = warna neon terang; di mode terang = versi gelapnya.
       Jangan pakai token ini untuk border/background (biarkan var(--neon-*)). */
    --txt-blue: var(--neon-blue);     /* aksen utama (ikut skin yang dipilih) */
    --txt-red: var(--neon-red);
    --txt-green: var(--neon-green);
    --txt-purple: var(--neon-purple);
    --txt-orange: var(--neon-orange);
    --txt-gold: var(--neon-gold);
    --on-accent: #071426;             /* huruf di atas tombol/permukaan gradien neon */
    --on-soft: #ffffff;               /* huruf di atas permukaan tint transparan */
}

body[data-theme="blue"]   { --neon-blue: #38bdf8; --neon-blue-glow: rgba(56,189,248,.5);  --neon-purple: #a78bfa; --border-color: rgba(56,189,248,.25); }
body[data-theme="red"]    { --neon-blue: #ff4d6d; --neon-blue-glow: rgba(255,77,109,.5);  --neon-purple: #ff85a1; --border-color: rgba(255,77,109,.3); }
body[data-theme="green"]  { --neon-blue: #34e5a0; --neon-blue-glow: rgba(52,229,160,.5);  --neon-purple: #19c37d; --border-color: rgba(52,229,160,.3); }
body[data-theme="purple"] { --neon-blue: #a78bfa; --neon-blue-glow: rgba(167,139,250,.5); --neon-purple: #d8b4fe; --border-color: rgba(167,139,250,.3); }
body[data-theme="gold"]   { --neon-blue: #ffd166; --neon-blue-glow: rgba(255,209,102,.5); --neon-purple: #ff9f43; --border-color: rgba(255,209,102,.3); }
body[data-theme="mono"]   { --neon-blue: #8b9bb4; --neon-blue-glow: rgba(139,155,180,.5); --neon-purple: #5a6b82; --border-color: rgba(139,155,180,.3); }

body.light-mode {
    --bg-dark: #e8eef7;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --bg-panel-solid: #ffffff;
    --text-main: #0a1a2f;
    --text-muted: #5a6b82;
    /* Versi gelap dari warna aksen agar huruf tetap terbaca di atas panel terang */
    --txt-blue: #0369a1;
    --txt-red: #be123c;
    --txt-green: #047857;
    --txt-purple: #6d28d9;
    --txt-orange: #c2410c;
    --txt-gold: #a16207;
    --on-soft: #0a1a2f;
}
/* Aksen utama (--txt-blue) mengikuti skin yang dipilih walau dalam mode terang */
body.light-mode[data-theme="red"]    { --txt-blue: #be123c; }
body.light-mode[data-theme="green"]  { --txt-blue: #047857; }
body.light-mode[data-theme="purple"] { --txt-blue: #6d28d9; }
body.light-mode[data-theme="gold"]   { --txt-blue: #a16207; }
body.light-mode[data-theme="mono"]   { --txt-blue: #475569; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-body); }

/* ================= BODY ================= */
body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(167, 139, 250, 0.12) 0%, transparent 45%),
        linear-gradient(180deg, #050914 0%, #0a1428 50%, #050914 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: 15px;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}
body.light-mode {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(167, 139, 250, 0.18) 0%, transparent 45%),
        linear-gradient(180deg, #e8eef7 0%, #d4e0f0 100%);
}

/* Lapisan ambient bergerak halus di belakang konten.
   Murah GPU: hanya animasi transform (compositor), tanpa JS/gambar ekstra. */
body::after {
    content: '';
    position: fixed;
    inset: -10%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 80% 75%, rgba(167, 139, 250, 0.10) 0%, transparent 40%);
    animation: ambientFloat 26s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes ambientFloat {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
    body::after { animation: none; }
}

/* =========================================================
   LOGIN PAGE (SPLIT SCREEN)
   ========================================================= */
body:has(.login-overlay) {
    padding: 0;
    overflow: hidden;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
    animation: gridMove 30s linear infinite;
}
@keyframes gridMove {
    from { transform: translate(0, 0); }
    to   { transform: translate(50px, 50px); }
}

.login-split {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ---- SISI KIRI ---- */
.login-left {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 40%, rgba(56, 189, 248, 0.25) 0%, transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(167, 139, 250, 0.2) 0%, transparent 55%),
        linear-gradient(135deg, rgba(5, 9, 20, 0.75) 0%, rgba(10, 20, 40, 0.7) 50%, rgba(13, 31, 61, 0.75) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: 1px solid rgba(56, 189, 248, 0.3);
}
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

.login-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    max-width: 500px;
    animation: slideInLeft 1s ease-out;
}
@keyframes slideInLeft {
    from { transform: translateX(-80px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.hero-shield {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-shield i {
    font-size: 90px;
    color: var(--txt-gold);
    text-shadow: 0 0 20px var(--neon-gold), 0 0 40px var(--neon-orange), 0 0 60px var(--neon-gold);
    animation: pulseGlow 2s infinite;
    position: relative;
    z-index: 2;
}
.hero-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 209, 102, 0.4);
    animation: rotateRing 12s linear infinite;
}
.hero-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--neon-gold);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--neon-gold);
    transform: translateX(-50%);
}
.hero-ring-2 {
    inset: -20px;
    border-style: dashed;
    border-color: rgba(56, 189, 248, 0.3);
    animation: rotateRing 18s linear infinite reverse;
}
.hero-ring-2::before {
    background: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
}
@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes pulseGlow {
    0%,100% { text-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-orange); }
    50%     { text-shadow: 0 0 20px var(--neon-gold), 0 0 35px var(--neon-orange); }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 36px;
    letter-spacing: 5px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, var(--neon-blue), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shineText 3s linear infinite;
}
@keyframes shineText {
    to { background-position: 200% center; }
}
.hero-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 30px;
    letter-spacing: 2px;
}
.hero-features {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-main);
    transition: all 0.3s ease;
}
.feature-item:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}
.feature-item i { color: var(--txt-blue); font-size: 11px; }

.hero-quote {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.8;
    padding: 15px 20px;
    border-left: 3px solid var(--neon-blue);
    background: rgba(56, 189, 248, 0.05);
    border-radius: 0 8px 8px 0;
    text-align: left;
    white-space: nowrap;
}
.login-left-glow {
    position: absolute;
    bottom: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%,100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50%     { opacity: 1;   transform: translateX(-50%) scale(1.05); }
}

/* ---- SISI KANAN ---- */
.login-right {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(10, 20, 40, 0.75) 0%, rgba(5, 9, 20, 0.85) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.login-right::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    border-radius: 50%;
    animation: floatBlob 10s ease-in-out infinite;
}
.login-right::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.12), transparent 70%);
    border-radius: 50%;
    animation: floatBlob 12s ease-in-out infinite reverse;
}
@keyframes floatBlob {
    0%,100% { transform: translate(0, 0) scale(1); }
    50%     { transform: translate(20px, -20px) scale(1.05); }
}

.login-form-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    animation: slideInRight 1s ease-out;
}
@keyframes slideInRight {
    from { transform: translateX(80px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.login-form-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-form-header i {
    font-size: 42px;
    color: var(--txt-blue);
    text-shadow: 0 0 20px var(--neon-blue-glow);
    margin-bottom: 12px;
    display: block;
    animation: pulseIcon 2.5s infinite;
}
@keyframes pulseIcon {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.08); }
}
.login-form-header h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    letter-spacing: 4px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #fff, var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-form-header p {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ================= LOGIN INPUT GROUP ================= */
.login-form form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-form .input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 8px 0 16px;
    margin-bottom: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
    position: relative;
    overflow: hidden;
}
.login-form .input-group::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--neon-blue);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.25s ease;
    box-shadow: 0 0 10px var(--neon-blue);
}
.login-form .input-group:focus-within::before { transform: scaleY(1); }
.login-form .input-group:focus-within {
    border-color: var(--neon-blue);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px var(--neon-blue), 0 0 20px var(--neon-blue-glow);
    transform: translateY(-1px);
}
.login-form .input-group > i {
    color: var(--txt-blue);
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.25s ease, filter 0.25s ease;
}
.login-form .input-group:focus-within > i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--neon-blue));
}
.login-form input {
    flex: 1;
    height: 100%;
    min-width: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    outline: none;
    color: var(--text-main);
    caret-color: var(--neon-blue);
    font-size: 14px;
    letter-spacing: 0.4px;
    padding: 0;
}
.login-form input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Hilangkan background putih/kuning bawaan browser (Chrome autofill) */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0 1000px #0a1428 inset !important;
    box-shadow: 0 0 0 1000px #0a1428 inset !important;
    background-color: transparent !important;
    background-image: none !important;
    caret-color: var(--text-main);
    transition: background-color 5000s ease-in-out 0s;
}
.login-form input:-moz-autofill {
    filter: none;
}

/* Light mode: input tetap terbaca di atas background terang */
body.light-mode .login-form .input-group {
    background: #ffffff;
    border-color: rgba(10, 26, 47, 0.12);
}
body.light-mode .login-form .input-group:focus-within {
    background: #ffffff;
    border-color: var(--neon-blue);
}
body.light-mode .login-form input:-webkit-autofill,
body.light-mode .login-form input:-webkit-autofill:hover,
body.light-mode .login-form input:-webkit-autofill:focus,
body.light-mode .login-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #0a1a2f !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    caret-color: #0a1a2f;
}

/* ================= BUTTON TOGGLE PASSWORD ================= */
.login-form .btn-toggle-password {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    margin-left: 0;
    border-radius: 8px;
    transition: color 0.25s ease, background 0.25s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.login-form .btn-toggle-password:hover {
    color: var(--txt-blue);
    background: rgba(56, 189, 248, 0.12);
}
.login-form .btn-toggle-password:active {
    transform: scale(0.92);
}
.login-form .btn-toggle-password:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 1px;
}
.login-form .btn-toggle-password i {
    pointer-events: none;
    color: inherit;
    font-size: 15px;
    width: auto;
}

/* ================= LOGIN ERROR ================= */
.login-error {
    display: none;
    color: var(--txt-red);
    font-size: 12px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 77, 109, 0.1);
    border: 1px solid rgba(255, 77, 109, 0.3);
    border-radius: 8px;
    align-items: center;
    gap: 8px;
}
.login-error.show {
    display: flex;
    animation: shake 0.5s;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-10px); }
    75%     { transform: translateX(10px); }
}

/* ================= LOGIN BUTTON ================= */
.btn-login {
    width: 100%;
    margin-top: 6px;
    padding: 15px;
    min-height: 52px;
    background: linear-gradient(90deg, #6366f1, var(--neon-blue));
    border: none;
    border-radius: 10px;
    color: var(--on-accent);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}
.btn-login:hover::before { left: 100%; }
.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.7);
    letter-spacing: 4px;
}
.btn-login:active { transform: translateY(-1px) scale(0.98); }

/* ================= LOGIN HINT & FOOTER ================= */
.login-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.login-hint i { color: var(--txt-blue); }

.login-footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.login-footer p {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ================= LAYOUT GRID (DASHBOARD) ================= */
.dashboard-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto 1fr;
    gap: 15px;
    max-width: 1700px;
    margin: 0 auto;
    min-height: calc(100vh - 30px);
    animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ================= HEADER ================= */
.header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background: linear-gradient(90deg, rgba(10,20,45,0.95) 0%, rgba(10,20,45,0.55) 100%);
    border-bottom: 2px solid var(--neon-blue);
    border-radius: 12px;
    box-shadow: 0 4px 25px var(--neon-blue-glow);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(12px);
    animation: slideDown 0.6s ease-out;
}
body.light-mode .header {
    background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 100%);
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.header-logo { display: flex; align-items: center; gap: 15px; }
.logo-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}
.hero-shield img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}
.header-logo .logo-icon {
    font-size: 34px;
    color: var(--txt-gold);
    text-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-orange);
    animation: pulseGlow 2s infinite;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-mode .header-title h1 {
    background: linear-gradient(90deg, #0a1a2f, var(--neon-blue));
    -webkit-background-clip: text;
    background-clip: text;
}
.header-title p {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.header-controls { display: flex; gap: 12px; align-items: center; }
.header-tagline {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
.header-tagline span { color: var(--txt-blue); margin: 0 4px; }

.control-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    padding: 6px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}
.control-box:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-glow);
    transform: translateY(-2px);
}
.control-box span.active { color: var(--txt-green); font-weight: 600; }
.control-box i { color: var(--txt-blue); }

/* ================= THEME PICKER ================= */
.theme-picker { position: relative; }
.theme-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--bg-panel-solid);
    border: 1px solid var(--neon-blue);
    border-radius: 10px;
    padding: 8px;
    min-width: 210px;
    box-shadow: 0 0 25px var(--neon-blue-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
}
.theme-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}
.theme-option:hover {
    background: rgba(56, 189, 248, 0.1);
    padding-left: 18px;
}
.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* ================= ADMIN BADGE ================= */
.admin-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    padding: 5px 15px 5px 5px;
    border-radius: 25px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
}
.admin-badge:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-glow);
}
.admin-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--on-accent);
}

/* ================= SIDEBAR ================= */
.sidebar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    position: relative;
    z-index: 5;
    animation: slideRight 0.6s ease-out;
    min-width: 0;
}
@keyframes slideRight {
    from { transform: translateX(-50px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.nav-menu { list-style: none; }
.nav-menu li {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    border-left: 3px solid transparent;
    position: relative;
}
.nav-menu li:hover,
.nav-menu li.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--neon-blue);
    color: var(--text-main);
    padding-left: 25px;
}
.nav-menu li.active i { color: var(--txt-blue); filter: drop-shadow(0 0 5px var(--neon-blue)); }
.nav-menu li i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    transition: 0.3s;
}
.nav-menu li:hover i {
    color: var(--txt-blue);
    transform: scale(1.2) rotate(-5deg);
}

/* ================= SIDEBAR: GRUP ANALISIS ================= */
.nav-menu li.nav-group {
    display: block;
    padding: 0;
    border-left: 0;
    background: none;
    cursor: default;
}
.nav-menu li.nav-group:hover,
.nav-menu li.nav-group.active {
    padding: 0;
    border-left: 0;
    background: none;
}
.nav-group > details { width: 100%; }

.nav-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    list-style: none;
    user-select: none;
}
.nav-parent::-webkit-details-marker { display: none; }
.nav-parent::marker { content: ""; }
.nav-parent:hover,
.nav-parent.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--neon-blue);
    color: var(--text-main);
    padding-left: 25px;
}
.nav-parent.active > i:first-child {
    color: var(--txt-blue);
    filter: drop-shadow(0 0 5px var(--neon-blue));
}
.nav-parent .nav-chevron {
    width: auto !important;
    margin-left: auto;
    font-size: 10px !important;
    transition: transform 0.3s ease;
}
.nav-group details[open] .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
    list-style: none;
    position: relative;
    margin: 2px 0 8px;
    padding: 0;
}
.nav-submenu::before {
    content: "";
    position: absolute;
    left: 31px;
    top: 2px;
    bottom: 6px;
    width: 1px;
    background: rgba(56, 189, 248, 0.18);
    pointer-events: none;
}
.nav-submenu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 42px;
    font-size: 12px;
    border-left: 3px solid transparent;
    position: relative;
}
.nav-submenu li:hover,
.nav-submenu li.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, transparent 100%);
    border-left-color: var(--neon-blue);
    color: var(--text-main);
}
.nav-submenu li.active i {
    color: var(--txt-blue);
    filter: drop-shadow(0 0 5px var(--neon-blue));
}
.nav-submenu li i {
    width: 16px;
    font-size: 12px;
    transition: 0.3s;
}
.nav-submenu li:hover i { transform: scale(1.15) rotate(-5deg); }

/* =========================================================
   MAIN CONTENT — FIX OVERFLOW UNTUK SCROLL TABEL
   ========================================================= */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 5;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
.page {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: pageIn 0.5s ease-out;
    min-width: 0;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================= STAT CARDS ================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: all 0.4s ease;
    cursor: pointer;
    animation: popIn 0.5s ease-out backwards;
    min-width: 0;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.5), 0 0 20px var(--neon-blue-glow);
    border-color: var(--neon-blue);
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
}
.stat-card.blue::after   { background: var(--neon-blue);   box-shadow: 0 0 15px var(--neon-blue); }
.stat-card.red::after    { background: var(--neon-red);    box-shadow: 0 0 15px var(--neon-red); }
.stat-card.green::after  { background: var(--neon-green);  box-shadow: 0 0 15px var(--neon-green); }
.stat-card.purple::after { background: var(--neon-purple); box-shadow: 0 0 15px var(--neon-purple); }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    background: rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.stat-card:hover .stat-icon { transform: scale(1.15) rotate(8deg); }
.blue   .stat-icon { color: var(--txt-blue);   border: 1px solid var(--neon-blue);   box-shadow: inset 0 0 10px var(--neon-blue-glow); }
.red    .stat-icon { color: var(--txt-red);    border: 1px solid var(--neon-red);    box-shadow: inset 0 0 10px var(--neon-red-glow); }
.green  .stat-icon { color: var(--txt-green);  border: 1px solid var(--neon-green);  box-shadow: inset 0 0 10px var(--neon-green-glow); }
.purple .stat-icon { color: var(--txt-purple); border: 1px solid var(--neon-purple); box-shadow: inset 0 0 10px rgba(167,139,250,0.4); }

.stat-info { min-width: 0; }
.stat-info h3 {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.stat-info h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin: 3px 0;
    color: var(--text-main);
}
.stat-info p { font-size: 10px; }
.text-up   { color: var(--txt-green); }
.text-down { color: var(--txt-red); }

/* ================= PANEL ================= */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 22px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.3s ease;
    overflow: visible;
    min-width: 0;
}
.panel:hover {
    box-shadow: 0 0 25px var(--neon-blue-glow);
    border-color: var(--neon-blue);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--txt-blue);
}
.panel-header h3 i { font-size: 16px; }

/* =========================================================
   FIX: TABLE SCROLL WRAPPER
   ========================================================= */
.table-scroll-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) rgba(0, 0, 0, 0.3);
}

.table-scroll-wrapper > table {
    min-width: 1600px;
    width: max-content;
    border-collapse: collapse;
}

.table-scroll-wrapper::-webkit-scrollbar {
    height: 12px;
}
.table-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}
.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border-radius: 6px;
    box-shadow: 0 0 8px var(--neon-blue-glow);
}
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* Kotak scroll dalam untuk tabel berbaris banyak (pola yg sama dipakai
   tabel Log Aktivitas, Riwayat Prediksi, Data Balita). Pasangan wajib:
   class "inner-scroll" + inline style overflow + max-height. Pil
   "Kembali ke Atas" otomatis muncul saat kotak ini discroll. */
.inner-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) rgba(0, 0, 0, 0.3);
}
.inner-scroll::-webkit-scrollbar { width: 10px; height: 12px; }
.inner-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 6px; }
.inner-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
    border-radius: 6px;
    box-shadow: 0 0 8px var(--neon-blue-glow);
}
.inner-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-panel-solid, #0d1730);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .12);
}

/* ================= TABLE ================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
th {
    text-align: left;
    padding: 10px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    white-space: nowrap;
}
td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-main);
    white-space: nowrap;
}
tbody tr { transition: all 0.3s ease; }
tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

/* ================= SCROLL HINT BADGE ================= */
.scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    animation: pulseHint 2s ease-in-out infinite;
}
@keyframes pulseHint {
    0%,100% { opacity: 0.7; }
    50%     { opacity: 1; }
}
.scroll-hint i {
    color: var(--txt-blue);
    animation: slideArrow 1.5s ease-in-out infinite;
}
@keyframes slideArrow {
    0%,100% { transform: translateX(0); }
    50%     { transform: translateX(6px); }
}

/* ================= STATUS BADGE ================= */
.status-badge {
    background: rgba(52, 229, 160, 0.15);
    color: var(--txt-green);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(52, 229, 160, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.status-badge.red {
    background: rgba(255, 77, 109, 0.15);
    color: var(--txt-red);
    border-color: rgba(255, 77, 109, 0.3);
}
.status-badge.orange {
    background: rgba(255, 159, 67, 0.15);
    color: var(--txt-orange);
    border-color: rgba(255, 159, 67, 0.3);
}

/* ================= BUTTONS ================= */
.btn-action {
    background: linear-gradient(90deg, #6366f1, var(--neon-blue));
    color: var(--on-accent);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-action:hover {
    box-shadow: 0 0 15px var(--neon-blue-glow);
    transform: translateY(-2px);
}

.btn-cancel, .btn-save {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.btn-cancel {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}
.btn-cancel:hover { background: rgba(255,255,255,0.2); }
.btn-save {
    background: linear-gradient(90deg, #6366f1, var(--neon-blue));
    color: var(--on-accent);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}
.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px var(--neon-blue-glow);
}

/* ================= INPUTS ================= */
.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    min-height: 50px;
    margin-bottom: 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    overflow: hidden;
}
.input-group::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--neon-blue);
    transform: scaleY(0);
    transition: transform 0.25s ease;
    box-shadow: 0 0 10px var(--neon-blue);
}
.input-group:focus-within::before { transform: scaleY(1); }
.input-group:focus-within {
    border-color: var(--neon-blue);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px var(--neon-blue), 0 0 20px var(--neon-blue-glow);
}
.input-group i {
    color: var(--txt-blue);
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.input-group:focus-within i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--neon-blue));
}
.input-group input {
    flex: 1;
    height: 50px;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    outline: none;
    color: var(--text-main);
    caret-color: var(--neon-blue);
    font-size: 14px;
    letter-spacing: 0.5px;
    min-width: 0;
    padding: 0;
}
.input-group input::placeholder { color: var(--text-muted); opacity: 1; }
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0 1000px #0a1428 inset !important;
    box-shadow: 0 0 0 1000px #0a1428 inset !important;
    caret-color: var(--text-main);
    transition: background-color 5000s ease-in-out 0s;
}
body.light-mode .input-group { background: #fff; }
body.light-mode .input-group input:-webkit-autofill,
body.light-mode .input-group input:-webkit-autofill:hover,
body.light-mode .input-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0a1a2f !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* ================= TOAST ================= */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--bg-panel-solid), rgba(56, 189, 248, 0.2));
    border: 1px solid var(--neon-blue);
    color: var(--text-main);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 0 25px var(--neon-blue-glow);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    transform: translateX(400px);
    transition: transform 0.5s ease;
    max-width: 400px;
}
.toast.show { transform: translateX(0); }
.toast i { color: var(--txt-green); font-size: 20px; }
.toast.toast-error {
    border-color: var(--neon-red);
    box-shadow: 0 0 25px rgba(255, 77, 109, 0.35);
}
.toast.toast-error i { color: var(--txt-red); }

/* ================= BACK TO TOP (pil emas "Kembali ke Atas") ================= */
.btn-top {
    position: fixed;
    left: 50%;
    bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--neon-gold);
    background: rgba(10, 20, 40, .88);
    backdrop-filter: blur(6px);
    color: var(--txt-gold);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    box-shadow: 0 0 18px rgba(255, 209, 102, .35);
}
.btn-top.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.btn-top.show i { animation: btnTopBob 1.6s ease-in-out infinite; }
@keyframes btnTopBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.btn-top:hover { transform: translateX(-50%) translateY(-4px); box-shadow: 0 0 26px rgba(255, 209, 102, .6); }
body.light-mode .btn-top { background: rgba(255, 255, 255, .92); }

/* ================= MODAL OVERLAY ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }

/* ================= LOGOUT MODAL ================= */
.logout-modal-box {
    background: linear-gradient(135deg, #0a1428 0%, #0d1f3d 100%);
    border: 2px solid var(--neon-blue);
    border-radius: 16px;
    padding: 35px 40px;
    width: 420px;
    max-width: 90vw;
    text-align: center;
    position: relative;
    box-shadow: 0 0 40px var(--neon-blue-glow), 0 0 80px var(--neon-blue-glow);
    animation: logoutPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
}
.logout-modal-box::-webkit-scrollbar { width: 8px; }
.logout-modal-box::-webkit-scrollbar-track { background: rgba(0,0,0,.2); border-radius: 4px; }
.logout-modal-box::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 4px;
    box-shadow: 0 0 8px var(--neon-blue-glow);
}
.logout-modal-box::-webkit-scrollbar-thumb:hover { background: var(--neon-purple); }

@keyframes logoutPop {
    from { transform: scale(0.5) translateY(50px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.logout-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 77, 109, 0.2), transparent 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.logout-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(255, 77, 109, 0.5);
    animation: rotateRing 10s linear infinite;
}
.logout-icon i {
    font-size: 45px;
    color: var(--txt-gold);
    text-shadow: 0 0 15px var(--neon-gold), 0 0 30px var(--neon-orange);
}
.logout-icon img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
.logout-title {
    font-family: var(--font-heading);
    font-size: 20px;
    letter-spacing: 4px;
    color: var(--txt-blue);
    text-shadow: 0 0 15px var(--neon-blue-glow);
    margin-bottom: 12px;
}
.logout-message {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 5px;
}
.logout-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}
.btn-logout-cancel, .btn-logout-confirm {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-logout-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}
.btn-logout-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}
.btn-logout-confirm {
    background: linear-gradient(90deg, #ff4d6d, #ff85a1);
    color: var(--on-accent);
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.5);
}
.btn-logout-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(255, 77, 109, 0.8);
}

/* ================= SELECT / COMBOBOX ================= */
/* Dropdown bawaan browser selalu terang -> paksa skema gelap agar ikon & scroll cocok tema */
select { color-scheme: dark; }
body.light-mode select { color-scheme: light; }

.input-group select {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    letter-spacing: 0.5px;
    min-width: 0;
    cursor: pointer;
    font-family: var(--font-body);
}
/* Isi daftar dropdown: samakan dengan panel tema aktif (berlaku di semua halaman) */
select option,
.input-group select option {
    background-color: var(--bg-panel-solid);
    color: var(--text-main);
}
body.light-mode select option,
body.light-mode .input-group select option {
    background-color: #ffffff;
    color: #0a1a2f;
}

/* ================= PILIHAN JUMLAH DATA PER HALAMAN ================= */
.per-page-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 11.5px;
    color: var(--text-muted);
}
.per-page-form label { cursor: pointer; }
.per-page-form .input-group {
    flex: 0 0 auto;
    width: 86px;
    min-width: 86px;
    margin: 0;
    padding: 0 8px;
    min-height: 32px;
    border-radius: 8px;
}
.per-page-form .input-group i { font-size: 11px; width: 14px; }
.per-page-form .input-group select {
    flex: 1 1 auto;
    width: 100%;
    font-size: 12px;
    font-weight: 600;
}
.per-page-form .btn-action {
    padding: 7px 11px !important;
    font-size: 11px !important;
    box-shadow: none;
}

/* ================= THEMED CONFIRM MODAL ================= */
/* Mengikuti tema aktif via var(--neon-blue) & light-mode, seperti modal logout */
.confirm-modal-box {
    text-align: left;
}
.confirm-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-blue-glow), transparent 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.confirm-modal-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed var(--neon-blue);
    opacity: .6;
    animation: rotateRing 10s linear infinite;
}
.confirm-modal-icon i {
    font-size: 28px;
    color: var(--txt-blue);
    text-shadow: 0 0 15px var(--neon-blue-glow);
}
.confirm-modal-box.danger .confirm-modal-icon {
    background: radial-gradient(circle, var(--neon-red-glow), transparent 70%);
}
.confirm-modal-box.danger .confirm-modal-icon::before { border-color: var(--neon-red); }
.confirm-modal-box.danger .confirm-modal-icon i {
    color: var(--txt-red);
    text-shadow: 0 0 15px var(--neon-red-glow);
}
.confirm-modal-title {
    font-family: var(--font-heading);
    font-size: 17px;
    letter-spacing: 3px;
    color: var(--txt-blue);
    text-shadow: 0 0 15px var(--neon-blue-glow);
    margin-bottom: 12px;
    text-align: center;
}
.confirm-modal-box.danger .confirm-modal-title {
    color: var(--txt-red);
    text-shadow: 0 0 15px var(--neon-red-glow);
}
.confirm-modal-message {
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--text-main);
    white-space: pre-line;
    text-align: center;
    margin-bottom: 5px;
}

/* ================= APP FOOTER (slim, full-width) ================= */
.app-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 18px;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.app-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}
.app-footer .footer-brand > i {
    color: var(--txt-blue);
    font-size: 13px;
}
.app-footer .footer-brand .footer-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.app-footer .footer-brand strong { color: var(--text-main); font-weight: 600; }
.app-footer .footer-links { display: flex; align-items: center; gap: 4px; }
.app-footer .footer-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.25s ease;
    cursor: pointer;
}
.app-footer .footer-links a i { color: var(--txt-blue); font-size: 12px; }
.app-footer .footer-links a:hover {
    color: var(--text-main);
    background: rgba(56, 189, 248, 0.1);
}
.app-footer .footer-links .footer-sep { opacity: 0.3; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 640px) {
    .app-footer { justify-content: center; text-align: center; }
}
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ================= CHART CONTAINER ================= */
.chart-container {
    height: 310px;
    position: relative;
    padding: 10px 0;
}
canvas { max-width: 100%; }

/* Grid 2 kolom untuk chart berdampingan (mis. pie + bar di Persiapan Data) */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: stretch;
}
@media (max-width: 1100px) {
    .chart-grid { grid-template-columns: 1fr; }
}

/* Pil ringkasan tingkat kebersihan data (badge di header panel) */
.qc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-container { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}
@media (max-width: 900px) {
    .login-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto;
    }
    .login-left {
        padding: 30px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    }
    .login-left-content { padding: 20px; }
    .hero-shield { width: 90px; height: 90px; margin-bottom: 15px; }
    .hero-shield i { font-size: 50px; }
    .hero-title { font-size: 22px; letter-spacing: 2px; }
    .hero-tagline { font-size: 11px; margin-bottom: 15px; }
    .hero-features { margin-bottom: 15px; }
    .hero-quote { font-size: 11px; padding: 10px 15px; white-space: normal; }
    .login-right { padding: 30px 20px; }
    .login-form-header h2 { font-size: 18px; }
}
@media (max-width: 768px) {
    .dashboard-container { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .header-controls { flex-wrap: wrap; gap: 8px; }
    .header-tagline { display: none; }
    .logout-modal-box { padding: 25px 20px; }
    .header-title h1 { font-size: 16px; }
    .header-title p { font-size: 9px; }
}
@media (max-width: 640px) {
    .logout-modal-box form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   ADAPTASI WARNA HURUF — MODE TERANG
   Menjaga semua teks tetap terbaca saat mode/skin berganti.
   ========================================================= */

/* Kotak tint gelap yang ditulis inline di halaman (mis. rgba(0,0,0,.25))
   diubah menjadi tint terang agar teks gelap tetap kontras. */
body.light-mode [style*="background:rgba(0,0,0,"],
body.light-mode [style*="background:rgba(0, 0, 0,"] {
    background-color: rgba(10, 26, 47, 0.05) !important;
}
/* Garis tepi putih transparan -> garis tipis gelap */
body.light-mode [style*="border:1px solid rgba(255,255,255,"],
body.light-mode [style*="border:1px solid rgba(255, 255, 255,"],
body.light-mode [style*="border:1px dashed rgba(255,255,255,"] {
    border-color: rgba(10, 26, 47, 0.14) !important;
}
body.light-mode .stat-icon { background: rgba(10, 26, 47, 0.06); }
body.light-mode .qc-badge { background: rgba(10, 26, 47, 0.04); }
body.light-mode .control-box,
body.light-mode .admin-badge { background: rgba(255, 255, 255, 0.72); }
/* Strip tab berlatar gelap transparan (gaya ditulis di masing-masing halaman) */
body.light-mode .uji-tabs,
body.light-mode .lap-tabs,
body.light-mode .peng-tabs { background: rgba(10, 26, 47, 0.05); border-color: rgba(10, 26, 47, 0.12); }
body.light-mode .uji-tabs button:hover,
body.light-mode .lap-tabs button:hover,
body.light-mode .lap-tabs a.lap-tab:hover,
body.light-mode .peng-tabs button:hover { background: rgba(10, 26, 47, 0.07); }
body.light-mode .btab { background: rgba(10, 26, 47, 0.03); border-color: rgba(10, 26, 47, 0.16); }
body.light-mode .btab:hover { border-color: rgba(10, 26, 47, 0.4); }
body.light-mode .logout-modal-box { background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%); }
/* Modal khusus di Laporan (bersihkan jalur) memakai gradien gelap inline —
   di mode terang kotaknya dipaksa putih agar huruf tidak hilang. */
body.light-mode #riwCleanupModal > div { background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%) !important; }
body.light-mode .btn-logout-cancel { background: rgba(10, 26, 47, 0.05); border-color: rgba(10, 26, 47, 0.18); }
body.light-mode .btn-logout-cancel:hover { background: rgba(10, 26, 47, 0.1); }

/* Halaman login/registrasi berlatar gelap permanen — kunci variabel ke versi
   gelap agar huruf tidak ikut berubah menjadi gelap bila mode terang aktif. */
body:has(.login-overlay) {
    --text-main: #ffffff;
    --text-muted: #9fb1c9;
    --txt-blue: var(--neon-blue);
    --txt-red: var(--neon-red);
    --txt-green: var(--neon-green);
    --txt-purple: var(--neon-purple);
    --txt-orange: var(--neon-orange);
    --txt-gold: var(--neon-gold);
    --on-soft: #ffffff;
}
body.light-mode:has(.login-overlay) {
    --bg-dark: #050914;
    --bg-panel: rgba(10, 20, 45, 0.75);
    --bg-panel-solid: #0d1730;
}
body.light-mode:has(.login-overlay) .login-form .input-group {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.12);
}

/* =========================================================
   MOBILE APP SHELL
   Header ringkas + drawer navigasi + bottom tab bar.
   Desktop tidak berubah: semua elemen khusus mobile
   disembunyikan di luar media query.
   ========================================================= */
.mobile-menu-btn,
.mobile-page-name,
.sidebar-mobile-head,
.sidebar-mobile-foot,
.sidebar-mobile-caption,
.mobile-nav-overlay,
.mobile-bottom-nav {
    display: none;
}

/* ================= DRAWER & TOMBOL MENU (<=1200px) ================= */
@media (max-width: 1200px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
        border: 1px solid var(--border-color);
        border-radius: 11px;
        background: rgba(0, 0, 0, .35);
        color: var(--txt-blue);
        font-size: 17px;
        line-height: 1;
        cursor: pointer;
        transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-menu-btn:hover {
        background: rgba(56, 189, 248, .14);
        box-shadow: 0 0 14px var(--neon-blue-glow);
    }
    .mobile-menu-btn:active { transform: scale(.93); }
    body.light-mode .mobile-menu-btn { background: #fff; }

    /* Sidebar menjadi panel geser (off-canvas) */
    .sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 86vw;
        width: min(86vw, 340px);
        max-width: 340px;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        align-self: auto;
        border-radius: 0 18px 18px 0;
        border-left: 0;
        background: linear-gradient(180deg, var(--bg-panel-solid) 0%, #081126 100%);
        box-shadow: 14px 0 45px rgba(0, 0, 0, .6);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 9970;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .3s cubic-bezier(.22, .61, .36, 1), visibility .3s;
        animation: none;
    }
    body.light-mode .sidebar {
        background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
    }
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }
    .sidebar::-webkit-scrollbar { width: 6px; }
    .sidebar::-webkit-scrollbar-track { background: transparent; }
    .sidebar::-webkit-scrollbar-thumb {
        background: var(--neon-blue);
        border-radius: 6px;
    }

    .sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 3;
        padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
        background: var(--bg-panel-solid);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
    body.light-mode .sidebar-mobile-head {
        background: #fff;
        border-bottom-color: rgba(10, 26, 47, .1);
    }
    .sidebar-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }
    .sidebar-mobile-brand img {
        width: 38px;
        height: 38px;
        object-fit: contain;
        flex-shrink: 0;
        filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
    }
    .sidebar-mobile-brand div { min-width: 0; }
    .sidebar-mobile-brand strong {
        display: block;
        font-family: var(--font-heading);
        font-size: 15px;
        letter-spacing: 1.5px;
        color: var(--text-main);
        line-height: 1.2;
        background: linear-gradient(90deg, var(--text-main), var(--neon-blue));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .sidebar-mobile-brand span {
        display: block;
        margin-top: 2px;
        color: var(--text-muted);
        font-size: 9.5px;
        letter-spacing: .5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .12);
        background: rgba(255, 255, 255, .06);
        color: var(--text-main);
        font-size: 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .sidebar-close-btn:active { transform: scale(.94); }
    body.light-mode .sidebar-close-btn {
        background: rgba(10, 26, 47, .05);
        border-color: rgba(10, 26, 47, .12);
    }

    .sidebar-mobile-caption {
        display: block;
        padding: 14px 22px 5px;
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1.8px;
        text-transform: uppercase;
    }

    /* Navigasi drawer: pil besar & nyaman disentuh */
    .sidebar .nav-menu { padding: 2px 8px 10px; }
    .sidebar .nav-menu > li:not(.nav-group),
    .sidebar .nav-parent {
        margin: 2px 0;
        padding: 12px 13px;
        border-left: 0;
        border-radius: 10px;
        font-size: 13.5px;
    }
    .sidebar .nav-menu > li:not(.nav-group):hover,
    .sidebar .nav-menu > li:not(.nav-group).active,
    .sidebar .nav-parent:hover,
    .sidebar .nav-parent.active {
        padding-left: 13px;
        border-left-color: transparent;
        border-radius: 10px;
    }
    .sidebar .nav-menu li.nav-group,
    .sidebar .nav-menu li.nav-group:hover,
    .sidebar .nav-menu li.nav-group.active {
        padding: 0;
        margin: 2px 0;
        background: none;
        border: 0;
    }
    .sidebar .nav-submenu { margin: 1px 0 6px; }
    .sidebar .nav-submenu::before { display: none; }
    .sidebar .nav-submenu li,
    .sidebar .nav-submenu li:hover,
    .sidebar .nav-submenu li.active {
        margin: 1px 0;
        padding: 10px 12px 10px 44px;
        border-left: 0;
        border-radius: 9px;
        font-size: 12.5px;
    }
    .sidebar .nav-submenu li:hover,
    .sidebar .nav-submenu li.active {
        background: linear-gradient(90deg, rgba(56, 189, 248, .16), transparent);
    }
    .sidebar .nav-menu li i { font-size: 16px; }
    .sidebar .nav-submenu li i { font-size: 12px; }

    .sidebar-mobile-foot {
        display: block;
        margin-top: auto;
        padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255, 255, 255, .08);
        background: rgba(0, 0, 0, .12);
    }
    body.light-mode .sidebar-mobile-foot {
        border-top-color: rgba(10, 26, 47, .1);
        background: rgba(10, 26, 47, .025);
    }
    .drawer-section-title {
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1.6px;
        text-transform: uppercase;
        margin-bottom: 9px;
    }
    .drawer-theme-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    .drawer-theme-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 38px;
        padding: 8px 9px;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 9px;
        background: rgba(255, 255, 255, .04);
        color: var(--text-muted);
        font-family: var(--font-body);
        font-size: 10.5px;
        cursor: pointer;
        transition: all .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .drawer-theme-btn.active {
        border-color: var(--neon-blue);
        background: rgba(56, 189, 248, .12);
        color: var(--text-main);
        box-shadow: 0 0 12px var(--neon-blue-glow);
    }
    body.light-mode .drawer-theme-btn {
        background: rgba(10, 26, 47, .03);
        border-color: rgba(10, 26, 47, .1);
    }
    .drawer-swatch {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .drawer-mode-btn,
    .drawer-logout-btn {
        display: flex;
        align-items: center;
        gap: 9px;
        width: 100%;
        min-height: 42px;
        margin-top: 8px;
        padding: 10px 11px;
        border-radius: 9px;
        border: 1px solid rgba(255, 255, 255, .1);
        background: rgba(255, 255, 255, .04);
        color: var(--text-main);
        font-family: var(--font-body);
        font-size: 11.5px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .drawer-mode-btn i { color: var(--txt-blue); font-size: 14px; }
    .drawer-mode-hint { margin-left: auto; opacity: .45; font-size: 11px !important; }
    .drawer-logout-btn {
        color: var(--txt-red);
        border-color: rgba(255, 77, 109, .28);
        background: rgba(255, 77, 109, .07);
    }
    .drawer-logout-btn i { font-size: 14px; }
    body.light-mode .drawer-mode-btn,
    body.light-mode .drawer-logout-btn { border-color: rgba(10, 26, 47, .12); }
    .drawer-version {
        margin-top: 12px;
        color: var(--text-muted);
        font-size: 9px;
        line-height: 1.5;
        text-align: center;
        opacity: .8;
    }

    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9960;
        background: rgba(2, 6, 15, .64);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .28s ease, visibility .28s;
    }
    .mobile-nav-overlay.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    body.nav-open { overflow: hidden; }
}

/* ================= APP SHELL & KONTEN (<=900px) ================= */
@media (max-width: 900px) {
    body {
        padding: 0;
        background-attachment: scroll;
        -webkit-text-size-adjust: 100%;
    }
    body::after { animation: none; }
    a, button, .nav-menu li { -webkit-tap-highlight-color: transparent; }

    .dashboard-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 10px calc(82px + env(safe-area-inset-bottom));
    }

    /* Header lengket di atas layar */
    .header {
        position: sticky;
        top: 0;
        z-index: 990;
        gap: 9px;
        margin: 0 -10px;
        padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
        border: 0;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0 0 14px 14px;
        background: linear-gradient(90deg, rgba(8, 16, 34, .97) 0%, rgba(10, 20, 45, .93) 100%);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        animation: none;
    }
    body.light-mode .header {
        background: linear-gradient(90deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .93) 100%);
    }
    .header-logo {
        flex: 1 1 auto;
        min-width: 0;
        gap: 9px;
    }
    .logo-img {
        width: 33px;
        height: 33px;
    }
    .header-title { min-width: 0; }
    .header-title h1 {
        font-size: 16px;
        letter-spacing: 1.6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-title p { display: none; }
    .mobile-page-name {
        display: block;
        margin-top: 1px;
        color: var(--text-muted);
        font-size: 9.5px;
        letter-spacing: .35px;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-tagline { display: none; }
    .header-controls {
        flex: 0 0 auto;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .header-controls > .theme-picker,
    .header-controls > .control-box { display: none; }
    .header-controls > .admin-badge {
        padding: 2px;
        border: 0;
        border-radius: 50%;
        background: transparent;
    }
    .header-controls > .admin-badge > div:not(.admin-avatar) { display: none; }
    .header-controls > .admin-badge:hover { box-shadow: none; border-color: transparent; }
    .admin-avatar {
        width: 35px;
        height: 35px;
        font-size: 13px;
        border: 1px solid rgba(255, 255, 255, .22);
        box-shadow: 0 0 12px var(--neon-blue-glow);
    }

    /* clip (bukan hidden) agar tab laporan/pengaturan bisa sticky,
       tanpa membuat halaman melebar ke samping. */
    .main-content {
        gap: 10px;
        overflow-x: visible;
        overflow-x: clip;
    }
    .page {
        gap: 10px;
        animation-duration: .35s;
    }
    .page > h1 {
        font-size: 19px !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
    }
    .page > h1 i { margin-right: 4px; }

    /* Tab sticky duduk tepat di bawah header, bukan tertutup olehnya.
       Latar dibuat solid agar isi halaman tidak tembus saat menempel. */
    .lap-tabs,
    .peng-tabs {
        top: var(--mobile-header-h, 57px) !important;
        z-index: 8;
        background: var(--bg-panel-solid) !important;
        border-color: var(--border-color) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    body.light-mode .lap-tabs,
    body.light-mode .peng-tabs {
        background: #fff !important;
        border-color: rgba(10, 26, 47, .12) !important;
        box-shadow: 0 8px 18px rgba(10, 26, 47, .14);
    }
    .lap-tabs::-webkit-scrollbar,
    .peng-tabs::-webkit-scrollbar { display: none; }

    body.light-mode .header-title h1 {
        background-image: linear-gradient(90deg, #0a1a2f, var(--neon-blue)) !important;
        -webkit-text-fill-color: transparent;
    }

    .panel {
        padding: 14px;
        border-radius: 11px;
    }
    .panel-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
        gap: 8px;
    }
    .panel-header h3 { font-size: 13px; line-height: 1.4; }
    .panel-header h3 i { font-size: 14px; }

    /* Kartu statistik 2 kolom agar tidak terlalu panjang */
    .stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 11px;
        animation-duration: .35s;
    }
    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .stat-info h3 {
        font-size: 9.5px;
        letter-spacing: .55px;
        line-height: 1.35;
    }
    .stat-info h2 { font-size: 21px; line-height: 1.15; }
    .stat-info p { font-size: 9px; line-height: 1.4; }

    .input-group {
        min-height: 46px;
        padding: 0 12px;
        margin-bottom: 12px;
        border-radius: 9px;
    }
    .input-group input { height: 46px; }
    /* 16px mencegah Safari iOS memperbesar halaman saat input disentuh */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .input-group input,
    .input-group select {
        font-size: 16px !important;
    }
    .input-group i { font-size: 14px; }

    .btn-action {
        min-height: 40px;
        padding: 9px 13px;
        font-size: 11.5px;
        justify-content: center;
    }
    .btn-cancel, .btn-save { min-height: 44px; padding: 11px 16px; }

    .chart-container { height: 255px; padding: 2px 0; }
    canvas { max-width: 100% !important; }

    /* Tabel: geser horizontal lebih nyaman */
    .table-scroll-wrapper {
        padding-bottom: 7px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .table-scroll-wrapper > table { max-width: none; }
    table { font-size: 11.5px; }
    th {
        padding: 9px 8px;
        font-size: 9px;
        letter-spacing: .4px;
    }
    td { padding: 10px 8px; }
    .table-scroll-wrapper::-webkit-scrollbar { height: 8px; }
    .table-scroll-wrapper::-webkit-scrollbar-thumb { border-radius: 4px; }
    .scroll-hint {
        font-size: 10px;
        line-height: 1.5;
        padding: 7px 9px;
        margin-top: 8px;
    }

    /* Grid dua kolom di halaman (termasuk inline) menjadi satu kolom */
    .grid-2,
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:1.4fr 1fr"],
    [style*="grid-template-columns:1fr 1.4fr"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .page { overflow-wrap: break-word; }

    /* Modal, toast, dan tombol ke atas */
    .modal-overlay { padding: 14px; }
    .logout-modal-box {
        width: 100% !important;
        max-width: 420px !important;
        max-height: calc(100vh - 28px);
        max-height: calc(100dvh - 28px);
        overflow-y: auto;
        padding: 26px 20px;
        border-radius: 14px;
    }
    .logout-buttons { gap: 9px; margin-top: 20px; }
    .btn-logout-cancel, .btn-logout-confirm { padding: 11px 12px; font-size: 12px; }

    .toast {
        top: calc(12px + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        max-width: none;
        padding: 13px 16px;
        font-size: 12px;
        transform: translateY(-130%);
    }
    .toast.show { transform: translateY(0); }

    .btn-top {
        bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 9940;
        padding: 9px 15px;
        font-size: 11px;
        gap: 6px;
    }

    /* Footer aplikasi */
    .app-footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 7px;
        padding: 11px 12px;
        font-size: 10px;
        line-height: 1.5;
    }
    .app-footer .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1px;
    }
    .app-footer .footer-links a { padding: 5px 7px; }
    .app-footer .footer-links .footer-sep { display: none; }

    /* Tombol naik: bulat kecil di kanan, di atas bottom tab bar */
    .btn-top {
        left: auto;
        right: 14px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        z-index: 9940;
        transform: translateY(12px);
    }
    .btn-top.show { transform: translateY(0); }
    .btn-top:hover { transform: translateY(-4px); }
    .btn-top span { display: none; }
    .btn-top i { font-size: 15px; }

    /* Bottom tab bar */
    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9950;
        padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
        background: rgba(6, 13, 28, .95);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -12px 30px rgba(0, 0, 0, .45);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    body.light-mode .mobile-bottom-nav {
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -10px 28px rgba(10, 26, 47, .14);
    }
    .mobile-nav-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        position: relative;
        padding: 7px 2px 4px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--text-muted);
        font-family: var(--font-body);
        font-size: 9.5px;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        transition: color .2s ease, background .2s ease, transform .12s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-nav-item i { font-size: 17px; line-height: 1; }
    .mobile-nav-item span {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-nav-item.active {
        color: var(--txt-blue);
        background: linear-gradient(180deg, rgba(56, 189, 248, .12), transparent);
    }
    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 3px;
        border-radius: 0 0 4px 4px;
        background: var(--neon-blue);
        box-shadow: 0 0 10px var(--neon-blue-glow);
    }
    .mobile-nav-item:active { transform: scale(.94); }
}

/* ================= PENYESUAIAN LAYAR PONSEL (<=600px) ================= */
@media (max-width: 600px) {
    .page > h1 { font-size: 18px !important; }
    .panel { padding: 12px; }
    .panel-header h3 { font-size: 12.5px; }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 11px;
        gap: 7px;
    }
    .stat-icon { width: 34px; height: 34px; font-size: 14px; }
    .stat-info h2 { font-size: 20px; margin: 1px 0; }
    .stat-info p { font-size: 8.5px; }

    .input-group { padding: 0 10px; }
    .btn-action { font-size: 11px; }

    /* Form/filter sejajar penuh agar mudah disentuh */
    .panel .input-group {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    /* Pilihan jumlah data tetap ringkas, tidak ikut melebar penuh */
    .panel .per-page-form .input-group {
        flex: 0 0 86px !important;
        width: 86px !important;
        min-width: 86px !important;
    }

    .logout-buttons { flex-direction: column-reverse; }
    .btn-logout-cancel, .btn-logout-confirm { width: 100%; }
    .logout-icon { width: 72px; height: 72px; margin-bottom: 14px; }
    .logout-icon img { width: 50px; height: 50px; }
    .logout-title { font-size: 17px; letter-spacing: 2.5px; }
    .logout-message { font-size: 13px; }
    .confirm-modal-title { font-size: 15px; }
    .confirm-modal-message { font-size: 12.5px; line-height: 1.75; }

    .toast { font-size: 11.5px; }

    .home-page-head h1 { font-size: 20px; }
    .home-page-head p { font-size: 11.5px; }

    /* Grid inline: 3 kolom ditumpuk, 4–5 kolom jadi 2 kolom */
    [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(5,minmax(0,1fr))"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }
    [style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    [style*="grid-template-columns:200px 1fr 60px"] {
        grid-template-columns: 96px minmax(0, 1fr) 42px !important;
        gap: 6px !important;
    }
    [style*="grid-template-columns:92px 1fr 1fr"] {
        grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 6px !important;
    }

    .guide-hero { padding: 16px 14px !important; }
    .guide-hero h2 { font-size: 18px; }
    .guide-section { padding: 15px 13px !important; }
    .guide-toc nav { gap: 4px; }

    .peta-legend { max-width: 150px; font-size: 9.5px; }
    .home-map-head h2 { font-size: 15.5px; }
    .peta-map-wrap { height: 330px; }
}

/* ================= LAYAR SANGAT KECIL (<=380px) ================= */
@media (max-width: 380px) {
    .dashboard-container { padding-left: 8px; padding-right: 8px; }
    .header { margin-left: -8px; margin-right: -8px; padding-left: 9px; padding-right: 9px; }
    .header-title h1 { font-size: 14px; letter-spacing: 1px; }
    .mobile-menu-btn, .admin-avatar { width: 33px; height: 33px; }
    .header-controls > .admin-badge .admin-avatar { width: 33px; height: 33px; }
    .stats-row { gap: 8px; }
    .stat-card { padding: 10px; }
    .stat-icon { width: 30px; height: 30px; font-size: 13px; }
    .stat-info h2 { font-size: 18px; }
    .panel { padding: 10px; }
    .mobile-nav-item { font-size: 9px; }
    .mobile-nav-item i { font-size: 16px; }
    .drawer-theme-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   LOGIN MOBILE — branding ringkas + form natural scroll
   ========================================================= */
@media (max-width: 900px) {
    body:has(.login-overlay) {
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .login-overlay {
        position: relative;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }
    .login-overlay::before { animation: none; opacity: .5; }
    .login-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }
    .login-left {
        padding: 26px 16px 20px;
        border-right: 0;
        border-bottom: 1px solid rgba(56, 189, 248, .3);
    }
    .login-left::before { opacity: .35; animation: none; }
    .login-left-content {
        width: 100%;
        max-width: 430px;
        padding: 0;
        animation: none;
    }
    .hero-shield { width: 84px; height: 84px; margin-bottom: 10px; }
    .hero-shield img { width: 58px; height: 58px; }
    .hero-title { font-size: 22px; letter-spacing: 2px; margin-bottom: 4px; }
    .hero-tagline { font-size: 10px; letter-spacing: 1px; margin-bottom: 12px; }
    .hero-features { gap: 7px; margin-bottom: 0; }
    .feature-item { padding: 5px 10px; font-size: 10px; }
    .hero-quote { display: none; }
    .login-left-glow { display: none; }

    .login-right {
        align-items: flex-start;
        padding: 24px 16px calc(30px + env(safe-area-inset-bottom));
    }
    .login-form-wrapper { max-width: 430px; animation: none; }
    .login-form-header { margin-bottom: 20px; }
    .login-form-header i { display: none; }
    .login-form-header h2 { font-size: 19px; letter-spacing: 2px; }
    .login-form .input-group { height: 50px; }
    .login-form input { font-size: 16px !important; }
    .btn-login { min-height: 50px; }
    .login-footer { margin-top: 26px; padding-top: 16px; }
}

@media (max-width: 480px) {
    .login-left { padding: 20px 16px 16px; }
    .hero-shield { width: 64px; height: 64px; margin-bottom: 8px; }
    .hero-shield img { width: 46px; height: 46px; }
    .hero-title { font-size: 18px; letter-spacing: 1.5px; }
    .hero-tagline { margin-bottom: 0; font-size: 9.5px; }
    .hero-features { display: none; }
    .login-right { padding: 20px 14px calc(26px + env(safe-area-inset-bottom)); }
    .login-form-header { margin-bottom: 16px; }
    .login-form-header h2 { font-size: 17px; }
    .login-form form { gap: 11px; }
    .login-hint { font-size: 10px; }
    .login-footer p { font-size: 9px; line-height: 1.7; }
}

/* Ringkasan laporan & tabel info: baris ditumpuk di ponsel
   supaya nilai panjang tidak terpotong di sisi kanan. */
@media (max-width: 600px) {
    .laporan-summary tbody tr {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }
    .laporan-summary tbody tr:last-child { border-bottom: 0; }
    .laporan-summary td {
        display: block;
        width: auto !important;
        padding: 0 !important;
        white-space: normal !important;
    }
    body.light-mode .laporan-summary tbody tr { border-bottom-color: rgba(10, 26, 47, .08); }

    .about-info-table td {
        white-space: normal !important;
        line-height: 1.65;
    }
    .about-info-table td:first-child {
        width: 82px;
        padding: 5px 8px 5px 0;
        vertical-align: top;
    }

    .login-right { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-nav-overlay,
    .mobile-nav-item,
    .mobile-menu-btn { transition: none !important; }
}