/* =====================================================================
   ACTTRACK — Tampilan
   Layout: HP = header ringkas + menu bawah; komputer (>720px) = menu atas.
   ===================================================================== */
:root {
  --bg:#F3F5F8; --surface:#FFFFFF; --surface-2:#EBEFF5; --line:#D8DEE8;
  --fg:#18202E; --muted:#5B6678; --accent:#2F4FA8; --accent-fg:#FFFFFF; --accent-soft:#E3E9F8;
  --brand:#F4B183;
  --ok:#1E7F5C; --ok-soft:#DDF2E9; --warn:#A8620B; --warn-soft:#FCEBD3; --crit:#B3261E; --crit-soft:#FADDDA;
  --edit:#6B4FA0; --edit-soft:#ECE5F7; --low:#5C7A99;
  --j-tech:#2a78d6; --j-rep:#eb6834; --j-sup:#1baf7a; --j-coo:#eda100; --j-oth:#e87ba4;
  --c1:#2a78d6; --c2:#eb6834; --c3:#1baf7a; --c4:#eda100; --c5:#e87ba4; --c6:#008300; --good:#1E8A4C; --bad:#D03B3B; --edit-bar:#6B4FA0;
  --font:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:var(--font);
  --r:12px; --navh:64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg:#10141C; --surface:#181E29; --surface-2:#222A37; --line:#2E3746;
  --fg:#E6EAF1; --muted:#98A3B5; --accent:#8EA8F0; --accent-fg:#0E1424; --accent-soft:#25304A;
  --brand:#D99467;
  --ok:#5CC79C; --ok-soft:#173329; --warn:#E6A54F; --warn-soft:#3A2A14; --crit:#F08178; --crit-soft:#3D1E1C;
  --edit:#B9A2E6; --edit-soft:#2C2440; --low:#94AFCB;
  --j-tech:#3987e5; --j-rep:#d95926; --j-sup:#199e70; --j-coo:#c98500; --j-oth:#d55181;
  --c1:#3987e5; --c2:#d95926; --c3:#199e70; --c4:#c98500; --c5:#d55181; --c6:#2E9E2E; --good:#3FB871; --bad:#EE6B6B; --edit-bar:#9C86D6;
  color-scheme: dark;
}}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13.5px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
h1,h2,h3 { margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.3rem; font-weight: 700; } h2 { font-size: 1rem; font-weight: 650; } h3 { font-size: .92rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.pad { padding-block: 32px; display: grid; gap: 16px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- brand / login ---------- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none; }
.brand img { border-radius: 7px; }
.brand.big { font-size: 1.3rem; } .brand.big img { width: 40px; height: 40px; border-radius: 10px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 400px; display: grid; gap: 20px; }

/* ---------- header & menu ---------- */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.top-row { display: flex; align-items: center; gap: 20px; min-height: 56px; }
nav.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
nav.tabs a { display: flex; align-items: center; padding: 0 12px; font-weight: 600; font-size: .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-size: .82rem; min-width: 0; margin-left: auto; }
.who-txt { text-align: right; min-width: 0; } .who-txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.2rem; }

nav.bottom { display: none; }

