:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #1a2233;
  --muted: #667085;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8efff;
  --sidebar: #111827;
  --sidebar-text: #cbd5e1;
  --ok: #16a34a;     --ok-soft: #e7f7ec;
  --warn: #d97706;   --warn-soft: #fdf3e2;
  --info: #0891b2;   --info-soft: #e3f6fa;
  --violet: #7c3aed; --violet-soft: #f1ebfe;
  --danger: #dc2626; --danger-soft: #fde9e9;
  --gray-soft: #eef1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.25; }

/* ---------- Tombol & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field small { color: var(--muted); display: block; margin-top: 4px; }
input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { height: auto; min-height: 72px; padding: 8px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; margin-bottom: 18px; }
img.auth-logo, img.logo { display: block; object-fit: cover; }
img.logo { border-radius: 8px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 24px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Layout admin ---------- */
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; font-weight: 600; }
.brand .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.brand small { display: block; color: var(--sidebar-text); font-weight: 400; font-size: 12px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav svg, .btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.sidebar-foot .who { padding: 0 10px 10px; font-size: 13px; }
.sidebar-foot .who b { color: #fff; display: block; }
.sidebar-foot button { background: none; border: 0; color: var(--sidebar-text); font: inherit; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 9px 10px; width: 100%; border-radius: 8px; }
.sidebar-foot button:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }
.stack > * + * { margin-top: 18px; }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.bar-stack span { display: block; border-radius: 4px 4px 0 0; min-height: 0; }
.bar-stack span + span { border-radius: 0; }
.bar-col .day { font-size: 11px; color: var(--muted); }
.bar-col .num { font-size: 12px; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { color: var(--muted); font-size: 12px; }
td.actions { text-align: right; }
td.actions .btn + .btn { margin-left: 4px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; text-transform: capitalize; }
.b-hadir { background: var(--ok-soft); color: var(--ok); }
.b-terlambat { background: var(--warn-soft); color: var(--warn); }
.b-izin { background: #fef6d8; color: #a16207; }
.b-sakit { background: var(--violet-soft); color: var(--violet); }
.b-cuti { background: #f3ebe3; color: #7c4f2c; }
.b-alpha { background: var(--danger-soft); color: var(--danger); }
.b-belum, .b-off { background: var(--gray-soft); color: var(--muted); }
.b-libur { background: var(--danger-soft); color: var(--danger); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { margin: 0; min-width: 150px; }
.toolbar input[type=search] { min-width: 220px; }

/* ---------- QR ---------- */
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-stage { text-align: center; padding: 28px 20px; }
.qr-stage .company { font-size: 18px; font-weight: 600; }
.qr-stage .clock { font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.qr-stage .date { color: var(--muted); margin-bottom: 18px; }
.qr-box { width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--border); position: relative; }
.qr-box img { width: 100%; height: 100%; display: block; image-rendering: pixelated; transition: opacity .2s; }
.qr-box.loading img { opacity: .25; }
.countdown { width: min(100%, 380px); margin: 18px auto 0; }
.countdown .track { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.countdown .fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s linear; }
.countdown .fill.low { background: var(--warn); }
.countdown .txt { margin-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed ul { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.feed .meta { flex: 1; min-width: 0; }
.feed .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .meta span { color: var(--muted); font-size: 12px; }

/* Mode layar penuh untuk ditampilkan di monitor/tablet pintu masuk */
.qr-fullscreen { position: fixed; inset: 0; z-index: 50; background: var(--surface); display: grid; place-items: center; overflow: auto; }
.qr-fullscreen .qr-box { width: min(72vh, 88vw); }
.qr-fullscreen .countdown { width: min(72vh, 88vw); }
.qr-fullscreen .clock { font-size: 56px; }
.qr-fullscreen .exit { position: absolute; top: 16px; right: 16px; }
.qr-hours { margin: 14px 0 0; }
.qr-offline .qr-box { border-color: var(--danger); }
.qr-offline .countdown .txt { color: var(--danger); }

/* Halaman /layar (tab/jendela terpisah): QR mengisi layar, ukuran mengikuti jendela */
body.layar { background: var(--surface); min-height: 100vh; display: grid; place-items: center; }
body.layar.idle { cursor: none; }
.layar-stage { width: 100%; padding: 3vh 16px; }
.layar-stage .company { font-size: clamp(16px, 3vh, 28px); }
.layar-stage .clock { font-size: clamp(32px, 7vh, 72px); }
.layar-stage .date { margin-bottom: 2.5vh; }
.layar-stage .qr-box, .layar-stage .countdown { width: min(62vh, 90vw); }
.layar-stage .countdown { margin-top: 2.5vh; }
.layar-tools { position: fixed; top: 12px; right: 12px; display: flex; align-items: center; gap: 10px; }
.layar-status { font-size: 12px; color: var(--muted); background: var(--surface); padding: 4px 8px; border-radius: 8px; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; z-index: 100; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-head button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 340px; animation: slide .2s ease-out; }
.toast.error { background: var(--danger); }
body.member .toasts, body.mobile .toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); align-items: center; }

/* ---------- Halaman pasang aplikasi (/app) ---------- */
.install-card { max-width: 420px; text-align: center; }
.install-card .auth-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; }
.install-btn { height: 46px; font-size: 15px; margin-top: 4px; }
.seg-plain { margin: 4px 0 16px; }
.seg-plain button.active { background: linear-gradient(135deg, #3b82f6, #0563F5); box-shadow: 0 4px 12px rgba(5, 99, 245, .35); }
.os-info { margin: 0 0 10px; }
.steps { text-align: left; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 12px 38px; line-height: 1.55; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.ios-ico { width: 20px; height: 20px; vertical-align: -4px; color: var(--primary); }
.os-note { font-size: 13px; text-align: left; margin: 4px 0 0; }
.install-qr { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; text-align: left; color: var(--muted); font-size: 13px; }
.install-qr img { width: 110px; height: 110px; image-rendering: pixelated; flex-shrink: 0; }
.copy-row { display: flex; gap: 8px; margin-top: 16px; }
.copy-row input { flex: 1; min-width: 0; color: var(--muted); }
.copy-row .btn { height: 38px; }

/* ---------- iPhone / iPad ---------- */
/* Safari memperbesar halaman bila huruf input < 16px; layar miring: jauhkan isi dari notch */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px; }
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

.code-chip { display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; letter-spacing: .06em; background: var(--primary-soft); color: var(--primary); padding: 3px 8px; border-radius: 6px; margin-right: 4px; }
.code-chip.used { background: var(--gray-soft); color: var(--muted); }
.code-big { text-align: center; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 34px; font-weight: 700; letter-spacing: .12em; color: var(--primary); background: var(--primary-soft); border-radius: 12px; padding: 18px 12px; }
/* Tab geser Karyawan | Admin */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--primary-soft); border-radius: 999px; padding: 4px; margin-bottom: 22px; user-select: none; touch-action: pan-y; }
.seg button { position: relative; z-index: 1; height: 40px; border: 0; background: none; border-radius: 999px; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; transition: color .25s; }
.seg button.active { color: #fff; }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: linear-gradient(135deg, #3b82f6, #0563F5); box-shadow: 0 4px 12px rgba(5, 99, 245, .35); transition: transform .3s cubic-bezier(.4, 0, .2, 1); }
.seg[data-tab="admin"] .thumb { transform: translateX(100%); }
.tab-pane { animation: fade .25s ease-out; }
.wrong-tab { color: var(--danger); font-weight: 600; text-align: center; margin: 12px 0 0; animation: fade .25s ease-out; }
/* Baris atas kartu login/daftar: ikon sesuai tab (kiri) + tab geser */
.auth-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-top .seg { flex: 1; margin: 0; }
.tab-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: block; box-shadow: 0 4px 12px rgba(5, 99, 245, .25); }
.tab-icon.swap { animation: icon-in .25s ease-out; }
@keyframes icon-in { from { opacity: 0; transform: scale(.85); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: -4px 0 16px; cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; }
.night-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 2px; }
.night-field > label:first-child { font-weight: 500; margin-bottom: 8px; }
label.check.night-opt { align-items: flex-start; margin: 0 0 10px; }
label.check.night-opt input { margin-top: 3px; flex-shrink: 0; }
.night-opt small { color: var(--muted); }
.auth-card .foot { text-align: center; margin: 18px 0 0; color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.muted { color: var(--muted); }
.hint { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* ---------- Halaman member (mobile-first) ---------- */
body.member { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.m-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.m-header .avatar { width: 40px; height: 40px; font-size: 14px; }
.m-who { min-width: 0; }
.m-who b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-who span { color: var(--muted); font-size: 12px; }
.m-main { max-width: 520px; margin: 0 auto; padding: 16px; }
.m-main > * + * { margin-top: 14px; }

.m-hero { background: linear-gradient(160deg, #2563eb, #1e40af); color: #fff; border-radius: 18px; padding: 22px 18px 18px; text-align: center; box-shadow: 0 8px 24px rgba(37, 99, 235, .25); }
.m-greet { opacity: .85; font-size: 14px; }
.m-clock { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; margin-top: 2px; }
.m-date { opacity: .85; margin-bottom: 18px; }
.m-scan-btn { width: 100%; min-height: 58px; border: 0; border-radius: 14px; background: #fff; color: var(--primary); font: inherit; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; padding: 10px 16px; }
.m-scan-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.m-scan-btn:active { transform: scale(.98); }
.m-scan-btn:disabled { background: rgba(255, 255, 255, .18); color: #fff; cursor: default; transform: none; }
.m-scan-btn.done:disabled { background: rgba(22, 163, 74, .9); }
.m-scan-btn.secondary { margin-top: 10px; min-height: 48px; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .45); font-size: 15px; }
.m-shift { font-size: 12px; opacity: .8; margin-top: 12px; }

.m-today, .m-month, .m-profile { padding: 16px; }
.m-today-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.m-today-head a { font-size: 13px; text-decoration: none; }
.m-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-times div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.m-times span { display: block; color: var(--muted); font-size: 12px; }
.m-times b { font-size: 22px; font-variant-numeric: tabular-nums; }
.m-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.m-count b { display: block; font-size: 22px; }
.m-count span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }

.m-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.m-month-nav b { font-size: 16px; }
.m-month-nav .btn { width: 38px; font-size: 18px; }
.m-day { display: flex; gap: 14px; align-items: center; padding: 12px 14px; margin-bottom: 8px; }
.m-day-date { width: 44px; text-align: center; flex-shrink: 0; }
.m-day-date b { display: block; font-size: 20px; line-height: 1.1; }
.m-day-date span { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.m-day-body { display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-width: 0; }

.m-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.m-row:last-of-type { border-bottom: 0; }
.m-row span { color: var(--muted); }
.m-row b { text-align: right; word-break: break-word; }

.m-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.m-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 10px; color: var(--muted); text-decoration: none; font-size: 12px; }
.m-nav a svg { width: 22px; height: 22px; }
.m-nav a.active { color: var(--primary); font-weight: 600; }

.scanner { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame span { width: min(70vw, 300px); aspect-ratio: 1; border-radius: 20px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 3px solid rgba(255, 255, 255, .9); }
.scan-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(20px + env(safe-area-inset-top)) 20px 0; text-align: center; }
.scan-top b { display: block; font-size: 18px; margin-bottom: 4px; }
.scan-top span { font-size: 14px; opacity: .9; }
.scan-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; }
.scan-bottom .btn { height: 46px; padding: 0 18px; background: rgba(255, 255, 255, .95); border: 0; }

.result-card { max-width: 340px; padding: 26px 22px 20px; text-align: center; }
.result-card h3 { font-size: 18px; margin: 14px 0 6px; }
.result-card p { color: var(--muted); margin: 0 0 18px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.result-icon svg { width: 34px; height: 34px; }
.result-icon.ok { background: var(--ok-soft); color: var(--ok); }
.result-icon.warn { background: var(--warn-soft); color: var(--warn); }
.result-icon.fail { background: var(--danger-soft); color: var(--danger); }

/* ---------- Panel admin: tampilan HP (body.mobile) ---------- */
.ma-header, .ma-nav { display: none; }
body.mobile .desktop-only { display: none !important; }
body.mobile { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
/* Tinggi mengikuti isi agar ruang di bawah menu bawah ikut terhitung saat menggulir */
body.mobile, body.member { height: auto; min-height: 100%; }
body.mobile .sidebar, body.mobile .topbar, body.mobile .scrim { display: none !important; }
body.mobile .app { display: block; }
body.mobile .ma-nav { display: flex; }
body.mobile .ma-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.ma-header img { border-radius: 10px; flex-shrink: 0; }
.ma-head-text { min-width: 0; }
.ma-head-text b { display: block; font-size: 17px; }
.ma-head-text span { color: var(--muted); font-size: 12px; }
body.mobile .main { padding: 14px 14px 24px; max-width: 640px; margin: 0 auto; }
body.mobile .page-head { margin-bottom: 12px; }
body.mobile .page-head h1, body.mobile .page-head p { display: none; }
body.mobile .page-head:not(:has(.actions > :not(.desktop-only))) { display: none; }
body.mobile .page-head .actions { width: 100%; }
body.mobile .page-head .actions .btn { flex: 1; }
body.mobile .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
body.mobile .stat { padding: 12px 14px; }
body.mobile .stat .value { font-size: 24px; }
body.mobile .stat:first-child { grid-column: span 2; }
body.mobile .two-col, body.mobile .qr-layout { grid-template-columns: 1fr; gap: 14px; }
body.mobile .card-head { padding: 12px 14px; }
body.mobile .card-body { padding: 14px; }
body.mobile .stack > * + * { margin-top: 14px; }
body.mobile .grid-2 { grid-template-columns: 1fr; }

/* Daftar kartu */
.m-list { display: flex; flex-direction: column; }
.m-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.m-item:last-child { border-bottom: 0; }
.m-item:active:not(:disabled) { background: var(--surface-2); }
.m-item:disabled { cursor: default; }
.m-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-item-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item-body > span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; font-size: 12px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.m-chips .badge { font-size: 11px; padding: 1px 7px; }
.m-section-title { padding: 10px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); }

/* Tombol + melayang */
.fab { position: fixed; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 35; width: 56px; height: 56px; border-radius: 18px; border: 0; background: linear-gradient(135deg, #3b82f6, #0563F5); color: #fff; box-shadow: 0 8px 20px rgba(5, 99, 245, .4); display: grid; place-items: center; cursor: pointer; animation: fade .25s ease-out; }
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.95); }

/* Lembar dari bawah: pilihan aksi & form */
.sheet-backdrop { align-items: end; padding: 0; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); animation: sheet-up .22s ease-out; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 10px; }
.sheet-title { font-weight: 600; text-align: center; padding: 0 8px 10px; color: var(--muted); font-size: 13px; white-space: pre-line; }
.sheet { max-height: 88vh; overflow-y: auto; }
.swap-preview { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.swap-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.swap-row:last-child { border-bottom: 0; }
.swap-row > b { min-width: 86px; flex-shrink: 0; }
.sheet-item { display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; font-weight: 500; text-align: center; color: var(--text); cursor: pointer; }
.sheet-item:active { background: var(--surface-2); }
.sheet-item.danger { color: var(--danger); }
.sheet-item.cancel { margin-top: 6px; background: var(--surface-2); font-weight: 600; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
body.mobile .modal-backdrop:not(.sheet-backdrop) { align-items: end; padding: 0; }
body.mobile .modal-backdrop .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; animation: sheet-up .22s ease-out; }
body.mobile .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
body.mobile .modal-foot .btn { flex: 1; height: 44px; }

/* Filter rekap yang bisa dibuka-tutup */
.filter-toggle { display: none; }
body.mobile .filter-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
body.mobile .filter-toggle span { color: var(--muted); font-size: 12px; }
body.mobile .filters-card.collapsed .card-body { display: none; }
body.mobile .toolbar .field { flex: 1 1 calc(50% - 10px); min-width: 0; }

/* ---------- Alat potong foto ---------- */
.cropper { position: fixed; inset: 0; z-index: 300; background: #0b1220; color: #fff; display: flex; flex-direction: column; }
.cropper-top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.cropper-link { background: none; border: 0; color: #fff; font: inherit; font-weight: 600; padding: 8px 4px; cursor: pointer; }
.cropper-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.cropper-wrap { position: relative; overflow: hidden; }
.cropper-img { display: block; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58); cursor: move; touch-action: none;
  background-image: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
    linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35));
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%;
  background-position: 0 33.33%, 0 66.66%, 33.33% 0, 66.66% 0; background-repeat: no-repeat; }
.crop-box.locked { cursor: default; box-shadow: none; background-image: none; border-style: dashed; }
.crop-box.locked .crop-h { display: none; }
.crop-h { position: absolute; width: 22px; height: 22px; border: 0 solid #fff; }
.crop-h[data-h="nw"] { left: -3px; top: -3px; border-width: 4px 0 0 4px; cursor: nwse-resize; }
.crop-h[data-h="ne"] { right: -3px; top: -3px; border-width: 4px 4px 0 0; cursor: nesw-resize; }
.crop-h[data-h="sw"] { left: -3px; bottom: -3px; border-width: 0 0 4px 4px; cursor: nesw-resize; }
.crop-h[data-h="se"] { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; cursor: nwse-resize; }
.cropper-ratios { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 6px; scrollbar-width: none; }
.ratio-chip { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.ratio-chip.active { background: #0563F5; font-weight: 600; }
.cropper-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.cropper-size { color: rgba(255, 255, 255, .6); font-size: 12px; }
.cropper-bottom .btn { height: 44px; padding: 0 22px; }

/* ---------- Foto profil ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 88px; height: 88px; font-size: 28px; }
/* Pratinjau di halaman profil: foto utuh tanpa dipotong */
.photo-full { width: 112px; height: 112px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.photo-full img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.photo-full .avatar { width: 88px; height: 88px; font-size: 28px; }
.photo-edit { display: flex; align-items: center; gap: 16px; }
img[data-photo-name] { cursor: zoom-in; }
/* Penampil foto ukuran penuh */
.photo-viewer { position: fixed; inset: 0; z-index: 150; background: rgba(15, 23, 42, .88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .2s ease-out; }
.photo-viewer figure { margin: 0; text-align: center; }
.photo-viewer img { max-width: min(92vw, 640px); max-height: 78vh; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); background: #fff; display: block; margin: 0 auto; }
.photo-viewer figcaption { color: #fff; font-weight: 600; margin-top: 12px; font-size: 16px; }
.photo-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
/* Nama + foto di tabel (tampilan laptop) */
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell .avatar { width: 34px; height: 34px; font-size: 12px; }
.photo-edit .photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-edit label.btn { cursor: pointer; }
.sidebar-foot .who { display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who .avatar { width: 36px; height: 36px; font-size: 13px; background: rgba(255, 255, 255, .12); color: #fff; flex-shrink: 0; }
.sidebar-foot .who-text { min-width: 0; }

/* ---------- Notifikasi belum absen pulang ---------- */
.bell { position: relative; margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.bell svg { width: 22px; height: 22px; }
.alert-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell .alert-count { position: absolute; top: -4px; right: -4px; border: 2px solid var(--surface); }
.nav-alerts .alert-count { margin-left: auto; }
.alert-card { border-color: #f5c27a; margin-bottom: 14px; }
.alert-card .card-head { background: var(--warn-soft); border-radius: var(--radius) var(--radius) 0 0; }
.alert-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.alert-item:last-child { border-bottom: 0; }
.alert-btns { display: flex; flex-wrap: wrap; gap: 6px; }
body.mobile .alert-btns .btn { flex: 1 1 auto; height: 38px; }

/* ---------- Shift & jadwal ---------- */
/* Warna shift: latar = warna gradasi tipis, teks = versi lebih gelap agar gradasi terang tetap terbaca */
.shift-chip { --c: var(--primary); display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 18%, transparent); white-space: nowrap; }
.shift-chip.sm { font-size: 11px; padding: 1px 7px; }
.shift-chip.off { --c: var(--danger); }
.shift-chip.none { --c: var(--muted); font-weight: 500; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav b { font-size: 13px; min-width: 150px; text-align: center; }
.wk-table th, .wk-table td { padding: 6px 8px; text-align: center; }
.wk-table th:first-child, .wk-table td:first-child { text-align: left; padding-left: 14px; }
.wk-table th.today { color: var(--primary); }
/* Judul kelompok divisi di jadwal mingguan */
.wk-table tr.group-row td { text-align: left; padding: 9px 14px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.wk-table tr.group-row td span, .wk-group span { margin-left: 8px; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.wk-group { padding: 8px 12px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; border-top: 1px solid var(--border); }
/* ---------- Dashboard: jumlah per periode & denda ---------- */
.period-ctl { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.period-ctl label { margin: 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.period-ctl select { width: auto; height: 30px; font-size: 13px; padding: 0 8px; }
.period-custom { display: inline-flex; align-items: center; gap: 4px; }
.period-custom input { width: 140px; height: 30px; font-size: 12px; padding: 0 6px; }
.today-table .th-group th { padding-top: 8px; padding-bottom: 0; border-bottom: 0; }
.today-table .th-group .grp { text-align: center; font-size: 11px; color: var(--primary); text-transform: none; letter-spacing: 0; border-bottom: 2px solid var(--primary-soft); }
.today-table .cnt-col { text-align: center; padding-left: 4px; padding-right: 4px; width: 46px; }
.today-table th.cnt-col { font-size: 11px; }
.cnt { font-variant-numeric: tabular-nums; }
.cnt.c-hadir { color: var(--ok); }
.cnt.c-terlambat { color: var(--warn); }
.cnt.c-izin { color: #ca8a04; }
.cnt.c-sakit { color: var(--violet); }
.cnt.c-cuti { color: #8b5e3c; }
.cnt.c-alpha { color: var(--danger); }
.cnt-zero { color: #c3cad5; }
.fine-cell { width: auto !important; white-space: nowrap; font-weight: 600; color: var(--danger); font-size: 12px; }
.m-item-body > span.m-counts { display: block; font-size: 11px; color: var(--primary); white-space: normal; text-align: left; overflow: visible; }
.fine-period { font-size: 12px; }
.fine-total { padding: 16px 18px 12px; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.fine-total span { font-size: 12px; color: var(--muted); }
.fine-total b { font-size: 28px; line-height: 1.2; color: var(--danger); font-variant-numeric: tabular-nums; }
.fine-total small { color: var(--muted); }
.fine-list { max-height: 340px; overflow-y: auto; }
.fine-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border); }
.fine-who { flex: 1; min-width: 0; }
.fine-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fine-who span { font-size: 12px; color: var(--muted); }
.fine-amt { color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fine-rule { font-size: 12px; margin: 0; padding: 10px 18px 14px; }
.qr-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qr-custom input { width: 110px; }
.qr-custom span { color: var(--muted); font-size: 13px; }
.settings-sub { font-size: 14px; margin: 6px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Pilihan Bulan / Minggu */
.sched-mode { display: inline-flex; background: var(--gray-soft); border-radius: 999px; padding: 3px; }
.sched-mode button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.sched-mode button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* Jadwal bulanan: kotak kecil per hari, kolom nama tetap saat digeser */
.mo-scroll { overflow-x: auto; }
.mo-table { --name-w: 150px; width: 100%; min-width: calc(var(--name-w) + var(--days) * 28px); table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.mo-table th, .mo-table td { padding: 2px 1px; text-align: center; border-bottom: 1px solid var(--border); }
.mo-table thead th { font-size: 11px; font-weight: 700; color: var(--text); padding: 6px 1px; line-height: 1.15; background: var(--surface-2); text-transform: none; letter-spacing: 0; }
.mo-table thead th span { display: block; font-size: 9px; font-weight: 500; color: var(--muted); }
.mo-table .mo-name { width: var(--name-w); text-align: left; padding: 4px 8px 4px 14px; position: sticky; left: 0; z-index: 1; background: var(--surface); }
.mo-table thead .mo-name { background: var(--surface-2); font-size: 12px; color: var(--muted); z-index: 2; }
.mo-name b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-table .we { background: var(--surface-2); }
.mo-table .mon { border-left: 1px solid var(--border); }
.mo-table th.today { color: var(--primary); background: var(--primary-soft); }
.mo-table th.today span { color: var(--primary); }
.mo-table td.today { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.mo-group td { background: var(--primary-soft) !important; padding: 6px 1px; }
.mo-group .mo-name { color: var(--primary); font-weight: 700; font-size: 12px; white-space: nowrap; overflow: visible; }
.mo-group .mo-name span { margin-left: 6px; font-weight: 500; color: var(--muted); }
.mo-cell { --c: var(--primary); display: inline-grid; place-items: center; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 6px; font: inherit; font-size: 10px; font-weight: 700; font-style: normal; color: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 20%, transparent); cursor: pointer; position: relative; }
.mo-cell:hover { outline: 2px solid color-mix(in srgb, var(--c) 45%, transparent); }
.mo-cell.none { --c: #98a2b3; font-weight: 500; background: transparent; }
.mo-cell.off { --c: var(--danger); }
/* Izin / sakit / cuti / alfa: kotak berwarna penuh */
.mo-cell.st { color: #fff; background: var(--sc); font-size: 9px; letter-spacing: -.02em; }
.mo-cell.st-izin { --sc: #eab308; color: #422006; } /* kuning: teks gelap agar terbaca */
.mo-cell.st-sakit { --sc: var(--violet); }
.mo-cell.st-cuti { --sc: #8b5e3c; } /* earth tone: cokelat tanah */
.mo-cell.st-alpha { --sc: var(--danger); }
.mo-cell.st:hover { outline-color: color-mix(in srgb, var(--sc) 45%, transparent); }
.bulk-note { align-self: center; font-size: 12px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.legend-div { font-style: normal; color: var(--muted); font-size: 11px; }
.div-picks { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 10px 0; margin: 0 0 6px; background: var(--surface-2); border-radius: 8px; }
.div-picks label.check { margin: 0 0 8px; }
label.check.div-all { margin: 0 0 6px; }
#dup-shift { margin-top: 2px; }
.swap-warn { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-bottom: 8px; }
.swap-misfit { color: var(--warn); font-size: 12px; font-weight: 500; }
.bulk-sep { flex-shrink: 0; width: 1px; align-self: stretch; margin: 4px 4px; background: var(--border); }
.mo-cell.daily::after { content: ''; position: absolute; top: 2px; right: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--warn); }
.mo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 14px 0; font-size: 12px; color: var(--muted); }
.mo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mo-legend .mo-cell { cursor: default; }
.mo-legend .mo-cell.none { border: 1px solid var(--border); }
.mo-legend .mo-cell:hover { outline: 0; }
/* Mode "Nama lengkap": kotak lebih lebar berisi nama shift; tabel digeser kanan-kiri */
.mo-table.names { --col: 76px; min-width: calc(var(--name-w) + var(--days) * var(--col)); }
.mo-table.names th:not(.mo-name), .mo-table.names td:not(.mo-name) { width: var(--col); }
.mo-table.names .mo-cell { display: block; width: calc(var(--col) - 8px); margin: 0 auto; padding: 0 5px; font-size: 11px; line-height: 22px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-table.names .mo-cell.st { font-size: 11px; letter-spacing: 0; }
.mo-scroll.has-slide { scrollbar-width: none; }
.mo-scroll.has-slide::-webkit-scrollbar { display: none; }
/* Slidebar di bawah tabel */
.mo-slide { display: flex; align-items: center; gap: 12px; padding: 10px 14px 2px; }
.mo-slide input[type=range] { flex: 1; height: 22px; padding: 0; border: 0; background: transparent; accent-color: var(--primary); cursor: pointer; }
.mo-slide input[type=range]:focus { outline: none; }
.mo-slide input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--gray-soft); }
.mo-slide input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 46px; height: 18px; margin-top: -5px; border-radius: 99px; background: var(--primary); box-shadow: 0 2px 6px rgba(5, 99, 245, .35); }
.mo-slide input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--gray-soft); }
.mo-slide input[type=range]::-moz-range-thumb { width: 46px; height: 18px; border: 0; border-radius: 99px; background: var(--primary); }
.mo-slide-label { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }

/* Pilih banyak kotak */
.mo-table { user-select: none; -webkit-user-select: none; }
.mo-table [data-row], .mo-table [data-col], .mo-table [data-group] { cursor: pointer; }
.mo-table [data-row]:hover b, .mo-table [data-group]:hover { text-decoration: underline; }
.mo-table th[data-col]:hover { color: var(--primary); }
.mo-cell.sel { outline: 2px solid var(--primary); outline-offset: 1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.mo-table.selecting .mo-cell { touch-action: none; }
.mo-table.selecting .mo-cell:not(.sel) { opacity: .8; }
.sel-toggle { margin-left: auto; }
.bulk-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(980px, calc(100vw - 32px)); display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); animation: bulk-up .2s ease-out; }
@keyframes bulk-up { from { transform: translate(-50%, 30px); opacity: 0; } }
.bulk-info { display: flex; flex-direction: column; flex-shrink: 0; line-height: 1.25; }
.bulk-info b { font-size: 14px; }
.bulk-info span { font-size: 12px; color: var(--muted); }
.bulk-actions { display: flex; gap: 6px; flex: 1; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.bulk-actions button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.bulk-actions button:hover { border-color: var(--primary); background: var(--primary-soft); }
.bulk-actions button:disabled { opacity: .5; cursor: default; }
.bulk-actions .mo-cell { cursor: inherit; }
.bulk-actions .mo-cell.none { border: 1px solid var(--border); }
.bulk-x { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--gray-soft); font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
body.bulk-on .main { padding-bottom: 110px; }
body.bulk-on .fab { display: none; }
body.mobile .bulk-bar { bottom: calc(76px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
body.mobile .bulk-info { flex-direction: row; align-items: baseline; gap: 8px; flex: 1; }
body.mobile .bulk-actions { order: 3; flex-basis: 100%; }
body.mobile .mo-table { --name-w: 96px; }
body.mobile .mo-table .mo-name { padding-left: 10px; }

.wk-cell { display: inline-flex; align-items: center; gap: 3px; border: 1px dashed transparent; background: none; border-radius: 8px; padding: 4px; cursor: pointer; font: inherit; }
.wk-cell:hover { border-color: var(--border); background: var(--surface-2); }
.wk-cell.today { background: var(--primary-soft); }
.wk-cell .src { font-style: normal; font-size: 9px; font-weight: 700; color: var(--muted); }
.wk-legend { font-size: 12px; padding: 10px 14px 12px; margin: 0; }
.wk-days-head { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 10px 4px; font-size: 11px; color: var(--muted); text-align: center; }
.wk-days-head b { display: block; font-size: 13px; color: var(--text); }
.wk-days-head .today, .wk-days-head .today b { color: var(--primary); }
.wk-row { padding: 8px 10px; border-top: 1px solid var(--border); }
.wk-name b { font-size: 14px; }
.wk-name span { color: var(--muted); font-size: 12px; margin-left: 6px; }
.wk-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 4px; }
.wk-cells .wk-cell { justify-content: center; flex-direction: column; padding: 4px 0; min-width: 0; }
.wk-cells .shift-chip.sm { font-size: 9px; padding: 1px 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.seg.seg-3 { grid-template-columns: repeat(3, 1fr); margin: 0; }
.seg.seg-3 .thumb { width: calc(33.33% - 2.67px); }
.seg.seg-3[data-p="w"] .thumb { transform: translateX(100%); }
.seg.seg-3[data-p="m"] .thumb { transform: translateX(200%); }
.seg.seg-3 button { height: 36px; font-size: 13px; }
.seg.seg-4 { grid-template-columns: repeat(4, 1fr); margin: 0; }
.seg.seg-4 .thumb { width: calc(25% - 2px); }
.seg.seg-4[data-p="w"] .thumb { transform: translateX(100%); }
.seg.seg-4[data-p="m"] .thumb { transform: translateX(200%); }
.seg.seg-4[data-p="r"] .thumb { transform: translateX(300%); }
.seg.seg-4 button { height: 36px; font-size: 12px; padding: 0 2px; }
.pick-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pick-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px; }
label.check.pick { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
label.check.pick:last-child { border-bottom: 0; }
label.check.pick .muted { margin-left: auto; font-size: 12px; }
.m-shift-today { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 13px; font-weight: 600; }
/* Keterangan shift yang akan dipakai saat scan (di bawah tombol Scan QR) */
.m-pick { margin-top: 10px; display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 13px; font-weight: 600; }
.m-pick.late { background: rgba(251, 191, 36, .3); }

/* ---------- Aplikasi karyawan: pop-up dari bawah ---------- */
.msheet-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.msheet-backdrop.closing { opacity: 0; transition: opacity .18s; }
.msheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .22s ease-out; transition: transform .12s; }
.msheet-grip { width: 42px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .6); margin: 0 auto 8px; }
.msheet-head { position: relative; padding: 10px 16px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.msheet-head .msheet-grip { background: var(--border); }
.msheet-head b { font-size: 15px; }

/* Kalender "Jadwal saya" (gaya kalender dinding) */
.cal-band { position: relative; padding: 10px 14px 16px; color: #fff; background: linear-gradient(135deg, #0563F5, #3b82f6); border-radius: 20px 20px 0 0; touch-action: none; }
.cal-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; margin-top: 22px; }
.cal-title small { display: block; font-size: 11px; opacity: .85; letter-spacing: .04em; text-transform: uppercase; }
.cal-title b { display: block; font-size: 26px; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.cal-nav { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.cal-x { position: absolute; top: 8px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.cal-x.dark { background: var(--gray-soft); color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; padding: 12px 10px 6px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text); padding-bottom: 4px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.cal-dow.sun { color: var(--danger); }
.cal-dow.fri { color: var(--ok); }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; border: 0; border-radius: 10px; background: none; font: inherit; cursor: pointer; min-width: 0; }
.cal-num { --c: #94a3b8; position: relative; width: 36px; height: 30px; display: grid; place-items: center; border-radius: 7px; font-size: 15px; font-weight: 700;
  color: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 24%, transparent); }
.cal-label { max-width: 100%; padding: 0 2px; font-size: 9.5px; line-height: 1.2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.none .cal-num { --c: #94a3b8; }
.cal-day.off .cal-num { --c: var(--danger); color: var(--danger); background: var(--danger-soft); }
.cal-day.off .cal-label { color: var(--danger); }
.cal-day.st .cal-num { color: #fff; background: var(--sc); }
.cal-day.st-izin .cal-num { --sc: #eab308; color: #422006; }
.cal-day.st-sakit .cal-num { --sc: var(--violet); }
.cal-day.st-cuti .cal-num { --sc: #8b5e3c; }
.cal-day.st-alpha .cal-num { --sc: var(--danger); }
.cal-day.today .cal-num { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.cal-day.sel { background: var(--primary-soft); }
.cal-day.today .cal-label { color: var(--primary); font-weight: 600; }
.cal-dot { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.cal-dot.late { background: var(--warn); }
.cal-desc { border-top: 1px solid var(--border); padding: 12px 16px 16px; }
.cal-sel b { display: block; font-size: 15px; margin-bottom: 2px; }
.cal-sel > div { font-size: 13px; color: var(--text); }
.cal-rec { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-rec span { font-size: 12px; color: var(--muted); }
.cal-sum { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.6; }
.cal-sum span { color: var(--muted); }
.cal-note { font-size: 11px; margin: 8px 0 0; }

/* Pengumuman (admin) */
.ann-list { display: flex; flex-direction: column; }
.ann-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ann-item:last-child { border-bottom: 0; }
.ann-main { flex: 1; min-width: 0; }
.ann-main b { display: block; font-size: 15px; }
.ann-main p { margin: 4px 0 6px; white-space: pre-line; color: var(--text); font-size: 13px; }
.ann-meta { font-size: 12px; color: var(--muted); }
.ann-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.ann-reads.all { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.ann-h { margin: 6px 0 8px; font-size: 13px; color: var(--muted); }
.ann-read-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ann-read-row span { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.ann-read-row small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.ann-read-row em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
body.mobile .ann-item { flex-direction: column; gap: 8px; padding: 12px 14px; }
body.mobile .ann-side { flex-direction: row; align-self: stretch; justify-content: flex-end; }
/* Pengumuman (karyawan) */
.m-ann { display: block; width: 100%; text-align: left; font: inherit; color: inherit; padding: 16px; margin-top: 14px; cursor: pointer; }
.m-ann-item { padding: 8px 0; border-top: 1px solid var(--border); }
.m-ann-item:first-of-type { border-top: 0; }
.m-ann-item b { display: block; font-size: 14px; }
.m-ann-item span { font-size: 12px; color: var(--muted); }
.m-ann-item.new b::after { content: 'Baru'; margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; vertical-align: 2px; }
.ann-full { padding: 10px 0 14px; border-bottom: 1px solid var(--border); }
.ann-full:last-of-type { border-bottom: 0; }
.ann-full b { display: block; font-size: 15px; }
.ann-full p { margin: 6px 0; white-space: pre-line; font-size: 14px; line-height: 1.5; }
.ann-full span { font-size: 12px; color: var(--muted); }

/* Pop-up pemberitahuan perubahan */
.notice-list { padding: 8px 16px 16px; }
.notice-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.45; }
.notice-item > span { flex-shrink: 0; width: 84px; font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 1px; }

/* Sakelar pengingat absen (Profil) */
.m-switch-row { cursor: pointer; align-items: center; }
.m-switch-row small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #cbd5e1; transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }
.remind-hint { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.remind-hint:empty { display: none; }
.remind-hint .ok { color: var(--ok); }

/* Kartu "Denda bulan ini" */
.m-fine { display: block; width: 100%; padding: 16px; margin-top: 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-fine-more { font-size: 13px; color: var(--primary); font-weight: 500; }
.m-fine-amt { font-size: 28px; font-weight: 800; color: var(--danger); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.m-fine-amt.ok { color: var(--ok); }
.m-fine-sub { font-size: 13px; color: var(--text); margin-top: 2px; }
.m-fine-rule { font-size: 11px; color: var(--muted); margin-top: 8px; }
.fine-detail { padding: 6px 16px 16px; }
.fine-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fine-line > div { flex: 1; min-width: 0; }
.fine-line b { display: block; }
.fine-line span { font-size: 12px; color: var(--muted); }
.fine-rp { color: var(--danger); white-space: nowrap; }

.m-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.m-week div { padding: 6px 0; border-radius: 10px; font-size: 11px; color: var(--muted); }
.m-week div.today { background: var(--primary-soft); }
.m-week b { display: block; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.m-week .shift-chip { font-size: 9px; padding: 1px 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .two-col, .qr-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 55; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--text); }
  .main { padding: 18px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .toolbar .field, .toolbar input[type=search] { min-width: 0; flex: 1 1 140px; }
}

/* ---------- Halaman akun induk (pengelolaan cabang) ---------- */
body.induk { background: var(--bg); min-height: 100vh; }
.induk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.induk-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.induk-brand img { border-radius: 10px; flex-shrink: 0; }
.induk-brand b { display: block; font-size: 15px; }
.induk-brand span { display: block; font-size: 12px; color: var(--muted); }
.induk-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.induk-email { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.induk-main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 60px; }
.stat-sub { color: var(--danger); font-size: 12px; margin-top: 2px; }
.induk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.induk-toolbar input[type=search] { max-width: 280px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.chip span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .8); }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.co { display: flex; flex-direction: column; padding: 16px; gap: 14px; }
.co-inactive, .co-deleting { background: var(--surface-2); }
.co-head { display: flex; align-items: center; gap: 12px; }
.co-av { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
  color: hsl(var(--h) 60% 32%); background: hsl(var(--h) 75% 92%); }
.co-inactive .co-av, .co-deleting .co-av { filter: grayscale(1); opacity: .7; }
.co-name { flex: 1; min-width: 0; }
.co-name b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-name span { font-size: 12px; color: var(--muted); }
.co-body { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.co-inactive .co-body, .co-deleting .co-body { background: var(--surface); }
.co-num { text-align: center; padding-right: 16px; border-right: 1px solid var(--border); }
.co-num b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.co-num span { font-size: 12px; color: var(--muted); }
.co-admin { min-width: 0; display: grid; }
.co-admin span { font-size: 12px; color: var(--muted); }
.co-admin b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-warn { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.co-warn span { opacity: .85; font-size: 12px; }
.co-note { font-size: 12px; color: var(--muted); }
.co-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.induk-empty { display: grid; gap: 6px; justify-items: center; }
.induk-empty b { color: var(--text); font-size: 15px; }
.induk-empty p { margin: 0; max-width: 420px; }
.induk-codes { margin-top: 22px; }
.induk-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border); }
.induk-code:first-of-type { border-top: 0; }
.induk-code-btns { margin-left: auto; display: flex; gap: 6px; }
.manage-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.manage-info > div { display: grid; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.manage-info span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.manage-list { display: grid; gap: 8px; }
.manage-item { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; cursor: pointer; }
.manage-item:hover { background: var(--surface-2); }
.manage-item span { font-size: 12px; color: var(--muted); }
.manage-item.danger b { color: var(--danger); }
.manage-item.danger:hover { background: var(--danger-soft); }
@media (max-width: 640px) {
  .induk-head { padding: 10px 14px; }
  .induk-email { display: none; }
  .induk-main { padding: 18px 14px 48px; }
  .induk-main .stats { grid-template-columns: 1fr 1fr; }
  .co-grid { grid-template-columns: 1fr; }
  .induk-toolbar input[type=search] { max-width: none; width: 100%; }
  .manage-info { grid-template-columns: 1fr; }
}
/* ---------- Masukkan jadwal dari teks / gambar ---------- */
.imp-modal { max-width: 1180px; position: relative; }
.imp-src { margin-bottom: 12px; }
.imp-help { font-size: 12px; margin: 0 0 8px; line-height: 1.5; }
#imp-input { width: 100%; font: 12px/1.4 ui-monospace, Consolas, monospace; tab-size: 6; white-space: pre; overflow-x: auto; resize: vertical; }
.imp-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.imp-file { margin-right: 10px; }
.imp-section { margin-top: 18px; }
.imp-section h4 { font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.imp-img { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.imp-img img { display: block; width: 100%; }
.imp-img.big { max-height: 70vh; }
.imp-img.big img { width: auto; max-width: none; }
.imp-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-color { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.imp-color.warn { border-color: var(--warn); background: var(--warn-soft); }
.imp-color i { width: 26px; height: 20px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .15); }
.imp-color select { padding: 4px 6px; font-size: 12px; }
.imp-month { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; font-size: 13px; }
.imp-month input[type=month] { padding: 4px 8px; margin-left: 6px; }
.imp-month label.check { margin: 0; }
.imp-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.imp-tag.warn { background: var(--warn-soft); color: var(--warn); }
.imp-table { --name-w: 190px; }
.imp-name { vertical-align: middle; }
.imp-name .imp-raw { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-name select { width: 100%; padding: 3px 4px; font-size: 12px; }
.imp-name.warn select { border-color: var(--danger); background: var(--danger-soft); }
.imp-name.unsure select { border-color: var(--warn); background: var(--warn-soft); }
.imp-table .imp-sum { width: 150px; font-size: 11px; color: var(--muted); text-align: left; padding-left: 8px; white-space: normal; }
.imp-table .imp-x { color: var(--danger); background: var(--danger-soft); font-size: 10px; }
.imp-off td:not(.mo-name) { opacity: .35; }
.mo-cell.warn { outline: 2px solid var(--warn); background: var(--warn-soft); color: var(--warn); }
.mo-cell.chg::before { content: ''; position: absolute; top: -2px; left: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); border: 1px solid var(--surface); }
.mo-cell.man::after { content: ''; position: absolute; bottom: 2px; right: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--text); }
.mo-cell.past { opacity: .35; }
.imp-pop { position: fixed; z-index: 120; max-height: calc(100vh - 16px); overflow-y: auto; width: 232px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); padding: 6px; display: grid; }
.imp-pop-head { font-size: 12px; font-weight: 600; padding: 4px 8px 6px; }
.imp-pop-head span { display: block; font-weight: 500; color: var(--warn); margin-top: 2px; }
.imp-pop button { text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.imp-pop button:hover { background: var(--surface-2); }
.imp-foot { flex-wrap: wrap; align-items: center; }
.imp-confirm { margin: 0 auto 0 0 !important; }
.imp-block { font-size: 12px; color: var(--warn); }
body.mobile .imp-table { --name-w: 118px; }
body.mobile .imp-table .imp-sum { width: 110px; }
body.mobile .imp-foot .imp-confirm { flex-basis: 100%; }
.cover-note { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 1px 6px; }

/* ---------- Penghasilan shift & Performa (penghasilan.js) ---------- */
.inc-backdrop { position: fixed; inset: 0; z-index: 130; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.inc-panel { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.inc-panel.inc-settings { max-width: 640px; }
.inc-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.inc-head b { display: block; font-size: 16px; }
.inc-head span { color: var(--muted); font-size: 13px; }
.inc-x { border: 0; background: var(--gray-soft); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.inc-body { padding: 14px 16px 18px; }
.inc-names { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.inc-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.inc-row.none { background: var(--surface-2); }
.inc-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.inc-cur { display: inline-block; min-width: 22px; padding: 0 5px; border-radius: 5px; font-size: 12px; text-align: center; color: #fff; background: var(--c); }
.inc-none { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: 12px; color: var(--muted); cursor: pointer; }
.inc-none input, .inc-check input { width: auto; height: auto; margin: 0; }
.inc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 84px; gap: 8px; align-items: end; }
.inc-fields label { margin: 0; font-size: 11px; color: var(--muted); font-weight: 500; }
.inc-fields input { height: 36px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; margin-top: 2px; }
.inc-fields input[readonly] { background: var(--surface-2); color: var(--muted); }
.inc-fields input:disabled { background: var(--surface-2); }
.inc-res { text-align: right; }
.inc-res span { display: block; font-size: 11px; color: var(--muted); }
.inc-res b { display: block; height: 36px; line-height: 36px; font-variant-numeric: tabular-nums; }
.inc-res b.neg { color: var(--danger); }
.inc-sum { border-radius: 10px; background: var(--primary-soft); padding: 10px 12px; margin: 12px 0 10px; font-size: 13px; }
.inc-sum > div { display: flex; justify-content: space-between; gap: 8px; }
.inc-sum .inc-sum-idr { border-top: 1px solid rgba(37, 99, 235, .2); margin-top: 6px; padding-top: 6px; font-size: 15px; }
.inc-sum small { color: var(--muted); }
.inc-rates { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.inc-rates label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.inc-rates input { width: 110px; height: 32px; text-align: right; }
.inc-rates input[readonly] { background: var(--surface-2); color: var(--muted); }
.inc-rates small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.inc-rule { font-size: 12px; margin: 10px 0 0; }
.inc-sub { font-size: 14px; margin: 18px 0 8px; }
.inc-check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; margin: 0 0 6px; cursor: pointer; }
.pl-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.pl-row.off { opacity: .6; }
.pl-top { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
.pl-bottom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pl-bottom .inc-check { margin: 0; }
.pl-shifts { flex: 1; min-width: 160px; font-size: 13px; }
.pl-shifts summary { cursor: pointer; color: var(--primary); }
.pl-shifts label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 4px 0; }
.pl-shifts input { width: auto; height: auto; }
.pl-shifts small { color: var(--muted); }
.pl-btns { display: flex; gap: 4px; margin-left: auto; }
.inc-chart-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.inc-chart .hit { cursor: pointer; }
.inc-chart .sel { fill: var(--primary); opacity: .09; }
.inc-chart .guide { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.inc-tip { position: absolute; top: 8px; z-index: 2; min-width: 170px; max-width: 260px; padding: 9px 11px; border-radius: 10px; background: #1f2937; color: #f8fafc; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); pointer-events: none; }
.inc-tip > b { display: block; margin-bottom: 5px; font-size: 13px; }
.inc-tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.inc-tip-row i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.inc-tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-tip-row b { font-variant-numeric: tabular-nums; }
.inc-tip-none { color: #cbd5e1; }
.inc-tip-tot { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 6px; padding-top: 5px; font-variant-numeric: tabular-nums; }
.inc-tip small { display: block; color: #94a3b8; margin-top: 4px; font-size: 11px; }
#pf-recs td.actions { white-space: nowrap; }
#pf-recs td.actions .btn + .btn { margin-left: 6px; }
.det-crew { display: grid; gap: 6px; }
.det-crew > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.det-crew > div b { flex: 1; }
.det-crew > div span { color: var(--muted); font-variant-numeric: tabular-nums; }
.det-table th, .det-table td { font-size: 13px; padding: 6px 8px; white-space: nowrap; }
.det-log { display: grid; gap: 4px; font-size: 12px; }
.det-log > div { display: flex; gap: 10px; flex-wrap: wrap; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.det-log > div span { color: var(--muted); font-variant-numeric: tabular-nums; }
.perf-chip { border: 1px solid var(--border); background: var(--surface); color: var(--primary); font: inherit; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 10px; margin-left: 6px; cursor: pointer; }
.inc-chart { display: block; }
.inc-chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.inc-chart text.sub { font-size: 10px; }
.inc-chart text.mark { font-size: 10px; font-weight: 700; }
.inc-chart .grid { stroke: var(--border); stroke-dasharray: 3 3; }
.inc-chart .axis { stroke: #cbd5e1; }
.inc-spark { display: block; }
.inc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.inc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.inc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* Kartu karyawan */
.m-inc .m-inc-date { font-size: 13px; color: var(--muted); }
.m-inc-tot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.m-inc-tot b { font-size: 22px; font-weight: 800; }
.m-inc-tot span { font-size: 15px; font-weight: 600; }
.m-perf { margin-top: 14px; }
.inc-wk-nav { display: flex; gap: 6px; }
.inc-wk-nav .btn { width: 34px; font-size: 16px; }
.inc-wk-title { font-weight: 600; font-size: 13px; color: var(--muted); }
.inc-wk-tot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.inc-wk-tot b { font-size: 20px; font-weight: 800; }
.inc-wk-tot span { font-weight: 600; }
.m-perf .inc-chart-wrap { touch-action: pan-y; }
/* Halaman Performa admin */
/* Pilihan tampilan: kartu sendiri, dikelompokkan dengan label */
.perf-controls { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; padding: 12px 16px; margin-bottom: 16px; }
.perf-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perf-group > span:first-child { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.perf-type { margin-left: auto; }
.perf-controls input { width: auto; height: 34px; }
.perf-range { display: inline-flex; align-items: center; gap: 6px; }
.perf-pills { display: inline-flex; background: var(--gray-soft); border-radius: 999px; padding: 3px; }
.perf-pills button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.perf-pills button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); font-weight: 600; }
/* Kartu grafik */
.perf-title { align-items: center; }
.perf-title h2 { display: block; margin-bottom: 2px; }
.perf-title .muted { font-size: 13px; }
.perf-title .perf-total { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: baseline; font-variant-numeric: tabular-nums; }
.perf-title .perf-total b { font-size: 18px; font-weight: 800; }
.perf-chart-body { padding: 14px 18px 8px; }
.perf-chart-body .inc-legend { margin: 6px 0 4px; font-size: 13px; }
.perf-sum-wrap { border-top: 1px solid var(--border); }
.perf-sum th, .perf-sum td { padding: 10px 18px; font-size: 14px; }
.perf-note { font-size: 12px; margin: 0; padding: 8px 18px 14px; }
.perf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.perf-section { margin-top: 18px; }
.perf-legend-foot { padding: 4px 18px 14px; }
/* Tabel per karyawan per tanggal */
.perf-daily { border-collapse: separate; border-spacing: 0; }
.perf-daily th, .perf-daily td { white-space: nowrap; padding: 3px 6px; font-size: 13px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.perf-daily thead th { background: var(--surface-2); font-size: 12px; color: var(--text); text-transform: none; letter-spacing: 0; }
.perf-daily thead th .sub { font-size: 11px; color: var(--muted); font-weight: 500; }
/* Satu bulan penuh muat selebar kartu (kolom tanggal berbagi sisa lebar); layar sempit tetap bisa digeser */
.perf-daily { width: 100%; min-width: 960px; table-layout: fixed; }
.perf-daily thead .perf-name { width: 112px; }
.perf-daily thead th:nth-last-child(2) { width: 78px; }
.perf-daily thead th:last-child { width: 112px; }
.perf-daily .perf-dcol { text-align: center; padding-left: 1px; padding-right: 1px; font-size: 12px; overflow: hidden; text-overflow: clip; }
.perf-daily th.sun, .perf-daily th.sun .sub { color: var(--danger); }
.perf-daily td.sun { background: #fef6f6; }
.perf-daily td.has { background: #f3fbf5; font-weight: 600; }
.perf-daily td div { line-height: 1.2; }
.perf-daily thead th { padding-top: 5px; padding-bottom: 5px; line-height: 1.2; }
.perf-nil { color: #cbd5e1; }
.perf-daily .perf-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 3px 14px 3px 18px; font-size: 14px; box-shadow: 1px 0 0 var(--border); }
.perf-daily thead .perf-name { background: var(--surface-2); }
.perf-daily .perf-st { background: color-mix(in srgb, var(--sc) 16%, white); color: var(--sc); font-weight: 700; }
.perf-daily .perf-total { text-align: right; font-weight: 700; padding: 3px 14px; background: var(--primary-soft); box-shadow: -1px 0 0 var(--border); }
.perf-daily .perf-spark { padding: 2px 18px 2px 12px; }
.perf-daily .perf-spark .inc-spark { height: 24px; }
.perf-daily tbody tr:hover td { filter: brightness(.97); }
/* Daftar catatan saldo */
#pf-recs th, #pf-recs td { padding: 10px 14px; font-size: 14px; }
#pf-recs td .sub { margin-top: 3px; }
.perf-missing td { background: var(--surface-2); color: var(--muted); }
.perf-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) {
  .inc-backdrop { align-items: flex-end; padding: 0; }
  .inc-panel { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .inc-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inc-res { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border); padding-top: 4px; }
  .inc-res b { height: auto; line-height: 1.4; }
  .pl-top { grid-template-columns: 1fr; }
  .perf-controls { padding: 12px; gap: 10px; } .perf-type { margin-left: 0; } .perf-chart-body { padding: 12px 12px 6px; } .perf-sum th, .perf-sum td { padding: 8px 12px; } .perf-daily .perf-name { padding-left: 12px; }
}

/* Ikon mata */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-wrap .eye-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.eye-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.eye-btn:hover { color: var(--primary); }

/* Pengumuman & Gaji */
.box-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.box-tabs button { flex: 0 1 160px; padding: 9px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.box-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pay-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pay-head .field { margin: 0; }
.pay-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--primary-soft); font-weight: 600; }
.pay-sent { background: #dcfce7; color: #166534; text-transform: none; }
.pay-wait { background: #f1f5f9; color: #475569; text-transform: none; }
.pay-amt { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; white-space: nowrap; }
.pay-greet { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.pay-month { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.m-pay-link { display: flex; align-items: center; justify-content: space-between; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.m-row small { display: block; margin-top: 2px; font-size: 12px; }
.pay-head-side { display: flex; align-items: center; gap: 12px; }
.modal.modal-wide { max-width: 640px; width: 100%; }
.pay-row { padding: 12px 0; border-top: 1px solid var(--border); }
.pay-row-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pay-row-head span { display: block; font-size: 12px; }
.pay-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-row-grid[hidden] { display: none; }
.pay-row-grid .field { margin-bottom: 10px; }
.pay-row label.check { margin: 0 0 8px; }
