:root {
    --brand-blue: #1d4ed8;
    /* Bright Accent Blue */
    --brand-blue-deep: #1e3a8a;
    /* Deep Navy Blue from reference */
    --brand-yellow: #facc15;
    /* Modern Yellow */
    --brand-white: #ffffff;
    --brand-bg: #1e3a8a;
    /* Deep Navy Blue Background */
    --radius-lg: 30px;
    --radius-md: 20px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--brand-bg);
    margin: 0;
    min-height: 100vh;
    color: #1e293b;
    /* Ubah default text ke gelap agar aman di card putih */
    overflow-x: hidden;
}

/* Pastikan semua modal dan card memiliki warna teks yang konsisten */
.modal-content,
.card-welcome,
.card-form,
.stat-box,
.kstat-item {
    color: #1e293b !important;
}

.text-muted {
    color: #64748b !important;
}

/* --- Header --- */
.header-kiosk {
    background: white;
    padding: 12px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 10;
}

.header-logo {
    height: 45px;
    margin-right: 15px;
}

.header-brand h5 {
    margin: 0;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--brand-blue-deep) !important;
}

.header-info {
    text-align: right;
}

.badge-merdeka {
    background: var(--brand-yellow);
    color: #1e3a8a;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.clock-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock-box {
    background: var(--brand-bg);
    color: white;
    padding: 10px 14px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 8px;
    align-items: center;
}

.clock-unit {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 6px;
    min-width: 35px;
    text-align: center;
}

.clock-val {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: monospace;
    display: block;
}

.clock-sep {
    font-weight: 800;
    opacity: 0.5;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.kiosk-banner {
    height: 380px;
    background: var(--brand-bg);
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    z-index: 1;
}

/* --- Content Layout --- */
.kiosk-wrapper {
    position: relative;
    z-index: 2;
    padding: 60px;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
}

.card-welcome {
    width: 350px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow);
    height: fit-content;
    transition: var(--transition);
    color: #1e293b;
}

.card-welcome:hover {
    transform: translateY(-8px);
}

.card-form {
    flex: 1;
    background: white;
    border-radius: var(--radius-lg);
    padding: 50px;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
    color: #1e293b;
}

.card-form:hover {
    transform: translateY(-8px);
}

/* --- UI Elements --- */
.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 800;
    margin-bottom: 40px;
    text-transform: uppercase;
    font-size: 1.15rem;
    letter-spacing: 1px;
    color: var(--brand-blue-deep);
}

.section-title::before {
    content: '';
    width: 8px;
    height: 28px;
    background: var(--brand-yellow);
    border-radius: 10px;
}

.form-label-custom {
    font-weight: 700;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
}

.input-custom {
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
    transition: 0.3s;
}

.input-custom:focus {
    border-color: var(--brand-blue);
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 173, 220, 0.1);
}

.btn-photo-kiosk {
    position: absolute;
    top: 45px;
    right: 50px;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-photo-kiosk:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.btn-submit-kiosk {
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 18px 45px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition);
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.25);
}

.btn-submit-kiosk:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(29, 78, 216, 0.35);
    color: white;
    background: var(--brand-blue-deep);
}

.nav-label-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #f1f5f9;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 25px;
}

.nav-label-title {
    background: var(--brand-yellow);
    color: var(--brand-blue-deep);
    font-weight: 800;
    padding: 15px 5px;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 165px;
    /* Fixed width for uniform length */
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-label-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
}

#sig-canvas {
    width: 100%;
    height: 180px;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    background: #ffffff;
    cursor: crosshair;
    transition: all 0.3s ease;
    position: relative;
}

#sig-canvas:hover {
    border-color: var(--brand-blue);
    background: #fdfdfd;
}

.btn-clear-sig {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    z-index: 10;
}

.btn-clear-sig:hover {
    background: #fff1f2;
    color: #ef4444;
    border-color: #fecaca;
    transform: scale(1.05);
}

.gender-selection {
    display: flex;
    gap: 12px;
}