main#view { padding-block: 22px 56px; }
.view { display: grid; gap: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head.tight { align-items: center; }
.page-head p { color: var(--muted); font-size: .88rem; margin-top: 2px; }

/* ---------- kartu & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; min-width: 0; }
.card.narrow, .narrow { max-width: 640px; width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.kpi .v { font-family: var(--font); font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi .v.good { color: var(--ok); } .kpi .v.warn { color: var(--warn); }
.kpi small { color: var(--muted); font-size: .74rem; line-height: 1.35; }

/* ---------- form ---------- */
.form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .flabel { font-size: .82rem; font-weight: 600; }
.hint { font-size: .76rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { resize: vertical; min-height: 72px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.check input { width: 20px; height: 20px; min-height: 0; }
.custom-box { max-width: 220px; margin-top: 6px; display: grid; gap: 4px; }

.btn { font: 600 .9rem var(--font); border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 10px 16px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.start { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.btn.end { background: var(--crit); border-color: var(--crit); color: var(--surface); }
.btn.danger { color: var(--crit); border-color: var(--crit); background: var(--surface); }
.btn.big { padding: 14px 26px; font-size: 1.05rem; min-height: 52px; }
.btn.small { padding: 6px 12px; font-size: .82rem; min-height: 36px; }
.btn.icon { width: 44px; padding: 0; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: var(--surface-2); color: var(--fg); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; flex: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg button { font: 600 .9rem var(--font); border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 10px; min-height: 46px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.segtabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.segtabs button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: 600 .88rem var(--font); color: var(--muted); cursor: pointer; min-height: 38px; }
.segtabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }

.err { background: var(--crit-soft); color: var(--crit); border-radius: 10px; padding: 10px 12px; font-size: .88rem; font-weight: 600; }
.err ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .84rem; color: var(--muted); }
.warn-txt { color: var(--warn); font-weight: 700; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 32px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chip ---------- */
.chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.chip.rt { background: var(--ok-soft); color: var(--ok); } .chip.bt { background: var(--warn-soft); color: var(--warn); }
.chip.ed { background: var(--edit-soft); color: var(--edit); } .chip.adm { background: var(--crit-soft); color: var(--crit); }
.chip.tag { background: var(--surface-2); color: var(--muted); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- daftar sederhana ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.li-main { min-width: 0; } .li-main b { font-weight: 600; }
.li-num { text-align: right; flex: none; }

/* ---------- tabel (berubah jadi kartu di HP) ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; font-weight: 600; background: var(--surface-2); padding: 9px 12px; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
th.n { text-align: left; }
tr.dim td { opacity: .55; }

/* ---------- timer ---------- */
.timers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; min-width: 0; }
.tcard-top { display: flex; justify-content: space-between; align-items: center; }
.clock { font-family: var(--font); font-size: 2.3rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .08em; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.prog { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.prog span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 1s linear; }

/* ---------- bar chart ---------- */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 62px; gap: 10px; align-items: center; font-size: .84rem; }
.bar .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; }
.bar .fill { height: 100%; border-radius: 4px; background: var(--accent); }
.bar .fill.low { background: var(--low); } .bar .fill.ok { background: var(--ok); }
.bar .val { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .8rem; }
.bar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fg); opacity: .55; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .lg-bt { background: var(--muted); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 3px, transparent 3px 6px); }
.legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend .lg-gap { border: 1px dashed var(--warn); background: var(--warn-soft); }
.legend .lg-mark { width: 2px; background: var(--fg); opacity: .55; }

/* ---------- timeline ---------- */
.tl-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.tl-tools .grow { flex: 1 1 220px; max-width: 320px; }
.daynav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.daypick { position: relative; min-width: 190px; text-align: center; font-size: .9rem; padding: 0 6px; }
.daypick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.tl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); -webkit-overflow-scrolling: touch; }
.tl { --labw: 190px; --sumw: 76px; --colw: 54px; min-width: calc(var(--labw) + var(--sumw) + var(--cols) * var(--colw)); }
.tl-row { display: grid; grid-template-columns: var(--labw) 1fr var(--sumw); border-top: 1px solid var(--line); min-height: 44px; }
.tl-row:first-child { border-top: 0; }
.tl-lab { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px; font-size: .82rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.tl-lab b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tl-lab .sub { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sum { padding: 6px 10px; font: 600 .78rem var(--mono); text-align: right; display: flex; align-items: center; justify-content: flex-end; border-left: 1px solid var(--line); white-space: nowrap; }
.tl-track { position: relative; cursor: cell;
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(200% / var(--cols))),
                    repeating-linear-gradient(to right, transparent 0 calc(100% / var(--cols)), var(--surface-2) calc(100% / var(--cols)) calc(100% / var(--cols) + 1px), transparent calc(100% / var(--cols) + 1px) calc(200% / var(--cols))); }
@media (hover: hover) { .tl-track:hover { background-color: var(--accent-soft); } }
.tl-head, .tl-head .tl-lab { background: var(--surface-2); }
.tl-head .tl-track { cursor: default; background-image: none; height: 30px; }
.tl-head .tl-lab, .tl-head .tl-sum { font: 700 .68rem var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tick { position: absolute; top: 7px; font: 600 .7rem var(--mono); color: var(--muted); transform: translateX(3px); white-space: nowrap; }
.tick.h { color: var(--fg); }
.tl-occ, .tl-occ .tl-lab { background-color: var(--surface-2); }
.tl-add .tl-lab b { color: var(--accent); }
.add-hint { position: sticky; left: calc(var(--labw) + 8px); display: inline-block; margin-top: 12px; margin-left: 10px; font-size: .76rem; color: var(--muted); pointer-events: none; }
.tl-bar { position: absolute; top: 9px; bottom: 9px; border-radius: 5px; min-width: 4px; cursor: pointer; z-index: 2; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
@media (hover: hover) { .tl-bar { cursor: grab; } .tl-bar:hover { filter: brightness(1.1); } }
.tl-bar.drag { cursor: grabbing; opacity: .85; z-index: 3; outline: 2px solid var(--fg); }
.tl-bar.bt { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.38) 0 4px, transparent 4px 8px); }
.tl-bar .h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.tl-bar .h.l { left: 0; } .tl-bar .h.r { right: 0; }
.tl-bar .dot { position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--edit); border: 2px solid var(--surface); pointer-events: none; }
.tl-bar .dot.adm { background: var(--crit); }
.tl-bar.run { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.3) 0 6px, transparent 6px 12px); animation: runbar 1.2s linear infinite; }
@keyframes runbar { to { background-position: 12px 0; } }
.tl-dlabel { position: absolute; top: -24px; left: 0; background: var(--fg); color: var(--bg); font: 600 .72rem var(--mono); padding: 2px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.occ-seg, .occ-multi, .occ-gap { position: absolute; top: 11px; bottom: 11px; border-radius: 3px; pointer-events: none; }
.occ-seg { background: var(--accent); } .occ-multi { background: var(--edit-bar); }
.occ-gap { background-image: repeating-linear-gradient(45deg, var(--warn-soft) 0 4px, transparent 4px 8px); border: 1px dashed var(--warn); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--crit); z-index: 3; pointer-events: none; }
.tl-now.head::after { content: "Sekarang"; position: absolute; top: -1px; left: 4px; font: 700 .62rem var(--font); color: var(--crit); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tl-future { position: absolute; top: 0; bottom: 0; right: 0; background: var(--surface-2); opacity: .55; pointer-events: none; }
.tip { position: fixed; z-index: 40; background: var(--fg); color: var(--bg); font-size: .8rem; padding: 8px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; line-height: 1.4; }
.tip b { display: block; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,14,22,.5); display: grid; place-items: center; padding: 16px; z-index: 30; }
.modal { background: var(--surface); border-radius: 16px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; overscroll-behavior: contain; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .push { margin-left: auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: .88rem; font-weight: 600; z-index: 50; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* ---------- akun & menu lainnya ---------- */
.profile { grid-template-columns: auto 1fr; align-items: center; }
.profile-info { display: grid; gap: 4px; justify-items: start; }
.menu-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--fg); border-top: 1px solid var(--line); min-height: 60px; }
.menu-item:first-child { border-top: 0; }
.mi-ico { color: var(--accent); display: grid; } .mi-txt { flex: 1; min-width: 0; } .mi-go { color: var(--muted); font-size: 1.3rem; }

