/* Dashboard admin & owner + kit grafik. Warna hanya token dari tokens.css. */

/* ── Warna seri & ramp (fill / stroke / background / color) ── */
.viz-f-mnh { fill: var(--viz-mnh); } .viz-f-jbr { fill: var(--viz-jbr); } .viz-f-lwy { fill: var(--viz-lwy); }
.viz-f-muted { fill: var(--viz-muted); } .viz-f-ref { fill: var(--viz-ref); } .viz-f-ink { fill: var(--ink); }
.viz-s-mnh { stroke: var(--viz-mnh); } .viz-s-jbr { stroke: var(--viz-jbr); } .viz-s-lwy { stroke: var(--viz-lwy); }
.viz-s-muted { stroke: var(--viz-muted); } .viz-s-ref { stroke: var(--viz-ref); } .viz-s-ink { stroke: var(--ink); }
.viz-b-mnh { background: var(--viz-mnh); } .viz-b-jbr { background: var(--viz-jbr); } .viz-b-lwy { background: var(--viz-lwy); }
.viz-b-muted { background: var(--viz-muted); } .viz-b-ref { background: var(--viz-ref); } .viz-b-ink { background: var(--ink); }
.viz-c-mnh { color: var(--viz-mnh); } .viz-c-jbr { color: var(--viz-jbr); } .viz-c-lwy { color: var(--viz-lwy); }
.viz-c-muted { color: var(--viz-muted); } .viz-c-ref { color: var(--viz-ref); } .viz-c-ink { color: var(--ink); }
.viz-f-seq0 { fill: var(--seq-0); } .viz-f-seq1 { fill: var(--seq-1); } .viz-f-seq2 { fill: var(--seq-2); }
.viz-f-seq3 { fill: var(--seq-3); } .viz-f-seq4 { fill: var(--seq-4); } .viz-f-seq5 { fill: var(--seq-5); }
.viz-b-seq0 { background: var(--seq-0); } .viz-b-seq1 { background: var(--seq-1); } .viz-b-seq2 { background: var(--seq-2); }
.viz-b-seq3 { background: var(--seq-3); } .viz-b-seq4 { background: var(--seq-4); } .viz-b-seq5 { background: var(--seq-5); }

.db-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.db-sw { display: inline-block; flex: none; width: 10px; height: 10px; margin-right: 8px; border-radius: var(--r-xs); vertical-align: 1px; }
.db-tl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.db-tl .ic { width: 16px; height: 16px; }
.db-warn { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; }
.db-warn .ic { width: 16px; height: 16px; stroke-width: 2; }