.gender-pill {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.gender-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pill-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border: 2px solid #f1f5f9;
    border-radius: 15px;
    background: #f8fafc;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    color: #64748b;
    text-align: center;
}

.gender-pill:hover .pill-content {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.gender-pill input:checked+.pill-content {
    border-color: var(--brand-blue) !important;
    background: rgba(29, 78, 216, 0.05) !important;
    color: var(--brand-blue) !important;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.1);
}

/* --- Kiosk Stats --- */
.card-stats {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 350px;
}

.card-stats:hover {
    transform: translateY(-5px);
}

.kstat-item {
    background: #f8fafc;
    border-radius: 18px;
    padding: 15px 10px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: var(--transition);
}

.kstat-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--brand-blue-deep);
    line-height: 1.2;
}

.kstat-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-manual-container {
    display: none;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.captured-photo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    display: none;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .kiosk-wrapper {
        flex-direction: column;
        padding: 30px;
        margin-top: 50px;
    }

    .card-welcome {
        width: 100%;
        order: 2;
    }

    .card-form {
        width: 100%;
        order: 1;
    }

    .kiosk-banner {
        height: 250px;
    }

    .header-kiosk {
        padding: 10px 30px;
    }

    .btn-photo-kiosk {
        position: static;
        margin-bottom: 30px;
        width: 100%;
        justify-content: center;
    }
}

/* --- Transitions --- */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Global Components --- */
#fullPageLoader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.admin-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e0;
    border: none;
    z-index: 1000;
    transition: 0.3s;
}

.admin-trigger:hover {
    color: var(--brand-blue);
    transform: rotate(45deg);
    scale: 1.1;
}

/* --- Login Page Redesign --- */
#loginPage {
    min-height: 100vh;
    display: flex;
    background: white;
    overflow: hidden;
    flex-direction: row;
}

.login-visual-side {
    flex: 1.4;
    background: var(--brand-blue-deep);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 80px;
    color: white;
}

.login-visual-content {
    position: relative;
    z-index: 2;
}

.login-visual-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.login-visual-content p {
    font-size: 1.25rem;
    opacity: 0.7;
    max-width: 500px;
    line-height: 1.6;
}

.login-star {
    font-size: 8rem;
    margin-bottom: 40px;
    color: white;
    display: block;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: white;
    position: relative;
}

.login-card-inner {
    width: 100%;
    max-width: 450px;
}

.login-input-group {
    position: relative;
    margin-bottom: 25px;
}

.login-input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.login-input-group .input-custom {
    padding-left: 55px;
    height: 60px;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
}

.login-footer {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* --- Admin Dashboard --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ======= SIDEBAR ======= */
.admin-sidebar {
    width: 260px;
    background: var(--brand-blue-deep);
    color: rgba(255, 255, 255, 0.7);
    position: fixed;
    height: 100vh;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: 0.3s;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
}

.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.sidebar-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.sidebar-logo-text h6 {
    margin: 0;
    font-weight: 800;
    font-size: 0.85rem;
    color: white;
    letter-spacing: 0.5px;
}

.sidebar-logo-text small {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.28);
    padding: 0 12px;
    margin-bottom: 8px;
    margin-top: 16px;
}

.nav-item-admin {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s ease;
    margin-bottom: 4px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    letter-spacing: 0.3px;
}

.nav-item-admin:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item-admin.active-nav {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-weight: 700;
}

.nav-item-admin .nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.nav-item-admin.active-nav .nav-icon {
    background: var(--brand-blue);
}

.sidebar-user-card {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info small {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    display: block;
}

.sidebar-user-info span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
}

.btn-logout-sidebar {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ======= MAIN CONTENT ======= */
.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f1f5f9;
    min-height: 100vh;
    transition: 0.3s;
    color: #1e293b;
    display: flex;
    flex-direction: column;
}

