/* FOLX Padel — pencatatan operasional
   Design System FOLX Padel, dipasang dengan gaya aplikasi "framed sheet" (tasteskill, seed 20946991):
   - Bingkai (sidebar + top bar 48px) di ground cream brand, tanpa garis di antaranya.
   - Halaman kerja = lembar putih, inset 8px dari kanan & bawah, sudut kiri-atas siku (bentuk "drop" FOLX),
     tiga sudut lain 16px, garis 1px, tanpa bayangan.
   - Forest = warna data (jam terjual, seri aktual, isi bar) + tombol utama. Clay = satu tanda kecil:
     garis target/batas yang harus dikejar, dan focus ring. Teks hampir hitam; tanpa gradien.
   - Clash Display hanya untuk judul halaman (tidak punya angka tabular). Satoshi untuk semua teks & angka
     (font-variant-numeric: tabular-nums benar-benar mengubah lebar digitnya).
   Aritmetika grid (1440px): sidebar 232 + lembar 1200 (inset 8) → konten 1200 − 2×32 = 1136px.
   Beranda: 1fr + rail 360 dengan celah 16 → 760 + 16 + 360 = 1136. */

@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Variable.woff2') format('woff2'); font-weight: 200 700; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Variable.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  /* brand (tokens.json FOLX) */
  --forest: #0F3725; --forest-soft: #1E4D38; --clay: #D4532F; --clay-soft: #B55D45;
  --cream: #F5F0DC; --stone: #CCCCCC; --paper: #F5F5F5; --graphite: #4D4D4D;

  /* peran aplikasi */
  --frame: var(--cream);          /* sidebar + top bar */
  --surface: #FFFFFF;             /* lembar kerja & kartu */
  --raised: #FAF8F1;              /* sumur di dalam kartu, hover baris */
  --active: #E8E1C6;              /* pil menu aktif di atas cream (1.15:1, netral-hangat) */
  --border: #E9E5D8;              /* tepi kartu: 1.26:1 di putih */
  --rule: #F1EEE5;                /* garis antarbaris */
  --control: #CFCABA;             /* input & tombol garis: satu langkah lebih tegas */
  --text: #15211B;                /* 16.6:1 di putih */
  --muted: #57554D;               /* teks sekunder: 7.1:1 putih, 6.2:1 cream */
  --faint: #6B6B6B;               /* meta & placeholder: 5.3:1 putih, 4.7:1 cream */
  --primary: var(--forest); --primary-ink: var(--cream);
  --accent: var(--forest);        /* data */
  --signal: var(--clay);          /* target & fokus */
  --clay-ink: #A63B1D;            /* clay untuk teks kecil (6.4:1) */

  --pill-pos-bg: #E4EFE7; --pill-pos-ink: #0F3725;
  --pill-neg-bg: #FBE7E0; --pill-neg-ink: #8A2A12;
  --pill-warn-bg: #FBF0D2; --pill-warn-ink: #6E4600;
  --pill-neutral-bg: #EFECE3; --pill-neutral-ink: #3D3D3D;
  --positive: #1E6B47; --negative: #A63B1D;

  /* alias lama yang masih dipakai di markup */
  --ink: var(--text); --line: var(--border); --bad: var(--negative); --warn: var(--pill-warn-ink); --court: var(--forest);

  --font: 'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Clash Display', 'Satoshi', system-ui, sans-serif;
  --fs-title: 26px; --fs-section: 16px; --fs-kpi: 24px; --fs-body: 14px; --fs-small: 12px;
  --nav-w: 232px; --gap: 16px; --card-pad: 20px; --pad: 32px;
  --r-sheet: 16px; --r-card: 16px; --r-input: 10px;
  --drop-sheet: 0 var(--r-sheet) var(--r-sheet) var(--r-sheet);   /* kiri-atas siku = bentuk drop */
  --control-h: 38px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--fs-body); line-height: 20px; color: var(--text); background: var(--frame); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--forest); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.num, table.t td, .kpi .v, .score, .cnt { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 18px; }
