@font-face { font-family: Inter; src: url(fonts/Inter-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-Bold.ttf); font-weight: 700; font-display: swap; }

/* Warna dari lib/core/theme.dart */
:root {
  --primary: #0E6B63; --primary-dark: #0A524C; --primary-soft: #E2F0EE; --primary-tint: #F1F8F7; --primary-line: #BFDCD8;
  --bg: #F6F8F7; --surface: #fff; --border: #E3E9E7; --divider: #EDF1F0;
  --text: #13201E; --muted: #66756F; --faint: #9AA6A2;
  --amber: #B26A12; --amber-soft: #FEF4E4; --amber-line: #F4D8A6; --amber-bar: #E2A93B; --amber-deep: #6D4309;
  --red: #C2412D; --red-soft: #FDECEA; --red-line: #F5C6BF; --red-deep: #A33423;
  --primary-mid: #4F978F; --leave: #7DA2EA;
  --blue: #2F6BE0; --disabled: #E6EBE9; --disabled-text: #A2ADA9;
  --radius: 12px; --shadow: 0 1px 2px rgba(19, 32, 30, .04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 13.5px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.2px; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; }
.brand b { font-size: 16px; letter-spacing: -0.4px; }
.company-switch { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.company-switch:hover { background: var(--primary-tint); }
.company-switch .name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.menu { display: flex; flex-direction: column; gap: 2px; }
nav.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav.menu a:hover { background: var(--primary-tint); color: var(--text); }
nav.menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
nav.menu svg { width: 18px; height: 18px; flex: none; }
nav.menu .count { margin-left: auto; background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line); border-radius: 999px; font-size: 11px; font-weight: 600; padding: 0 7px; }
.side .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 9px; padding: 8px; border-top: 1px solid var(--divider); }
.me .who { flex: 1; min-width: 0; }
.me .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main.page { padding: 22px 28px 40px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ------------------------------------------------------------ komponen */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.card-head h3 { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-top: 2px; }
.stat .hint { color: var(--faint); font-size: 11.5px; }

.btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--primary-tint); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.btn:disabled { background: var(--disabled); border-color: var(--disabled); color: var(--disabled-text); cursor: default; }
.icon-btn { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--divider); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .help { font-size: 11.5px; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; cursor: pointer; user-select: none; background: var(--surface); }
.check:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.check input { accent-color: var(--primary); margin: 0; }
.check-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.check-list label:hover { background: var(--primary-tint); }
.check-list input { accent-color: var(--primary); }