/* ======= TOPBAR ======= */
.admin-topbar {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle-btn {
    display: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #475569;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 16px;
    transition: all 0.2s;
}

.menu-toggle-btn:hover {
    background: #e2e8f0;
}

/* RESPONSIVE MOBILE SIDEBAR (FIX TOTAL) */
@media (max-width: 991px) {
    .menu-toggle-btn {
        display: flex !important;
    }

    .sidebar-close-btn {
        display: flex !important;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        border: none;
        font-size: 1.2rem;
    }

    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -300px !important;
        /* Mulai di luar layar kiri */
        width: 280px !important;
        z-index: 99999 !important;
        /* Nilai tertinggi agar pasti tampil */
        background: #1e3a8a !important;
        /* Warna biru pekat agar kontras */
        display: flex !important;
        flex-direction: column !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidebar-open .admin-sidebar {
        left: 0 !important;
        /* Tampilkan dengan geser ke 0 */
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(5px) !important;
        z-index: 88888 !important;
        /* Di bawah sidebar */
        display: none;
    }

    .sidebar-open .sidebar-overlay {
        display: block !important;
    }

    .admin-topbar {
        padding: 10px 15px !important;
    }

    .admin-topbar-right {
        display: none !important;
    }
}

.sidebar-close-btn {
    display: none;
}

.admin-topbar-title h4 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}

.admin-topbar-title p {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 500;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
}

.topbar-clock-val {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--brand-blue-deep);
    font-family: 'Courier New', monospace;
}

.topbar-badge {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: var(--brand-blue);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ======= PAGE CONTENT ======= */
.admin-content {
    padding: 28px 36px;
    flex: 1;
}

/* ======= STAT CARDS ======= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #e8eef5;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card-icon.blue {
    background: #eff6ff;
    color: var(--brand-blue);
}

.stat-card-icon.yellow {
    background: #fefce8;
    color: #ca8a04;
}

.stat-card-icon.green {
    background: #f0fdf4;
    color: #16a34a;
}

.stat-card-icon.purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.stat-card-body small {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-card-body h2 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0 0;
    line-height: 1;
}

.stat-card-body p {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 4px 0 0;
    font-weight: 500;
}

/* ======= TABLE SECTION ======= */
.table-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e8eef5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.table-header-left h5 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.table-header-left small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 240px;
}

.search-box-admin i {
    color: #94a3b8;
    font-size: 0.85rem;
}

.search-box-admin input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    font-family: 'Plus Jakarta Sans', sans-serif;
    width: 100%;
}

.search-box-admin input::placeholder {
    color: #cbd5e1;
}

.btn-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
}

.btn-toolbar.refresh {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.btn-toolbar.refresh:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--brand-blue);
}

.btn-toolbar.export-pdf {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-toolbar.export-pdf:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}

.btn-toolbar.primary-btn {
    background: var(--brand-blue-deep);
    color: white;
    border-color: var(--brand-blue-deep);
}

.btn-toolbar.primary-btn:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
}

/* ======= TABLE STYLES ======= */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table thead th {
    padding: 12px 16px;
    font-size: 0.67rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.admin-table thead th:first-child {
    padding-left: 24px;
}

.admin-table thead th:last-child {
    padding-right: 24px;
}

.admin-table tbody tr {
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: #fafbfd;
}

.admin-table tbody tr:last-child {
    border-bottom: none;
}

.admin-table tbody td {
    padding: 13px 16px;
    font-size: 0.82rem;
    color: #334155;
    vertical-align: middle;
}

.admin-table tbody td:first-child {
    padding-left: 24px;
}

.admin-table tbody td:last-child {
    padding-right: 24px;
}

.guest-avatar-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guest-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
}

.guest-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.guest-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.83rem;
}

.guest-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