h1, h2, h3 { margin: 0; color: var(--text); }
h1 { font-family: var(--font-display); font-size: var(--fs-title); line-height: 32px; font-weight: 500; letter-spacing: 0; color: var(--forest); }
h2 { font-size: var(--fs-section); line-height: 22px; font-weight: 700; }
h3 { font-size: 14px; line-height: 20px; font-weight: 500; }
b, strong { font-weight: 700; }
.hidden { display: none !important; }

/* ---------- kerangka: bingkai cream + lembar putih */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--frame); padding: 16px 12px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; min-height: 48px; margin-bottom: 12px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .scope { display: block; font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.side a:hover { background: rgba(15, 55, 37, 0.05); color: var(--text); }
.side a.on { background: var(--active); color: var(--text); }
.side .grp { font-size: 12px; line-height: 16px; color: var(--faint); padding: 18px 10px 6px; }
.side .foot { border-top: 1px solid var(--active); margin-top: 8px; padding-top: 8px; }
.badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--forest); color: var(--cream); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 20px 0 0; background: var(--frame); position: sticky; top: 0; z-index: 5; }
.top .grow { flex: 1; }
.top .mbrand { display: none; }
.page { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--drop-sheet); margin: 0 8px 8px 0; padding: 28px var(--pad) 40px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 78ch; }
.page-head .finding { color: var(--text); }
.page-head .finding b { font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; vertical-align: middle; }
.pill.ok { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }
.pill.warn { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }
.pill.bad { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.pill.info { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.top .pill { height: 26px; padding: 0 11px; background: transparent; border: 1px solid var(--control); color: var(--muted); }
.top .pill.ok::before, .top .pill.info::before, .top .pill.warn::before, .top .pill.bad::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.top .pill.info::before { background: var(--faint); }
.top .pill.warn::before { background: #B07A00; }
.top .pill.bad { color: var(--pill-neg-ink); border-color: #E9B9A9; }
.top .pill.bad::before { background: var(--negative); }

.who { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 999px; cursor: pointer; text-align: left; }
.who:hover { background: rgba(15, 55, 37, 0.05); }
.who .av { width: 30px; height: 30px; border-radius: 0 50% 50% 50%; background: var(--forest); color: var(--cream); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.who .t { line-height: 16px; }
.who .t b { font-weight: 500; }
.who .t small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- komponen dasar */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--card-pad); min-width: 0; }
.panel + .panel, .stack > * + *, section + section, .panel + section, section + .panel, .grid2 + .panel, .panel + .grid2, .grid2 + section, section + .grid2, .grid2 + .grid2, .kpis + .panel, .kpis + section { margin-top: var(--gap); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel > h2, section.panel > h2 { margin-bottom: 14px; }
.panel h3 { margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.grid2 > * + *, .grid3 > * + * { margin-top: 0 !important; }
.grid3 > .panel { display: flex; flex-direction: column; gap: 10px; }
.grid3 > .panel > .btn, .grid3 > .panel > .row { margin-top: auto; align-self: flex-start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-h); padding: 0 18px; border-radius: 999px; border: 1px solid var(--control); background: var(--surface); font-weight: 500; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; transition: background-color .15s ease, border-color .15s ease; }
.btn:hover { background: var(--raised); border-color: #B9B3A0; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.go { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.btn.primary:hover, .btn.go:hover { background: var(--forest-soft); border-color: var(--forest-soft); }
.btn.danger { color: var(--negative); border-color: #E2B4A5; }
.btn.danger:hover { background: var(--pill-neg-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { background: var(--paper); border-color: var(--border); color: var(--faint); cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 500; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

label.f { display: block; }
label.f > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
label.f > em { display: block; font-style: normal; font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 6px; min-height: 16px; }
input.in, select.in, textarea.in { width: 100%; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--r-input); background: var(--surface); height: var(--control-h); }
textarea.in { height: auto; padding: 9px 12px; }
input.in::placeholder, textarea.in::placeholder { color: var(--faint); }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--forest); outline: 2px solid var(--signal); outline-offset: 1px; }
input.in[readonly], input.in:disabled, select.in:disabled, textarea.in:disabled { background: var(--raised); color: var(--muted); border-color: var(--border); }
input.in.num { text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--forest); width: 16px; height: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fieldset-title { font-weight: 700; font-size: 15px; margin: 28px 0 12px; display: flex; align-items: center; gap: 12px; }
.fieldset-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* tabel: tanpa zebra, tanpa pita header; header abu 12px, angka rata kanan tabular */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 16px; padding: 0 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: bottom; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.t th:first-child, table.t td:first-child { padding-left: 0; }
table.t th:last-child, table.t td:last-child { padding-right: 0; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t td.num { white-space: nowrap; }
table.t tr.total td { font-weight: 700; border-top: 1px solid var(--control); border-bottom: 0; }
table.t tr.strong td { font-weight: 700; border-top: 1px solid var(--border); }
table.t tr.strong td:first-child { color: var(--forest); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t input.in, table.t select.in { height: 32px; padding: 0 8px; font-size: 14px; border-radius: 8px; }

/* KPI: satu kartu dibagi garis 1px; label di atas angka, tanpa ikon */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.panel .kpis { border: 0; border-radius: 0; background: transparent; }   /* di dalam kartu: strip terbuka, tanpa tingkat sarang ke-4 */
.panel .kpis .kpi { padding: 4px 20px 2px; }
.panel .kpis .kpi:first-child { padding-left: 0; }
.panel .kpis .kpi:last-child { padding-right: 0; }
.kpi { padding: 16px var(--card-pad); min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi .k { font-size: 13px; line-height: 18px; color: var(--muted); }
.kpi .v { font-size: var(--fs-kpi); line-height: 30px; font-weight: 500; margin-top: 6px; color: var(--text); white-space: nowrap; }
.kpi .s { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bar { height: 6px; background: var(--rule); border-radius: 999px; margin-top: 10px; position: relative; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar b { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--signal); border-radius: 1px; }
.delta-up { color: var(--positive); } .delta-down { color: var(--negative); }

.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tasks li:last-child { border-bottom: 0; }
.tasks .dot { width: 8px; height: 8px; border-radius: 0 50% 50% 50%; background: var(--stone); flex: none; }
.tasks .dot.bad { background: var(--signal); }
.tasks .dot.ok { background: var(--forest); }
.tasks .spacer { line-height: 20px; }
.empty { display: grid; place-items: center; min-height: 72px; padding: 16px; border: 1px dashed var(--control); border-radius: 10px; color: var(--muted); text-align: center; }
.empty.small { min-height: 48px; }

/* ---------- papan lapangan (Jam Harian) — elemen khas aplikasi: tiap jam terjual = satu "drop" forest */
.weekstrip { display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)) 40px; gap: 8px; align-items: stretch; }
.weekstrip a.d { text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 7px 4px 8px; text-align: center; line-height: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.weekstrip a.d:hover { border-color: var(--control); }
.weekstrip a.d small { display: block; font-size: 12px; color: var(--muted); }
.weekstrip a.d b { font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.weekstrip a.d.on { border: 2px solid var(--forest); padding: 6px 3px 7px; }
.weekstrip a.d.on b { font-weight: 700; color: var(--forest); }
.weekstrip a.d .st { display: block; width: 24px; height: 3px; border-radius: 2px; margin-top: 5px; background: var(--rule); }
.weekstrip a.d .st.draft { background: #D9A300; }
.weekstrip a.d .st.dikirim, .weekstrip a.d .st.divalidasi { background: var(--faint); }
.weekstrip a.d .st.terkunci { background: var(--forest); }
.weekstrip .nav-prev b, .weekstrip .nav-next b { font-size: 20px; color: var(--muted); }

.courtwrap { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: var(--gap); align-items: stretch; }
.court { border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 18px 14px; }
.court-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.court-head span:first-child { color: var(--text); font-weight: 500; font-size: 14px; }
.board { display: grid; grid-template-columns: 84px repeat(15, minmax(0, 1fr)); gap: 5px; }
.board .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.board .hh { font-size: 12px; text-align: center; color: var(--faint); padding-bottom: 2px; font-variant-numeric: tabular-nums; }
.board .hh.night { color: var(--text); font-weight: 700; }
.cell { height: 44px; border-radius: 0 10px 10px 10px; border: 1px solid #E3DECD; background: #F6F3EA; cursor: pointer; padding: 0; position: relative; }
.cell:not(.on):hover { border-color: var(--forest-soft); background: var(--surface); }
.cell.on { background: var(--forest); border-color: var(--forest); }
.cell:disabled { cursor: default; }
.cell:disabled:not(.on):hover { border-color: #E3DECD; background: #F6F3EA; }
.board .sep { grid-column: 1 / -1; height: 1px; background: var(--border); margin: 3px 0; }
.board .cnt { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 500; }
.board .night-band { grid-column: 10 / -1; }
.score { background: var(--forest); color: var(--cream); border-radius: 0 24px 24px 24px; padding: 18px 20px; display: flex; flex-direction: column; }
.score .big { font-size: 40px; font-weight: 700; line-height: 44px; color: var(--cream); margin: 6px 0 2px; }
.score .lbl2 { color: #D3D9CF; font-size: 13px; line-height: 18px; }
.score dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; margin: auto 0 0; padding-top: 16px; font-size: 13px; border-top: 1px solid rgba(245, 240, 220, 0.18); }
.score dt { color: #D3D9CF; } .score dd { margin: 0; font-size: 16px; font-weight: 500; text-align: right; }

/* peta jam mini (Beranda) — encoding sama dengan papan lapangan */
.peta { display: grid; grid-template-columns: 36px repeat(15, minmax(0, 1fr)); gap: 3px; }
.peta .h { font-size: 11px; line-height: 14px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.peta .h.night { color: var(--text); }
.peta .dname { font-size: 12px; line-height: 22px; color: var(--muted); }
.peta i { display: block; height: 22px; border-radius: 0 6px 6px 6px; background: #F1EEE4; }
.peta i.v1 { background: #8DB39E; }
.peta i.v2 { background: var(--forest); }
.peta i.na { background: transparent; border: 1px dashed var(--border); }
.peta-key { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); }
.peta-key i { display: inline-block; width: 12px; height: 12px; border-radius: 0 4px 4px 4px; background: #F1EEE4; vertical-align: -2px; margin-right: 5px; }
.peta-key i.v1 { background: #8DB39E; } .peta-key i.v2 { background: var(--forest); }

/* beranda: kolom utama + rail */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.home > .col > * + * { margin-top: var(--gap); }
.rail-h { font-size: 16px; line-height: 22px; font-weight: 700; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.rail-h span { font-size: 12px; font-weight: 400; color: var(--muted); }
.rail .panel { padding: 4px var(--card-pad); }

/* pengaturan: kolom label + baris nilai */
.set-sec { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px 48px; }
.set-sec.sep { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 24px; }
.set-label h2 { font-size: 15px; margin-bottom: 4px; }
.set-rows { display: grid; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 60px; padding: 8px 0; }
.set-row + .set-row { border-top: 1px solid var(--rule); }
.set-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.set-row b { font-weight: 500; }
.set-in { display: flex; align-items: center; gap: 8px; flex: none; }
.set-in input.in { width: 140px; }
.set-in .small { width: 56px; }

/* ---------- alur & riwayat */
.flow { display: flex; gap: 0; align-items: center; margin: 2px 0 16px; flex-wrap: wrap; row-gap: 8px; }
.flow .s { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 16px; color: var(--muted); padding-right: 12px; }
.flow .s i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--control); display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; background: var(--surface); flex: none; }
.flow .s i svg { width: 12px; height: 12px; }
.flow .s.done i { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.flow .s.now i { border: 2px solid var(--forest); color: var(--forest); }
.flow .s.done, .flow .s.now { color: var(--text); }
.flow .s b { font-weight: 500; }
.flow .s + .s::before { content: ''; width: 20px; height: 1px; background: var(--control); margin-right: 4px; }
.actor { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; font-size: 13px; line-height: 18px; color: var(--muted); margin-bottom: 10px; }
.actor b { color: var(--text); }
.idle-warn { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px; background: var(--forest); color: var(--cream); padding: 10px 12px 10px 18px; border-radius: 0 14px 14px 14px; box-shadow: 0 8px 24px rgba(15, 55, 37, 0.2); max-width: calc(100vw - 32px); font-size: 14px; } /* taste-skill-ignore: peringatan melayang */
.idle-warn .btn { background: var(--cream); border-color: var(--cream); color: var(--forest); font-weight: 700; }
.actionbar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 14px 0; margin-top: 20px; z-index: 3; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--raised); border: 1px solid var(--border); font-size: 13px; line-height: 18px; color: var(--text); }
.note.warn { background: #FFFAEB; border-color: #F2DC9C; color: #5C3D00; }
.note.bad { background: #FDF3EF; border-color: #EDC2B3; color: #7A2510; }
.note.ok { background: #F1F7F2; border-color: #C9DECF; color: var(--forest); }
.note + *, * + .note { margin-top: 12px; }
details.panel summary { cursor: pointer; list-style-position: inside; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 0 50% 50% 50%; background: var(--forest); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 19px; bottom: 2px; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .chg { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { position: relative; padding: 10px 0; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); }
.tabs a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--forest); }
.filters { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.filters select.in { width: auto; height: 34px; }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--paper); border: 1px solid var(--border); }
.seg label { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { border: 1px solid transparent; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); border-color: var(--border); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--signal); }

.heat td.h { text-align: center; font-size: 12px; padding: 7px 2px; min-width: 32px; border-bottom: 2px solid var(--surface); border-left: 2px solid var(--surface); }
.heat th.r { text-align: center; }
.chart svg { width: 100%; height: auto; max-height: 280px; display: block; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 18px; height: 10px; display: inline-block; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--forest); color: var(--cream); padding: 12px 18px; border-radius: 0 14px 14px 14px; z-index: 50; max-width: min(92vw, 560px); box-shadow: 0 8px 24px rgba(15, 55, 37, 0.18); } /* taste-skill-ignore: toast melayang */
.toast.bad { background: #7A2510; color: #FFF4EF; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 55, 37, 0.38); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--drop-sheet); padding: 24px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 16px 40px rgba(15, 55, 37, 0.2); } /* taste-skill-ignore: dialog melayang */
.modal h2 { font-size: 18px; margin-bottom: 8px; }
.modal p { margin: 0 0 16px; }

/* ---------- layar masuk: kartu putih di ground cream, form kiri + poster kanan (inset 12px) */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--frame); }
.gate-card { width: min(1280px, 100%); min-height: min(820px, calc(100vh - 64px)); background: var(--surface); border: 1px solid var(--border); border-radius: 0 28px 28px 28px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.gate-form { padding: 36px 56px 28px 64px; display: flex; flex-direction: column; min-width: 0; }
.gate-logo { height: 44px; width: auto; align-self: flex-start; display: block; }
.gate-body { margin: auto 0; padding: 40px 0; max-width: 420px; width: 100%; }
.gate-title { font-size: 44px; line-height: 48px; font-weight: 500; color: var(--forest); }
.gate-sub { margin: 14px 0 28px; color: var(--muted); font-size: 15px; line-height: 22px; }
.gate-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.gate-row .link { white-space: nowrap; }
.gate-cta { min-width: 220px; height: 44px; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 32px 0 18px; color: var(--faint); font-size: 12px; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.gate-demo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.gate-demo .btn { height: var(--control-h); }
.gate-foot { margin: 0; font-size: 13px; color: var(--muted); }
.gate-art { border-radius: 0 20px 20px 20px; background: #052818; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.gate-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gate .note { margin: 0 0 16px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--muted); }
.check input { margin-top: 1px; flex: none; }

/* ---------- ponsel & tablet: bingkai hilang, lembar jadi layar */
.mnav { display: none; }
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home .rail { order: -1; }
}
@media (max-width: 900px) {
  :root { --pad: 16px; }
  body { background: var(--surface); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { height: 52px; padding: 0 16px; gap: 8px; border-bottom: 1px solid var(--border); }
  .top .mbrand { display: block; height: 26px; width: auto; }
  .top .grow { flex: 1; }
  .top label.demo-as > span, .who .t { display: none; }
  .top label.demo-as select { max-width: 110px; }
  .who { padding: 2px; }
  .top #sync { max-width: 128px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 24px; }
  .top .pill::before { display: inline-block; vertical-align: 1px; margin-right: 6px; }
  .top label.demo-as select { max-width: 132px; }
  .page { border: 0; border-radius: 0; margin: 0; padding: 20px 16px 120px; }
  .flow { flex-wrap: nowrap; overflow-x: auto; }
  .flow .s { padding-right: 8px; white-space: nowrap; }
  .flow .s .small { display: none; }
  .flow .s:not(.now) b { display: none; }
  .flow .s.now { padding-right: 8px; }
  .flow .s + .s::before { width: 10px; }
  .courtwrap { grid-template-columns: minmax(0, 1fr); }
  .courtwrap .score { order: -1; padding: 14px 16px; border-radius: 0 20px 20px 20px; }
  .courtwrap .score .big { font-size: 36px; line-height: 40px; margin: 2px 0 0; }
  .courtwrap .score dl { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; gap: 2px 12px; margin-top: 12px; padding-top: 10px; font-size: 12px; }
  .courtwrap .score dd { font-size: 16px; text-align: left; }
  .court { padding: 12px; }
  .court-head { flex-direction: column; gap: 2px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: 52px 1fr 1fr 40px; gap: 6px; }
  .board .desk, .board .dk { display: none; }
  .cell { height: 44px; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi, .panel .kpis .kpi { padding: 14px 16px; }
  .panel .kpis .kpi:nth-child(odd) { padding-left: 0; }
  .kpi .v { font-size: 22px; }
  .gate { padding: 0; place-items: stretch; background: var(--surface); }
  .gate-card { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; padding: 0; min-height: 100vh; }
  .gate-form { padding: 24px 20px 28px; }
  .gate-logo { height: 36px; }
  .gate-body { padding: 32px 0 28px; max-width: none; }
  .gate-title { font-size: 32px; line-height: 36px; }
  .gate-cta { width: 100%; }
  .gate-art { margin: 0 12px 12px; }
  .gate-art img { height: auto; }
  .mnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--frame); border-top: 1px solid var(--active); z-index: 20; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .mnav a { color: var(--muted); text-decoration: none; text-align: center; font-size: 12px; line-height: 16px; font-weight: 500; padding: 14px 2px; border-radius: 999px; position: relative; }
  .mnav a.on { background: var(--active); color: var(--text); font-weight: 700; }
  .mnav .badge { position: absolute; top: -7px; right: 6%; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .weekstrip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .weekstrip a.nav-prev, .weekstrip a.nav-next { display: none; }
  .weekstrip a.d { padding: 6px 2px; }
  .actionbar { bottom: 66px; }
  .actionbar .row { gap: 8px; }
  h1 { font-size: 22px; line-height: 28px; }
  .tabs { gap: 20px; }
  .set-sec { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .set-in input.in { width: 110px; }
  .peta { grid-template-columns: 30px repeat(15, minmax(0, 1fr)); gap: 2px; }
  .peta .h:nth-child(even) { visibility: hidden; }
  .peta i { height: 18px; border-radius: 0 4px 4px 4px; }
  /* tabel lebar di ponsel: gulir di dalam bingkainya sendiri, kolom pertama tetap */
  .tbl-wrap table.t td:first-child, .tbl-wrap table.t th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
}
@media (min-width: 901px) { .board .mob { display: none; } }
@media (prefers-reduced-motion: no-preference) { .cell { transition: background-color .12s, border-color .12s; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }

/* ---------- cetak (laporan PDF untuk Owner) */
#print { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.4; }
  #app, .toast, .modal-bg { display: none !important; }
  #print { display: block; }
  .rp h1 { font-size: 20pt; line-height: 1.2; }
  .rp section, .rp .panel { break-inside: avoid; }
  .rp .panel { border: 0; padding: 0; margin-top: 14pt; border-radius: 0; }
  .rp table.t { font-size: 9pt; }
  .rp table.t td, .rp table.t th { padding: 3pt 5pt; }
  .rp .kpis { grid-auto-flow: column; }
  .rp .kpi { padding: 6pt 8pt; } .rp .kpi .v { font-size: 16pt; line-height: 1.2; }
  .rp .grid2 { grid-template-columns: 1fr 1fr; }
  .pill { border: 1px solid currentColor; }
}
.rp { color: var(--text); }
.rp header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--forest); padding-bottom: 8pt; margin-bottom: 10pt; }
.rp header img { height: 30pt; width: auto; display: block; margin-bottom: 6pt; }
.rp .foot { margin-top: 18pt; font-size: 8.5pt; color: var(--muted); border-top: 1px solid var(--border); padding-top: 6pt; }