/* ── Kepala halaman ───────────────────────────────────── */
.db-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 24px; }
.db-head-t { display: grid; gap: 6px; min-width: 0; }
.db-head .over { font-size: 11px; color: var(--muted); }
.db-head h2 { letter-spacing: -.02em; }
.db-head h2 .db-sw { width: 12px; height: 12px; margin-right: 10px; vertical-align: 3px; border-radius: 3px; }
.db-now { margin: 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.db-head-a { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.db-head-a label.f { min-width: 168px; }
.db-head-a .btn .ic { width: 20px; height: 20px; }
@media (max-width: 759px) {
  .db-head { display: grid; gap: 12px; margin-bottom: 16px; }
  .db-head-t { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; }
  .db-head .over { display: none; }
  .db-head h2 { overflow: hidden; font-size: 22px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
  .db-now { font-size: 13px; text-align: right; }
  .db-head-a { flex-wrap: nowrap; gap: 8px; }
  .db-head-a label.f { flex: 1 1 0; min-width: 0; }
  .db-head-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .db-head-a select { min-height: 44px; }
  .db-head-a label.f::after { bottom: 13px; }
  .db-head-a .btn { flex: none; min-height: 44px; padding: 0 14px; }
}

/* ── Stat tile (label · nilai · delta · sparkline) ───── */
.db-kh { display: none; }
.db-kpis-s { margin-bottom: 28px; }
.db-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.db-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 16px 14px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.db-tv { display: block; margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-lead { grid-column: 1 / -1; }
.db-lead .db-tv { font-size: clamp(32px, 2vw + 22px, 40px); }
.db-delta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.db-delta b { font-weight: 650; font-variant-numeric: tabular-nums; }
.db-delta .ic { width: 15px; height: 15px; stroke-width: 2.25; }
.db-delta.ok { color: var(--ok); } .db-delta.bad { color: var(--err); }
.db-delta.ok span, .db-delta.bad span { color: var(--muted); }
.db-up { transform: rotate(-90deg); } .db-down { transform: rotate(90deg); }
.db-tsub { font-size: 13px; line-height: 1.4; color: var(--muted); }
.db-spark { height: 30px; margin-top: auto; padding-top: 6px; }
.db-xf { animation: viz-fade .2s var(--e-out); }
@media (min-width: 640px) {
  .db-admin .db-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .db-admin .db-lead { grid-column: span 2; }
  .db-tile { padding: 18px 20px 16px; }
}
@media (min-width: 1000px) {
  .db-admin .db-kpis { grid-template-columns: minmax(0, 1.55fr) repeat(4, minmax(0, 1fr)); gap: 14px; }
  .db-admin .db-lead { grid-column: auto; }
}
@media (max-width: 759px) {
  .db-spark, .db-tile .db-vs, .db .db-xm { display: none; }
  .db-tile { gap: 3px; padding: 12px 14px; }
  .db-tv, .db-lead .db-tv { font-size: 22px; }
  .db-tsub { font-size: 12px; }
  .db-kh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 4px; font-size: 16px; font-weight: 650; }
  .db-kh span { color: var(--muted); font-size: 13px; font-weight: 500; }
  /* Admin di ponsel: antrian dulu, ringkasan sebagai satu baris ubin yang bisa digeser */
  .db-admin { display: flex; flex-direction: column; gap: 24px; }
  .db-admin .db-grid { display: contents; }
  .db-admin .db-head { margin: 0; }
  .db-admin .db-queue { order: 1; }
  .db-admin .db-kpis-s { order: 2; margin: 0; }
  .db-admin .db-charts { order: 3; }
  .db-admin .db-kpis { display: flex; gap: 10px; margin: 0 -16px; padding: 8px 16px 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
  .db-admin .db-kpis::-webkit-scrollbar { display: none; }
  .db-admin .db-tile { flex: 0 0 auto; min-width: 132px; max-width: 220px; scroll-snap-align: start; }
}

/* ── Admin: antrian + grafik ──────────────────────────── */
.db-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1000px) { .db-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 36px; } }
.db-queue { padding: 10px 20px 16px; border: 0; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); scroll-margin-top: calc(var(--top-h, 64px) + 16px); }
.db-queue:focus { outline: none; }
.db-queue:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (min-width: 640px) { .db-queue { padding: 12px 24px 18px; } }
/* Pil lunak di atas lintasan --surface-alt; digeser (bukan dipotong) bila tidak muat */
.db-tabs, .db-seg { display: flex; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: calc(var(--r-sm) + 3px); background: var(--surface-alt); overflow-x: auto; scrollbar-width: none; }
.db-tabs::-webkit-scrollbar, .db-seg::-webkit-scrollbar { display: none; }
.db-tabs { margin: 6px 0 4px; }
.db-tabs button {
  display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); font-size: 15px; transition: color .2s var(--e-out), background-color .2s var(--e-out), box-shadow .2s var(--e-out);
}
.db-tabs button:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.tabs.db-tabs button[aria-selected=true] { background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); }
.db-fade-e { -webkit-mask-image: linear-gradient(90deg, black calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, black calc(100% - 36px), transparent); }
.db-fade-s { -webkit-mask-image: linear-gradient(90deg, transparent, black 36px); mask-image: linear-gradient(90deg, transparent, black 36px); }
.db-fade-s.db-fade-e { -webkit-mask-image: linear-gradient(90deg, transparent, black 36px, black calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, black 36px, black calc(100% - 36px), transparent); }
@media (max-width: 759px) {
  .db-queue { padding: 8px 12px 12px; }
  .db-tabs button { flex: 0 0 auto; gap: 6px; padding: 0 12px; font-size: 14px; }
  .db-tabs .db-cnt { min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; }
}
.db-cnt { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-tabs button[aria-selected=true] .db-cnt { background: var(--primary); color: var(--on-primary); }
.db-filt { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-top: 12px; padding: 2px 4px 2px 12px; border-radius: var(--r-sm); background: var(--primary-tint); font-size: 14px; }
.db-filt > span { display: inline-flex; align-items: center; gap: 6px; }
.db-filt .ic { width: 16px; height: 16px; }
.db-filt .link { min-height: 44px; padding: 0 8px; }
.db-list li > .db-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 14px 4px 14px; text-align: left;
}
.db-list li:last-child > .db-row { border-bottom: 0; }
.db-row .code { font-size: 13px; color: var(--muted); }
.db-age { display: inline-flex; align-items: center; justify-self: end; gap: 4px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-age .ic { width: 15px; height: 15px; }
.db-age.late { color: var(--warn); font-weight: 600; }
.db-row-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 650; }
.db-row-p { justify-self: end; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-row-s, .db-row .db-chips { grid-column: 1 / -1; }
.db-st { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1.35; }
.db-st .ic { width: 17px; height: 17px; }
.db-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-chips .chip { height: 22px; border-color: transparent; border-radius: 11px; background: var(--surface-alt); color: var(--muted); }
.db-chips .chip.db-kurir { background: var(--info-bg); color: var(--info); }
.db-empty { display: grid; justify-items: center; gap: 10px; padding: 28px 16px 36px; color: var(--muted); text-align: center; }
.db-empty .ic { box-sizing: content-box; width: 28px; height: 28px; padding: 14px; border-radius: 50%; background-color: var(--surface); background-image: var(--kawung); border: 1px solid var(--line); color: var(--primary); }

.db-charts { min-width: 0; }
.db-stick { position: sticky; top: calc(var(--top-h, 64px) + 16px); }

/* Grafik di kartu tenang: permukaan + bayangan lembut, tanpa garis tepi tebal */
.db-sheet { display: grid; gap: 16px; min-width: 0; }
.db-sheet > .viz, .db-sheet > .db-sec, .db-sheet .db-g2 > *, .db-sheet .db-pay > * {
  min-width: 0; padding: 22px 24px 24px; border: 0; border-radius: var(--r-md); background: var(--viz-surface); box-shadow: var(--shadow-card);
}
.db-sheet .db-g2, .db-sheet .db-pay { gap: 16px; align-items: stretch; }
@media (max-width: 639px) {
  .db-sheet, .db-sheet .db-g2, .db-sheet .db-pay { gap: 12px; }
  .db-sheet > .viz, .db-sheet > .db-sec, .db-sheet .db-g2 > *, .db-sheet .db-pay > * { padding: 18px 16px 20px; }
}

/* detail order */
.db-det { gap: 16px; }
.db-back { align-self: flex-start; min-height: 44px; }
.db-back .ic { width: 18px; height: 18px; }
.db-det-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.db-det-h > div:first-child { min-width: 0; }
@media (max-width: 759px) {
  .db-det-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id age" "nm pr" "st st"; align-items: center; gap: 2px 12px; }
  .db-det-h > div { display: contents; }
  .db-det-h .code { grid-area: id; }
  .db-det-h h3 { grid-area: nm; min-width: 0; margin: 0; }
  .db-det-h > div > .db-st { grid-area: st; margin-top: 2px; }
  .db-det-p .price { grid-area: pr; text-align: right; }
  .db-det-p .small { grid-area: age; text-align: right; white-space: nowrap; }
}
.db-det-h h3 { margin: 4px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.db-det-h .code { color: var(--muted); }
.db-det-p { display: grid; justify-items: end; gap: 2px; text-align: right; }
.db-det-p .price { font-size: 24px; letter-spacing: -.02em; }
.db-kv th { width: 38%; color: var(--muted); font-weight: 500; font-size: 14px; }
.db-kv th, .db-kv td { padding: 10px 8px 10px 0; }
.db-kv tr:last-child > * { border-bottom: 0; }
.db-addr { display: flex; align-items: flex-start; gap: 6px; }
.db-addr .ic { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.db-proof {
  position: relative; padding: 22px 16px 14px; background: var(--surface-alt); border-radius: 0 0 var(--r-sm) var(--r-sm);
  -webkit-mask: radial-gradient(circle at 7px 0, transparent 4px, black 4.5px) 0 0 / 14px 100% repeat-x;
  mask: radial-gradient(circle at 7px 0, transparent 4px, black 4.5px) 0 0 / 14px 100% repeat-x;
}
.db-proof-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; font-weight: 650; }
.db-proof-h .ic { color: var(--primary); }
.db-proof-h .chip { max-width: 100%; margin-left: auto; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.db-proof dl { margin: 0; }
.db-proof dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 8px 0; border-top: 1px dashed var(--line-strong); font-size: 14px; }
.db-proof dt { color: var(--muted); }
.db-proof dd { margin: 0; font-weight: 600; text-align: right; }
.db-proof p { display: flex; gap: 6px; margin: 8px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; line-height: 1.45; }
.db-proof p .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--err); }
.db-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.db-grow { flex: 1 1 240px; }
.db-acts .btn { white-space: nowrap; }
@media (max-width: 559px) { .db-acts .btn { flex: 1 1 100%; } }
/* Ponsel: aksi utama menempel di bawah layar (di atas tab bar) selama detail terlihat */
@media (max-width: 759px) {
  .db-actbar { position: sticky; bottom: var(--tab-h, 0px); z-index: 6; margin: 0 -12px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); }
  .db-actbar .btn { flex: 1 1 auto; min-height: 48px; padding: 0 16px; }
  .db-actbar .btn.danger { flex: 0 0 auto; }
  body:has(.db-actbar) #toast { bottom: calc(var(--tab-h, 0px) + 80px); }
}
.db-f3 label.f { justify-content: space-between; }
.db-tolak { padding: 14px; border-radius: var(--r-sm); background: var(--surface-alt); }
.db-kga { max-width: 240px; }
.db-wa { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.db-wa-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.db-wa-h .num { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.db-wa-h .ic { width: 18px; height: 18px; color: var(--muted); }
.db-msg { margin: 0; padding: 12px 14px; border-radius: var(--r-md) var(--r-md) var(--r-md) var(--r-xs); background: var(--surface-alt); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.db-wa .btn { justify-self: start; }
.db-mf { gap: 14px; }
.db-f2, .db-f3 { display: grid; gap: 12px; }
.db-f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 520px) { .db-f2 { grid-template-columns: 1fr 1fr; } }
.db-fs { display: grid; gap: 8px; }
.db-fs > legend { margin-bottom: 8px; }
label.f[hidden] { display: none; }
.db-fs textarea { min-height: 64px; resize: vertical; }

/* ── Owner ────────────────────────────────────────────── */
.db-filters {
  position: sticky; top: 0; z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 24px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) { .db-filters { top: var(--top-h, 64px); } }
.db-seg { display: inline-flex; overflow-x: auto; }
.db-seg label { position: relative; display: flex; flex: 1 0 auto; }
.db-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.db-seg span {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-sm); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .2s var(--e-out), color .2s var(--e-out), box-shadow .2s var(--e-out), transform .2s var(--e-out);
}
.db-seg span:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.db-seg label:active span { transform: scale(.97); transition-duration: .09s; }
.db-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.db-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.db-seg .db-sw { width: 8px; height: 8px; margin-right: 6px; }
@media (max-width: 759px) {
  /* Satu baris ringkas (±52px): rentang + cabang yang bisa digeser; label "Filter" disembunyikan */
  .db-filters { flex-wrap: nowrap; gap: 8px; margin: 0 -16px 16px; padding: 3px 16px; }
  .db-filters > .db-tl { display: none; }
  .db-seg { padding: 2px; }
  .db-seg span { min-height: 44px; padding: 0 11px; }
  .db-seg-n { flex: none; }
  .db-seg-n span { padding: 0 9px; }
  .db-seg-c { flex: 1 1 auto; min-width: 0; }
  .db-seg-c label { flex: none; }
}
.db-top { display: grid; gap: 20px; margin-bottom: 20px; }
.db-hero { display: grid; gap: 8px; align-content: start; padding: 4px 0 8px; }
.db-hero-v { display: block; font-size: clamp(40px, 3vw + 30px, 68px); font-weight: 700; line-height: 1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-hero .db-delta { font-size: 15px; }
.db-hero .db-delta .ic { width: 18px; height: 18px; }
@media (min-width: 640px) { .db-kpis-o { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .db-top { grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: 32px; align-items: start; }
}
@media (max-width: 759px) {
  .db-top { gap: 14px; margin-bottom: 16px; }
  .db-hero { gap: 6px; padding: 0; }
  .db-kpis-o { gap: 10px; }
}
.db-g2 { display: grid; column-gap: 40px; }
@media (min-width: 1000px) { .db-g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .db-g2-w { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.db-sec { min-width: 0; padding: 20px 0 28px; border-top: 1px solid var(--line); }
.db-sec > .viz-s { margin-bottom: 12px; }

.db-cmp th, .db-cmp td { padding: 6px 10px 6px 0; vertical-align: middle; }
.db-cmp thead th { padding-bottom: 8px; }
.db-cmp tbody tr { position: relative; transition: background-color .2s var(--e-out); }
.db-cmp tbody tr:hover { background: var(--surface-alt); }
.db-cmp tbody tr.on { background: var(--primary-tint); }
.db-cmp tbody tr.dim { color: var(--muted); }
.db-rowbtn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 0 0 6px; border: 0; background: none; color: inherit; font-weight: 650; text-align: left; white-space: nowrap; cursor: pointer; }
.db-rowbtn::after { content: ''; position: absolute; inset: 0; }
.db-rowbtn:focus-visible { outline: 0; }
.db-cmp tbody tr:has(.db-rowbtn:focus-visible) { outline: 2px solid var(--primary); outline-offset: -2px; }
.db-ibw { display: grid; grid-template-columns: minmax(56px, 1fr) auto; align-items: center; gap: 10px; min-width: 132px; }
.db-ib { display: block; height: 10px; }
.db-ib > span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.db-cmp th, .db-cmp td { white-space: nowrap; }
.db-cmp-sub { display: block; color: var(--muted); font-size: 12px; }
/* Ponsel: tiap cabang jadi satu blok (nama · omzet · empat angka kecil) alih-alih tabel 6 kolom yang terpotong */
@media (max-width: 759px) {
  .db-cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .db-cmp, .db-cmp tbody { display: block; }
  .db-cmp tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; padding: 2px 8px 14px; border-bottom: 1px solid var(--line); border-radius: var(--r-sm); }
  .db-cmp tbody tr:last-child { border-bottom: 0; }
  .db-cmp th, .db-cmp td { padding: 0; border: 0; text-align: left; }
  .db-cmp tbody th, .db-cmp tbody td:nth-child(2) { grid-column: 1 / -1; }
  .db-cmp .db-rowbtn { min-height: 44px; padding: 0; }
  .db-cmp .db-ibw { min-width: 0; margin-bottom: 6px; }
  .db-cmp td:nth-child(n+3) { font-size: 15px; font-weight: 600; }
  .db-cmp td:nth-child(n+3)::before { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
  .db-cmp td:nth-child(3)::before { content: 'Kg'; }
  .db-cmp td:nth-child(4)::before { content: 'Order'; }
  .db-cmp td:nth-child(5)::before { content: 'Proses'; }
  .db-cmp td:nth-child(6)::before { content: 'Piutang'; }
  .db-cmp .db-cmp-sub { font-weight: 400; }
}

.db-pay { display: grid; column-gap: 40px; }
@media (min-width: 1000px) { .db-pay { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.db-aging td, .db-aging th { vertical-align: middle; }
.db-aging .btn { min-height: 44px; padding: 0 14px; border-color: transparent; background: var(--primary-tint); color: var(--primary); white-space: nowrap; }
.db-aging .btn:hover:not(:disabled) { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.db-aging .btn .ic { width: 18px; height: 18px; }
.db-aging tfoot th, .db-aging tfoot td { border-bottom: 0; font-weight: 650; }
.db-aging th, .db-aging td { white-space: nowrap; }
@media (max-width: 559px) {
  .db-aging thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .db-aging tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .db-aging tfoot tr { border-bottom: 0; }
  .db-aging th, .db-aging td { padding: 0; border: 0; text-align: left; }
  .db-aging tr > :nth-child(1) { grid-column: 1; grid-row: 1; font-size: 16px; }
  .db-aging tr > :nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; font-size: 16px; }
  .db-aging tr > :nth-child(2), .db-aging tr > :nth-child(4) { grid-column: 1 / 3; color: var(--muted); font-size: 13px; font-weight: 400; }
  .db-aging tbody tr > :nth-child(2)::after, .db-aging tfoot tr > :nth-child(2)::after { content: ' order'; }
  .db-aging tbody tr > :nth-child(4):not(:empty)::before { content: 'tertua '; }
  .db-aging tr > :nth-child(5) { grid-column: 3; grid-row: 1 / span 3; justify-self: end; }
  .db-aging tfoot tr > :nth-child(4), .db-aging tfoot tr > :nth-child(5) { display: none; }
  .db-aging .btn { padding: 0 12px; }
}
.db-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; border-block: 1px solid var(--line); }
.db-stat { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 14px 12px 14px 0; }
.db-stat + .db-stat { padding-left: 14px; border-left: 1px solid var(--line); }
.db-stat > .ic { width: 20px; height: 20px; color: var(--muted); margin-bottom: 2px; }
.db-stat b { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .db-stat b { font-size: 22px; } .db-stat + .db-stat { padding-left: 10px; } .db-stat { padding-right: 8px; } }
.db-facts { margin: 0; }
.db-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.db-facts > div:last-child { border-bottom: 0; }
.db-facts dt { font-weight: 600; font-size: 15px; }
.db-facts dd { display: contents; }
.db-facts dd b { grid-column: 2; grid-row: 1; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-facts dd span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.db-recent td, .db-recent th { white-space: nowrap; }
.db-recent .db-st { font-size: 14px; }
.db-recent td.db-rc-s { min-width: 9.5em; white-space: normal; }
.db-recent tbody tr:last-child > * { border-bottom: 0; }
/* Ponsel: tabel order terbaru jadi daftar kartu; seluruh baris membuka status */
@media (max-width: 759px) {
  .db-recent thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .db-recent, .db-recent tbody { display: block; }
  .db-recent tr { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "n n t" "s s s" "id cab cab"; align-items: center; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .db-recent tbody tr:last-child { border-bottom: 0; }
  .db-recent td { padding: 0; border: 0; }
  .db-recent .db-rc-n { grid-area: n; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 650; }
  .db-recent .db-rc-t { grid-area: t; font-size: 16px; font-weight: 700; }
  .db-recent .db-rc-s { grid-area: s; }
  .db-recent .db-rc-id { grid-area: id; }
  .db-recent .db-rc-id .code { font-size: 13px; color: var(--muted); text-decoration: none; }
  .db-recent .db-rc-id .code::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-sm); }
  .db-recent .db-rc-id .code:focus-visible { outline: 0; }
  .db-recent .db-rc-id .code:focus-visible::after { outline: 2px solid var(--primary); outline-offset: 2px; }
  .db-recent .db-rc-cab { grid-area: cab; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 13px; }
  .db-recent tr:has(.code:hover) { background: color-mix(in srgb, var(--primary-tint) 60%, transparent); }
}
.db-hf-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin: 4px 0 18px; }
.db-hf label.f { justify-content: space-between; }
.db-hf label.f .mute { font-weight: 400; }
.db-in { position: relative; display: flex; }
.db-in input { width: 100%; padding-left: 40px; }
.db-in-a { position: absolute; top: 50%; left: 14px; color: var(--muted); font-size: 15px; font-weight: 500; transform: translateY(-50%); pointer-events: none; }
.db-in-pct input { padding: 0 34px 0 14px; }
.db-in-pct .db-in-a { left: auto; right: 14px; }
@media (max-width: 759px) { .db-hf .btn { width: 100%; } }

/* ── Figure grafik ────────────────────────────────────── */
.viz { min-width: 0; margin: 0; padding: 20px 0 28px; border-top: 1px solid var(--line); }
.viz-cap { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px 12px; margin-bottom: 4px; }
.viz-cap-t { min-width: 0; }
.viz-t { font-size: 16px; font-weight: 650; line-height: 1.35; letter-spacing: -.005em; }
.viz-s { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.viz-tb { flex: none; min-height: 44px; margin-top: -11px; padding: 0 2px; font-size: 14px; white-space: nowrap; }
.viz-tb .ic { width: 18px; height: 18px; }
.viz-leg { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 8px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.viz-leg li { display: inline-flex; align-items: center; gap: 7px; }
.viz-key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }
.viz-key-line { width: 16px; height: 2px; border-radius: 1px; }
.viz-key-dot { border-radius: 50%; }
.viz-key-ring { box-sizing: border-box; border-radius: 50%; border: 2px solid currentColor; background: transparent; }
.viz-plot { position: relative; width: 100%; margin-top: 10px; border-radius: var(--r-xs); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.viz-plot:focus { outline: none; }
.viz-plot:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.viz-plot svg { display: block; overflow: visible; }
.viz svg text { font-family: var(--font); font-size: 11px; font-weight: 500; fill: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.viz svg .viz-sub { font-size: 12px; font-weight: 600; }
.viz svg .viz-cap-l { fill: var(--ink); font-weight: 650; paint-order: stroke; stroke: var(--viz-surface); stroke-width: 4px; stroke-linejoin: round; }
.viz svg .viz-ft { fill: var(--ink); font-size: 13px; font-weight: 650; }
.viz svg .viz-rl { fill: var(--ink); font-size: 13px; font-weight: 600; }
.viz svg .viz-dl { font-size: 11.5px; paint-order: stroke; stroke: var(--viz-surface); stroke-width: 4px; stroke-linejoin: round; }
.viz svg .viz-ref-l { font-weight: 650; }
.viz svg .viz-warn-l { fill: var(--warn); font-size: 12px; font-weight: 650; }
.viz svg .viz-on { fill: var(--on-primary); font-weight: 700; }
.viz-ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz-warn { color: var(--warn); }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; stroke-opacity: .75; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1; stroke-opacity: .8; shape-rendering: crispEdges; }
.viz-ref { stroke: var(--viz-ref); stroke-width: 1.5; }
.viz-ln { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz-xh { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.viz-hov { fill: color-mix(in srgb, var(--ink) 5%, transparent); pointer-events: none; }
.viz-dot, .viz-hdot { stroke: var(--viz-surface); stroke-width: 4; paint-order: stroke; }
.viz-ring { fill: var(--viz-surface); stroke-width: 2; }
.viz-dr { pointer-events: none; }
.viz-hit { fill: transparent; cursor: default; }
.viz-hit.is-hot { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.viz-cell { stroke: transparent; stroke-width: 2; }
.viz-cell.is-hot { stroke: var(--ink); }
.viz-f-seqna { fill: transparent; stroke: var(--line-strong); stroke-width: 1; }
.viz-f-seqna.is-hot { stroke: var(--ink); stroke-width: 2; }
.viz-agg { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.viz-agg[hidden] { display: none; }
.viz-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; }
.viz-scale ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.viz-scale li { display: grid; gap: 4px; }
.viz-scale i { display: block; width: 40px; height: 10px; border-radius: 2px; }
.viz-scale li:first-child i { box-shadow: inset 0 0 0 1px var(--line); }
.viz-scale-na { margin-left: 10px; }
.viz-scale-na i { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.viz-scale span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 400px) { .viz-scale i { width: 34px; } }
.viz-tab { max-height: 22rem; margin-top: 16px; overflow: auto; border-top: 1px solid var(--line-strong); }
.viz-tab[hidden] { display: none; }
.viz-table { font-size: 14px; }
.viz-table th, .viz-table td { padding: 8px 10px 8px 0; white-space: nowrap; }
.viz-table thead th { position: sticky; top: 0; z-index: 1; background: var(--viz-surface); }
.viz-table tbody th { font-weight: 500; }

/* batang horizontal HTML */
.viz-hb { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.viz-hb-row {
  display: grid; grid-template-columns: minmax(0, 9em) minmax(40px, 1fr) 2.6em; grid-template-areas: "l t v" ". n n"; align-items: center; gap: 2px 12px;
  width: 100%; padding: 6px 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font-size: 14px; text-align: left;
}
.viz-hb-l { grid-area: l; display: inline-flex; align-items: center; gap: 8px; min-width: 0; line-height: 1.3; }
.viz-hb-l .ic { width: 18px; height: 18px; color: var(--muted); }
.viz-hb-track { grid-area: t; display: block; height: 12px; border-left: 1px solid var(--viz-axis); }
.viz-hb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.viz-hb-v { grid-area: v; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.viz-hb-n { grid-area: n; color: var(--muted); font-size: 13px; line-height: 1.35; }
.viz-hb-row.is-hot { background: color-mix(in srgb, var(--ink) 4%, transparent); }
button.viz-hb-row { min-height: 52px; padding: 6px 8px; cursor: pointer; transition: background-color .2s var(--e-out), transform .2s var(--e-out); }
button.viz-hb-row:hover { background: var(--surface-alt); }
button.viz-hb-row:active { transform: scale(.985); transition-duration: .09s; }
button.viz-hb-row[aria-pressed=true] { background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary); }
button.viz-hb-row:disabled { cursor: default; color: var(--muted); }
button.viz-hb-row:disabled:hover { background: none; }
.db-stage { margin: 8px -8px 0; }
.db-stage .viz-hb-row { grid-template-columns: minmax(0, 11em) minmax(40px, 1fr) 2em; }
@media (max-width: 559px) {
  .db-stage .viz-hb-row { grid-template-columns: minmax(0, 1fr) 2em; grid-template-areas: "l v" "t t" "n n"; row-gap: 6px; }
}
.db-mix { display: grid; gap: 18px; margin-top: 12px; }
.db-mini h4 { display: flex; align-items: center; margin: 0 0 4px; font-size: 14px; font-weight: 650; }
.db-mini .viz-hb-row { grid-template-columns: minmax(0, 9.5em) minmax(40px, 1fr) 3em; padding: 5px 4px; }
.db-mix:focus { outline: none; }
.db-mix:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

/* tooltip */
.viz-tip {
  position: fixed; left: 0; top: 0; z-index: 80; min-width: 150px; max-width: min(260px, calc(100vw - 16px)); padding: 10px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-overlay);
  font-size: 13px; line-height: 1.45; pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.viz-tip.on { opacity: 1; }
.viz-tip p { margin: 0; }
.viz-tip-h { margin-bottom: 6px !important; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.viz-tip-r { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); align-items: center; gap: 8px; }
.viz-tip-r b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-tip-r span { color: var(--muted); min-width: 0; }
.viz-tip-sum { margin-top: 2px !important; }
.viz-tip-w { display: flex; align-items: center; gap: 6px; margin-top: 6px !important; color: var(--warn); font-weight: 650; }
.viz-tip-w .ic { width: 16px; height: 16px; }

/* gerak */
@keyframes viz-grow { from { transform: scaleY(0); } }
@keyframes viz-growx { from { transform: scaleX(0); } }
@keyframes viz-fade { from { opacity: 0; } }
.viz-anim .viz-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: viz-grow .48s var(--e-out) both; }
.viz-anim .viz-reveal { transform-box: fill-box; transform-origin: 0 50%; animation: viz-growx .6s var(--e-io) .12s both; }
.viz-anim .viz-cell { animation: viz-fade .32s var(--e-out) both; }
.viz-anim .viz-dr { animation: viz-fade .36s var(--e-out) both; }
.viz-anim .viz-hb-fill { transform-origin: 0 50%; animation: viz-growx .48s var(--e-out) both; }
@media (prefers-reduced-motion: reduce) {
  .viz-anim *, .db-xf { animation: none !important; }
  .viz-tip { transition: none; }
}
@media (forced-colors: active) {
  .viz-hb-fill, .db-ib > span, .db-sw, .viz-key { forced-color-adjust: none; }
}
