* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --line: #e1e4e8;
    --text: #202124;
    --muted: #6b7280;
    --primary: #586174;
    --primary-strong: #424a58;
    --success: #2f6a4f;
    --danger: #a33a2f;
    --warning: #a7641b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f5f7;
    color: var(--text);
    line-height: 1.5;
}

header {
    background: var(--primary);
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--line);
}
header h1 { font-size: 1.25rem; }
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.eyebrow {
    color: rgba(255,255,255,0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.subtitle { font-size: 0.86rem; color: rgba(255,255,255,0.78); margin-top: 0.2rem; }
.userbar { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.userbar button {
    border: 1px solid rgba(255,255,255,0.24);
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border-radius: 6px;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
}

/* ===== Sistem tombol GLOBAL (satu-satunya) — .button + modifier =====
   Pakai: <button class="button button--primary">  /  button--secondary  /
   button--danger  /  button--small. JANGAN bikin kelas tombol sendiri. */
.button {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    font: inherit;
    background: var(--surface-strong);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
}
.button--primary { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.button--primary:hover { background: var(--primary-strong); }
.button--secondary { background: var(--surface-strong); color: var(--text); }
.button--danger { background: #fff; color: var(--danger); border-color: rgba(163, 58, 47, 0.28); }
.button--danger:hover { background: #ffebee; }
.button--small { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
/* Tombol IKON-saja (aksi di grid) — label jadi tooltip (title/aria-label) */
.button--icon { padding: 0.32rem; width: 30px; height: 30px; justify-content: center; }
.button--icon svg { display: block; }
.button--icon.button--small { width: 28px; height: 28px; padding: 0.28rem; }

main { max-width: 1360px; margin: 1rem auto; padding: 0 1rem; }

.tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 0.35rem;
    flex-wrap: wrap;
}
.tab {
    padding: 0.62rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--muted);
}
.tab.active {
    color: #ffffff;
    background: var(--primary);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content.stack { display: none; }
.tab-content.active.stack { display: grid; }

h2 { margin-bottom: 0.5rem; font-size: 1.2rem; }
h3 { margin-top: 1rem; margin-bottom: 0.5rem; font-size: 1rem; }
/* Keterangan abu-abu di bawah judul disembunyikan (hemat tinggi) — hanya judul */
section p { display: none; }

form { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
/* Input GLOBAL — SATU gaya utk semua (termasuk waktu/tanggal). Tinggi seragam. */
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="month"], input[type="week"],
input[type="search"], input[type="file"], input[type="number"], input[type="tel"], select, textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--text);
    height: 38px;
    box-sizing: border-box;
    line-height: 1.2;
    vertical-align: middle;
}
textarea { height: auto; }
input[type="file"] { height: auto; padding: 0.4rem 0.6rem; }
/* ikon kalender kotak waktu/tanggal ikut warna teks */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }
/* Fokus ring seragam (sama seperti input grid) */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 97, 116, 0.12);
}
button[type="submit"] {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    align-self: flex-start;
}
button[type="submit"]:hover { background: var(--primary-strong); }
button[type="submit"]:disabled { background: #ccc; cursor: not-allowed; }

.stack {
    display: grid;
    gap: 0.7rem;
}
.hidden { display: none !important; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    padding: 0.8rem 1rem;
}
.hero-panel,
.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.grid-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}
.employee-editor { width: 100%; }
.form-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.75rem;
}
.form-title h3 { margin: 0; }
.grid-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}
.grid-form label.wide { grid-column: span 2; }
.grid-form label.check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
}
/* Footer aksi form: baris sendiri (span penuh), box beda warna, tombol rata kanan */
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem -1rem -1rem;
    padding: 0.7rem 1rem;
    background: #f4f5f7;
    border-top: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
}
.form-actions .button { padding: 0.5rem 0.85rem; align-self: center; }
.form-actions .button svg { flex-shrink: 0; }

/* ===== MODAL / POPUP GLOBAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(17, 20, 24, 0.45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 4vh 1rem; z-index: 1000; overflow-y: auto;
}
.modal-box {
    background: var(--surface); width: 100%; border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28); max-height: 92vh; overflow: auto;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-close {
    border: none; background: transparent; cursor: pointer; color: var(--muted);
    display: inline-flex; padding: 4px; border-radius: 6px;
}
.modal-close:hover { background: #f0f0f2; color: var(--text); }
.modal-body { padding: 1rem; }
/* form karyawan di dalam modal (bukan panel lagi) */
.employee-editor { padding: 1rem; }

