/* Hapus baris ini jika file ditanam di WordPress (agar tidak menimpa tema) */
html, body { margin: 0; background: #eef0f3; }

/* Seluruh gaya di-scope ke .kp agar tidak bentrok dengan CSS lain */
.kp {
  --bg: #eef0f3; --surface: #ffffff; --ink: #1d2433; --ink-2: #4a5365; --ink-3: #7a8394;
  --line: #e4e7ec; --line-2: #d3d8e0; --soft: #f6f7f9;
  --primary: #b3322d; --primary-d: #982a26;
  --ok: #1f7a4d; --ok-soft: #e8f4ee; --warn: #9a6700; --warn-soft: #fbf1dc; --bad: #b3322d; --bad-soft: #fbe9e7;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  min-height: 100vh; font-variant-numeric: tabular-nums;
}
.kp *, .kp *::before, .kp *::after { box-sizing: border-box; }
.kp button, .kp input, .kp select, .kp textarea { font: inherit; color: inherit; }
.kp [hidden] { display: none !important; }
.kp h1, .kp h2, .kp h3, .kp p { margin: 0; }
.kp table { border-collapse: collapse; }

/* Header */
.kp-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.kp-top-in { max-width: 1680px; margin: 0 auto; padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.brand h1 { font-size: 15px; font-weight: 600; }
.brand p { font-size: 12px; color: var(--ink-3); }
.nav { display: flex; gap: 2px; height: 60px; }
.nav button { border: 0; background: none; padding: 0 16px; height: 100%; color: var(--ink-3); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav button:hover { color: var(--ink); }
.nav button.on { color: var(--ink); border-bottom-color: var(--primary); }
.kp-main { max-width: 1680px; margin: 0 auto; padding: 20px 28px 32px; }
.pane { display: none; }
.pane.on { display: block; }

/* Komponen dasar */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar { display: flex; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.grow { flex: 1; min-width: 0; }
.inp { height: 38px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 12px; background: #fff; outline: none; width: 100%; }
textarea.inp { height: auto; padding: 8px 12px; resize: vertical; }
.toolbar .inp, .ctl-row .inp { width: auto; }
.toolbar .inp.grow, .ctl-row .inp.grow { width: 100%; }
.inp:focus { border-color: #6b7a99; box-shadow: 0 0 0 3px rgba(80,100,140,.14); }
.inp[readonly] { background: var(--soft); color: var(--ink-2); }
.btn { height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.added { background: var(--ok-soft); border-color: #bfe0cf; color: var(--ok); cursor: default; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--primary); }
.icon-btn { border: 0; background: none; color: var(--ink-3); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--bad-soft); color: var(--bad); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #e2e5ea; border-radius: 8px; }
.seg button { border: 0; background: none; padding: 4px 11px; border-radius: 6px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.08); }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.tag.lokal { background: #e6eefb; color: #2b5aa8; }
.tag.impor { background: #f3ecfb; color: #6b3fa8; }

/* Tabel */
.scroll { overflow: auto; }
.tbl { width: 100%; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl th small { font-weight: 400; display: block; color: #9aa2b1; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.gstart td { border-top: 2px solid var(--line-2); }
.tbl tbody tr.gstart:first-child td { border-top: 0; }
.tbl tbody tr.hl { background: #eaeff9; }
.tbl tbody tr.off td { color: var(--ink-3); }
.tbl td.supcell { vertical-align: top; border-left: 1px solid var(--line); background: #fcfcfd; }
.num { text-align: right; white-space: nowrap; }
.c { text-align: center; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px !important; }
.partno { font-weight: 600; white-space: nowrap; letter-spacing: .2px; }
.muted { color: var(--ink-3); font-size: 12px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eff1f5; color: var(--ink-2); font-size: 12px; margin: 1px 4px 1px 0; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; margin: 0 4px 3px 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Pesanan: bilah pencarian + hasil mengambang */
.ctl { position: relative; z-index: 60; }
.ctl-row { display: flex; gap: 10px; align-items: center; padding: 14px 20px 6px; }
.ctl-foot { padding: 0 20px 12px; font-size: 12px; color: var(--ink-3); min-height: 24px; }
.tgt { display: flex; align-items: center; gap: 8px; }
.float { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 14px 40px rgba(20,26,38,.20); overflow: hidden; }
.fl-scroll { max-height: min(60vh, 520px); }
.fl-help { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: #fafbfc; }

/* Pesanan: pesanan supplier selebar halaman */
.head-tools { display: flex; align-items: center; gap: 14px; }
.head-tools label { font-size: 12px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.head-tools .inp { width: 150px; height: 32px; }
.banner { margin: 12px 20px 0; padding: 10px 12px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 500; }
.groups { padding: 16px 20px 20px; }
.ctabs { margin: 14px 20px 0; }
.cust-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.8fr 110px; gap: 12px; align-items: end; margin-bottom: 14px; }
.cust-hint { margin: -6px 0 12px; }
.cart-scroll { border: 1px solid var(--line); border-radius: 8px; max-height: 360px; min-height: 120px; overflow: auto; }
.cart-tbl th, .cart-tbl td { padding: 9px 14px; }
.cart-tbl td.nm { font-weight: 500; }
.cart-empty { padding: 34px 8px !important; text-align: center; color: var(--ink-3); }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { width: 26px; height: 30px; border: 1px solid var(--line-2); background: #fff; border-radius: 6px; cursor: pointer; padding: 0; }
.qty button:hover { background: var(--soft); }
.qty input { width: 48px; height: 30px; border: 1px solid var(--line); border-radius: 6px; text-align: center; outline: none; background: #fff; font-weight: 600; padding: 0; }
.qty input:focus { border-color: #6b7a99; }
.full { grid-column: 1 / -1; }
.fld label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.row { display: flex; gap: 8px; }
.hint { font-size: 12px; color: var(--ink-3); }
.cart-sum { margin: 14px 0 0 auto; width: 360px; max-width: 100%; }
.cart-sum div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-2); }
.cart-sum .grand { color: var(--ink); font-weight: 700; font-size: 16px; border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.bar-bottom { position: sticky; bottom: 0; z-index: 50; margin-top: 16px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 -6px 20px rgba(20,26,38,.08); padding: 12px 20px; display: flex; justify-content: flex-end; align-items: center; gap: 32px; }
.bt { text-align: right; }
.bt .l { font-size: 12px; color: var(--ink-3); }
.bt .v { font-size: 17px; font-weight: 600; white-space: nowrap; }
.bt.m .v { color: var(--ok); }
.bar-bottom .btn.primary { height: 44px; padding: 0 28px; font-weight: 600; font-size: 15px; }

/* Laporan */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: #e2e5ea; border-radius: 9px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 7px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.08); }
.cnt { font-size: 12px; padding: 0 7px; border-radius: 999px; background: rgba(20,26,38,.08); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.stat { padding: 18px 22px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .l { font-size: 13px; color: var(--ink-3); }
.stat .v { font-size: 22px; font-weight: 600; margin: 4px 0 2px; white-space: nowrap; }
.stat .s { font-size: 12px; color: var(--ink-3); }
.pager select { width: auto; height: 30px; padding: 0 8px; margin: 0 6px; }
.note-in { height: 30px; min-width: 170px; width: 100%; font-size: 13px; }
.note-in.saved { border-color: #7fc3a0; background: var(--ok-soft); }

/* Menu & modal */
#kp-menu { position: fixed; display: none; min-width: 230px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(20,26,38,.14); padding: 4px; z-index: 900; }
#kp-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; border-radius: 5px; cursor: pointer; }
#kp-menu button:hover { background: #f3f4f7; }
#kp-menu button.danger { color: var(--bad); }
#kp-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.modal { position: fixed; inset: 0; background: rgba(20,26,38,.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.on { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; box-shadow: 0 20px 50px rgba(20,26,38,.25); }
.modal-box.wide { width: 600px; }
.modal-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-box .fld { margin-bottom: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.chk input { width: 16px; height: 16px; }
.hist { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.hist div { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.imp-box { border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 14px; background: var(--soft); }
.imp-sample { margin-top: 10px; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.imp-sample table { width: 100%; font-size: 12px; }
.imp-sample td, .imp-sample th { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.swal2-container { z-index: 3000 !important; font-family: inherit; }
body:not(.swal2-toast-shown) .swal2-container.swal2-backdrop-show { background: rgba(16, 24, 40, .45) !important; }
body.swal2-toast-shown .swal2-container { background: transparent !important; }
.sw-pop { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important; border-radius: 16px !important; padding: 26px 24px 22px !important; width: 400px !important; max-width: calc(100vw - 32px); box-shadow: 0 24px 60px rgba(16, 24, 40, .28) !important; }
.sw-title { font-size: 18px !important; font-weight: 700 !important; color: #1d2433 !important; padding: 6px 0 0 !important; line-height: 1.35 !important; }
.sw-text { font-size: 14px !important; color: #667085 !important; line-height: 1.55 !important; margin: 8px 0 0 !important; padding: 0 !important; }
.sw-icon { transform: scale(.78); margin: 0 auto -4px !important; }
.sw-actions { margin: 22px 0 0 !important; gap: 10px; width: 100%; flex-wrap: nowrap !important; }
.sw-btn { flex: 1; font-family: inherit !important; font-size: 14px !important; font-weight: 600 !important; padding: 11px 16px !important; border-radius: 10px !important; border: 1px solid transparent !important; cursor: pointer; margin: 0 !important; transition: background .15s; }
.sw-ok { background: #b3322d !important; color: #fff !important; } .sw-ok:hover { background: #9a2a26 !important; }
.sw-cancel { background: #fff !important; color: #344054 !important; border-color: #d0d5dd !important; } .sw-cancel:hover { background: #f4f6f8 !important; }
.sw-btn:focus, .sw-btn:focus-visible { outline: 0 !important; box-shadow: 0 0 0 3px rgba(179, 50, 45, .22) !important; }
.sw-input { font-family: inherit !important; font-size: 15px !important; border: 1px solid #d0d5dd !important; border-radius: 10px !important; margin: 16px 0 0 !important; box-shadow: none !important; height: 44px !important; }
.sw-input:focus { border-color: #b3322d !important; box-shadow: 0 0 0 3px rgba(179, 50, 45, .15) !important; }
.sw-toast { font-family: 'Inter', system-ui, sans-serif !important; background: #fff !important; border-radius: 12px !important; padding: 12px 16px !important; border: 1px solid #e4e7ec !important; border-left: 4px solid #1f7a4d !important; box-shadow: 0 10px 30px rgba(16, 24, 40, .16) !important; width: auto !important; max-width: min(420px, calc(100vw - 32px)); }
.sw-toast.swal2-icon-error { border-left-color: #b3322d !important; } .sw-toast.swal2-icon-warning { border-left-color: #c9822b !important; }
.sw-toast { display: flex !important; align-items: center !important; }
.sw-toast-title { font-size: 14px !important; font-weight: 600 !important; color: #1d2433 !important; margin: 0 8px !important; padding: 0 !important; align-self: center; }
.sw-toast-icon { transform: scale(.6); margin: 0 !important; flex-shrink: 0; }
@media (max-width: 960px) { .swal2-container.swal2-bottom { padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; } .sw-actions { flex-direction: column-reverse; } .sw-btn { width: 100% !important; flex: none !important; } }

/* Login & 2FA */
.kp.locked .kp-top, .kp.locked .kp-main { display: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 420px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: 0 18px 50px rgba(20,26,38,.10); }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.auth-card .fld { margin-bottom: 14px; }
.auth-card .btn.primary { width: 100%; height: 42px; font-weight: 600; margin-top: 4px; }
.auth-msg { min-height: 20px; margin-top: 12px; color: var(--bad); font-size: 13px; }
.auth-qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.auth-qr img { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.auth-secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; word-break: break-all; text-align: center; margin-bottom: 14px; user-select: all; }
.code-in { text-align: center; letter-spacing: 8px; font-size: 20px; font-weight: 600; height: 46px; }
.auth-out { text-align: center; margin-top: 14px; }
.stats.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.stat .v.ok { color: var(--ok); } .stat .v.warn { color: var(--warn); }
.stat .s b { color: var(--ink-2); font-weight: 600; }
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.db-head h2 { font-size: 20px; font-weight: 600; }
.db-head p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.db-head .row .inp { width: 150px; }
.pw { position: relative; }
.pw .inp { padding-right: 42px; }
.eye { position: absolute; right: 4px; top: 4px; width: 34px; height: 30px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.eye:hover { color: var(--ink); background: var(--soft); }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sec-row:last-child { border-bottom: 0; }
.sec-flow { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.who { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }

/* ---------- Komponen laporan & dashboard ---------- */
.rk-m { display: none; }
.rank-row .rk { display: inline-block; min-width: 18px; color: var(--ink-3); font-weight: 600; }
.age-bar { height: 6px; border-radius: 3px; background: var(--soft); margin: -2px 0 6px; overflow: hidden; }
.age-bar i { display: block; height: 100%; background: #c9822b; border-radius: 3px; }
.age-bar.bad i { background: var(--bad); }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.five .stat .v { font-size: 20px; }
.stat .s .ok { color: var(--ok); } .stat .s .warn { color: var(--warn); }
.rbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rbar .row { gap: 8px; }
.toolbar.wrap { flex-wrap: wrap; }
.toolbar .dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.toolbar .dt .inp { width: 150px; }
.rnote { padding: 8px 20px; font-size: 12px; color: var(--ink-3); background: #fafbfc; border-bottom: 1px solid var(--line); }
.sec-h { font-size: 14px; font-weight: 600; margin: 4px 2px 10px; display: flex; gap: 8px; align-items: baseline; }
.sec-h .hint { font-weight: 400; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; text-align: left; }
.kpi .l { font-size: 13px; color: var(--ink-3); }
.kpi .v { font-size: 22px; font-weight: 600; margin: 4px 0 2px; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--ink-3); }
.kpi .s b { color: var(--ink-2); font-weight: 600; }
.kpi .d { font-size: 12px; margin-top: 5px; color: var(--ink-3); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.kpi.ok .v { color: var(--ok); } .kpi.warn .v { color: var(--warn); } .kpi.bad .v { color: var(--bad); }
.kpi.click { cursor: pointer; } .kpi.click:hover { border-color: var(--line-2); box-shadow: 0 1px 4px rgba(20,26,38,.06); }
.db-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 22px; }
.db-grid.even { grid-template-columns: 1fr 1fr; }
.db-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-grid > .panel { min-width: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { padding: 10px 14px 14px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; font-size: 11px; fill: #7a8394; }
.rank { padding: 4px 20px 14px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .a { font-weight: 600; white-space: nowrap; text-align: right; }
.rank-row .m { font-size: 12px; color: var(--ink-3); }
.rank-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: #eef0f3; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); opacity: .85; }
.age-grid { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 14px 20px 16px; }
.age-grid h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.age-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.age-row:last-child { border-bottom: 0; }
.age-row b { color: var(--ink); }
.attn-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.attn-row:hover { background: #fafbfc; }
.attn-row .n { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-row .a { text-align: right; white-space: nowrap; font-weight: 600; }
.attn-row .m { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.attn-empty { padding: 22px 20px; color: var(--ink-3); text-align: center; }
.panel-link { padding: 10px 20px; font-size: 13px; }
.panel-link button { border: 0; background: none; color: var(--primary); font-weight: 500; cursor: pointer; padding: 0; }
.bnav, .sheet { display: none; }
.m-title { display: none; }
.sheet-user { padding: 4px 4px 10px; color: var(--ink-3); font-size: 13px; }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 8px; border: 0; background: none; text-align: left; border-radius: 10px; cursor: pointer; }
.sheet-item:hover, .sheet-item:active { background: var(--soft); }
.sheet-item b { display: block; font-weight: 600; }
.sheet-item span { display: block; font-size: 12px; color: var(--ink-3); }
.sheet-item.danger b { color: var(--bad); }
.sheet-item svg { flex: 0 0 22px; color: var(--ink-3); }

/* ---------- Tampilan HP / tablet (<= 960px) ---------- */
@media (max-width: 960px) {
  .kp { font-size: 14px; }
  .kp-top { position: sticky; top: 0; z-index: 700; }
  .kp-top-in { height: 52px; padding: 0 14px; justify-content: flex-start; gap: 12px; }
  .brand-text, .nav, .who { display: none; }
  .m-title { display: block; font-size: 17px; font-weight: 600; margin: 0; }
  .kp-main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  #pane-pesanan.on { padding-bottom: 84px; }

  /* menu bawah */
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; background: #fff;
          border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(20,26,38,.06); }
  .bnav button { border: 0; background: none; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 500; cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
  .bnav button svg { width: 22px; height: 22px; }
  .bnav button.on { color: var(--primary); }
  .bnav button.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .kp.locked .bnav, .kp.locked .sheet { display: none !important; }

  .sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 950; }
  .sheet-bg { position: absolute; inset: 0; background: rgba(20,26,38,.45); }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; box-shadow: 0 -10px 40px rgba(20,26,38,.2); }
  .sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 10px; }

  /* kontrol umum */
  .inp { height: 44px; font-size: 16px; }
  textarea.inp { font-size: 16px; }
  .btn { height: 42px; }
  .btn.sm { height: 36px; padding: 0 12px; }
  .icon-btn { width: 34px; height: 34px; font-size: 20px; }
  .panel-head { flex-wrap: wrap; padding: 12px 14px; }
  .panel-foot { padding: 10px 14px; flex-wrap: wrap; }
  .toolbar { flex-wrap: wrap; padding: 12px 14px; }
  .toolbar .inp, .toolbar .inp.grow { width: 100% !important; flex: 1 1 100%; }
  .toolbar select.inp { flex: 1 1 calc(50% - 6px); }
  .toolbar .dt { flex: 1 1 calc(50% - 6px); }
  .toolbar .dt .inp { width: 100% !important; }
  .rnote { padding: 8px 14px; }
  .rbar .seg, .rbar .row { width: 100%; }
  .rbar .seg button { flex: 1; }
  .rbar .row .btn { flex: 1; }
  .tabs { display: flex; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: 0 0 auto; padding: 8px 14px; }

  /* kartu ringkasan */
  .stats, .stats.five, .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat .v, .stats.five .stat .v { font-size: 17px; }
  .stats.five .stat:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .kpi { padding: 13px 14px; }
  .kpi .v { font-size: 17px; }
  .db-grid, .db-grid.even, .db-grid.three { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
  .db-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .db-head .row { display: grid; grid-template-columns: 1fr 1fr auto; }
  .db-head .row .inp { width: 100%; }
  .attn-row, .rank { padding-left: 14px; padding-right: 14px; }
  .attn-row { padding: 11px 14px; }
  .age-grid, .chart { padding-left: 14px; padding-right: 14px; }

  /* tabel menjadi kartu */
  .scroll { max-height: none !important; overflow: visible; }
  .tbl.stack, .tbl.stack tbody { display: block; width: 100%; }
  .tbl.stack thead { display: none; }
  .tbl.stack tbody tr { display: block; position: relative; margin: 10px 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .tbl.stack tbody tr:hover { background: #fff; }
  .tbl.stack tbody tr.gstart td { border-top: 0; }
  .tbl.stack tbody tr.hl { background: #eaeff9; }
  .tbl.stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; padding: 6px 0; border: 0; text-align: right; }
  .tbl.stack td::before { content: attr(data-label); flex: 0 0 34%; text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); }
  .tbl.stack td.nolabel::before { display: none; }
  .tbl.stack td.nolabel { display: block; text-align: left; }
  .tbl.stack td.hd { font-size: 15px; padding-bottom: 2px; }
  .tbl.stack td.hide-m { display: none; }
  .rk-m { display: inline; color: var(--primary); font-weight: 700; margin-right: 4px; }
  .tbl.stack td.num, .tbl.stack td.c { text-align: right; }
  .tbl.stack td.empty { display: block; text-align: center; }
  .tbl.stack td.empty::before { display: none; }
  .tbl.stack td.supcell { border-left: 0; background: none; align-items: flex-start; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 10px; }
  .tbl.stack td.supcell > * { text-align: right; }
  .tbl.stack td.note .note-in { max-width: none; text-align: left; flex: 1; }
  .tbl.stack td.act { display: block; padding-top: 8px; }
  .tbl.stack td.act::before { display: none; }
  .tbl.stack td.act .row-actions { justify-content: stretch; }
  .tbl.stack td.act .row-actions .btn { flex: 1; }
  .tbl.stack td.del { position: absolute; top: 4px; right: 6px; width: auto; padding: 0; }
  .tbl.stack td.del::before { display: none; }
  .tbl.stack td.pr { padding-right: 36px; }

  /* pesanan */
  .ctl-row { flex-wrap: wrap; padding: 12px 14px 4px; gap: 8px; }
  #q { flex: 1 1 100%; }
  #qf, #qm { flex: 1 1 calc(50% - 4px); width: auto !important; }
  #q-clear { flex: 1 1 100%; }
  .ctl-foot { padding: 0 14px 10px; }
  .float { left: -1px; right: -1px; }
  .fl-scroll { max-height: 58vh; }
  .fl-help { display: none; }
  .head-tools { flex-wrap: wrap; width: 100%; gap: 8px; }
  .head-tools label { flex: 1 1 100%; justify-content: space-between; }
  .head-tools .inp { width: 170px; height: 40px; }
  .head-tools .btn { width: 100%; }
  .banner { margin: 10px 12px 0; flex-wrap: wrap; }
  .groups { padding: 12px 12px 14px; }
  .ctabs { margin: 12px 12px 0; }
  .cust-grid { grid-template-columns: 1fr; gap: 10px; }
  .cart-scroll { border: 0; max-height: none; min-height: 0; }
  .cart-tbl tbody tr { margin: 8px 0 !important; }
  .cart-tbl td.cart-name { font-weight: 500; }
  .cart-sum { width: 100%; }
  .bar-bottom { position: fixed; left: 8px; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); margin: 0; z-index: 790; padding: 10px 12px; gap: 12px; justify-content: space-between; border-radius: 14px; box-shadow: 0 6px 24px rgba(20,26,38,.18); }
  .bar-bottom .bt { text-align: left; }
  .bar-bottom .bt:nth-child(2) { display: none; }
  .bar-bottom .bt .v { font-size: 16px; }
  .bar-bottom .btn.primary { height: 44px; padding: 0 20px; font-size: 14px; }

  /* modal menjadi panel dari bawah */
  .modal { align-items: flex-end; }
  .modal-box, .modal-box.wide { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .g3 { grid-template-columns: 1fr; }
  .modal-foot { position: sticky; bottom: -18px; background: #fff; padding-top: 10px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }

  /* login */
  .auth { padding: 16px; place-items: start center; padding-top: 8vh; }
  .auth-card { padding: 22px; }
  #kp-menu { min-width: 0; width: calc(100vw - 24px); }
  #kp-menu button { padding: 12px 14px; }
}
@media (min-width: 961px) and (max-width: 1280px) {
  .kp-top-in, .kp-main { padding-left: 18px; padding-right: 18px; }
  .brand-text p { display: none; }
  .nav button { padding: 0 11px; }
  .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-grid.three { grid-template-columns: 1fr; }
}
