:root {
    --primer: #0d6efd;
    --primer-dark: #0a58ca;
    --bg: #f2f4f8;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== Landing & Kiosk ===== */
.brand-header {
    background: linear-gradient(135deg, var(--primer), var(--primer-dark));
    color: #fff;
    padding: 28px 16px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.brand-header img { max-height: 56px; margin-bottom: 8px; }
.brand-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.brand-header p { opacity: .9; margin: 4px 0 0; font-size: .95rem; }
.jam-layanan-info { font-size: .85rem; margin-top: 8px !important; opacity: .95; }

.kiosk-wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }

.loket-btn {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 28px 20px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    transition: transform .15s, box-shadow .15s;
    text-align: left;
}
.loket-btn:active { transform: scale(.97); }
.loket-btn:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.loket-btn .icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primer); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
}
.loket-btn .txt strong { display: block; font-size: 1.15rem; color: #212529; }
.loket-btn .txt span { color: #6c757d; font-size: .9rem; }

.ticket-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}
.ticket-card::before, .ticket-card::after {
    content: '';
    position: absolute;
    width: 28px; height: 28px;
    background: var(--bg);
    border-radius: 50%;
    top: 50%; transform: translateY(-50%);
}
.ticket-card::before { left: -14px; }
.ticket-card::after { right: -14px; }
.ticket-number { font-size: 4rem; font-weight: 800; color: var(--primer); letter-spacing: 2px; }
.ticket-meta { color: #6c757d; margin-top: 8px; }

/* ===== Display / TV ===== */
.tv-body { background: #0b1220; color: #fff; min-height: 100vh; }
.tv-header {
    background: linear-gradient(135deg, var(--primer), var(--primer-dark));
    padding: 18px 32px;
    display: flex; align-items: center; justify-content: space-between;
}
.tv-header h1 { font-size: 1.8rem; margin: 0; font-weight: 700; }
.tv-clock { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.tv-jam-layanan { font-size: .85rem; opacity: .85; margin-top: 2px; }
.tv-status-tutup {
    background: #7a1f1f; color: #fff; text-align: center; font-weight: 700;
    padding: 10px; letter-spacing: .5px;
}
.tv-berikutnya { margin-top: 16px; }
.tv-berikutnya .label { color: #7c8ba8; font-size: .85rem; margin-bottom: 6px; }
.tv-berikutnya .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tv-berikutnya .chip {
    background: #1d2a44; color: #cfd8ea; border-radius: 10px; padding: 6px 12px;
    font-weight: 700; font-size: 1rem; letter-spacing: 1px;
}

.tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    padding: 32px;
}
.tv-loket {
    background: #131c2e;
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    border: 2px solid #1d2a44;
    transition: border-color .3s, box-shadow .3s;
}
.tv-loket.flash {
    border-color: #ffc107;
    box-shadow: 0 0 40px rgba(255,193,7,.5);
}
.tv-loket h2 { font-size: 1.3rem; color: #9fb0d0; margin-bottom: 12px; font-weight: 600; }
.tv-number { font-size: 5.5rem; font-weight: 800; letter-spacing: 3px; line-height: 1.1; }
.tv-waiting { margin-top: 14px; color: #7c8ba8; font-size: 1rem; }

@keyframes scroll-left { from { transform: translateX(0);} to { transform: translateX(-100%);} }

.tv-runningtext {
    background: #ffc107; color: #1a1a1a; font-weight: 600;
    padding: 8px 0; overflow: hidden; white-space: nowrap;
}
.tv-runningtext span { display: inline-block; padding-left: 100%; animation: scroll-left 22s linear infinite; }

/* ===== Admin ===== */
.admin-sidebar {
    background: #131c2e; min-height: 100vh; color: #cfd8ea; width: 240px;
}
.admin-sidebar a {
    color: #cfd8ea; text-decoration: none; display: block; padding: 12px 20px; border-radius: 10px; margin: 4px 10px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--primer); color: #fff; }
.admin-sidebar .brand { padding: 20px; font-weight: 700; font-size: 1.1rem; color: #fff; }

.admin-content { padding: 28px; }
.stat-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.loket-panel { background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.loket-panel .angka-panggil { font-size: 3.2rem; font-weight: 800; color: var(--primer); }

@media (max-width: 767px) {
    .admin-sidebar { position: fixed; z-index: 1050; left: -260px; transition: left .2s; }
    .admin-sidebar.show { left: 0; }
    .tv-number { font-size: 3.4rem; }
    .tv-header h1 { font-size: 1.2rem; }
}