.badge-gender {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-gender.lk {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-gender.pr {
    background: #fdf2f8;
    color: #a21caf;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-status.active {
    background: #fefce8;
    color: #854d0e;
}

.badge-status.done {
    background: #f0fdf4;
    color: #166534;
}

.badge-status.active::before {
    content: '●';
    font-size: 0.5rem;
    color: #eab308;
}

.badge-status.done::before {
    content: '✓ ';
}

.btn-action {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action.view {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.btn-action.view:hover {
    background: #1d4ed8;
    color: white;
}

.btn-action.wa {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.btn-action.wa:hover {
    background: #16a34a;
    color: white;
}

.btn-action.checkout {
    background: #fefce8;
    border-color: #fde68a;
    color: #d97706;
}

.btn-action.checkout:hover {
    background: #d97706;
    color: white;
}

.btn-action.del {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-action.del:hover {
    background: #dc2626;
    color: white;
}

.table-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.table-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.3;
}

.table-empty p {
    font-size: 0.85rem;
    font-weight: 600;
}

.loading-row td {
    text-align: center;
    padding: 50px;
}

.row-number {
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: monospace;
}

.time-chip {
    background: #f0fdf4;
    color: #166534;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: monospace;
}

.time-chip.out {
    background: #fef2f2;
    color: #dc2626;
}

/* ======= FILTER BAR ======= */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-wrap: wrap;
}

.filter-select {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    padding: 7px 12px;
    outline: none;
    cursor: pointer;
    transition: 0.2s;
}

.filter-select:focus {
    border-color: var(--brand-blue);
}

.filter-date {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    padding: 7px 12px;
    outline: none;
}

.filter-date:focus {
    border-color: var(--brand-blue);
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ======= STAT BOX (legacy, keep for kiosk) ======= */
.stat-box {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border-top: 6px solid var(--brand-blue);
    position: relative;
    transition: 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.active-nav {
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
    opacity: 1 !important;
}

.active-nav .nav-icon {
    background: var(--brand-blue) !important;
}

.xsmall {
    font-size: 0.75rem;
}

.fw-800 {
    font-weight: 800;
}

.fw-600 {
    font-weight: 600;
}

.italic {
    font-style: italic;
}

/* ======= MIGRATION / SETTINGS PANEL ======= */
.panel-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e8eef5;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ======= TABLE PAGINATION FOOTER ======= */
.table-footer {
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-footer-info {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ======= RESPONSIVE: dipindahkan ke bagian bawah ======= */

/* @media (max-width: 768px) dipindahkan ke bagian bawah */

/* ========== OPTIONS MANAGEMENT & EDIT MODAL ========== */
.panel-card {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.options-list {
    max-height: 320px;
    overflow-y: auto;
}

.option-item {
    transition: background 0.15s;
}

.option-item:hover {
    background: #f1f5f9 !important;
}

.btn-toolbar.primary-btn {
    background: var(--brand-blue-deep);
    color: #fff;
    border-color: var(--brand-blue-deep);
}

.btn-toolbar.primary-btn:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.form-label-custom {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

/* ===== SETTINGS PANEL ===== */
.settings-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.settings-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.logo-preview-box {
    width: 110px;
    height: 110px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.logo-preview-box:hover {
    border-color: var(--brand-blue);
}

/* ===== ANALYTICS CHARTS ===== */
.charts-row {
    display: flex;
    gap: 20px;
    margin-top: 32px;
    /* Tambah jarak dari stat cards */
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    /* Tambah padding dalam agar tidak terlalu sesak */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #e8eef5;
    flex: 1;
}

.chart-card-wide {
    flex: 2.2;
}

.chart-side-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.chart-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.chart-card-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
}

.chart-period-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
}

.chart-tab {
    border: none;
    background: transparent;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.chart-tab.active {
    background: white;
    color: var(--brand-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1200px) {
    .charts-row {
        flex-direction: column;
    }

    .chart-side-col {
        flex-direction: row;
        gap: 16px;
    }

    .chart-card-wide {
        flex: 1;
    }
}

/* Settings sidebar mini-preview */
.settings-preview-sidebar {
    background: var(--brand-blue-deep);
    border-radius: 16px;
    padding: 18px 16px;
}

.settings-preview-logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-nav-item {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    cursor: default;
    transition: all 0.2s;
}

.preview-nav-item.active {
    background: var(--brand-blue);
    color: #fff;
    opacity: 1;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.active-nav {
    background: var(--brand-blue) !important;
    color: white !important;
    opacity: 1 !important;
    box-shadow: 0 8px 20px rgba(0, 173, 220, 0.3);
}

.xsmall {
    font-size: 0.75rem;
}

.fw-800 {
    font-weight: 800;
}

.fw-600 {
    font-weight: 600;
}

.italic {
    font-style: italic;
}

/* =========================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ========================================= */

/* --- Tablet (max 992px) --- */
@media (max-width: 992px) {

    /* Admin sidebar: slide-out on mobile */
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -300px !important;
        width: 280px !important;
        z-index: 99999 !important;
        background: #1e3a8a !important;
        display: flex !important;
        flex-direction: column !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
        padding: 30px 20px !important;
        overflow-y: auto !important;
    }

    .sidebar-open .admin-sidebar {
        left: 0 !important;
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .menu-toggle-btn {
        display: flex !important;
    }

    .sidebar-close-btn {
        display: flex !important;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(5px) !important;
        z-index: 88888 !important;
        display: none;
    }

    .sidebar-open .sidebar-overlay {
        display: block !important;
    }

    .admin-topbar {
        padding: 10px 16px !important;
    }

    .admin-topbar-right {
        display: none !important;
    }

    .admin-content {
        padding: 20px 16px;
    }

    /* Stat grid: 2 columns on tablet */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Charts */
    .charts-row {
        flex-direction: column;
    }

    .chart-side-col {
        flex-direction: row;
    }

    /* Kiosk - stack vertically */
    .kiosk-wrapper {
        flex-direction: column;
        padding: 30px;
        gap: 20px;
    }

    .kiosk-aside {
        flex-direction: row !important;
        align-items: stretch;
        gap: 20px !important;
    }

    .card-welcome,
    .card-stats {
        width: 50%;
        height: auto;
        padding: 30px !important;
    }

    .kiosk-banner {
        top: 120px;
    }

    /* Login: stack on tablet */
    #loginPage {
        flex-direction: column;
    }

    .login-visual-side {
        flex: none;
        min-height: 220px;
        padding: 40px;
        justify-content: center;
    }

    .login-visual-content h1 {
        font-size: 2.2rem;
    }

    .login-star {
        font-size: 4rem;
        margin-bottom: 20px;
    }

    .login-footer {
        display: none;
    }

    .login-form-side {
        padding: 30px 20px;
    }

    /* Filter bar: wrap */
    .filter-bar {
        gap: 8px;
    }

    /* Table: allow horizontal scroll */
    .table-section {
        overflow-x: auto;
    }
}

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {

    /* === KIOSK === */
    .header-kiosk {
        height: auto;
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px !important;
        align-items: center !important;
    }

    .header-brand h5 {
        font-size: 0.95rem;
        text-align: center;
    }

    .clock-container {
        width: 100%;
        flex-direction: column !important;
        justify-content: center;
        gap: 8px !important;
        align-items: center;
    }

    .kiosk-date-header {
        text-align: center !important;
    }

    .clock-box {
        padding: 8px 12px;
    }

    .clock-val {
        font-size: 0.95rem;
    }

    .kiosk-banner {
        top: 200px;
        height: 200px;
    }

    .kiosk-wrapper {
        padding: 12px;
        gap: 12px;
        margin-top: 0;
    }

    .kiosk-aside {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .card-welcome,
    .card-stats {
        width: 100% !important;
        border-radius: 20px !important;
        padding: 20px !important;
    }

    .card-welcome {
        display: none;
        /* Hide welcome card on very small screens to save space */
    }

    .card-form {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .kstat-val {
        font-size: 1rem;
    }

    /* Form: stack all columns */
    .card-form .row>[class*="col-md-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Nav label group: stack */
    .nav-label-group {
        flex-direction: column;
    }

    .nav-label-title {
        width: 100%;
        padding: 10px 15px;
        border-radius: 12px 12px 0 0;
        justify-content: flex-start;
    }

    .nav-label-input {
        border-radius: 0 0 12px 12px !important;
        border-top: 1px solid #f1f5f9 !important;
    }

    /* Buttons at bottom of kiosk form: stack */
    .card-form .d-flex.gap-3.mt-5 {
        flex-direction: column;
    }

    /* === LOGIN === */
    #loginPage {
        flex-direction: column;
        min-height: 100vh;
    }

    .login-visual-side {
        flex: none;
        min-height: 180px;
        padding: 30px 20px;
        align-items: flex-start;
        justify-content: flex-end;
    }

    .login-visual-content h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .login-visual-content p {
        font-size: 0.9rem;
    }

    .login-star {
        font-size: 3rem;
        margin-bottom: 10px;
    }

    .login-footer {
        display: none;
    }

    .login-form-side {
        flex: 1;
        padding: 24px 16px;
        align-items: flex-start;
    }

    .login-card-inner {
        max-width: 100%;
    }

    /* === ADMIN DASHBOARD === */
    .admin-content {
        padding: 14px 12px;
    }

    .admin-topbar {
        padding: 10px 12px !important;
    }

    .admin-topbar-title h4 {
        font-size: 0.9rem;
    }

    .admin-topbar-title p {
        display: none;
    }

    /* Stat cards: single column */
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px 18px;
    }

    .stat-card-body h2 {
        font-size: 1.5rem;
    }

    /* Charts */
    .charts-row {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .chart-side-col {
        flex-direction: column;
        gap: 12px;
    }

    .chart-card {
        padding: 18px 14px;
    }

    .chart-card-wide {
        flex: 1;
    }

    .chart-canvas-wrap[style*="420px"] {
        height: 250px !important;
    }

    .chart-canvas-wrap[style*="145px"] {
        height: 130px !important;
    }

    /* Table section */
    .table-header {
        padding: 14px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .search-box-admin {
        min-width: unset;
        width: 100%;
    }

    .btn-toolbar {
        justify-content: center;
    }

    .filter-bar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-select,
    .filter-date {
        width: 100%;
    }

    .filter-label {
        display: none;
    }

    .table-footer {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        padding: 10px 14px;
    }

    /* Settings panel */
    .panel-card {
        padding: 18px 14px;
    }

    /* Settings: stack columns */
    #panel-settings .row>[class*="col-lg-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #panel-settings .col-lg-4 .panel-card {
        position: static !important;
    }

    .settings-section-head {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    /* Migration panel */
    #panel-migration .col-md-8,
    #panel-migration .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: left !important;
    }

    /* Options panel: stack */
    #panel-options .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Data Tamu panel */
    #panel-tamu .table-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* --- Small Mobile (max 480px) --- */
@media (max-width: 480px) {

    /* Kiosk header: smaller */
    .header-logo {
        height: 35px;
    }

    .badge-merdeka {
        font-size: 0.55rem;
        padding: 3px 8px;
    }

    .clock-val {
        font-size: 0.85rem;
    }

    /* Kiosk form: tight padding */
    .card-form {
        padding: 16px 12px;
        border-radius: 16px;
    }

    /* Hidden gender labels show as stacked */
    .gender-selection {
        flex-direction: column;
        gap: 8px;
    }

    /* Signature canvas */
    #sig-canvas {
        height: 140px;
    }

    /* Login */
    .login-visual-side {
        min-height: 140px;
        padding: 20px 16px;
    }

    .login-visual-content h1 {
        font-size: 1.5rem;
    }

    .login-star {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    /* Form buttons */
    .btn-submit-kiosk {
        padding: 14px 20px;
        border-radius: 14px;
        font-size: 0.85rem;
    }

    /* Stat cards */
    .stat-card-body h2 {
        font-size: 1.3rem;
    }

    .stat-card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* Admin topbar */
    .admin-topbar-title h4 {
        font-size: 0.82rem;
    }

    /* Detail modal adjustments */
    .modal-dialog.modal-lg {
        margin: 8px;
    }

    /* Chart heights on very small screens */
    .chart-card {
        padding: 14px 10px;
    }
}