:root {
  --paper: #F4F5F3;
  --surface: #FFFFFF;
  --ink: #1F2A2E;
  --ink-2: #4A5559;
  --muted: #6E787B;
  --line: #DDE1DE;
  --line-2: #EBEEEC;
  --accent: #2F5D62;
  --accent-soft: #E3ECEC;
  --minus: #B83A2B;
  --minus-soft: #F7E7E4;
  --plus: #2E6B47;
  --plus-soft: #E3F0E8;
  --amber: #8A5A12;
  --amber-soft: #F6EDDC;
  --r-sm: 6px;
  --r: 10px;
  --sidebar: 248px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); font-feature-settings: 'tnum' 1; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ink); color: #D9DFDF;
  padding: 22px 14px 22px 30px; display: flex; flex-direction: column; gap: 18px;
}
/* tepi perforasi film — elemen identitas Studio Kita */
.sidebar::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 9px;
  background: repeating-linear-gradient(to bottom, transparent 0 7px, rgba(244,245,243,.16) 7px 16px);
}
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 10px; }
.brand b { font-family: var(--display); font-size: 1.35rem; letter-spacing: .14em; color: #fff; }
.brand span { font-size: .8rem; color: #93A0A2; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: .74rem; color: #7F8C8E; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #D9DFDF; text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: #F4F5F3; color: var(--ink); }
.nav a .badge { margin-left: auto; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { margin-top: auto; font-size: .8rem; color: #93A0A2; padding: 0 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.topbar .title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; }
.who .meta { text-align: right; line-height: 1.25; }
.who .meta small { display: block; color: var(--muted); font-size: .78rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.content { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.bottom-nav { display: none; }

/* ---------- Komponen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #BFC6C3; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2C3A3F; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--minus); border-color: #E7C3BD; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel > header .actions { margin-left: auto; display: flex; gap: 6px; }
.panel .body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.minus { color: var(--minus); }
.plus { color: var(--plus); }
.right { text-align: right; }

/* Ringkasan angka */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.fig { padding: 14px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
.fig dt { color: var(--muted); font-size: .84rem; }
.fig dd { margin: 4px 0 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fig dd.minus { color: var(--minus); }

/* Angka utama: take home pay sebagai "cetakan" */
.print { background: var(--ink); color: #fff; border-radius: var(--r); padding: 22px 24px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.print .lbl { color: #A9B5B7; font-size: .88rem; }
.print .val { font-family: var(--display); font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.print .note { color: #A9B5B7; font-size: .84rem; }
.print::after { content: ''; position: absolute; right: 18px; top: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(to bottom, transparent 0 8px, rgba(255,255,255,.13) 8px 18px); }

/* Tabel */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFA; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: #FAFBFA; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: #FAFBFA; }
.t .actions { white-space: nowrap; text-align: right; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* Status */
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.st.DRAFT { background: var(--line-2); color: var(--ink-2); }
.st.SUBMITTED, .st.PENDING, .st.WAITING_APPROVAL { background: var(--amber-soft); color: var(--amber); }
.st.APPROVED, .st.PRESENT { background: var(--accent-soft); color: var(--accent); }
.st.READY_TO_PAY { background: #E4E8F3; color: #33437A; }
.st.PAID { background: var(--plus-soft); color: var(--plus); }
.st.REJECTED, .st.ALPHA, .st.UNPAID { background: var(--minus-soft); color: var(--minus); }
.st.LATE { background: var(--amber-soft); color: var(--amber); }
.badge { background: var(--minus); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; line-height: 1.6; }
.pic { display: inline-block; font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--ink); color: #fff; margin-left: 4px; vertical-align: 1px; }

/* Form */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; min-height: 38px; }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters .field { min-width: 140px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.rating-grid { display: grid; gap: 8px; }
.rating-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.calc { background: var(--accent-soft); border-radius: var(--r-sm); padding: 12px 14px; font-size: .9rem; }
.calc b { font-size: 1.1rem; }
.calc ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.items-list .item { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.notice { border-left: 3px solid var(--amber); background: var(--amber-soft); padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .9rem; }
.notice.info { border-color: var(--accent); background: var(--accent-soft); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(23,31,34,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(680px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(20,28,30,.25); }
.modal.wide { width: min(940px, 100%); }
.modal > header { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal > header .x { margin-left: auto; }
.modal .mbody { padding: 18px 20px; overflow-y: auto; }
.modal > footer { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(0,0,0,.18); font-weight: 500; max-width: 90vw; }
.toast.err { background: var(--minus); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 12px; background: repeating-linear-gradient(to bottom, transparent 0 10px, rgba(244,245,243,.15) 10px 22px); }
.login .art::after { content: ''; position: absolute; right: 22px; top: 0; bottom: 0; width: 12px; background: repeating-linear-gradient(to bottom, transparent 0 10px, rgba(244,245,243,.15) 10px 22px); }
.login .art .mark { font-family: var(--display); font-size: clamp(3rem, 7vw, 5.4rem); line-height: .92; letter-spacing: .04em; font-weight: 700; padding-left: 24px; }
.login .art p { color: #A9B5B7; max-width: 36ch; padding-left: 24px; }
.login form { align-self: center; justify-self: center; width: min(380px, 100% - 40px); display: flex; flex-direction: column; gap: 14px; }
.login .err { color: var(--minus); font-size: .9rem; min-height: 1.3em; }

/* Slip gaji */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 30px; max-width: 820px; }
.slip .head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; gap: 10px; }
.slip .head b { font-family: var(--display); font-size: 1.6rem; letter-spacing: .14em; }
.slip .meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; margin-bottom: 20px; }
.slip .meta dt { color: var(--muted); font-size: .8rem; }
.slip .meta dd { margin: 0; font-weight: 600; }
.slip .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.slip .line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.slip .line.total { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--ink); margin-top: 4px; }
.slip .thp { margin-top: 20px; }

/* Grafik */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; font-size: .88rem; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0 30% 0 0; z-index: 40; height: 100vh; }
  .topbar { padding: 12px 16px; }
  .topbar .who .meta { display: none; }
  .content { padding: 18px 16px 96px; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig { padding: 12px 14px; }
  .fig dd { font-size: 1.05rem; }
  .page-head .actions { margin-left: 0; }
  h1 { font-size: 1.4rem; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; border: 0; background: none; padding: 4px 2px; font-weight: 600; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--ink); }
  .login { grid-template-columns: 1fr; }
  .login .art { min-height: 220px; padding: 32px 28px; }
  .slip { padding: 18px; }
  .slip .cols, .slip .meta { grid-template-columns: 1fr; }
  .t.stackable thead { display: none; }
  .t.stackable, .t.stackable tbody { display: block; width: 100%; }
  .t.stackable td::before { flex: none; max-width: 45%; }
  .t.stackable td > .v { min-width: 0; overflow-wrap: anywhere; }
  .t.stackable td > .v .clip { max-width: 100% !important; }
  .t.stackable td[data-l=""]::before { display: none; }
  .t.stackable td[data-l=""] { justify-content: flex-end; }
  .t.stackable tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .t.stackable td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
  .t.stackable td::before { content: attr(data-l); color: var(--muted); font-size: .8rem; text-align: left; }
  .t.stackable td.num { text-align: right; }
  .t.stackable tfoot { display: block; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .slip { border: 0; padding: 0; }
  .print { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.btn svg { width: 18px; height: 18px; flex: none; }

/* Absensi: selfie, lokasi, istirahat */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.timeline li { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px; }
.timeline img, .timeline .ph { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line-2); }
.thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line-2); }
.cap-step { display: flex; flex-direction: column; gap: 8px; }
.cam { position: relative; background: var(--ink); border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; max-height: 52vh; display: grid; place-items: center; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam img { width: 100%; height: 100%; object-fit: cover; }
.cam-msg { position: absolute; inset: auto 12px 12px; color: #fff; font-size: .88rem; text-align: center; }
.evidence { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.evidence figure { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.evidence img, .evidence .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; background: var(--line-2); color: var(--muted); font-size: .85rem; }
.evidence figcaption { padding: 10px 12px; display: grid; gap: 2px; }
.map-frame { width: 100%; height: 260px; border: 0; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.cam img { object-fit: contain; }
.evidence img { object-fit: contain; background: var(--ink); }
.steps3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps3 li { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; background: var(--surface); }
.steps3 li.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.steps3 li.done { background: #FAFBFA; }
.steps3 img, .steps3 .ph { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; }
.steps3 .ph { display: grid; place-items: center; background: var(--line-2); color: var(--muted); font-weight: 700; }
.steps3 li.now .ph { background: var(--accent); color: #fff; }
@media (max-width: 860px) { .steps3 { grid-template-columns: 1fr; } }

/* Mode aplikasi (PWA) di HP: hormati area notch/status bar */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* Lembur & jadwal */
.st.OPEN { background: #E4E8F3; color: #33437A; }
.st.NOT_APPLICABLE, .st.CONTINUE, .st.ZERO_CATEGORY { background: var(--line-2); color: var(--ink-2); }
.st.NEEDS_CATEGORY, .st.RATE_MISSING, .st.BELOW_MINIMUM, .st.NOT_CLOCKED_OUT { background: var(--amber-soft); color: var(--amber); }
.st.ADDITIONAL, .st.OK, .st.WORKING, .st.DONE { background: var(--accent-soft); color: var(--accent); }
.st.OVERTIME { background: #E4E8F3; color: #33437A; }
.st.NOT_IN { background: var(--minus-soft); color: var(--minus); }
.lead { font-size: 1.05rem; color: var(--ink); margin: 0; }
.cat-pick { display: grid; gap: 8px; }
.cat-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.cat-opt input { margin-top: 3px; accent-color: var(--accent); }
.cat-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cat-opt b { display: block; }
.cat-opt small { color: var(--muted); display: block; }
