:root {
    --brand-primary: #2563eb;
    --brand-primary-dark: #1e40af;
    --sidebar-width: 250px;
}

body {
    background-color: #f4f6fb;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Auth ---------- */
.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(30, 64, 175, 0.82) 0%, rgba(37, 99, 235, 0.75) 100%),
        url('../images/gedung-bkpsdm.jpg') center center / cover no-repeat;
}
.auth-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
}
.auth-logo {
    width: 84px; height: 84px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}
.auth-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
}

/* ---------- Admin Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #111827;
    color: #e5e7eb;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
}
/* Scrollbar tipis khusus sidebar, supaya tidak mengganggu tampilan gelap */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }

.sidebar-brand {
    padding: 20px;
    font-weight: 700;
    font-size: 18px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    background: #111827;
    z-index: 1;
}
.sidebar-logo {
    width: 34px; height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}
.sidebar-menu { list-style: none; padding: 12px 0; margin: 0; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14.5px;
    transition: background 0.15s;
}
.sidebar-menu li a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-menu li a.text-danger:hover { background: rgba(220,38,38,0.15); }

.main-content { margin-left: var(--sidebar-width); }
.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.sidebar-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ---------- Peserta (mobile-first) ---------- */
.topbar-peserta {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky; top: 0; z-index: 1020;
}
.topbar-logo {
    width: 28px; height: 28px;
    object-fit: contain;
}
.pb-nav { padding-bottom: 76px; }

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1030;
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #6b7280;
    text-decoration: none;
    flex: 1;
}
.bottom-nav a i { font-size: 20px; }
.bottom-nav a:hover, .bottom-nav a:active { color: var(--brand-primary); }

/* ---------- Stat cards ---------- */
.stat-card {
    border-radius: 14px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

/* ---------- Kamera pendaftaran wajah / absensi ---------- */
/* Browser secara default me-mirror video dari kamera depan (facingMode: user)
   agar terasa seperti bercermin. Transform di bawah ini membalik ulang
   tampilan preview supaya terlihat normal (tidak mirror). Ini HANYA mengubah
   tampilan di layar — foto/descriptor yang disimpan ke server tetap diambil
   dari stream asli, jadi tidak terpengaruh. */
#video {
    transform: scaleX(-1);
}

/* ---------- Notifikasi ---------- */
.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    line-height: 1;
}
.notif-dropdown {
    width: 320px;
    max-width: 90vw;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: none;
    overflow: hidden;
}
.notif-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.notif-unread { background: #eff6ff; }
.notif-item.notif-unread:hover { background: #dbeafe; }

/* ---------- Form aksi inline (toggle status, hapus, dsb) ---------- */
/* Dipakai supaya tombol aksi yang sekarang dibungkus <form> (untuk proteksi CSRF)
   tetap sejajar rapi dengan tombol/link lain di baris yang sama. */
form.d-inline { margin: 0; }

/* ---------- Dropdown Jam/Menit (jadwal kerja per hari, 24 jam WIB) ---------- */
.time-select-wrap .time-select {
    width: 68px;
    min-width: 68px;
    padding-left: 8px;
    padding-right: 4px;
}
.jadwal-hari-table td, .jadwal-hari-table th {
    vertical-align: middle;
}
.jadwal-hari-row.text-muted .time-select {
    background-color: #f8fafc;
}

/* ---------- Thumbnail foto absensi (Data Absensi admin) ---------- */
.foto-absensi-thumb {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s;
    display: inline-block;
}
.foto-absensi-thumb:hover {
    transform: scale(1.08);
    border-color: #94a3b8;
}
