/* BG Backoffice — tambahan di atas /app.css (POS). Lebih lebar di laptop, tetap enak di iPhone. */
body.bo main, body.bo #ptitle { max-width: 980px; }
body.bo main { padding-bottom: calc(110px + var(--safe-b)); }
.bo .tools { position: sticky; top: calc(env(safe-area-inset-top) + 50px); z-index: 4; background: var(--bg); padding: 4px 0 8px; }
.bo .tools .rowf { display: flex; gap: 8px; } .bo .tools .rowf > * { flex: 1; } .bo .tools select { flex: 0 0 38%; }
.bo .fchips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.bo .fchips button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--ink); }
.bo .fchips button.on { background: var(--head); border-color: var(--head); color: #fff; font-weight: 700; }
.bo .irow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.bo .th { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #4e6573; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 300; }
.bo .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo .irow .mid { flex: 1; min-width: 0; } .bo .irow .mid b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo .irow .rt { text-align: right; white-space: nowrap; }
.bo .tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #e8f0fb; color: #1f4f8f; margin-left: 4px; }
.bo .tag.warn { background: var(--hutang-brg-bg); color: #8a5a00; } .bo .tag.off { background: #fbe9e7; color: var(--bad); }
.bo .sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px 14px; margin-bottom: 12px; }
.bo .sec > h2 { margin: 14px 0 2px; }
.bo .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (min-width: 760px) { .bo .cols { display: grid; grid-template-columns: 300px 1fr; gap: 0 14px; align-items: start; } .bo .g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; } }
.bo .foto { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #4e6573; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 54px; font-weight: 300; margin-top: 12px; }
.bo .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo .btns { display: flex; gap: 8px; } .bo .btns .btn { margin-top: 10px; padding: 10px; }
.bo .hint { font-size: 13px; color: var(--muted); margin-top: 4px; } .bo .hint.bad { color: var(--bad); font-weight: 600; }
.bo .note { background: var(--hutang-brg-bg); border-radius: 10px; padding: 9px 11px; font-size: 13px; margin-top: 10px; }
.bo .rp-in { position: relative; } .bo .rp-in::before { content: "Rp"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }
.bo .rp-in input { padding-left: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.bo .savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-b)); display: flex; gap: 10px; justify-content: center; }
.bo .savebar .btn { margin: 0; max-width: 420px; } .bo .savebar .sub { align-self: center; }
.bo .soon { opacity: .45; } .bo .soon small { margin-left: auto; font-size: 12px; }
.bo .logo-mark span { letter-spacing: 1px; }
body.bo header { grid-template-columns: auto 1fr auto; }
body.bo header .hr { align-items: center; gap: 6px; }
body.bo header #topAction:empty { display: none; }
.bo #toast { bottom: calc(90px + var(--safe-b)); }
.bo .irow .mid .sub { display: block; }
/* Pembelian */
.bo .kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.bo .kv.big { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 17px; }
.bo .pl { padding: 10px; } .bo .pl .x { border: 0; background: none; font-size: 18px; color: var(--muted); padding: 0 4px; }
.bo .g3l { display: grid; grid-template-columns: 0.8fr 1.3fr 1fr; gap: 0 8px; } .bo .g3l label { font-size: 12px; }
.bo .tag.ok { background: #e6f4ea; color: var(--ok); }
.bo .card.off { opacity: .55; }
/* Tagihan supplier (gaya sheet OPENBILLS) */
.bo .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.bo .tile { text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.bo .tile b { display: block; font-size: 16px; margin-top: 2px; font-variant-numeric: tabular-nums; } .bo .tile .sub { font-size: 12px; }
.bo .tile.on { border-color: var(--head); box-shadow: inset 0 0 0 1px var(--head); } .bo .tile.bad b { color: var(--bad); }
.bo #sups button small { opacity: .6; margin-left: 2px; }
.bo #tgSheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.bo .sh-row { display: grid; grid-template-columns: 34px minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, .9fr) 110px 96px 130px; gap: 8px; align-items: center;
  padding: 7px 10px; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.bo .sh-row input[type=checkbox], .bo .sh-date input { width: 20px; height: 20px; margin: 0; }
.bo .sh-head { background: #eef1f4; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; cursor: default; border-top: 0; }
.bo .sh-date { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: #f6f3ec; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.bo .sh-date label { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--ink); } .bo .sh-date > span { color: var(--muted); font-weight: 400; }
.bo .sh-row .r { text-align: right; } .bo .sh-row .num { font-variant-numeric: tabular-nums; font-weight: 600; } .bo .sh-row .num small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.bo .sh-row .sup b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .bo .sh-row .sup .m { display: none; }
.bo .sh-row .isi, .bo .sh-row .fak, .bo .sh-row .lok { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bo .sh-row .st small { color: var(--muted); font-size: 11px; } .bo .sh-row .ok { color: var(--ok); font-weight: 700; }
.bo .sh-row.late { background: #fdf0ee; } .bo .sh-row.part .num { color: #8a5a00; } .bo .sh-row.sel { background: #e8f0fb; }
.bo .sh-detail { padding: 6px 12px 10px 52px; background: #fafbfc; border-top: 1px dashed var(--line); font-size: 13px; }
@media (max-width: 760px) {
  .bo .sh-row { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 2px; column-gap: 8px; }
  .bo .sh-row .fak, .bo .sh-row .isi, .bo .sh-row .lok { display: none; }
  .bo .sh-row .sup .m { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bo .sh-row .st { grid-column: 2 / 4; font-size: 12px; } .bo .sh-row .st:empty { display: none; }
  .bo .sh-head { display: none; } .bo .sh-detail { padding-left: 40px; }
  .bo .tile b { font-size: 14px; }
}
.bo .selbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 2px solid var(--head);
  padding: 10px 16px calc(10px + var(--safe-b)); display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: center; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.bo .selbar .btn.sm { margin: 0; } .bo .paypanel { width: 100%; max-width: 560px; } .bo .paypanel .x { border: 0; background: none; font-size: 18px; color: var(--muted); }
.bo .snack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); z-index: 9; background: #222; color: #fff; border-radius: 10px;
  padding: 10px 14px; display: flex; gap: 14px; align-items: center; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.bo .snack button { background: none; border: 0; color: #ffd27a; font: inherit; font-weight: 700; }
.bo .tools.static { position: static; }

/* Form nota beli: di HP urutan Nota → Barang → Diskon/PPN → Pembayaran → Ringkasan; di PC 2 kolom */
.bo .pform { display: flex; flex-direction: column; }
.bo .pform > .pc { display: contents; }
.bo .pform .s1 { order: 1; } .bo .pform .s2 { order: 2; } .bo .pform .s3 { order: 3; } .bo .pform .s4 { order: 4; } .bo .pform .s5 { order: 5; }
@media (min-width: 760px) { .bo .pform { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 14px; align-items: start; }
  .bo .pform > .pc { display: block; } .bo .pform > .c1 { grid-area: 1 / 1; } .bo .pform > .c3 { grid-area: 2 / 1; } .bo .pform > .c2 { grid-area: 1 / 2 / 3 / 3; } }
#sering .lgrid3 { margin-bottom: 10px; }
.bo .tgbtn { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .bo .tgbtn .btn { text-decoration: none; }
.bo .sh-row.paid { background: #e3f3e6; } .bo .sh-row.paid.sel { background: #d3ead9; }
.bo .sh-row .pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.bo .sh-row .pill.ok { background: #1f7a3a; color: #fff; } .bo .sh-row .pill.no { background: #fbe3df; color: #9b2c1c; }
.bo .sh-row .stt small { display: block; font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .bo .sh-row .stt { display: none; } }
.bo .tgnew { display: block; margin: 10px 0 4px; padding: 14px; font-size: 17px; font-weight: 700; text-align: center; text-decoration: none; }
@media (min-width: 761px) { .bo .tgnew { display: inline-block; width: auto; padding: 10px 22px; font-size: 15px; } }
.bo .card.irow.paid { background: #e3f3e6; border-color: #b9dfc2; }

/* Antar regional — rekap per bulan */
.bo .rgt { width: 100%; border-collapse: collapse; font-size: 14px; }
.bo .rgt th, .bo .rgt td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.bo .rgt th { background: #eef1f4; font-size: 12px; color: var(--muted); text-transform: uppercase; border-top: 0; }
.bo .rgt .r { text-align: right; font-variant-numeric: tabular-nums; } .bo .rgt small { display: block; font-size: 11px; color: var(--muted); }
.bo .rgt tbody tr { cursor: pointer; } .bo .rgt tbody tr:active { background: #e8f0fb; }
.bo .rgt .neg { color: var(--bad, #b3261e); font-weight: 700; } .bo .rgt .ok { color: var(--ok); font-weight: 700; }
.bo .rgall { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .bo .rgall:empty { display: none; } .bo .rgall .btn { margin: 0; }
@media (max-width: 760px) { .bo .rgall .btn { flex: 1 1 100%; padding: 12px; font-size: 15px; } }

/* Akuntansi (modul 6) */
.bo .fchips a { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bo .fchips a.on { background: var(--head); border-color: var(--head); color: #fff; font-weight: 700; }
.bo a.tile { text-decoration: none; display: block; }
.bo .akr { color: var(--ink); text-decoration: none; padding: 7px 0; border-top: 1px solid var(--line); align-items: center; }
.bo .akr:first-child { border-top: 0; } .bo .akr small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.bo .akr b { white-space: nowrap; } .bo a.akr:active { background: #e8f0fb; } .bo .akr.bad b, .bo .akr.bad span { color: var(--bad); } .bo .akr.off { opacity: .5; }
.bo .akg { margin-top: 10px; } .bo .akgh { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 12px 0 2px; }
.bo .akt { border-top: 1px solid var(--ink); padding-top: 6px; margin-top: 2px; font-weight: 700; } .bo .akt.big { font-size: 17px; margin-top: 12px; }
.bo .akt.neg b { color: var(--bad); }
.bo .aksub { margin: -2px 0 4px 14px; font-size: 14px; } .bo .aksub .akr { padding: 4px 0; border-top: 1px dashed var(--line); color: var(--muted); }
.bo .akopt { align-items: center; margin: 6px 2px 8px; } .bo .ck { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink); }
.bo .ck input { width: 20px; height: 20px; margin: 0; flex: none; }
.bo .aktr { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; }
.bo .aktr .bar { position: relative; height: 18px; background: #f1f3f5; border-radius: 5px; overflow: hidden; }
.bo .aktr .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #c9d1d8; } .bo .aktr .bar i.l { top: 5px; bottom: 5px; background: #1f7a3a; } .bo .aktr .bar i.l.neg { background: var(--bad); }
.bo .aktr .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; } .bo .aktr .r small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.bo .akj { margin-bottom: 8px; } .bo .akl { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.bo .akl td, .bo .akl th { padding: 4px 0; border-top: 1px solid var(--line); vertical-align: top; } .bo .akl th { border-top: 0; font-size: 12px; color: var(--muted); text-align: left; }
.bo .akl td.r, .bo .akl th.r { text-align: right; width: 92px; padding-left: 6px; white-space: nowrap; } .bo .akl td.kr { padding-left: 18px; }
.bo .akl a { color: var(--ink); text-decoration: none; } .bo .akl small { display: block; font-size: 11px; color: var(--muted); }
.bo .akb { display: flex; gap: 10px; align-items: center; padding: 9px 12px; margin-bottom: 6px; color: var(--ink); text-decoration: none; }
.bo .akb .mid { flex: 1; min-width: 0; } .bo .akb .mid b { display: block; } .bo .akb .mid .sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo .akb .rt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .bo .akb .rt small { display: block; font-size: 11px; color: var(--muted); }
.bo .akb .kr, .bo .akb b.kr { color: #9b2c1c; } .bo .akb.rk input { width: 22px; height: 22px; margin: 0; flex: none; } .bo .akb.rk.ok { background: #e3f3e6; border-color: #b9dfc2; }
.bo .akx td a { color: var(--ink); text-decoration: none; } .bo .akx tr.tt td { font-weight: 700; background: #f6f7f8; } .bo .akx tr.tt.big td { font-size: 15px; }
.bo .akx td:first-child, .bo .akx th:first-child { position: sticky; left: 0; background: var(--card); max-width: 190px; overflow: hidden; text-overflow: ellipsis; } .bo .akx tr.tt td:first-child { background: #f6f7f8; }
.bo .mfr { padding: 10px; margin-bottom: 8px; } .bo .mfr .row select { flex: 1; } .bo .mfr > select { margin-top: 8px; } .bo .mfr .x { border: 0; background: none; font-size: 18px; color: var(--muted); padding: 0 4px; }
.bo details summary { cursor: pointer; padding: 8px 0 4px; }
@media (min-width: 761px) { .bo .akh .rowf select { width: auto; flex: 0 0 260px; } .bo .akh .rowf { justify-content: flex-start; } }
.bo .akdl { display: flex; gap: 8px; margin: 8px 0; } .bo .akdl .btn { flex: 1; margin: 0; } @media (min-width: 761px) { .bo .akdl .btn { flex: 0 0 auto; } }
#akPrint { display: none; }
@media print {
  body.akprint > *:not(#akPrint) { display: none !important; }
  body.akprint { background: #fff; padding: 0; }
  body.akprint #akPrint { display: block; color: #000; font: 11pt/1.35 -apple-system, "Segoe UI", Arial, sans-serif; }
  #akPrint section { page-break-after: always; } #akPrint section:last-child { page-break-after: auto; }
  #akPrint .kop { text-align: center; border-bottom: 2px solid #8e1b1b; padding-bottom: 8px; margin-bottom: 12px; }
  #akPrint .kop b { font-size: 13pt; letter-spacing: .5px; } #akPrint h1 { font-size: 16pt; margin: 4px 0 2px; }
  #akPrint table { width: 100%; border-collapse: collapse; } #akPrint td { padding: 3px 4px; } #akPrint td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #akPrint tr.h td { font-weight: 700; text-transform: uppercase; font-size: 9.5pt; color: #555; padding-top: 12px; border-bottom: 1px solid #999; }
  #akPrint tr.s td { color: #555; font-size: 9.5pt; } #akPrint tr.s td:first-child { padding-left: 18px; } #akPrint tr.t td { font-weight: 700; border-top: 1px solid #000; }
  #akPrint tr.big td { font-size: 12.5pt; border-top: 2px solid #000; padding-top: 6px; } #akPrint .ft { margin-top: 18px; font-size: 8.5pt; color: #666; }
}
.bo .mchip { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 10px; background: #eef1f4; color: var(--muted); white-space: nowrap; } .bo .mchip.ok { background: #e3f3e6; color: #1f7a3a; } .bo .mchip.no { background: #fbe3df; color: #9b2c1c; }
.bo label.btn input[type=file] { display: none; }

/* Menu Setting (induk) — 19 Okt */
#drawer .ditem.grph { cursor: pointer; color: var(--muted); font-weight: 600; }
#drawer .ditem.grph.on { background: none; color: var(--head); }

/* Tarik ke bawah untuk muat ulang — 19 Okt */
#ptr { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translate(-50%, -60px); opacity: 0; z-index: 60;
  width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); pointer-events: none; transition: opacity .15s; }
#ptr.ready, #ptr.spin { color: var(--brand); }
#ptr.ready span { display: inline-block; transform: rotate(180deg); transition: transform .15s; }
#ptr.spin span { display: inline-block; animation: ptrspin .7s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* Saldo awal checklist (19 Okt) */
.bo .kv.akr.warn > span > b { color: #8a5a00; }
.bo .kv.akr > span > b { display: block; }
.bo .akw .kv.akr > span { flex: 1; min-width: 0; }
.bo .akw .kv.akr > span > b { white-space: normal; }
.bo .akw .kv.akr > .btn { flex: none; align-self: center; }
.bo .akw .kv.akr { border-bottom: 1px solid var(--line); padding: 8px 0; }
.bo .irow.aset .rt .sub { display: block; font-size: 11px; }
.bo .irow.aset .mid b { white-space: normal; }
.bo .akh .akttl { font-size: 20px; font-weight: 800; margin: 2px 2px 10px; color: var(--ink); } .bo .akh .akttl span { font-size: 13px; font-weight: 600; color: var(--muted); display: block; }

/* ---- Asisten AI (modul 7) ---- */
#aiBtn { display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--head); border: 0; border-radius: 999px;
  padding: 6px 12px 6px 10px; margin-left: 6px; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
#aiBtn span { font-size: 16px; line-height: 1; } #aiBtn b { font-weight: 800; }
@media (max-width: 380px) { #aiBtn b { display: none; } }
body.aiOn { overflow: hidden; }
#aiPanel { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg);
  transform: translateY(100%); transition: transform .18s ease-out; }
#aiPanel.open { transform: none; }
@media (min-width: 900px) { #aiPanel { left: auto; width: 460px; box-shadow: -8px 0 24px rgba(0,0,0,.18); transform: translateX(100%); } #aiPanel.open { transform: none; } body.aiOn { overflow: auto; } }
.aiTop { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; background: var(--head); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; }
.aiTop b { text-align: center; font-size: 16px; }
.aiTop button { background: none; border: 0; color: #fff; font: inherit; font-size: 15px; padding: 8px 6px; min-height: 40px; }
.aiTb { display: flex; gap: 2px; }
.aiBody { flex: 1; overflow-y: auto; padding: 12px 12px 4px; -webkit-overflow-scrolling: touch; }
.aim { max-width: 88%; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; line-height: 1.45; font-size: 15px; word-wrap: break-word; }
.aim p { margin: 0 0 6px; } .aim p:last-of-type { margin-bottom: 0; }
.aim ul, .aim ol { margin: 4px 0 6px; padding-left: 20px; } .aim li { margin: 2px 0; }
.aim code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.aim a { color: var(--brand); font-weight: 600; }
.aim.u { margin-left: auto; background: var(--head); color: #fff; border-bottom-right-radius: 4px; }
.aim.u img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; margin-bottom: 6px; }
.aim.a { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.aim.a.err { border-color: var(--bad); color: var(--bad); }
.aih { font-weight: 700; margin: 8px 0 4px !important; }
.aitag { font-size: 13px; opacity: .85; margin-bottom: 4px; }
.aimod { margin-top: 6px; font-size: 11px; color: var(--muted); }
a.aiAct { display: block; margin: 8px 0 0; padding: 11px 12px; border-radius: 10px; background: var(--ok); color: #fff !important; text-decoration: none; text-align: center; font-weight: 700; }
.aim.busy { display: flex; gap: 5px; width: 64px; }
.aim.busy span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: aiDot 1s infinite; }
.aim.busy span:nth-child(2) { animation-delay: .15s; } .aim.busy span:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.aiHello { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 15px; }
.aiHello p { margin: 0 0 8px; }
.aiSug { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.aiSug button, .aiList button { text-align: left; font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.aiList { display: flex; flex-direction: column; gap: 8px; }
.aiList button.on { border-color: var(--head); }
.aiList small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.aiList .aiBack { text-align: center; }
.aiFoot { border-top: 1px solid var(--line); background: var(--card); padding: 8px 10px calc(8px + var(--safe-b)); }
.aiRow { display: flex; align-items: flex-end; gap: 8px; }
.aiRow textarea { flex: 1; resize: none; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px; max-height: 140px; background: #fff; }
.aiCam { font-size: 24px; padding: 6px 2px; cursor: pointer; }
.aiSend { background: var(--ok); color: #fff; border: 0; border-radius: 18px; padding: 10px 16px; font: inherit; font-weight: 700; min-height: 44px; }
#aiImg { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
#aiImg img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
#aiImg button { margin-left: auto; background: none; border: 0; font-size: 18px; color: var(--muted); padding: 6px; }
.aiInfo { font-size: 11px; color: var(--muted); margin-top: 6px; text-align: center; }
.aiInfo.err { color: var(--bad); }

/* ================= Layout lebar Backoffice (PC / tablet horizontal ≥900px), 19 Okt =================
   Menu samping tetap (#side) + isi + panel rincian kanan (#detail). Di HP tidak berubah. */
#side, #detail { display: none; }
body.bo.wide { --rail: 236px; --detw: 400px; }
body.bo.wide #menuBtn { display: none; }
body.bo.wide header { grid-template-columns: var(--rail) 1fr auto; padding-left: 0; }
body.bo.wide header .logo-mark { padding-left: 20px; }
body.bo.wide header .hl { justify-content: flex-start; }
body.bo.wide #side:not([hidden]) { display: flex; flex-direction: column; position: fixed; top: var(--hh); left: 0; bottom: 0; width: var(--rail); z-index: 4;
  background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; padding: 6px 8px 12px; }
#side .dsec { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px 4px; }
#side .ditem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; font: inherit;
  font-size: 15px; color: var(--ink); padding: 9px 10px; text-decoration: none; cursor: pointer; min-height: 40px; }
#side .ditem:hover { background: #f4f1ec; }
#side .ditem .di { width: 22px; text-align: center; font-size: 17px; flex: none; }
#side .ditem.on { background: #fbe9e9; color: var(--head); font-weight: 800; }
#side .ditem.subm { padding-left: 30px; font-size: 14px; min-height: 36px; } #side .ditem.subm .di { font-size: 15px; }
#side .ditem.grp .caret { margin-left: auto; font-size: 13px; color: var(--muted); transition: transform .15s; }
#side .ditem.grp:not(.open) .caret { transform: rotate(-90deg); }
#side .ditem.grp.on { background: none; color: var(--head); font-weight: 700; }
#side .ditem[hidden] { display: none; }
#side .soon { opacity: .45; } #side .soon small { margin-left: auto; font-size: 11px; }
#side .sp { flex: 1; min-height: 10px; }
#side .sme { padding: 10px 10px 0; border-top: 1px solid var(--line); margin-top: 8px; font-size: 13px; } #side .sme span { display: block; color: var(--muted); font-size: 12px; }
body.bo.wide main { max-width: none; margin: 0 0 0 var(--rail); padding: 16px 24px 40px; }
body.bo.wide #ptitle { max-width: none; margin: 0 0 0 var(--rail); padding: 14px 24px 0; }
body.bo.wide.det main, body.bo.wide.det #ptitle { margin-right: var(--detw); }
body.bo.wide .tools { top: var(--hh); }
body.bo.wide .tools.static { position: static; }
body.bo.wide .savebar, body.bo.wide .selbar { left: var(--rail); }
body.bo.wide.det .savebar, body.bo.wide.det .selbar { right: var(--detw); }
body.bo.wide #toast { left: calc(var(--rail) + 20px); }
body.bo.wide .sh-detail { display: none !important; }
@media print { #side, #detail { display: none !important; } body.bo.wide main { margin: 0; } }

/* Panel rincian kanan */
body.bo.wide #detail:not([hidden]) { display: flex; flex-direction: column; position: fixed; top: var(--hh); right: 0; bottom: 0; width: var(--detw); z-index: 5;
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -6px 0 18px rgba(0,0,0,.05); }
#detail .dhd { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); font-size: 16px; }
#detail .dhd b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#detail .dhd .x { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 2px 6px; }
#detail .dbody { flex: 1; overflow-y: auto; padding: 12px 16px 20px; font-size: 14px; }
#detail .tgbtn { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; } #detail .tgbtn .btn { margin: 0; }
.dsec2 { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-top: 12px; }
.dsec2 h3 { margin: 2px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dsec2.alert { background: #fdf0ee; border-color: #f2c6bf; } .dsec2.alert h3 { color: var(--bad); }
.dsec2 .kv { border-bottom: 1px dashed var(--line); } .dsec2 .kv:last-child { border-bottom: 0; }
.kv.lnk { color: inherit; text-decoration: none; } .kv.lnk:hover span { text-decoration: underline; } .kv.lnk.on { font-weight: 700; color: var(--head); }
.dbtns { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; } .dbtns .btn { margin: 0; text-align: center; text-decoration: none; }
.dprod { display: flex; gap: 12px; align-items: center; } .dprod .th { width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; background: #4e6573; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; } .dprod .th img { width: 100%; height: 100%; object-fit: cover; }
.cur, .sh-row.cur { box-shadow: inset 4px 0 0 var(--head); }
.bo .sh-row.cur:not(.sel) { background: #fff7f0; }

/* Tabel umum (Produk, Pergerakan stok) */
.bo .tbw { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.bo .tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.bo .tbl th { background: #eef1f4; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 8px 10px; position: sticky; top: 0; white-space: nowrap; }
.bo .tbl td { padding: 7px 10px; border-top: 1px solid var(--line); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.bo .tbl .r { text-align: right; } .bo .tbl .mut { color: var(--muted); } .bo .tbl .pos { color: var(--ok); font-weight: 700; }
.bo .tbl tbody tr[data-id] { cursor: pointer; } .bo .tbl tbody tr[data-id]:hover td { background: #faf8f4; }
.bo .tbl tr.cur td { background: #fff7f0; } .bo .tbl tr.cur td:first-child { box-shadow: inset 4px 0 0 var(--head); }
.bo .tbl tr.off td { opacity: .55; } .bo .tbl tr.late td { background: #fdf0ee; }
.bo .tbl .th.sm { display: inline-flex; width: 34px; height: 34px; border-radius: 8px; font-size: 12px; vertical-align: middle; margin-right: 10px; }
.bo .tbl.sm td { padding: 6px 10px; }
@media (max-width: 760px) { .bo .tbl .hide-n { display: none; } }

/* Keterangan warna Tagihan */
.bo .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 6px 2px 8px; }
.bo .legend span { display: inline-flex; align-items: center; gap: 6px; }
.bo .lg { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); display: inline-block; }
.bo .lg.sel { background: #e8f0fb; border-color: #c7d8f0; } .bo .lg.late { background: #fdf0ee; border-color: #f2c6bf; } .bo .lg.paid { background: #e3f3e6; border-color: #bfe0c7; }

/* Pembelian: diskon, ongkir, PPN sejajar */
.bo .frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.bo .frow .ppnf { grid-column: 1 / -1; }
.bo .frow .fld input, .bo .frow .fld select { height: 46px; box-sizing: border-box; }
@media (min-width: 1100px) { .bo .frow { grid-template-columns: 1fr 1fr 1.5fr; } .bo .frow .ppnf { grid-column: auto; } }
/* Pembelian di layar lebar: 3 kolom — Nota | Barang + diskon | Pembayaran + ringkasan */
@media (min-width: 1200px) {
  body.bo.wide .pform { grid-template-columns: 300px minmax(0, 1fr) 340px; grid-template-rows: auto; }
  body.bo.wide .pform > .c1 { grid-area: 1 / 1; } body.bo.wide .pform > .c2 { grid-area: 1 / 2; } body.bo.wide .pform > .c3 { grid-area: 1 / 3; }
}

/* Pergerakan stok */
.bo .smtools .rowf select { flex: 0 0 220px; }
.bo .smpick { position: relative; flex: 1; } .bo .smpick input { width: 100%; }
.bo .smres { position: absolute; left: 0; right: 0; top: 100%; z-index: 8; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 360px; overflow: auto; }
.bo .smres button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; padding: 9px 12px; cursor: pointer; }
.bo .smres button:hover { background: #faf8f4; } .bo .smres button .sub { display: block; font-size: 12px; }
.bo .fsep { flex: none; width: 1px; background: var(--line); margin: 2px 4px; }
.bo .smitem { margin: 10px 2px; font-size: 17px; } .bo .lnkbtn { border: 0; background: none; color: var(--head); font: inherit; font-size: 13px; cursor: pointer; }
.bo .tiles.t4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; } .bo .tile.okb b { color: var(--ok); }
@media (max-width: 600px) { .bo .tiles.t4 { grid-template-columns: repeat(2, 1fr); } .bo .smtools .rowf { flex-wrap: wrap; } .bo .smtools .rowf select { flex: 1 0 100%; } }
#side .ditem.grp { text-transform: none; letter-spacing: normal; }
.bo .tbl .show-n { display: none; } .bo .tbl td.ket { max-width: 170px; }
@media (max-width: 1500px) { body.det .bo .tbl .hide-w, body.bo.det .tbl .hide-w { display: none; } }
@media (max-width: 760px) { .bo .tbl .show-n { display: table-cell; } .bo .tbl td.show-n small { color: var(--muted); } .bo .tbl td { white-space: normal; } .bo .tbl td.mut { white-space: nowrap; } }
.bo .tbl td.wk small { font-size: inherit; }
@media (max-width: 760px) { .bo .tbl td.wk small { display: block; font-size: 12px; } .bo .tbl td, .bo .tbl th { padding-left: 7px; padding-right: 7px; } }

/* ---- Stok opname (laporan investigasi) ---- */
.bo .op-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; } .bo .op-head > div:first-child { flex: 1 1 380px; }
.bo .op-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .bo .op-title h1 { margin: 2px 0; font-size: 22px; }
.bo .op-acts { display: flex; gap: 8px; flex-wrap: wrap; } .bo .op-acts .btn { margin: 0; }
.bo .btn.op-ok, .bo button.op-ok { background: var(--ok); color: #fff; border: 0; }
.bo .op-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eee; color: var(--muted); white-space: nowrap; }
.bo .op-pill.w { background: #e8eefc; color: #2a4cc7; } .bo .op-pill.r { background: #fff1c9; color: #7a5300; } .bo .op-pill.ok { background: #e3f3e8; color: var(--ok); } .bo .op-pill.x { background: #fbe9e7; color: var(--bad); }
.bo .op-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
@media (max-width: 760px) { .bo .op-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bo .op-tiles .tile b { font-size: 15px !important; } }
.bo .op-tiles .tile b { font-size: 18px; white-space: nowrap; } .bo .op-tiles .tile b small { font-size: 13px; font-weight: 400; color: var(--muted); } .bo .op-tiles .tile > small { display: block; }
.bo .tile.op-tp { background: #eef8f1; border-color: #cde7d7; } .bo .tile.op-tp b { color: var(--ok); }
.bo .tile.op-tm { background: #fdf0ee; border-color: #f2c6bf; } .bo .tile.op-tm b { color: var(--bad); }
.bo .tile.op-tb { border: 2px solid var(--ink); }
.bo .op-p { color: var(--ok); } .bo .op-m { color: var(--bad); } b.op-p, b.op-m { font-weight: 800; }
.bo .op-h2 { margin: 22px 0 8px; } .bo .op-h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; margin-left: 6px; }
.bo .op-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.bo .op-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.bo .op-card.cabang { border-color: #c9d6f8; } .bo .op-ct { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #7a5300; }
.bo .op-card.cabang .op-ct { color: #2a4cc7; } .bo .op-card.dokumen .op-ct { color: var(--bad); }
.bo .op-cr { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.bo .op-cr.p { background: #eef8f1; } .bo .op-cr.p b { color: var(--ok); } .bo .op-cr.m { background: #fdf0ee; } .bo .op-cr.m b { color: var(--bad); }
.bo .op-cb { font-size: 13px; line-height: 1.45; } .bo .op-cn { font-size: 13px; color: #2a4cc7; font-weight: 600; }
.bo .op-cbt { display: flex; gap: 6px; flex-wrap: wrap; } .bo .op-cbt .btn { margin: 0; padding: 6px 10px; font-size: 13px; }
.bo .op-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #f0eeea; color: #3d3a37; white-space: nowrap; margin: 1px 0; }
.bo .op-tag.pas, .bo .op-tag.w { background: #fff1c9; color: #6b4600; } .bo .op-tag.cab { background: #e8eefc; color: #2a4cc7; } .bo .op-tag.dok, .bo .op-tag.m, .bo .op-tag.x { background: #fdecea; color: var(--bad); }
.bo .op-tag.ul, .bo .op-tag.ulg { background: #efe8f7; color: #5b2e91; } .bo .op-tag.gerak { background: #e8f0fb; color: #1f4f8f; } .bo .op-tag.ok { background: #e3f3e8; color: var(--ok); }
.bo .op-tbl td.op-nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; } .bo .op-tbl td.op-nm small { display: block; }
.bo .op-tbl td.op-tags { white-space: normal; max-width: 260px; } .bo .op-tbl tr.op-aw td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }
.bo .op-tbl input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.bo .op-inl td { background: #fbfaf7; white-space: normal; max-width: none; padding: 10px 12px 14px; }
.bo .op-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; margin: 10px 0; }
.bo .op-3 > div { background: var(--bg); border-radius: 10px; padding: 8px; } .bo .op-3 b { display: block; font-size: 20px; }
.bo .op-3 .m { background: #fdf0ee; } .bo .op-3 .m b { color: var(--bad); } .bo .op-3 .p { background: #eef8f1; } .bo .op-3 .p b { color: var(--ok); }
.op-pt { font-size: 13px; padding: 7px 10px; border-radius: 8px; background: #f5f3f0; margin: 4px 0; }
.op-pt.pas, .op-pt.ul { background: #fff8e6; color: #4a3700; } .op-pt.cab { background: #e8eefc; color: #1d3a9c; } .op-pt.dok { background: #fdecea; color: #7d2a22; }
.op-bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding-top: 4px; }
.op-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; font-size: 11px; }
.op-bars i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: #ccc; } .op-bars i.m { background: #e8a29b; } .op-bars i.p { background: #9cc9ae; } .op-bars i.z { background: #ddd; }
.op-bars i.m.now { background: var(--bad); } .op-bars i.p.now { background: var(--ok); } .op-bars span { color: var(--muted); }
.op-bars small.op-m { color: var(--bad); font-weight: 700; } .op-bars small.op-p { color: var(--ok); font-weight: 700; }
.bo .op-kat { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.bo .op-kat label { display: flex; align-items: center; gap: 6px; font-size: 14px; } .bo .op-kat input { width: 18px; height: 18px; margin: 0; }
.bo .op-hp, .bo .op-tbl td.op-nm .op-hp { display: none; }
@media (max-width: 760px) { .bo .op-tbl td.op-nm .op-hp { display: block; margin-top: 2px; } .bo .op-tbl td.op-nm b { max-width: 200px; white-space: normal; } .bo .op-inl td { padding: 8px; } }

/* Log aktivitas (pemilik) */
.bo .lgrow { padding: 9px 12px; margin-bottom: 6px; cursor: pointer; display: block; }
.bo .lgrow.lgbad { border-left: 4px solid var(--bad); } .bo .lgrow.lgwarn { border-left: 4px solid #e0a100; }
.bo .lgh { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; } .bo .lgt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bo .lgmsg { color: var(--bad); }
.bo .lgd { margin-top: 6px; } .bo .lgpre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: #f4f6f8; border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 320px; overflow: auto; } .bo .lgpre.bad { color: var(--bad); background: #fdf0ee; }
/* iOS: layer sendiri supaya bar bawah tetap terkunci saat scroll / setelah keyboard */
.bo .savebar, .bo .selbar { transform: translateZ(0); -webkit-transform: translateZ(0); }