/* Kartu wajah enrolled (popup lihat detail) — thumbnail biar bisa dibedakan */
.enroll-face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.enroll-face { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.enroll-face img { width: 100%; height: 108px; object-fit: cover; display: block; background: #f4f4f5; }
.enroll-face__noimg { height: 108px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--muted); text-align: center; background: #f4f4f5; padding: 4px; }
.enroll-face figcaption { padding: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 0.75rem; }
.enroll-face__kind { text-transform: uppercase; font-weight: 700; color: var(--success); }
.enroll-face__kind.is-adaptif { color: var(--warning); }
.enroll-face__date { color: var(--muted); }
.list-panel {
    min-width: 0;
}
.list-panel .panel-header { margin-bottom: 0.5rem; }
.list-panel input[type="search"] {
    width: min(360px, 100%);
}
.toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.live-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.live-controls button {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.live-controls button:disabled { background: #c7c7cc; cursor: not-allowed; }
.live-controls #live-stop { background: var(--danger); }
.live-controls #live-flip { background: #6b7280; }
.live-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.live-controls input[type="number"] {
    width: 5.5rem;
    padding: 0.4rem;
}
.live-stage {
    position: relative;
    max-width: 760px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.live-stage video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.live-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.live-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    min-height: 1.5em;
}
.live-status.matched { color: #2e7d32; font-weight: 600; }
.live-status.spoof { color: #c62828; font-weight: 600; }
.live-status.unknown { color: #ef6c00; }

.track-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.track-card {
    background: white;
    border: 1px solid var(--line);
    border-left: 4px solid #9e9e9e;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
}
.track-card div:first-child {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.muted { color: var(--muted); }
.track-acc {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.enroll-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.enroll-thumb {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: white;
    width: 140px;
}
.enroll-thumb img {
    display: block;
    width: 100%;
    height: 100px;
    object-fit: cover;
}
.enroll-thumb-label {
    padding: 0.35rem 0.5rem;
    font-size: 0.74rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
.db-pill, .status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f0f0f2;
    color: #3a3a3c;
}
.status-active { background: #e5f2eb; color: var(--success); }
.status-muted { background: #eee; color: #666; }
.status-warn { background: #fff3d8; color: var(--warning); }
.status-info { background: #e4eefb; color: #2563a8; }

/* Ringkasan status enroll per karyawan */
.enroll-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
}
.enroll-summary__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #555;
}
.enroll-summary__num {
    display: inline-flex;
    min-width: 1.9rem;
    justify-content: center;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-weight: 800;
    background: #f0f0f2;
    color: #3a3a3c;
}
.status-approved { background: #e5f2eb; color: var(--success); }
.status-pending { background: #fff3d8; color: var(--warning); }
.status-rejected { background: #f8e1df; color: var(--danger); }
.lock-note {
    align-self: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}
.row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.45rem 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.data-table th { background: #f5f5f7; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.protected-row { background: #fafafa; }

/* ===== GRID GLOBAL — filter per-kolom + sort + pagination + kolom aksi ===== */
.data-table.grid th.grid-sortable { cursor: pointer; user-select: none; }
.data-table.grid th.grid-sortable:hover { background: #eceef1; }
.grid-arrow { font-size: 0.75rem; opacity: 0.28; }
.data-table.grid thead tr.filter-row th {
    background: #fbfbfc; text-transform: none; padding: 0.4rem 0.5rem; vertical-align: top;
}
.grid-ftxt, .grid-fsel, .grid-fdate input {
    width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 5px;
    padding: 0.32rem 0.45rem; font: inherit; font-size: 0.8rem; background: #fff; color: var(--text);
}
.grid-ftxt:focus, .grid-fsel:focus, .grid-fdate input:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88,97,116,0.12);
}
.grid-ftxt::placeholder { color: var(--muted); }
.grid-fdate { display: flex; gap: 4px; }
.grid-ftxt, .grid-fsel { min-width: 90px; }
.data-table.grid td.tbl-action-col, .data-table.grid th.tbl-action-col {
    width: 1%; white-space: nowrap; text-align: right;
}
.grid-empty { text-align: center; color: var(--muted); padding: 1.4rem; }
.grid-pagination {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
    padding: 0.6rem 0.2rem; font-size: 0.82rem; color: var(--muted);
}
.grid-page-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.grid-page {
    min-width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
    background: #fff; color: var(--text); cursor: pointer; font: inherit; font-size: 0.8rem;
}
.grid-page.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.grid-page:disabled { opacity: 0.4; cursor: not-allowed; }

.result { margin-top: 1rem; padding: 1rem; border-radius: 6px; background: #f8f8f8; border-left: 4px solid #ddd; }
.result.matched { background: #e8f5e9; border-left-color: #4caf50; }
.result.high { background: #c8e6c9; border-left-color: #2e7d32; }
.result.unknown { background: #fff3e0; border-left-color: #ff9800; }
.result.spoof { background: #ffebee; border-left-color: #f44336; }
.result.error { background: #ffebee; border-left-color: #f44336; color: #c62828; }

.face-card {
    background: white;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    border: 1px solid #eee;
}
.face-card h4 { font-size: 0.95rem; margin-bottom: 0.5rem; }

.score-row { display: flex; justify-content: space-between; font-size: 0.85rem; margin: 0.4rem 0 0.1rem; }
.score-bar {
    background: #eee;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.score-bar .fill {
    height: 100%;
    background: #007aff;
    transition: width 0.3s;
}
.score-bar.spoof .fill { background: #f44336; }
.score-bar.quality .fill { background: #4caf50; }

.frame-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}
.frame-table th, .frame-table td {
    padding: 0.4rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.frame-table th { background: #f0f0f0; font-weight: 600; }
.frame-table tr.matched { background: #f1f8e9; }
.frame-table tr.spoof { background: #fbe9e7; }

button:disabled { opacity: 0.45; cursor: not-allowed; }

.loading { color: #666; font-style: italic; padding: 1rem; }

footer {
    max-width: 1360px;
    margin: 2rem auto 1rem;
    padding: 0 1rem;
    color: #999;
    font-size: 0.8rem;
    text-align: center;
}

details { margin-top: 0.5rem; font-size: 0.82rem; }
details summary { cursor: pointer; color: #666; }
details pre { background: #fafafa; padding: 0.5rem; border-radius: 4px; margin-top: 0.3rem; overflow-x: auto; }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f5f7;
}
.login-shell { width: min(440px, calc(100% - 32px)); margin: 0; padding: 0; }
.login-header {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary-strong);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
}
.login-header h1 {
    font-size: 1.2rem;
    margin-top: 0.1rem;
}
.login-header .subtitle {
    color: rgba(255,255,255,0.78);
    margin-top: 0.2rem;
}
.login-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 18px 44px rgba(32, 33, 36, 0.08);
}
.login-panel h1 { margin-bottom: 0.35rem; }
.login-panel .subtitle { color: var(--muted); margin-bottom: 1rem; }
.login-panel form { display: grid; margin-top: 1rem; }
.login-provider-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.login-provider-row h2 {
    font-size: 1rem;
    margin: 0 0 0.15rem;
}
.login-provider-row p {
    color: var(--muted);
    font-size: 0.86rem;
}
.status-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary);
    background: #f8f9fb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.28rem 0.55rem;
}
.google-area {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin-top: 1.45rem;
}

@media (max-width: 760px) {
    .app-header, .panel-header { flex-direction: column; }
    .master-layout { grid-template-columns: 1fr; }
    .employee-editor { position: static; }
    .grid-form { grid-template-columns: 1fr; }
    .grid-form label.wide { grid-column: auto; }
    .form-actions { align-items: start; }
}

/* Mode Gerbang + Laporan (v=20260704) */
.gate-log { display: flex; flex-direction: column; gap: 2px; }
.gate-log-row { padding: 4px 8px; border-radius: 4px; font-size: 0.9rem; background: #f4f4f5; }
.gate-log-row.ok { background: #dcfce7; color: #166534; font-weight: 600; }
.gate-log-row.dup { background: #fef9c3; color: #854d0e; }
.gate-log-row.err { background: #fee2e2; color: #991b1b; }
.badge-late { background: #fee2e2; color: #991b1b; padding: 1px 6px; border-radius: 4px; font-weight: 600; font-size: 0.8rem; }
.muted { color: #71717a; }

/* Toast gerbang overlay (Iterasi 3 S3) */
.gate-toast-wrap { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.gate-toast { min-width: 220px; max-width: 320px; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transform: translateX(40px); transition: opacity .25s, transform .25s; }
.gate-toast.show { opacity: 1; transform: translateX(0); }
.gate-toast__title { font-weight: 700; font-size: 1.1rem; }
.gate-toast__sub { font-size: .85rem; opacity: .85; margin-top: 2px; }
.gate-toast--ok { background: #16a34a; color: #fff; }
.gate-toast--dup { background: #eab308; color: #422006; }
.gate-toast--err { background: #6b7280; color: #fff; }
.gate-toast--fallback { background: #dc2626; color: #fff; }

/* Sesi absen + zona SAP (v=20260704-3) */
.gate-session { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 12px; background:#f4f4f5; border-radius:8px; }
.gate-session-btns { display:flex; gap:8px; flex-wrap:wrap; }
.gate-session-badge { font-weight:700; padding:3px 10px; border-radius:6px; }
.gate-session-badge.closed { background:#e5e7eb; color:#4b5563; }
.gate-session-badge.open-masuk { background:#16a34a; color:#fff; }
.gate-session-badge.open-pulang { background:#2563eb; color:#fff; }
.sap-zones { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.sap-zone { border:2px solid #e5e7eb; border-radius:10px; padding:10px; min-height:74px; text-align:center; transition:background .2s,border-color .2s; }
.sap-zone__label { font-size:.75rem; font-weight:700; color:#71717a; letter-spacing:.04em; }
.sap-zone__body { margin-top:4px; font-size:.95rem; }
.sap-name { font-weight:700; }
.sap-sub { font-size:.78rem; opacity:.8; }
.sap-zone--ok { background:#dcfce7; border-color:#16a34a; }
.sap-zone--dup { background:#f4f4f5; border-color:#a1a1aa; color:#52525b; }
.sap-zone--fallback { background:#fee2e2; border-color:#dc2626; }

/* Kontrol Gerbang (tab admin, v=20260704-4) */
.gerbang-status { font-size:1.1rem; margin-bottom:.75rem; }
.gerbang-badge { font-weight:800; padding:4px 12px; border-radius:6px; }
.gerbang-badge.closed { background:#e5e7eb; color:#4b5563; }
.gerbang-badge.open-masuk { background:#16a34a; color:#fff; }
.gerbang-badge.open-pulang { background:#2563eb; color:#fff; }
.gerbang-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* Sub-tab laporan + badge sesi lembur (v=20260704-5) */
.sub-tabs { display:flex; gap:6px; margin-top:.75rem; }
.sub-tab { padding:5px 14px; border:1px solid #d4d4d8; background:#fff; border-radius:999px; cursor:pointer; font-size:.9rem; }
.sub-tab.active { background:#334155; color:#fff; border-color:#334155; }
.gerbang-badge.open-lembur { background:#ea580c; color:#fff; }
#laporan-count { margin-top:.5rem; font-size:.85rem; }

/* Galeri bukti foto (v=20260704-13) */
.bukti-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.bukti-item { margin:0; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; background:#fff; }
.bukti-item img { width:100%; height:150px; object-fit:cover; display:block; background:#f4f4f5; }
.bukti-item figcaption { padding:6px 8px; font-size:.8rem; line-height:1.3; }

/* RBAC (v=20260704-14) */
.rbac-perms { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:10px; }
.rbac-group { border:1px solid #e5e7eb; border-radius:8px; padding:8px 10px; }
.rbac-group legend { font-weight:700; font-size:.85rem; padding:0 4px; }
.rbac-group .check { display:block; font-size:.85rem; margin:2px 0; }
.rbac-group code { font-size:.75rem; color:#71717a; }

/* Header nav dropdown (v=20260704-17) */
.app-header { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.brand h1 { font-size:1.15rem; margin:0; white-space:nowrap; }
.topnav { display:flex; gap:2px; flex-wrap:wrap; flex:1; justify-content:center; }
.navgroup { position:relative; }
.navgroup-btn { background:transparent; border:none; padding:8px 12px; cursor:pointer; font-weight:600; border-radius:6px; font-size:.92rem; color:inherit; }
.navgroup-btn:hover, .navgroup.open .navgroup-btn { background:rgba(120,120,120,.15); }
.navgroup-menu { position:absolute; top:calc(100% + 3px); left:0; min-width:190px; background:#fff; border:1px solid #e5e7eb; border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.16); padding:5px; display:none; z-index:100; }
.navgroup.open .navgroup-menu { display:block; }
.navgroup-menu .tab { display:block; width:100%; text-align:left; background:transparent; border:none; padding:9px 12px; cursor:pointer; border-radius:7px; font-size:.9rem; color:#1f2937; }
.navgroup-menu .tab:hover { background:#f4f4f5; }
.navgroup-menu .tab.active { background:#334155; color:#fff; }
.userbar { margin-left:auto; display:flex; align-items:center; gap:10px; }

/* Banner impersonate ("lihat sebagai user lain") */
#imp-banner {
    position: sticky; top: 0; z-index: 1500;
    display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
    background: #b45309; color: #fff; padding: 0.5rem 1rem; font-size: 0.9rem;
}
#imp-banner .button { background: #fff; color: #b45309; border-color: #fff; font-weight: 700; }
