/* toko-cinta design system
   Dokumen kerja toko: kertas hangat, satu aksen wine, tanpa dekorasi. */

:root {
  --paper: #F4F5F3;
  --surface: #FFFFFF;
  --line: #DDE3E0;
  --line-strong: #CBD3CF;
  --ink: #16211F;
  --muted: #4B5754;
  --brand: #0F5C55;
  --brand-dark: #0A403B;
  --brand-soft: #E3F1EE;
  --gold: #E8A33D;
  --side: #10302C;
  --side-hover: #18403B;
  --side-on: #1F5149;
  --side-text: #C9D6D3;
  --side-label: #9DB8B2;
  --head: #EEF1EF;

  --ok-bg: #DCFAE6; --ok-fg: #05603A;
  --warn-bg: #FEF0C7; --warn-fg: #93370D;
  --bad-bg: #FEE4E2; --bad-fg: #B42318;
  --info-bg: #E0EAFF; --info-fg: #1849A9;

  --r-ctl: 8px;
  --r-panel: 10px;
  --r-card: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* shell */
.app { display: flex; min-height: 100vh; }
.side {
  flex: 0 0 232px; width: 232px; background: var(--side); color: var(--side-text);
  padding: 8px 12px 8px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 9px; background: var(--gold); color: #10302C;
  display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none;
}
.brand-name { font-weight: 700; color: #fff; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--side-label); }
.grp {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--side-label); padding: 6px 10px 4px; margin-top: 2px;
  border-top: 1px solid #2A4A44;
}
.brand + .grp { margin-top: 0; border-top: 0; padding-top: 2px; }
.side a.home { margin-bottom: 4px; }
.menu-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin: 2px 0 4px;
  background: #0B2521; border: 1px solid #2A4A44; border-radius: 8px;
}
.menu-tabs button {
  min-height: 30px; border: 0; border-radius: 6px; background: transparent;
  color: var(--side-label); font: 600 12px "IBM Plex Sans", sans-serif; cursor: pointer;
}
.menu-tabs button:hover { color: #fff; background: #22453F; }
.menu-tabs button[aria-selected="true"] { background: var(--side-on); color: #fff; }
.menu-tabs button:last-child { grid-column: 1 / -1; }
.menu-flat { display: flex; flex-direction: column; gap: 2px; }
.menu-list { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.menu-list::-webkit-scrollbar { width: 6px; }
.menu-list::-webkit-scrollbar-thumb { background: #2A4A44; border-radius: 3px; }
.sect-wrap { margin-bottom: 0; }
.sect {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px;
  padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--side-text); font: 600 13.5px "IBM Plex Sans", sans-serif;
  cursor: pointer; text-align: left;
}
.sect:hover { background: var(--side-hover); color: #fff; }
.sect.active { color: #fff; }
.sect-label { flex: 1; min-width: 0; }
.sect .chev { width: 14px; height: 14px; flex: none; color: var(--side-label); transition: transform .15s ease; }
.sect[aria-expanded="true"] .chev { transform: rotate(180deg); color: #fff; }
.sect-items {
  display: flex; flex-direction: column; gap: 2px;
  margin: 1px 0 2px 10px; padding-left: 8px; border-left: 1px solid #2A4A44;
}
.sect-items[hidden] { display: none; }
.sect-items a { min-height: 30px; padding: 0 10px; font-size: 13px; color: var(--side-label); }
.sect-items a:hover { color: #fff; }
.sect-items a.on { background: var(--side-on); color: #fff; font-weight: 600; }
.side-util { margin-top: 3px; padding-top: 3px; border-top: 1px solid #2A4A44; }
.side a.util { color: var(--side-label); font-weight: 600; }
.side a.util.on { background: var(--side-on); color: #fff; }
.side a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 30px; padding: 0 10px; border-radius: 8px;
  color: var(--side-text); font-size: 14px; text-decoration: none;
}
.side a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side a.on { background: var(--side-on); color: #fff; font-weight: 600; }
.side .count { font-size: 12px; background: #24524A; color: #E3F1EE; border-radius: 999px; padding: 1px 7px; }
.side a.on .count { background: #2E635A; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.side-foot { margin-top: auto; padding: 8px 10px 0; border-top: 1px solid #2A4A44; font-size: 12px; color: var(--side-label); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.store-pick { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.store-pick select { height: 36px; border: 0; background: transparent; font: 600 14px "IBM Plex Sans", sans-serif; color: var(--ink); padding: 0 4px; cursor: pointer; }
.top-right { display: flex; align-items: center; gap: 12px; }
.today { font-size: 12px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.who-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.who-role { font-size: 12px; color: var(--muted); }
.hamburger { display: none; }

.content { width: 100%; max-width: 1280px; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; }

.hdr { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.hdr-main { min-width: 0; }
.hdr .sub { color: var(--muted); margin-top: 4px; font-size: 14px; max-width: 70ch; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font: 600 14px "IBM Plex Sans", sans-serif; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #F6F9F8; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--brand); }
.btn.quiet:hover { background: var(--brand-soft); }
.btn.danger { border-color: #D92D20; color: #B42318; }
.btn.danger:hover { background: #FBE5E3; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* surface */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.card-head .meta { font-size: 12px; color: var(--muted); }
.card-body { display: flex; flex-direction: column; gap: 10px; }

.note { border-radius: var(--r-panel); padding: 10px 14px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.note.info { background: var(--info-bg); color: var(--info-fg); }
.note.warn { background: var(--warn-bg); color: var(--warn-fg); }
.note.bad { background: var(--bad-bg); color: var(--bad-fg); }
.note.ok { background: var(--ok-bg); color: var(--ok-fg); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font: 500 14px "IBM Plex Sans", sans-serif; cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: #F6F9F8; }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.tab .dot.ok { background: #0E7A4B; }
.tab .dot.warn { background: #B26A12; }
.tab .dot.bad { background: #B42318; }
.tab .n { font-size: 12px; color: var(--muted); }
.tabpanel { padding-top: 4px; display: flex; flex-direction: column; gap: 14px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.meta-line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.report-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.card[data-tabs] { padding-top: 0; }
.card[data-tabs] > .tabs { margin: 0 -20px; padding: 0 10px; }
.tabpanel[hidden] { display: none; }

/* table */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: var(--head); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover { background: #F8FAF9; }
.tbl tfoot td { background: var(--head); font-weight: 700; border-top: 1px solid var(--line-strong); }
.tbl .linkish { font-weight: 600; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* status: dot + text */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.st.ok::before { background: #0E7A4B; }
.st.warn::before { background: #B26A12; }
.st.bad::before { background: #B42318; }
.st.info::before { background: #1849A9; }
.st.neutral::before { background: #6B7B77; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: #fff;
  font: 500 14px "IBM Plex Sans", sans-serif; color: var(--muted); cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: 12px; opacity: .8; }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--line-strong); color: var(--muted); }

/* kpi */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .foot { font-size: 12px; color: var(--muted); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .req { color: var(--brand); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); background: #fff; font: 14px "IBM Plex Sans", sans-serif; color: var(--ink);
}
.textarea { min-height: 84px; resize: vertical; }
.input[readonly] { background: #EDF1EF; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hint { font-size: 12px; color: var(--muted); }

/* meta list */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 24px; }
.meta-grid .k { font-size: 12px; color: var(--muted); display: block; }
.meta-grid .v { font-weight: 600; }

/* timeline */
.tl { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: flex; gap: 12px; font-size: 14px; }
.tl-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.tl-item .dot.open { background: #fff; border: 2px solid var(--warn-fg); }
.tl-item .when { font-size: 12px; color: var(--muted); }

/* progress stepper */
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.steps span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.steps span.done { color: var(--ink); }
.steps span.done::before { background: #0E7A4B; }
.steps span.pending::before { background: #B26A12; }
.steps .sep { color: var(--muted); }

/* kasir */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-catalog { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 0 12px; height: 48px; background: #fff; }
.search input { border: 0; outline: none; width: 100%; font: 14px "IBM Plex Sans", sans-serif; background: transparent; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.prod {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font: inherit;
}
.prod:hover { border-color: var(--line-strong); background: #F8FAF9; }
.prod .init { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.prod .name { font-size: 14px; font-weight: 600; line-height: 1.3; min-height: 34px; }
.prod .cat { font-size: 12px; color: var(--muted); }
.prod .price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: space-between; }
.prod .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.cart { position: sticky; top: 72px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); display: flex; flex-direction: column; overflow: hidden; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cart-head b { font-size: 14px; }
.cart-cust { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.cart-items { padding: 6px 0; max-height: 300px; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; padding: 9px 16px; border-bottom: 1px solid #E8EEEC; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .nm { font-size: 14px; font-weight: 600; }
.cart-line .unit { font-size: 12px; color: var(--muted); }
.cart-line .amt { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-weight: 700; }
.qty span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.cart-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.cart-sum { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: #F8FAF9; }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.row.total { font-size: 16px; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--line); }
.cart-actions { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.pay-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.change { font-size: 14px; display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(30, 25, 22, .45); display: grid; place-items: start center; padding: 24px 16px; overflow-y: auto; z-index: 60; }
.modal { background: #fff; border-radius: var(--r-card); border: 1px solid var(--line); width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(30,25,22,.18); }
.modal.wide { width: min(880px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; background: #F8FAF9; }
.x { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 6px; }
.x:hover { background: #E8EEEC; color: var(--ink); }

/* misc */
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 2px 0; font-size: 12px; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; }
.totals {
  display: flex; flex-wrap: wrap; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  font-size: 12px; color: var(--muted);
}
.totals > span {
  flex: 1 1 148px; min-width: 0; background: var(--head);
  padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.totals .k { font-size: 12px; color: var(--muted); }
.totals b { font-size: 15px; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.totals > span:not(.tot) { font-size: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.kbd { font-family: "IBM Plex Mono", monospace; font-size: 12px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: #fff; }
.list { display: flex; flex-direction: column; }
.list a, .list div.item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list a:hover { text-decoration: none; background: #F8FAF9; }
.list .t { font-size: 14px; font-weight: 600; }
.list .s { font-size: 12px; color: var(--muted); }
.big-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.danger-zone { border: 1px solid #F3C9C5; border-radius: var(--r-card); padding: 18px 20px; background: #FEF6F5; display: flex; flex-direction: column; gap: 10px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checkline:last-child { border-bottom: 0; }
.checkline .mark { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 12px; flex: none; margin-top: 1px; }
.checkline .mark.ok { background: var(--ok-bg); color: var(--ok-fg); }
.checkline .mark.warn { background: var(--warn-bg); color: var(--warn-fg); }

/* responsive */
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; min-height: 0; }
  .inbox-list { border-right: 0; }
  .thread { display: none; }
  .inbox.show-thread .inbox-list { display: none; }
  .inbox.show-thread .thread { display: flex; }
  .thread-back { display: inline-flex; }
  .thread-body { max-height: 58vh; }
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .18s ease; }
  .side a { min-height: 44px; }
  .sect { min-height: 44px; }
  .menu-tabs button { min-height: 40px; }
  body.nav-open .side { transform: translateX(0); }
  .nav-back { position: fixed; inset: 0; background: rgba(30,25,22,.4); z-index: 40; }
  .hamburger { display: inline-flex; }
  .content { padding: 16px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .today { display: none; }
}
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 18px; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acts { width: 100%; }
  .acts .btn { flex: 1 1 auto; }
}

@media (min-width: 1280px) {
  h1 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px);
  background: #10302C; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; z-index: 80; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
 
/* Kotak masuk WhatsApp */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 560px; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.inbox-tools { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.conv-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.conv { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: start; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.conv:hover { background: var(--head); }
.conv.on { background: var(--brand-soft); }
.conv .av, .thread .av { width: 34px; height: 34px; border-radius: 50%; background: var(--head); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink); flex: none; }
.conv .nm { display: block; font-weight: 600; font-size: 14px; }
.conv .sn { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .tm { font-size: 12px; color: var(--muted); text-align: right; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.thread-head .who { min-width: 0; flex: 1; }
.thread-head .who b { display: block; font-size: 14px; }
.thread-head .who span { font-size: 12px; color: var(--muted); }
.thread-back { display: none; }
.thread-body { flex: 1 1 auto; min-height: 220px; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; background: var(--paper); }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.msg.out { align-self: flex-end; background: var(--brand-soft); border-color: #CFE6E0; }
.msg.flag { border-color: var(--bad-fg); box-shadow: inset 3px 0 0 var(--bad-fg); }
.msg .mt { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer .input { flex: 1; }
.ai-banner { margin: 12px 16px 0; }
.wa-num { display: flex; flex-direction: column; gap: 4px; }
.wa-num .mono { font-size: 14px; }
.qr-box { width: 180px; height: 180px; border: 2px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; padding: 12px; margin: 4px auto 0; background: var(--paper); }

@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; min-height: 0; }
  .inbox-list { border-right: 0; }
  .thread { display: none; }
  .inbox.show-thread .inbox-list { display: none; }
  .inbox.show-thread .thread { display: flex; }
  .thread-back { display: inline-flex; }
  .thread-body { max-height: 58vh; }
}


/* ===== Struktur Accurate dengan warna operasional ===== */
.fin-badge { display: none; }
.sect-ic { width: 15px; height: 15px; flex: none; color: var(--side-label); }
.sect.active .sect-ic { color: #fff; }

/* filter + toolbar daftar */
.acc-list { background: var(--surface); }
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; padding: 8px 10px;
}
.filterbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.filterbar .input, .filterbar .select { height: 30px; width: auto; min-width: 130px; }
.filterbar .btn { height: 30px; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; padding: 6px 10px;
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .btn { height: 30px; padding: 0 8px; font-size: 12px; }
.toolbar .btn.dark { width: 30px; padding: 0; background: var(--ink); border-color: var(--ink); color: #fff; justify-content: center; }
.toolbar .btn.icon { width: 30px; padding: 0; justify-content: center; }
.toolbar .input { height: 30px; width: 230px; }
.toolbar .cnt { min-width: 28px; text-align: center; font-size: 12px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 6px; }
.tw.table-accurate { border-radius: 0 0 var(--r-panel) var(--r-panel); }
.table-accurate .tbl thead th { background: var(--head); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 12px; }
.table-accurate .tbl tbody tr { background: var(--surface); }
.table-accurate .tbl tbody tr:hover { background: #F3F7F5; }
.table-accurate .empty { padding: 28px; text-align: center; color: var(--muted); }

/* tab dokumen */
.docbar { display: flex; gap: 2px; background: var(--head); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-panel) var(--r-panel) 0 0; padding: 4px 4px 0; margin-bottom: 0; }
.doc-tab {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-bottom-color: var(--surface); border-radius: 6px 6px 0 0;
  padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: -1px;
}
.doc-tab[aria-selected="false"], .doc-tab.ghost { background: var(--head); color: var(--muted); border-color: transparent; border-bottom-color: var(--line); }
.doc-tab a { color: inherit; text-decoration: none; }
.doc-tab .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.doc-tab .x:hover { color: var(--bad-fg); }

/* form dokumen */
.doc-head { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 12px; display: grid; grid-template-columns: 1.4fr .8fr .8fr .8fr auto; gap: 10px; align-items: end; }
.doc-body { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.doc-body h2 { font-size: 13px; font-weight: 700; margin: 0; }
.doc-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.doc-field .req { color: var(--bad-fg); }
.doc-field .input, .doc-field .select { width: 100%; height: 30px; }
.doc-field .inline { display: flex; align-items: center; gap: 6px; }
.doc-total { display: flex; justify-content: flex-end; align-items: center; gap: 12px; background: var(--head); border: 1px solid var(--line); padding: 8px 12px; font-size: 12.5px; font-weight: 600; }
.doc-total b { font-size: 15px; color: var(--ink); min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 10px; }
.doc-actions .btn { min-width: 96px; justify-content: center; }
.toggle { display: inline-block; width: 34px; height: 18px; border-radius: 999px; background: var(--brand); position: relative; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.table-form .tbl thead th { background: var(--head); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 12px; }
.table-form .empty { padding: 18px; }

/* kertas laporan */
.report-paper { max-width: 920px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); padding: 24px 28px 18px; }
.report-head { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.report-company { font: 600 12px "IBM Plex Mono", monospace; color: var(--muted); letter-spacing: .04em; }
.report-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 4px 0 2px; }
.report-period { font-size: 12px; color: var(--muted); }
.report-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.report-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 14px; }
.report-paper .tbl thead th { background: var(--head); color: var(--ink); text-transform: none; letter-spacing: 0; }

@media (max-width: 900px) {
  .doc-head { grid-template-columns: 1fr 1fr; }
  .doc-head .doc-field:last-child { grid-column: 1 / -1; }
}