/* =====================================================================
   HP / layar kecil (≤ 720px)
   ===================================================================== */
@media (max-width: 720px) {
  nav.tabs, .who-txt { display: none; }
  .top-row { min-height: 52px; }
  main#view { padding-block: 16px calc(var(--navh) + 28px + env(safe-area-inset-bottom, 0px)); }
  body { font-size: 13px; }
  h1 { font-size: 17px; } h2 { font-size: 14.5px; }
  .label, th { font-size: 9.5px; }
  input, select, textarea { font-size: 16px; }
  .kpi .v { font-size: 1.15rem; }
  .card { padding: 16px; }

  nav.bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  nav.bottom a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--navh);
    color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; }
  nav.bottom a[aria-current="page"] { color: var(--accent); }
  nav.bottom a[aria-current="page"] svg { transform: translateY(-1px); }
  nav.bottom .badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--ok); color: var(--surface);
    font: 700 .66rem/18px var(--font); font-style: normal; text-align: center; padding: 0 5px; }
  .toast { bottom: calc(var(--navh) + 14px + env(safe-area-inset-bottom, 0px)); }

  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 1.2rem; }
  .kpis.k3 { grid-template-columns: repeat(3, 1fr); }
  .kpis.k3 .kpi .v { font-size: 1.02rem; }

  /* tabel → kartu */
  .tbl-wrap:has(.rtable) { border: 0; background: none; overflow: visible; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody { display: block; }
  .rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
  .rtable td { border: 0; padding: 0; min-width: 0; }
  .rtable td[data-label]::before { content: attr(data-label); display: block; font: 700 .66rem var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 1px; }
  .rtable td.rt-title { grid-column: 1 / -1; font-weight: 700; font-size: .95rem; white-space: normal; }
  .rtable td.rt-title::before { display: none; }
  .rtable td.rt-act { grid-column: 1 / -1; }
  .rtable td.rt-act .btn { width: 100%; }

  /* timeline */
  .tl { --labw: 108px; --sumw: 56px; --colw: 42px; }
  .tl-lab { padding: 6px 8px; font-size: .76rem; }
  .tl-sum { padding: 6px; font-size: .7rem; }
  .daynav { width: 100%; justify-content: space-between; }
  .daypick { flex: 1; min-width: 0; }
  .tl-tools .grow { max-width: none; }

  /* modal = lembar dari bawah */
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal-actions .btn { flex: 1; }
  .modal-actions .push { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 380px) {
  .row2 { grid-template-columns: 1fr; }
  .seg { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .bar { grid-template-columns: 84px 1fr 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .live::before, .tl-bar.run, .spinner { animation: none; } .prog span { transition: none; }
}
@media (min-width: 721px) { .seg { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* =====================================================================
   Tambahan v2: durasi custom, foto, status hari, kalender, grafik
   ===================================================================== */
.ghost { background: transparent; }
.mt { margin-top: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.center-row { justify-content: center; }
.field.compact { min-width: 160px; } .field.compact select { min-height: 38px; padding-block: 6px; font-size: .86rem; }

/* durasi: kolom angka + menit */
.seg-custom { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface); grid-column: span 1; min-height: 46px; }
.seg-custom input { border: 0; padding: 0; min-height: 0; width: 100%; background: transparent; text-align: right; font-weight: 600; }
.seg-custom input:focus-visible { outline: none; }
.seg-custom span { font-size: .82rem; color: var(--muted); }
.seg-custom.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.seg-custom:focus-within { border-color: var(--accent); }
.seg7 { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }

/* foto */
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; text-align: center; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop label.btn { cursor: pointer; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { display: grid; place-items: center; height: 100%; color: var(--muted); }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; cursor: pointer; }
.thumb-new { position: absolute; left: 4px; bottom: 4px; font-size: .62rem; font-weight: 700; background: var(--accent); color: var(--accent-fg); border-radius: 6px; padding: 1px 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }

/* status hari di timeline */
.daystat { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ok-soft); color: var(--fg); border-radius: 10px; padding: 8px 12px; font-size: .86rem; }
.daystat.off { background: var(--surface-2); }
.daystat.ov { background: var(--warn-soft); }

/* kalender jadwal */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: .7rem; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-height: 58px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; color: var(--fg); }
.cal-cell.empty { border: 0; background: none; cursor: default; }
.cal-cell.work { background: var(--ok-soft); border-color: transparent; }
.cal-cell.off { background: var(--surface-2); color: var(--muted); border-color: transparent; }
.cal-cell.holiday { background: var(--crit-soft); border-color: transparent; }
.cal-cell.ov-off { background: var(--warn-soft); border-color: var(--warn); }
.cal-cell.ov-work { background: var(--accent-soft); border-color: var(--accent); }
.cal-cell.today { box-shadow: 0 0 0 2px var(--fg); }
.cal-n { font-weight: 650; font-size: .9rem; }
.cal-tag { font-size: .6rem; line-height: 1.15; text-align: center; color: var(--fg); opacity: .8; word-break: break-word; }
.legend .lg-cal { width: 14px; height: 12px; border-radius: 3px; }
.lg-cal.work { background: var(--ok-soft); border: 1px solid var(--ok); } .lg-cal.off { background: var(--surface-2); border: 1px solid var(--line); }
.lg-cal.holiday { background: var(--crit-soft); border: 1px solid var(--crit); } .lg-cal.ov-off { background: var(--warn-soft); border: 1px solid var(--warn); }
.lg-cal.ov-work { background: var(--accent-soft); border: 1px solid var(--accent); }
.radio-list { display: grid; gap: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; }
.checkgroup { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; display: grid; gap: 6px; }
.checkgroup legend { font-size: .78rem; font-weight: 650; color: var(--muted); padding: 0 4px; }
.card-link { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

/* grafik */
.chart { max-width: 100%; height: auto; display: block; margin-inline: auto; overflow: visible; }
.chart .ax { font: 500 10.5px var(--font); fill: var(--muted); }
.chart .ax.off { font-weight: 600; }
.chart .lb { font: 600 11.5px var(--font); fill: var(--fg); }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-scroll .chart { margin: 0; max-width: none; }
.legend.center { justify-content: center; }
.legend .sq { width: 11px; height: 11px; border-radius: 3px; } .legend .dt { width: 11px; height: 11px; border-radius: 50%; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
table.mini { font-size: .8rem; margin-top: 6px; } table.mini th, table.mini td { padding: 5px 8px; }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.stack span { height: 100%; }
.trend { display: grid; grid-template-columns: repeat(var(--n), minmax(30px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tcol { display: grid; gap: 3px; justify-items: center; min-width: 30px; }
.tbar-wrap { position: relative; width: 100%; height: 130px; background: var(--surface-2); border-radius: 6px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.tbar { width: 70%; background: var(--accent); border-radius: 4px 4px 0 0; }
.tbar.ok { background: var(--ok); } .tbar.low { background: var(--low); }
.t100 { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--fg); opacity: .4; }
.toff { position: absolute; inset: 0; display: grid; place-items: center; font-size: .62rem; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }
.tval { font-size: .72rem; font-weight: 600; min-height: 1em; }
.tday { font-size: .66rem; color: var(--muted); text-align: center; line-height: 1.2; }

/* matriks mulai/selesai */
.mx-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.mx { border-collapse: separate; border-spacing: 0; font-size: .78rem; width: auto; min-width: 100%; }
.mx th, .mx td { padding: 6px 6px; border-top: 1px solid var(--line); text-align: center; white-space: nowrap; }
.mx thead th { border-top: 0; font-size: .66rem; }
.mx thead th span { display: block; font-weight: 500; }
.mx .mx-name { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; border-right: 1px solid var(--line); max-width: 140px; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; text-transform: none; letter-spacing: 0; color: var(--fg); }
.mx thead .mx-name { background: var(--surface-2); color: var(--muted); }
.mx td { min-width: 62px; }
.pill { display: block; border-radius: 6px; padding: 1px 6px; font-weight: 600; font-size: .74rem; color: #fff; margin: 1px 0; }
.pill.dot { border-radius: 999px; }
.pill.good { background: var(--good); } .pill.warn { background: var(--warn); } .pill.bad { background: var(--bad); }
.mx-empty { color: var(--muted); }
.mx-off { font-size: .64rem; color: var(--muted); }
@media (max-width: 720px) {
  .seg { grid-template-columns: repeat(4, 1fr); }
  .seg-custom { grid-column: span 1; }
  .cal-cell { min-height: 48px; padding: 4px 2px; }
  .cal-tag { font-size: .54rem; }
  .thumb { width: 72px; height: 72px; }
}

/* =====================================================================
   v2.1: kartu ringkas, pemilih, donut, tiga grafik sejajar
   ===================================================================== */
.m-only { display: none; }
tr.tap { cursor: pointer; }
@media (hover: hover) { tr.tap:hover td { background: var(--surface-2); } }
.btn.icon-sm { width: 32px; min-height: 32px; padding: 0; font-size: .95rem; }
.list.compact li { padding: 7px 0; }
.list.compact .sub { font-size: .74rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }

/* donut */
.donut-wrap { display: grid; gap: 10px; justify-items: center; }
.chart.donut { width: 100%; max-width: 210px; }
.dn-big { font: 700 22px var(--font); fill: var(--fg); }
.dn-small { font: 500 11px var(--font); fill: var(--muted); }
.dn-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 4px; }
.dn-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: .82rem; }
.dn-legend i { width: 11px; height: 11px; border-radius: 3px; }
.dn-legend .sub { display: inline; min-width: 52px; text-align: right; }

/* pemilih */
.pick-field { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.pick-field span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-field.empty { color: var(--muted); }
.pk-caret { color: var(--muted); font-size: .75rem; }
.pk-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.picker { display: flex; flex-direction: column; gap: 10px; max-width: 440px; padding: 16px; max-height: min(640px, 86vh); }
.picker-head { display: flex; justify-content: space-between; align-items: center; }
.picker-q { min-height: 40px; }
.picker-list { overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; flex: 1; min-height: 120px; }
.pk-sec { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 2px; }
.pk-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--fg); font: inherit; font-size: .88rem;
  text-align: left; padding: 10px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.pk-item:hover, .pk-item:focus-visible { background: var(--surface-2); }
.pk-item.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pk-label { flex: 1; min-width: 0; }
.pk-label b { color: var(--accent); }
.pk-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); flex: none; position: relative; }
.pk-check.on { background: var(--accent); border-color: var(--accent); }
.pk-check.on::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--accent-fg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pk-empty { color: var(--muted); padding: 14px 10px; font-size: .86rem; }
.picker-bulk { gap: 6px; }
.picker-foot { padding-top: 4px; }

@media (max-width: 720px) {
  .m-only { display: block; }
  .d-only { display: none !important; }
  .rtable tr { position: relative; gap: 3px 10px; padding: 11px 12px; margin-bottom: 8px; }
  .rtable td.rt-title { font-size: 14px; padding-right: 26px; }
  .rtable td.rt-title .sub { font-weight: 500; }
  .rtable .pen { position: absolute; top: 10px; right: 12px; color: var(--muted); font-size: 14px; }
  .rtable td.rt-when { grid-column: 1 / -1; font-size: 12px; color: var(--fg); }
  .rtable td.rt-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; }
  .rtable td.rt-meta .btn { min-height: 28px; padding: 2px 8px; font-size: .76rem; }
  .rt-note { flex-basis: 100%; font-size: 11.5px; }
  .rtable.compact td[data-label]::before { font-size: 9px; }
  .picker-bg { place-items: end stretch; padding: 0; }
  .picker { max-width: none; border-radius: 18px 18px 0 0; max-height: 82vh; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .pk-item { font-size: 13.5px; padding: 9px 10px; }
  .dn-legend li { font-size: 12px; }
}
