/* ============================================================
   assets/css/style.css  (Warna dominan: Biru, Putih, Abu-abu)
   ============================================================ */

:root {
    --bs-primary: #0d6efd;
    --app-bg: #f1f5f9;
    --app-nav: #0b3d91;      /* biru gelap untuk navbar */
}

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

/* ---------- Sidebar umum (dashboard, history, setting) ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0b2d6b 0%, #0d6efd 100%);
    color: #fff;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    flex-direction: column;   /* penting: rapi agar menu tersusun vertikal (bukan mendatar) */
    overflow-y: auto;
}

.app-sidebar .brand {
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 1rem;
}
.app-sidebar .brand .title {
    font-weight: 700;
    line-height: 1.3;
    font-size: .95rem;
}

.app-sidebar .nav-link {
    color: rgba(255,255,255,.85);
    padding: .65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-left: 3px solid transparent;
}
.app-sidebar .nav-link i {
    font-size: 1.1rem;
}
.app-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.16);
    border-left-color: #ffc107;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.app-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app-content {
    padding: 1.25rem;
    flex: 1;
}

/* ---------- Responsif: confirm tidak terpotong di mobile ---------- */
@media (max-width: 991.98px) {
    .app-content { padding: 1rem; }
    .app-topbar { padding: .6rem 1rem; }
}

/* ---------- Offcanvas menu (mobile < lg) ---------- */
.app-offcanvas {
    width: 260px;
    background: linear-gradient(180deg, #0b2d6b 0%, #0d6efd 100%);
    color: #fff;
}
.app-offcanvas .offcanvas-body { padding: 0 .5rem .5rem; }
.app-offcanvas .nav-link {
    color: rgba(255,255,255,.85);
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-left: 3px solid transparent;
    border-radius: .5rem;
    margin: .1rem 0;
}
.app-offcanvas .nav-link i { font-size: 1.15rem; }
.app-offcanvas .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.app-offcanvas .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.16);
    border-left-color: #ffc107;
}
.app-offcanvas .brand { padding: .5rem 1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.15); }

/* ---------- Kartu statistik ---------- */
.stat-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 14px rgba(13,110,253,.10);
}
.stat-card .icon {
    width: 52px;
    height: 52px;
    border-radius: .75rem;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #fff;
}

/* ---------- Halaman login ---------- */
.bg-auth {
    background: linear-gradient(135deg, #0b54d8 0%, #0d6efd 55%, #59a1ff 100%);
    min-height: 100vh;
}

/* ---------- Halaman OPERATOR (mobile-first) ---------- */
.opt-timer {
    font-size: clamp(4rem, 18vw, 7rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.opt-btn {
    padding: 1.1rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: .9rem;
}
.countdown-input {
    width: 110px;
    text-align: center;
}

/* ---------- Halaman DISPLAY (full screen TV) ---------- */
.display-page {
    background: radial-gradient(circle at top, #0d4c9e 0%, #062b63 70%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.display-timer {
    font-size: clamp(6rem, 20vw, 14rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 6px 24px rgba(0,0,0,.4);
}

/* Countdown 5 detik terakhir: merah + pulse */
.countdown-danger {
    color: #ff3b3b !important;
    animation: countdown-pulse 1s ease-in-out infinite;
}
@keyframes countdown-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
/* Banner petunjuk aktifkan suara (autoplay) */
#disp-audio-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(0,0,0,.78);
    color: #ffd43b;
    border: 1px solid rgba(255,212,59,.5);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    animation: countdown-pulse 1.2s ease-in-out infinite;
}
.result-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 2rem;
    backdrop-filter: blur(2px);
}
.rank-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background: rgba(255,255,255,.08);
    border-radius: 1rem;
    padding: .9rem 1.2rem;
}
.rank-badge {
    min-width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    background: rgba(255,255,255,.15);
    border: 2px solid #fff;
}
.rank-badge.top { background: #ffc107; color:#212529; border-color:#ffc107; }
.rank-badge.so2 { background: #b8c4d0; color:#212529; border-color:#b8c4d0; }
.rank-badge.so3 { background: #cd7f32; color:#fff; border-color:#cd7f32; }

/* Daftar ranking 1 box (Display) */
.rank-list-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 1.2rem;
    padding: .4rem 1rem;
    max-width: 1100px;
    margin: 0 auto 1.5rem;
}
.rank-row-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: .8rem .6rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.rank-row-item:last-child { border-bottom: none; }
.rank-row-item .rb-badge {
    min-width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    background: rgba(255,255,255,.15);
    border: 2px solid #fff;
}
.rank-row-item .rb-badge.top { background: #ffc107; color:#212529; border-color:#ffc107; }
.rank-row-item .rb-badge.so2 { background: #b8c4d0; color:#212529; border-color:#b8c4d0; }
.rank-row-item .rb-badge.so3 { background: #cd7f32; color:#fff; border-color:#cd7f32; }
.rank-row-item .rb-nama {
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;
}
.rank-row-item .rb-atas {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #ffd76a;
    font-weight: 700;
    margin-top: .2rem;
}
.rank-row-item .rb-time {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Kotak total (peserta & botol) di Display */
.disp-total-card {
    background: rgba(255,255,255,.1);
    border: 2px solid rgba(255,255,255,.22);
    border-radius: 1.4rem;
    padding: 1.3rem 1rem;
    text-align: center;
}
.disp-total-card .dt-label {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #ffd76a;
    font-weight: 700;
}
.disp-total-card .dt-value {
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    font-weight: 900;
    line-height: 1.1;
}

/* ---------- Umum ---------- */
.table-white { background:#fff; border-radius:1rem; overflow:hidden; }
.table-white thead th { background:#f8fafc; border-bottom:2px solid #e2e8f0; white-space:nowrap; }
.small-nowrap { white-space: nowrap; }
.logo-header { height: 56px; }