.error { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-line); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; }
.notice { background: var(--primary-tint); border: 1px solid var(--primary-line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.notice.warn { background: var(--amber-soft); border-color: var(--amber-line); color: #6d4309; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge.ok { color: var(--primary); background: var(--primary-tint); border-color: var(--primary-line); }
.badge.warn { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.badge.off { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.badge.plain { color: var(--muted); background: var(--bg); border-color: var(--border); }
.badge.blue { color: var(--blue); background: #EEF3FD; border-color: #C9D8F6; }

.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .name { font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .field { min-width: 160px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 10px 14px; background: var(--primary-tint); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr.click:hover td { background: var(--primary-tint); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--divider); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--primary-tint); }

.code { font: 700 26px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 3px; color: var(--primary); background: var(--primary-tint); border: 1px dashed var(--primary-line); border-radius: 12px; padding: 16px; text-align: center; }

.facts { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 0; }
.section-title { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 18px 0 8px; }
.actions { display: grid; gap: 8px; }
.action { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.action .txt { flex: 1; }
.action .txt b { display: block; font-weight: 600; font-size: 13px; }
.action .txt span { font-size: 12px; color: var(--muted); }

.map { height: 320px; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; z-index: 0; }
.map.small { height: 200px; }
.photo { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }

/* ------------------------------------------------------------ ringkasan */
.ov-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.num { font-variant-numeric: tabular-nums; }
.ov-summary { padding: 14px 16px 12px; border-bottom: 1px solid var(--divider); }
.ov-summary p { margin: 0; }
.ov-summary p:first-child { font-size: 16px; }
.ov-summary p + p { margin-top: 3px; }
.ov-absent { color: var(--red); }
.ov-site { align-items: flex-start; }
.ov-names { margin-top: 4px; color: var(--muted); line-height: 1.6; }
.ov-name { border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; border-radius: 6px; }
.ov-name:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ov-name:focus-visible, .ov-gap:focus-visible, [data-req]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ov-count { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.ov-count b { font-size: 20px; line-height: 1.2; }
.ov-away-wrap { border-top: 1px solid var(--divider); padding: 10px 16px 12px; display: grid; gap: 6px; }
.ov-away { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ov-away .ov-names { margin-top: 0; }
.ov-away-label { font-size: 12px; font-weight: 600; }
.ov-gap { text-decoration: none; color: inherit; }
.ov-link { color: var(--primary); font-weight: 600; }
.ov-more { color: var(--primary); font-weight: 600; text-decoration: none; }
.ov-note { padding: 10px 16px; border-top: 1px solid var(--divider); }
/* warna Ringkasan: hanya untuk status dan penunjuk arah (Wash-Rule-Ink) */
.ov-live { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 500; }
.ov-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ov-bar { display: flex; gap: 2px; height: 8px; margin-top: 12px; border-radius: 999px; overflow: hidden; background: var(--divider); }
.ov-seg { min-width: 6px; }
.is-here { background: var(--primary); }
.is-gone { background: var(--primary-mid); }
.is-leave { background: var(--amber-bar); }
.is-absent { background: var(--red); }
.ov-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.ov-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ov-legend b { color: var(--text); }
.ov-key { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.ov-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; border: 1px solid transparent; }
.tone-ok { background: var(--primary-soft); color: var(--primary); }
.tone-warn { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.tone-bad { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.tone-quiet { background: var(--bg); color: var(--muted); border-color: var(--border); }
#todoCount .badge { color: var(--amber-deep); }
.ov-count.is-zero b { color: var(--faint); }
.ov-away.is-alert { background: var(--red-soft); border: 1px solid var(--red-line); border-radius: 9px; padding: 8px 10px; margin: 0 -11px; }
.ov-away.is-alert .ov-away-label { color: var(--red-deep); }
.ov-clear { display: flex; align-items: center; gap: 10px; padding: 16px; }
.ov-setup { margin-bottom: 14px; }
.ov-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ov-steps li { display: flex; align-items: center; gap: 10px; }
.ov-steps a { color: var(--text); text-decoration: none; }
.ov-steps a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ov-step { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--border); }
.ov-steps li.done .ov-step { color: var(--primary); background: var(--primary-tint); border-color: var(--primary-line); }
.ov-steps li.done a { color: var(--faint); }

/* ------------------------------------------------------------ rekap */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* buku besar ringkas: satu baris per karyawan, hanya catatan yang ada */
table.data.ledger { min-width: 860px; }
table.data.ledger td, table.data.ledger tbody th { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
table.data.ledger thead th { padding-top: 8px; padding-bottom: 8px; }
table.data.ledger thead th:first-child, table.data.ledger tbody th { position: sticky; left: 0; z-index: 1; min-width: 250px; text-align: left; box-shadow: inset -1px 0 0 var(--divider); }
table.data.ledger tbody th { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); white-space: normal; }
table.data.ledger tbody th { background: var(--surface); font-weight: 400; border-bottom: 1px solid var(--divider); }
table.data.ledger tbody tr.click:hover th { background: var(--primary-tint); }
table.data.ledger tbody tr:last-child th { border-bottom: 0; }
.lg-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
.lg-sort svg { opacity: 0; transition: opacity .15s; }
.lg-sort:hover svg { opacity: .5; }
.lg-sort.is-on { color: var(--text); }
.lg-sort.is-on svg { opacity: 1; }
.lg-sort:focus-visible, .lg-name:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
table.data.ledger .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.lg-who { min-width: 0; }
.lg-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; border-radius: 6px; }
.lg-name:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.lg-rate { display: grid; grid-template-columns: 40px minmax(90px, 140px); gap: 3px 10px; align-items: center; }
.lg-pct { font-weight: 700; }
.lg-meter { height: 6px; border-radius: 999px; overflow: hidden; display: block; }
.lg-meter span { display: block; height: 100%; border-radius: 999px; }
.lg-meter.m-good { background: var(--primary-soft); } .lg-meter.m-good span { background: var(--primary); }
.lg-meter.m-warn { background: var(--amber-soft); } .lg-meter.m-warn span { background: var(--amber-bar); }
.lg-meter.m-bad { background: var(--red-soft); } .lg-meter.m-bad span { background: var(--red); }
.lg-meter.m-none { background: var(--divider); }
.lg-days { grid-column: 2; font-size: 11px; color: var(--muted); }
.lg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.lg-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; border: 1px solid; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.lg-chip.c-bad { background: var(--red-soft); border-color: var(--red-line); color: var(--red-deep); }
.lg-chip.c-warn { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-deep); }
.lg-chip.c-quiet { background: var(--bg); border-color: var(--border); color: var(--muted); }
.lg-clean, .lg-none { color: var(--faint); font-size: 12px; }
.lg-req { font-size: 12.5px; white-space: nowrap; }
.recap-note { margin: auto 2px 0; padding-top: 16px; max-width: 75ch; }
/* Halaman yang catatan kakinya menempel di bawah: wadah tampilan mengisi tinggi area konten. */
main.page:has(> .page-fill) { display: flex; flex-direction: column; }
.page-fill { flex: 1; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ rekap: kinerja & grafik */
.recap-h { margin: 6px 0 10px; }
.insights { display: grid; gap: 14px; margin-bottom: 24px; transition: opacity .2s; }
.insights:empty { display: none; }
.insights.is-loading { opacity: .55; }
/* status harian: satu arti, satu warna, di semua grafik */
.s-ok { background: var(--primary); }
.s-late { background: var(--amber-bar); }
.s-leave { background: var(--leave); }
.s-absent { background: var(--red); }
.s-off { background: var(--divider); }
.s-none { background: var(--surface); box-shadow: inset 0 0 0 1px var(--divider); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.2; margin-top: 2px; }
.kpi-ctx { font-size: 12px; color: var(--muted); }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: auto; padding-top: 6px; }
.kpi-delta.muted { font-weight: 400; }
.kpi-delta.is-good { color: var(--primary); }
.kpi-delta.is-bad { color: var(--red-deep); }

.ins-card { padding: 14px 16px 16px; min-width: 0; }
.ins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ins-head h3 { margin-bottom: 2px; }
.ins-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.ins-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ins-key { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.ins-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ins-clear { display: flex; align-items: center; gap: 10px; color: var(--primary); padding: 8px 0; }

/* peta kehadiran: karyawan × hari */
.hm-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; }
.hm { display: grid; grid-template-columns: minmax(150px, 200px) repeat(var(--days), minmax(14px, 1fr)) 48px; gap: 3px; align-items: center; min-width: calc(150px + var(--days) * 17px + 48px); }
.hm-corner { align-self: end; padding-bottom: 2px; }
.hm-day { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; padding-bottom: 2px; }
.hm-day.is-sun { color: var(--faint); }
.hm-day.is-today { color: var(--primary); font-weight: 700; }
.hm-rate-h { text-align: right; align-self: end; padding-bottom: 2px; }
.hm-name { position: sticky; left: 0; z-index: 1; background: var(--surface); border: 0; padding: 0 8px 0 0; font: inherit; font-size: 12.5px; text-align: left; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 100%; }
.hm-name:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.hm-name:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 6px; }
.hm-c { aspect-ratio: 1; max-height: 26px; border-radius: 4px; cursor: pointer; }
.hm-c:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.hm-c.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary-line); }
.hm-rate { font-size: 12px; text-align: right; color: var(--muted); }

/* kehadiran harian: kolom bertumpuk */
.tr-plot { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: 168px auto; column-gap: 8px; row-gap: 6px; }
.tr-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-variant-numeric: tabular-nums; margin: -6px 0; }
.tr-area { position: relative; border-bottom: 1px solid var(--border); }
.tr-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.tr-grid i { border-top: 1px solid var(--divider); }
.tr-grid i:last-child { border-top: 0; }
.tr-cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.tr-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; cursor: default; }
.tr-col:hover { background: var(--primary-tint); }
.tr-stack { width: 100%; max-width: 18px; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.tr-stack span { flex-basis: 0; min-height: 2px; }
.tr-x { display: flex; gap: 2px; font-variant-numeric: tabular-nums; }
.tr-x span { flex: 1; text-align: center; }

/* sebaran jam masuk */
.ds-plot { position: relative; height: 196px; }
.ds-bars { position: absolute; top: 18px; bottom: 22px; left: 0; right: 0; display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.ds-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border-radius: 4px 4px 0 0; }
.ds-col:hover { background: var(--primary-tint); }
.ds-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; }
.ds-peak { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ds-zero { position: absolute; top: 0; bottom: 22px; border-left: 1px solid var(--muted); pointer-events: none; }
.ds-zero span { position: absolute; top: 0; left: 4px; color: var(--muted); white-space: nowrap; }
.ds-x { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-variant-numeric: tabular-nums; }
.ds-x span { position: absolute; transform: translateX(-50%); }
.ds-x span:first-child { left: 0; transform: none; }
.ds-x span:last-child { right: 0; transform: none; }

/* batang mendatar: jam per lokasi, paling sering telat */
.hb { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hb li { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 12px; align-items: center; }
.hb-label { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; }
.hb-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.hb-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-bar { height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.hb-val { font-size: 12px; color: var(--text); white-space: nowrap; }

/* tooltip bersama */
.ins-tip { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; background: var(--text); color: #fff; border-radius: 9px; padding: 8px 10px; font-size: 12px; line-height: 1.45; min-width: 150px; max-width: 260px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.ins-tip .tip-title { font-weight: 600; }
.ins-tip .tip-sub, .ins-tip .tip-line { color: rgba(255, 255, 255, .78); }
.ins-tip .tip-row { display: flex; align-items: center; gap: 6px; }
.ins-tip .tip-row b { margin-left: auto; padding-left: 12px; }
.ins-tip .ins-key { box-shadow: 0 0 0 2px var(--text); }

/* satu momen gerak: kartu berpindah saat bulan/lokasi diganti */
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; } }

/* ------------------------------------------------------------ dialog */
dialog.dlg { border: 0; border-radius: 16px; padding: 0; width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .18); color: var(--text); display: flex; flex-direction: column; }
dialog.dlg:not([open]) { display: none; }
dialog.dlg.wide { width: min(860px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(19, 32, 30, .45); }
.dlg-head { padding: 16px 18px 12px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--divider); }
.dlg-head > div { flex: 1; }
.dlg-content { overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.dlg-body { padding: 16px 18px; overflow: auto; }
.dlg-foot { padding: 12px 18px; border-top: 1px solid var(--divider); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
.dlg-foot .left { margin-right: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 1000; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }

/* ------------------------------------------------------------ halaman masuk */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: var(--primary); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 30px; line-height: 1.2; max-width: 440px; letter-spacing: -0.6px; }
.auth-tag { margin-left: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.auth-hero .mark { background: rgba(255, 255, 255, .16); }
.auth-hero .ring { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .14); }
.auth-hero .ring.r2 { right: -60px; bottom: -60px; width: 300px; height: 300px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 20px; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; background: var(--divider); padding: 4px; border-radius: 10px; margin: 18px 0; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 6px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; font-size: 12.5px; }

/* halaman mulai (akun tanpa perusahaan) */
.onb { min-height: 100vh; }
.onb-col { width: 100%; max-width: 460px; }
.onb-col .brand { margin-bottom: 18px; padding: 0; }
.onb-lead { margin: 6px 0 18px; }
.onb .or { margin: 18px 0; }
.onb-join { padding: 14px 16px; }
.onb-join-row { display: flex; gap: 8px; align-items: flex-end; }
.onb-join-row .field { flex: 1; min-width: 0; }
.onb-join-row .btn { height: 38px; }
.onb-foot { margin-top: 18px; }

.splash { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ------------------------------------------------------------ responsif */
@media (max-width: 1000px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ins-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side .grow, .me .who { display: none; }
  .company-switch { flex: 1; width: auto; }
  nav.menu { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  nav.menu a { white-space: nowrap; }
  .me { border-top: 0; padding: 0; }
  main.page { padding: 16px 16px 32px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 20px; }
  .auth-hero h1 { font-size: 24px; }
}
@media (max-width: 560px) {
  .grid.cols-4, .grid.cols-2, .form-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .ov-away { grid-template-columns: 1fr; gap: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb li { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr); }
}
