/* ==========================================================================
   Sentra Fresh — stylesheet utama
   ========================================================================== */
:root {
    --bg: #f4f6f1;
    --surface: #ffffff;
    --surface-2: #f8faf6;
    --ink: #17231c;
    --ink-2: #3a4a40;
    --muted: #6b7a70;
    --line: #e2e8df;
    --line-2: #eef2ec;
    --primary: #1d7447;
    --primary-600: #165c38;
    --primary-50: #e8f4ec;
    --primary-100: #cfe7d8;
    --accent: #ef8a2b;
    --accent-50: #fdf1e5;
    --danger: #c9423b;
    --danger-50: #fbeceb;
    --warning: #b7791f;
    --warning-50: #fdf5e2;
    --info: #2c6aa6;
    --info-50: #e9f1f9;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(23, 35, 28, .05), 0 4px 16px rgba(23, 35, 28, .05);
    --sidebar-w: 248px;
    --topbar-h: 60px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--primary); }
.text-warning { color: var(--warning); }
.hidden { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
    background: #10261a; color: #cfe0d5; display: flex; flex-direction: column;
    transition: transform .2s ease, width .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; height: var(--topbar-h); border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.brand-text { line-height: 1.15; overflow: hidden; }
.brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .02em; }
.brand-text span { font-size: 11px; color: #8fb09c; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6f917d; padding: 0 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #cfe0d5; font-weight: 500; margin-bottom: 1px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link .icon { opacity: .9; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #8fb09c; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px; padding: 0 24px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-store { font-size: 12px; color: var(--muted); font-weight: 500; }
.topbar .menu-toggle { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; font: inherit; color: inherit; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 11.5px; color: var(--muted); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }

.content { padding: 24px; width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; }
.support-banner { background: var(--accent); color: #fff; padding: 8px 24px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 13px; flex-wrap: wrap; }
.support-banner form { margin-left: auto; }
.support-banner .btn { background: #fff; color: #9a4f0b; border-color: #fff; }

.bottom-nav { display: none; }
.backdrop { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Card / panel ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

/* Statistik: satu strip, bukan banyak kartu */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.stat { padding: 16px 18px; border-right: 1px solid var(--line-2); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-accent .stat-value { color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px;
    cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #cfd8cc; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #d9771c; border-color: #d9771c; }
.btn-danger { background: var(--surface); border-color: #efc9c6; color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.req { color: var(--danger); }
.input, .select, .textarea {
    width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid #d5ddd2; background: #fff; color: var(--ink); font: inherit; font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a70' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input[readonly] { background: var(--surface-2); }
.input-sm { height: 32px; font-size: 13px; }
.field-error { font-size: 12px; color: var(--danger); }
.has-error .input, .has-error .select { border-color: var(--danger); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid #d5ddd2; border-left: 0; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-group .addon-left { border-left: 1px solid #d5ddd2; border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon-left + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; }

/* Filter bar */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.filters .field { flex: 1 1 150px; max-width: 240px; }
.filters .field.grow { max-width: 340px; flex: 2 1 220px; }
.filters .field label { font-size: 11.5px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafcf8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.table-sm th, .table-sm td { padding: 7px 10px; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--primary-50); flex: none; display: grid; place-items: center; color: var(--primary); font-weight: 700; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.row-inactive td { color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--primary-50); color: var(--primary-600); }
.badge-warning { background: var(--warning-50); color: #93600f; }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: #eef0ec; color: #5e6b62; }
.badge-accent { background: var(--accent-50); color: #b05d10; }

/* ---------- Alerts / flash ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-600); }
.alert-error { background: var(--danger-50); border-color: #f1cdca; color: #a23630; }
.alert-warning { background: var(--warning-50); border-color: #f3dfb0; color: #7c520d; }
.alert-info { background: var(--info-50); border-color: #cfe0f0; color: var(--info); }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pages a, .pages span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); background: #fff; font-weight: 600; }
.pages a:hover { background: var(--surface-2); text-decoration: none; }
.pages .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pages .gap { border: 0; background: none; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: #b4c2b8; margin: 0 auto 10px; display: block; }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Detail list ---------- */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Modal (dialog) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(520px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog.modal::backdrop { background: rgba(16, 38, 26, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* Grafik batang sederhana */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 38px; background: var(--primary-100); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.chart-col:hover .chart-bar { background: var(--primary); }
.chart-col.today .chart-bar { background: var(--primary); }
.chart-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-col[data-tip]:hover::after { content: attr(data-tip); position: absolute; transform: translateY(-190px); background: var(--ink); color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-aside { background: #10261a; color: #dcebe1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside h2 { font-size: 30px; color: #fff; max-width: 420px; line-height: 1.2; margin-top: 18px; }
.auth-aside p { color: #9fbfab; max-width: 400px; margin-top: 12px; font-size: 15px; }
.auth-fruits { position: absolute; right: -60px; bottom: -60px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f6a44f, var(--accent) 60%); opacity: .95; }
.auth-fruits::after { content: ""; position: absolute; width: 60px; height: 30px; background: #3fa86b; border-radius: 60px 0; top: 20px; left: 150px; transform: rotate(-25deg); }
.auth-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.auth-list li { display: flex; gap: 10px; align-items: center; color: #cfe0d5; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .form-stack { display: grid; gap: 14px; margin-top: 24px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-row .brand-text strong { color: inherit; font-size: 17px; }
.brand-row .brand-text span { color: var(--muted); }
.auth-aside .brand-row .brand-text strong { color: #fff; }
.auth-aside .brand-row .brand-text span { color: #8fb09c; }

/* ---------- Error page ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--primary); letter-spacing: -.04em; }

/* ---------- Jadwal (kalender tabel) ---------- */
.schedule-wrap { overflow: auto; max-height: calc(100vh - 260px); border-top: 1px solid var(--line-2); }
.schedule { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.schedule th, .schedule td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; text-align: center; min-width: 38px; height: 38px; }
.schedule thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-weight: 600; color: var(--muted); padding: 4px 2px; line-height: 1.15; }
.schedule thead th.weekend { color: var(--danger); }
.schedule thead th.is-today { background: var(--primary-50); color: var(--primary); }
.schedule .emp { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 6px 12px; min-width: 170px; max-width: 200px; }
.schedule thead .emp { z-index: 3; background: var(--surface-2); }
.schedule .emp strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule .emp span { font-size: 11px; color: var(--muted); }
.sched-cell { width: 100%; height: 38px; border: 0; background: transparent; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.sched-cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.sched-cell.off { color: #9aa79f; background: repeating-linear-gradient(45deg, #f6f7f5, #f6f7f5 4px, #eff1ed 4px, #eff1ed 8px); }
.sched-cell.dirty { box-shadow: inset 0 -3px 0 var(--accent); }
.schedule td.is-today { background: #f7fbf8; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 11px; color: #fff; }
.shift-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.shift-picker button { border: 2px solid transparent; border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; color: #fff; }
.shift-picker button.active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* ---------- QR absensi ---------- */
.qr-stage { display: grid; place-items: center; gap: 14px; padding: 28px 20px; text-align: center; }
.qr-box { background: #fff; padding: 16px; border-radius: 16px; border: 1px solid var(--line); width: min(360px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.qr-box canvas, .qr-box img, .qr-box svg { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-timer { width: min(360px, 80vw); height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.qr-timer span { display: block; height: 100%; background: var(--accent); width: 100%; transition: width .2s linear; }
.qr-clock { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fullscreen-qr { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center; }
.scanner { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; background: #0d1a12; border-radius: 16px; overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scan-result { text-align: center; padding: 24px; }
.scan-result .icon { width: 56px; height: 56px; margin: 0 auto 12px; display: block; }

/* ---------- Employee home ---------- */
.today-card { background: #10261a; color: #dcebe1; border-radius: 14px; padding: 22px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.today-card h2 { color: #fff; font-size: 22px; margin-top: 4px; }
.today-card .muted { color: #9fbfab; }
.day-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; background: #fff; }
.day small { display: block; color: var(--muted); font-size: 11px; }
.day strong { display: block; font-size: 16px; }
.day .pill { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: #fff; }
.day.is-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }

/* ---------- Mobile / tablet ---------- */
@media (max-width: 1100px) and (min-width: 761px) {
    :root { --sidebar-w: 72px; }
    .sidebar-brand { justify-content: center; padding: 14px 0; }
    .brand-text, .nav-label, .nav-link span, .sidebar-foot { display: none; }
    .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
    .nav-link { justify-content: center; padding: 10px 0; position: relative; }
    .nav-link:hover::after { content: attr(data-title); position: absolute; left: calc(100% + 10px); background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 50; }
}
@media (max-width: 1100px) {
    .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    body { font-size: 14px; }
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
    .main { margin-left: 0; padding-bottom: 68px; }
    .topbar .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 12px; gap: 8px; }
    .user-meta { display: none; }
    .content { padding: 16px 12px; }
    .support-banner { padding: 8px 12px; }
    .page-head { margin-bottom: 14px; align-items: flex-start; }
    .page-head h1 { font-size: 18px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .card-body { padding: 14px; }
    .card-head { padding: 12px 14px; }
    .filters { padding: 10px 14px; }
    .filters .field { max-width: none; flex: 1 1 45%; }
    .filters .btn { flex: 1; }
    .dl { grid-template-columns: 1fr; gap: 2px; }
    .dl dd { margin-bottom: 10px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { border-bottom: 1px solid var(--line-2); padding: 12px 14px; }
    .stat:nth-child(2n) { border-right: 0; }
    .stat-value { font-size: 18px; }
    .table th, .table td { padding: 9px 10px; }
    /* Tabel responsif: tampil sebagai kartu */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
    .table-cards td { border: 0; padding: 3px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .table-cards td::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; flex: none; }
    .table-cards td.actions { justify-content: flex-end; padding-top: 6px; }
    .table-cards td.actions::before, .table-cards td[data-label=""]::before { content: none; }
    .table-cards td.cell-main { justify-content: flex-start; text-align: left; }
    .table-cards td.cell-main::before { content: none; }
    .table-cards tfoot, .table-cards tfoot tr, .table-cards tfoot td { display: block; }
    .bottom-nav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: #fff; border-top: 1px solid var(--line); height: 62px; padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; padding: 0; line-height: inherit; }
    .bottom-nav a:hover { text-decoration: none; }
    .bottom-nav .active { color: var(--primary); }
    .bottom-nav .icon { width: 21px; height: 21px; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .day-list { gap: 4px; }
    .day strong { font-size: 14px; }
}

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
    @page { margin: 12mm; }
    body { background: #fff; font-size: 11.5px; }
    .sidebar, .topbar, .bottom-nav, .no-print, .page-actions, .filters, .pagination, .support-banner, .alert, .backdrop { display: none !important; }
    .main { margin: 0; padding: 0; }
    .content { padding: 0; max-width: none; }
    .card { border: 0; }
    .card-head { padding: 0 0 8px; }
    .card-body { padding: 0; }
    .table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table th, .table td { padding: 5px 6px; border-bottom: 1px solid #ccc; }
    .table-wrap { overflow: visible; }
    .print-only { display: block; }
    .stats { border: 1px solid #ccc; }
    .schedule-wrap { max-height: none; overflow: visible; }
    a { color: inherit; }
}

/* Select dengan tombol aksi di sampingnya (mis. tambah kategori) */
.select-with-actions { display: flex; gap: 6px; }
.select-with-actions .select { flex: 1; min-width: 0; }
.manage-list { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 280px; overflow-y: auto; }
.manage-list li { padding: 8px 12px; }
