:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e7e4dc;
  --text: #1d1c1a;
  --muted: #77736a;
  --primary: #2f5d50;
  --primary-2: #24493f;
  --primary-soft: #e4eeea;
  --red: #b4372f;
  --red-soft: #fbe9e7;
  --amber: #a86a0c;
  --amber-soft: #fdf1dc;
  --green: #2f7a4f;
  --green-soft: #e3f3e8;
  --blue: #2c5aa0;
  --blue-soft: #e6eefa;
  --sidebar: #1f2a27;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 28, 20, .05), 0 4px 16px rgba(30, 28, 20, .05);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45;
  display: flex; min-height: 100vh;
}
a { color: var(--primary); }
.mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.spacer { flex: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--sidebar); color: #d8dfdc;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: #6fae95; color: #10201a; display: grid; place-items: center; font-weight: 800; }
.brand-name { color: #fff; font-weight: 600; font-size: 14.5px; }
.brand-sub { font-size: 11.5px; color: #93a39d; }
#nav { padding: 4px 8px; flex: 1; }
.nav-group { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #7d8c86; padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #d8dfdc; text-decoration: none; font-size: 13.5px; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(111,174,149,.18); color: #fff; }
.nav-ico { width: 18px; text-align: center; opacity: .85; }
.nav-item em { margin-left: auto; font-style: normal; font-size: 10px; background: rgba(255,255,255,.08); color: #9fb0a9; padding: 1px 6px; border-radius: 10px; }
.nav-item.is-soon { color: #8e9c97; }
.sidebar-foot { font-size: 11px; color: #6f7e78; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--bg); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; margin: 0; font-weight: 650; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; }
.view { padding: 22px 28px 60px; max-width: 1400px; width: 100%; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #cfcabe; background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #962b24; border-color: #962b24; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 7px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.icon-btn:hover:not(:disabled) { background: rgba(0,0,0,.06); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; text-decoration: underline; }

input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,93,80,.25); border-color: var(--primary); }
input.mini { width: 78px; padding: 5px 7px; }
input.r { text-align: right; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.fld input, .fld select, .fld textarea { color: var(--text); font-size: 14px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check input { width: auto; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
label.inline input { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Toolbar & tables ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; min-width: 140px; }
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.prow:hover td { background: #fcfbf8; }
.prow.is-off td { opacity: .6; }
.vrow > td { background: var(--surface-2); padding-top: 4px; padding-bottom: 14px; }
.tbl-inner { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.tbl-inner th { background: transparent; padding: 7px 10px; }
.tbl-inner td { padding: 7px 10px; }
.tbl-compact td { padding: 8px 4px; }
.tbl-var td { padding: 6px 8px; }
.tbl-var input:not(.mini) { min-width: 130px; padding: 5px 8px; }
.tbl-var tr.hl td { background: var(--amber-soft); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.list-foot { padding: 10px 2px; }
.pcell { display: flex; gap: 10px; align-items: center; }
.pname { font-weight: 600; }
.thumb { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.thumb-empty { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); margin-right: 6px; vertical-align: -1px; }
.stok-ro { font-weight: 600; padding: 0 6px; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px; background: #eeece6; color: var(--muted); white-space: nowrap; }
.badge-aman { background: var(--green-soft); color: var(--green); }
.badge-menipis, .badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-habis, .badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- Cards / dashboard ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-danger { border-color: #efc9c4; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-v { font-size: 22px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-grid .span-2 { grid-column: span 2; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; }
.bar { height: 10px; background: #efede7; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.bar-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.alert { background: var(--amber-soft); color: #6d4708; border: 1px solid #f0d9a8; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.mini-stats { display: flex; gap: 18px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 30px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty.big { padding: 60px 30px; }
.empty h2 { color: var(--text); margin: 8px 0; font-size: 18px; }
.empty p { max-width: 460px; margin: 0 auto 16px; }
.empty-ico { font-size: 40px; }
.small-empty { padding: 18px; font-size: 13px; border: 0; background: var(--surface-2); }

/* ---------- Master ---------- */
.master-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.add-row { display: flex; gap: 6px; margin-bottom: 8px; }
.mlist { list-style: none; margin: 0; padding: 0; }
.mlist li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mlist li:last-child { border-bottom: 0; }
.mname { font-weight: 500; }
.swatch-pick { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; flex-shrink: 0; position: relative; overflow: hidden; }
.swatch-pick input { opacity: 0; position: absolute; inset: 0; cursor: pointer; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 980px; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- Tabs / segmented ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.seg { display: flex; background: #efede7; border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 8px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 7px; font: inherit; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(20, 22, 20, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; opacity: 0; transition: opacity .15s; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.25); transform: translateY(8px); transition: transform .15s; }
.modal-wrap.show .modal { transform: none; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 12px 12px; position: sticky; bottom: 0; }
.confirm-msg { margin: 0; }
.form-section h4 { margin: 0 0 10px; font-size: 14px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 130px 1fr; gap: 16px; }
.photo-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.photo { width: 130px; height: 130px; border: 1.5px dashed #cdc8bb; border-radius: 10px; display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.margin-info { margin-top: 8px; }
.chip-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.chip-label { width: 60px; font-size: 12.5px; color: var(--muted); padding-top: 6px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: #bdb7a9; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-2); font-weight: 600; }
.chip-add input { width: 130px; padding: 5px 10px; border-radius: 20px; font-size: 13px; border-style: dashed; }
.var-tools { display: flex; gap: 14px; align-items: center; margin: 6px 0 8px; color: var(--muted); flex-wrap: wrap; }
.var-tools label { display: flex; align-items: center; gap: 6px; }

/* ---------- Popup menu ---------- */
.popmenu { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 4px; min-width: 190px; }
.popmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.popmenu button:hover { background: var(--surface-2); }
.popmenu .danger { color: var(--red); }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #1f2a27; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13.5px; max-width: 380px; opacity: 0; transform: translateY(8px); transition: all .2s; }
.toast.show { opacity: 1; transform: none; }
.toast-err { background: var(--red); }

/* ---------- Responsive ---------- */
.nav-backdrop { display: none; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .master-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .menu-toggle { display: inline-block; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .view { padding: 16px; }
  .dash-grid, .master-grid, .settings-grid { grid-template-columns: 1fr; }
  .dash-grid .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toolbar input[type=search] { max-width: none; }
}
.tbl-products { min-width: 780px; }
.tbl-inner { min-width: 640px; }

/* =========================================================
 * v2 — Product Master
 * ========================================================= */
.back-btn { font-size: 18px; color: var(--text); }
.req { color: var(--red); }
.center { text-align: center; }
.btn-ghost-danger { color: var(--red); }
.btn-ghost-danger:hover { background: var(--red-soft); border-color: #efc9c4; }
a.btn { text-decoration: none; }
.is-off td, li.is-off { opacity: .55; }
.alert-info { background: var(--blue-soft); color: #23457a; border-color: #cddcf3; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }

/* list */
.pcell { color: inherit; text-decoration: none; }
.pcell:hover .pname { color: var(--primary); text-decoration: underline; }
.sku-hits { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.chip-mini { font-size: 11px; background: var(--amber-soft); color: #6d4708; padding: 1px 6px; border-radius: 4px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 12px 2px; flex-wrap: wrap; }
.pager .btn-sm { min-width: 32px; justify-content: center; }
.per-page { width: auto; padding: 4px 8px; font-size: 12.5px; margin-left: 8px; }

/* form */
.pform { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.fsec { padding: 18px 20px; }
.fsec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.fsec-head h3 { margin: 0; font-size: 15.5px; }
.step { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.info-grid { display: grid; grid-template-columns: 150px 1fr; gap: 20px; }
.info-grid .photo { width: 150px; height: 150px; }
.input-row { display: flex; gap: 6px; }
.input-row select { flex: 1; }
.fld-err { color: var(--red); font-size: 12px; font-weight: 500; min-height: 0; }
.fld-err:empty { display: none; }
input.is-invalid, .is-invalid { border-color: var(--red) !important; background: #fff7f6; }
input.is-dup { border-color: var(--amber) !important; background: var(--amber-soft); }
.seg-sm { margin: 0; }
.seg-sm button { padding: 6px 10px; }
.chips { margin-bottom: 4px; }
.chip-code { font-size: 10.5px; color: var(--muted); font-family: Consolas, ui-monospace, monospace; }
.chip.on .chip-code { color: var(--primary); }
.quick-add { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; align-items: center; }
.quick-add input:not([type=color]) { max-width: 260px; }
.quick-add input[type=color] { width: 40px; height: 34px; padding: 2px; }
.w-code { max-width: 110px !important; }

/* rich text */
.rte { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: var(--primary); outline: 2px solid rgba(47,93,80,.18); }
.rte-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.rte-bar button { border: 0; background: none; padding: 4px 9px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.rte-bar button:hover { background: rgba(0,0,0,.06); }
.rte-sep { width: 1px; background: var(--line); margin: 3px 4px; }
.rte-area { min-height: 110px; padding: 10px 12px; outline: none; color: var(--text); font-size: 14px; font-weight: 400; }
.rte-area:empty::before { content: attr(data-placeholder); color: #a9a497; }
.rte-area ul, .rte-area ol, .rich ul, .rich ol { padding-left: 22px; margin: 4px 0; }
.rte-area p, .rich p { margin: 0 0 6px; }

/* size chart */
.sc-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.sc-head { display: flex; gap: 4px; align-items: center; }
.sc-label { min-width: 110px; font-weight: 600; font-size: 12.5px; }
.sc-unit { width: 52px; font-size: 12px; color: var(--muted); }
.tbl-edit th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.tbl-edit td { padding: 5px 6px; }
.tbl-edit input { padding: 6px 8px; }
.popmenu-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* bulk + variant table */
.bulk { display: flex; gap: 12px; align-items: flex-end; background: var(--primary-soft); border: 1px solid #cfe0d9; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.bulk-title { font-weight: 700; color: var(--primary-2); align-self: center; margin-right: 4px; }
.bulk .fld { width: 150px; }
.money-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.money-in span { padding: 0 0 0 9px; color: var(--muted); font-size: 13px; }
.money-in input { border: 0; outline: none; }
.money-in:focus-within { border-color: var(--primary); }
.tbl-var td { padding: 5px 6px; }
.tbl-var input { min-width: 0; }
.hint { margin: 8px 2px 0; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d7d3c8; border-radius: 22px; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }
.hidden-vars { margin-top: 12px; background: var(--amber-soft); border: 1px solid #f0d9a8; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.hidden-vars summary { cursor: pointer; }
.hidden-vars ul { margin: 8px 0; padding-left: 18px; }
.err-box { margin-top: 12px; background: var(--red-soft); border: 1px solid #efc9c4; color: #7c241e; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.err-box ul { margin: 6px 0 0; padding-left: 18px; }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; background: rgba(245,244,240,.94); backdrop-filter: blur(4px); padding: 12px 0; border-top: 1px solid var(--line); z-index: 4; }

/* detail */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.detail-grid .span-2 { grid-column: span 2; }
.detail-head { display: flex; gap: 18px; margin-bottom: 14px; }
.detail-photo { width: 130px; height: 130px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; display: grid; place-items: center; font-size: 36px; }
.detail-name { margin: 6px 0 10px; font-size: 20px; }
.detail-badges { display: flex; gap: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
h4.sub { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rich { font-size: 14px; }
.tbl-compact-2 td, .tbl-compact-2 th { padding: 7px 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); font-size: 12px; white-space: nowrap; width: 135px; flex-shrink: 0; padding-top: 1px; }
.diff { margin: 0; padding-left: 16px; }
.diff li { margin: 1px 0; }

.dash-grid .card { min-width: 0; }

@media (max-width: 980px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .span-2 { grid-column: auto; }
}
@media (max-width: 820px) {
  .info-grid { grid-template-columns: 1fr; }
  .bulk .fld { width: 100%; }
  .detail-head { flex-direction: column; }
  .tbl-var { min-width: 860px; }
}

/* ---------- v3: input tag warna & ukuran ---------- */
.tag-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; background: var(--surface); min-height: 44px; cursor: text; }
.tag-box:focus-within { border-color: var(--primary); outline: 2px solid rgba(47,93,80,.18); }
.tag-chips { display: contents; }
.tag { display: inline-flex; align-items: center; gap: 2px; background: var(--primary-soft); border: 1px solid #cfe0d9; color: var(--primary-2); border-radius: 20px; padding: 3px 4px 3px 10px; font-size: 13.5px; font-weight: 600; cursor: grab; user-select: none; }
.tag .swatch { margin-right: 5px; }
.tag.dragging { opacity: .4; }
.tag.drop { outline: 2px dashed var(--primary); }
.tag-x { border: 0; background: none; color: var(--primary-2); cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: 50%; opacity: .7; }
.tag-x:hover { background: rgba(0,0,0,.08); opacity: 1; }
.tag-input { border: 0 !important; outline: none !important; flex: 1; min-width: 180px; padding: 5px 4px !important; background: transparent; }
.tag-help { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.tag-sugg { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.sugg { border: 1px dashed #c9c4b6; background: var(--surface); border-radius: 20px; padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.sugg:hover { border-color: var(--primary); color: var(--primary); }
.sugg .swatch { margin-right: 4px; }
.swatch-unknown { background: repeating-linear-gradient(45deg, #ddd 0 3px, #f5f5f5 3px 6px); }
.master-single { grid-template-columns: minmax(280px, 520px) minmax(240px, 380px); }
.note-card h3 { margin: 0 0 8px; font-size: 15px; }
@media (max-width: 820px) { .master-single { grid-template-columns: 1fr; } .tag-input { min-width: 120px; } }

/* ---------- v4: harga per barang, size chart satu tabel, modal varian ---------- */
.price-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.price-note { margin: -4px 0 0; }
.money-in .suffix { padding: 0 10px 0 0; color: var(--muted); font-size: 12.5px; }
.money-in.is-invalid { border-color: var(--red); background: #fff7f6; }
.margin-box { padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--green); }
.margin-box.neg { color: var(--red); }

.sc-wrap { overflow-x: auto; }
.sc-grid { border-collapse: collapse; min-width: 100%; width: auto; background: var(--surface); font-size: 14px; }
.sc-grid th, .sc-grid td { border: 1px solid #d9d5ca; padding: 0; height: 38px; }
.sc-grid thead th { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text); text-transform: none; letter-spacing: 0; vertical-align: middle; min-width: 120px; }
.sc-grid .sc-size-col { width: 110px; min-width: 110px; background: #f6f4ee; }
.sc-grid thead .sc-size-col { padding: 0 10px; text-align: left; }
.sc-grid input { border: 0; border-radius: 0; background: transparent; width: 100%; height: 38px; padding: 0 10px; text-align: center; font-size: 14px; }
.sc-grid input:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; }
.sc-grid td.is-invalid input { background: #fff1ef; color: var(--red); }
.sc-grid .sc-size { text-align: left; font-weight: 600; }
.sc-th { display: flex; align-items: center; }
.sc-th .sc-label { font-weight: 600; height: 30px; padding: 0 6px; }
.sc-unit-txt { font-size: 11px; color: var(--muted); font-weight: 400; padding-bottom: 4px; text-align: center; }
.sc-del { border: 0; background: none; color: #b8b2a3; cursor: pointer; font-size: 11px; padding: 4px 8px; border-radius: 4px; }
.sc-del:hover { color: var(--red); background: var(--red-soft); }
.sc-grid .sc-add-col { width: 44px; min-width: 44px; text-align: center; background: var(--surface); border-right-color: transparent; border-top-color: transparent; border-bottom-color: transparent; }
.sc-grid thead .sc-add-col { background: var(--surface); width: auto; min-width: 90px; }
.sc-grid tfoot td { border: 0; padding: 6px 0 0; height: auto; }
.sc-add { border: 1px dashed #c9c4b6; background: var(--surface); color: var(--primary); border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sc-add:hover { border-color: var(--primary); background: var(--primary-soft); }
.sc-tools select { width: auto; padding: 4px 8px; }

.var-modal-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.var-modal-tbl th, .var-modal-tbl td { border: 1px solid #cfcabd; padding: 7px 10px; }
.var-modal-tbl thead th { text-align: center; font-weight: 700; background: var(--surface-2); }
.var-modal-tbl .vm-color { text-align: center; font-weight: 700; vertical-align: middle; }
.vm-code { display: flex; align-items: center; gap: 8px; }
.vm-code .btn-qr { margin-left: auto; background: #2f6fb0; border-color: #2f6fb0; color: #fff; padding: 3px 9px; font-weight: 700; font-size: 11.5px; }
.vm-code .btn-qr:hover { background: #255a90; }
.var-modal-tbl tr.is-off td:not(.vm-color) { opacity: .55; }
.qr-box { text-align: center; }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; }
.qr-sku { font-size: 16px; font-weight: 700; margin: 6px 0 2px; }
@media (max-width: 820px) { .price-row { grid-template-columns: 1fr 1fr; } }

/* ---------- v4.1: login (mode server) ---------- */
body.is-login .sidebar, body.is-login .topbar { display: none; }
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.login-card h2 { margin: 0 0 4px; font-size: 19px; }

/* ---------- v5: Pemesanan ---------- */
.block { display: block; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.po-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.po-summary-dash { grid-template-columns: repeat(3, 1fr); }
.po-sum-item { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.po-sum-item span { font-size: 12px; color: var(--muted); }
.po-sum-item b { font-size: 18px; }
.po-sum-item:hover { border-color: var(--primary); }
.po-sum-item.is-warn b { color: var(--red); }
.progress { height: 6px; background: #ebe8e0; border-radius: 4px; overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; background: var(--primary); }
.po-head-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.po-head-grid .span-2 { grid-column: span 2; }
.po-head-grid .span-3 { grid-column: span 3; }
.po-search { position: relative; margin-bottom: 6px; }
.po-search input { padding: 10px 12px; font-size: 14.5px; }
.po-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); max-height: 380px; overflow-y: auto; padding: 4px; }
.po-res { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.po-res:hover { background: var(--primary-soft); }
.po-res img, .po-res-ph { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.po-res-ph { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.po-res > span:nth-child(2) { flex: 1; min-width: 0; }
.po-res-add { font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }
.po-res-sku { gap: 12px; }
.po-res-sku .mono { min-width: 130px; }
.po-res-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.po-items .po-group td { background: var(--surface-2); padding: 6px 10px; }
.po-group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.po-group-head label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.po-group-head .mini { width: 70px; }
.mini-money { width: 110px; padding: 5px 7px; }
.po-items tr.po-empty td:not(:first-child):not(:nth-child(2)):not(:nth-child(3)) { opacity: .75; }
.po-items tr.po-empty input[data-k="qty_ordered"] { background: #fffdf5; }
.hpp-diff { color: var(--amber); margin-top: 2px; text-align: right; }
.po-cost-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.ppn-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ppn-box .span-2 { grid-column: span 2; margin: 0; }
.po-total { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.po-total > div { display: flex; justify-content: space-between; gap: 10px; }
.po-total .po-total-grand { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-size: 16px; }
.po-total.compact { margin-bottom: 4px; }
.po-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.po-detail .span-2 { grid-column: span 2; }
.po-info-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.po-no { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.po-progress { min-width: 200px; }
.po-progress .progress { margin-top: 4px; height: 8px; }
.kv-4 { grid-template-columns: auto 1fr auto 1fr; }
.kv-4 .span-3 { grid-column: span 3; }
.po-list { list-style: none; margin: 0; padding: 0; }
.po-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.po-list li:last-child { border-bottom: 0; }
.po-list li.is-off { opacity: .55; }
.po-list .r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tax-card.tax-none { border-color: #efc9c4; }
.tax-card.tax-partial { border-color: #f0d9a8; }
.tax-status { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.tax-light { font-size: 22px; }
.tax-text { flex: 1; min-width: 200px; }
.tax-verify { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; align-items: flex-start; }
.tax-verify input { margin-top: 3px; }
.inv-drop { border: 1.5px dashed #cdc8bb; border-radius: 10px; padding: 14px; cursor: pointer; background: var(--surface-2); text-align: center; }
.inv-drop:hover { border-color: var(--primary); }
.inv-drop img { max-height: 160px; max-width: 100%; display: block; margin: 0 auto 6px; border-radius: 6px; }
.inv-img { max-width: 100%; display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; }
.inv-pdf { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 980px) {
  .po-detail, .po-cost-grid { grid-template-columns: 1fr; }
  .po-detail .span-2 { grid-column: auto; }
  .po-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .po-head-grid, .grid-3 { grid-template-columns: 1fr; }
  .po-head-grid .span-2, .po-head-grid .span-3 { grid-column: auto; }
  .kv-4 { grid-template-columns: auto 1fr; }
  .kv-4 .span-3 { grid-column: auto; }
  .po-items { min-width: 760px; }
}

/* Elemen ber-atribut hidden selalu tersembunyi (mengalahkan display:grid/flex) */
[hidden] { display: none !important; }

/* ---------- v5.1: langkah PO, barang baru cepat ---------- */
.po-steps { margin-bottom: 14px; padding: 14px 18px; }
.po-steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.po-step { display: flex; gap: 10px; align-items: flex-start; }
.po-step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #ebe8e0; color: var(--muted); flex-shrink: 0; }
.po-step.done .po-step-dot { background: var(--green); color: #fff; }
.po-step.active .po-step-dot { background: var(--primary-soft); color: var(--primary); outline: 2px solid var(--primary); }
.po-step-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.po-next { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.po-search-row { display: flex; gap: 8px; align-items: flex-start; }
.po-search-row .po-search { flex: 1; }
.po-search-row > .btn { padding: 10px 14px; }
.qp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qp-grid .span-2 { grid-column: span 2; }
.qp-sku-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.qp-sku-tools label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.qp-sku-tools input { width: 120px; padding: 5px 8px; }
@media (max-width: 820px) { .qp-grid { grid-template-columns: 1fr; } .qp-grid .span-2 { grid-column: auto; } }

/* v5.2 — kelebihan terima & barang baru SKU menyusul */
.po-over { margin-top: 10px; border: 1px solid var(--amber); background: var(--amber-soft); border-radius: var(--radius); padding: 10px 12px; }
.po-over-head { color: var(--amber); margin-bottom: 8px; }
.po-over-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.po-over-opts .check { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.po-over-opts input { width: auto; margin-top: 3px; }
.block { display: block; }
.rc-hint { white-space: nowrap; }
.po-pending-row td { background: var(--amber-soft); }
.po-pend-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 6px; }
.po-pend-group td { background: var(--amber-soft); }
.as-head { background: var(--amber-soft); border-radius: var(--radius); padding: 10px 12px; }
.as-choice { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.as-opt { display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px; }
button.as-opt { cursor: pointer; }
button.as-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.as-results { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.as-prod { display: flex; justify-content: space-between; gap: 8px; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.as-prod:hover { border-color: var(--primary); background: var(--primary-soft); }
.as-picked { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; }
@media (max-width: 820px) { .as-choice, .po-over-opts { grid-template-columns: 1fr; } }
#as-step2 .row-gap { margin: 12px 0 6px; }
.as-pend { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.as-pend-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.as-nomatch td { background: var(--bg); }
.as-src { padding: 4px 6px; font-size: 12.5px; }
.po-group-pending .pg-name { max-width: 320px; font-weight: 600; padding: 5px 8px; }
.po-group-pending .po-group-head { align-items: center; gap: 8px; }

/* v5.3 — size chart dibalik, lingkar otomatis, master size chart */
.sc-t thead th.sc-size-h { min-width: 72px; text-align: center; padding: 0 6px; }
.sc-t thead th.is-extra { background: var(--amber-soft); color: var(--amber); }
.sc-t .sc-key-col { min-width: 200px; width: 220px; background: #f6f4ee; padding: 2px 4px; text-align: left; }
.sc-t thead .sc-key-col { padding: 0 10px; }
.sc-t td { min-width: 72px; }
.sc-circ-tg { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 0 6px 4px; cursor: pointer; }
.sc-grid .sc-circ-tg input { width: auto; height: auto; }
.sc-circ-row td { background: #fbfaf6; }
.sc-circ-row .sc-key-col { padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.sc-circ-row input { color: var(--muted); font-style: italic; }
.sc-circ-row input:focus { color: var(--text); font-style: normal; }
.sc-sizes-fld { flex: 1 1 100%; }
.sc-view .sc-circ-row td { color: var(--muted); font-style: italic; }
.sc-master-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.sc-master-row select { width: auto; min-width: 220px; padding: 5px 8px; }
.scm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 820px) { .scm-grid { grid-template-columns: 1fr; } .sc-t .sc-key-col { min-width: 150px; width: 150px; } }
.dp-box { margin-top: 10px; }
.dp-quick { display: block; margin-top: 4px; }
.hv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; }
.hv-del { font-size: 12.5px; margin-left: 6px; }
.scp-card { margin-bottom: 14px; }
.scp-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 16px; }
.scp-list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.scp-name { font-weight: 600; }
.scp-circ { color: var(--muted); }
.scp-add { display: flex; gap: 8px; align-items: center; }
.scp-add input[name=label] { flex: 1; }
.popmenu-link { display: block; padding: 6px 10px; color: var(--muted); text-decoration: none; }
.popmenu-link:hover { color: var(--primary); }
.scp-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.scp-name, .scp-circ { white-space: nowrap; }
.scp-list .icon-btn { padding: 4px 5px; }

/* v6.0 — Penjualan */
.ch-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.ch-tiktok { background: #111; color: #fff; }
.ch-shopee { background: #ee4d2d; color: #fff; }
.ch-lazada { background: #1a237e; color: #fff; }
.ch-web { background: var(--primary-soft); color: var(--primary); }
.ch-wa { background: #dcf8e6; color: #137a3a; }
.ch-internal { background: var(--amber-soft); color: var(--amber); }
.ch-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.ch-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; font: inherit; }
.ch-chip.on { border-color: var(--primary); background: var(--primary-soft); }
.po-sum-item small { display: block; font-size: 11.5px; margin-top: 2px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.bs-map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bs-map-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.bs-map-card h4, .bs-unmatched h4 { margin: 0 0 8px; }
.bs-map-card select { padding: 4px 6px; font-size: 13px; }
.bs-map-card tr.is-warn td { background: var(--amber-soft); }
.bs-sum { margin-top: 12px; }
.bs-unmatched { border: 1px solid var(--amber); border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; background: #fffaf0; }
.bs-alias { padding: 4px 8px; }
.bs-neg { margin-top: 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.bs-skip { margin-top: 12px; }
.bs-skip summary { cursor: pointer; }
.sd-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sd-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sd-actions select { width: auto; padding: 4px 8px; }
.danger-text { color: var(--red); }
.sd-raw { margin-top: 12px; }
.sd-raw summary { cursor: pointer; color: var(--muted); }
.raw-tbl { margin-top: 8px; }
.raw-tbl th { width: 40%; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 820px) { .bs-map-grid, .grid-4 { grid-template-columns: 1fr; } }

/* v6.1 — riwayat penerimaan & label QR */
.lbl-code { display: inline-block; font-family: 'Courier New', monospace; font-weight: 800; letter-spacing: .06em; background: #111; color: #fff; padding: 1px 7px; border-radius: 5px; font-size: 12.5px; }
.lbl-code-lg { font-size: 16px; padding: 4px 10px; }
.lbl-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.rc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-items li { display: flex; align-items: center; gap: 6px; }
.rc-print { font-size: 16px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.rc-print:hover:not([disabled]) { border-color: var(--primary); background: var(--primary-soft); }
.rc-qty { margin-left: 4px; }
.scan-box { margin-bottom: 12px; }
.lp-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.lp-prev { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 160px; }
.lp-zoom { zoom: 2.2; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.lp-zoom .lbl { border: 0; }
.ls-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
@media (max-width: 820px) { .lp-grid { grid-template-columns: 1fr; } }
.st-tabs { margin: 4px 0 10px; flex-wrap: wrap; }
.tab-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; }
.tab.on .tab-n { background: var(--primary); color: #fff; }
.tab.is-empty { color: var(--muted); }

/* v6.2 — desainer label */
.ld-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.ld-stage-wrap { background: repeating-conic-gradient(#eee 0 25%, #f7f7f7 0 50%) 0 0 / 16px 16px; border-radius: var(--radius); padding: 28px; display: flex; justify-content: center; align-items: center; min-height: 360px; overflow: auto; }
.ld-stage { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); flex: none; }
.ld-label { position: absolute; left: 0; top: 0; pointer-events: none; }
.ld-box { position: absolute; box-sizing: border-box; border: 1px dashed transparent; cursor: move; transform-origin: center center; touch-action: none; }
.ld-box:hover { border-color: rgba(47,93,80,.5); }
.ld-box.on { border: 1.5px solid var(--primary); background: rgba(47,93,80,.06); }
.ld-h { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; user-select: none; }
.ld-resize { right: -10px; bottom: -10px; cursor: nwse-resize; border-radius: 4px; }
.ld-rot { left: 50%; top: -26px; margin-left: -9px; cursor: grab; }
.ld-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); border: 1px dashed var(--muted); }
.ld-help { margin: 8px 0; }
.ld-size { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ld-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-height: 280px; overflow: auto; }
.ld-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ld-item.on { background: var(--primary-soft); font-weight: 600; }
.ld-item input { width: auto; }
.ld-thumb { width: 22px; height: 22px; object-fit: contain; margin-left: auto; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.ld-props { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.ld-props h4 { margin: 0 0 8px; }
.ld-num { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.ld-num label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); }
.ld-num input { padding: 4px 6px; }
.ld-rotbtn { display: flex; gap: 4px; align-items: end; }
.ld-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ld-row select { width: auto; padding: 3px 6px; }
@media (max-width: 900px) { .ld-grid { grid-template-columns: 1fr; } .ld-size { grid-template-columns: 1fr 1fr; } }
.ld-linebox { display: flex; align-items: center; }
.ld-linethumb { display: inline-block; width: 22px; background: #000; margin-left: auto; }
.ld-addline { margin-top: 6px; width: 100%; justify-content: center; }

/* ===== v6.3 Gudang Kain ===== */
.rc-fabs { margin-top: 14px; }
.rc-fab { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-top: 8px; background: #fff; }
.rc-fab-head { margin-bottom: 6px; line-height: 1.4; }
.rc-rolls { width: 100%; resize: vertical; font-size: 14px; }
.rc-rolls.is-invalid { border-color: var(--danger, #c0392b); }
.rc-fab-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.rc-fab-foot label { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.rc-fab-foot input[type=checkbox] { width: auto; }
.qty-unit { display: flex; align-items: center; gap: 4px; }
.qty-unit input { min-width: 70px; }
.qty-unit span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fp-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; margin: 8px 0; }
.fp-item { text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 10px; cursor: pointer; font: inherit; }
.fp-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.fp-new { border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 10px; margin-top: 6px; }
.fp-new summary { cursor: pointer; }
.po-group-fabric td { background: #f4f1ea; }
.fb-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.fb-big { font-size: 22px; }
tr.fb-focus td { background: #fff6d6 !important; }

/* ===== v6.4 Produksi ===== */
.fld-hint { font-size: 11.5px; color: var(--muted); }
.po-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.po-shipto { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.po-shipto select { width: auto; padding: 4px 8px; }
.fb-locs { margin: 4px 0 10px; font-size: 13px; }
.fb-sel { margin: 6px 0; }
.fb-sel select { width: auto; padding: 4px 8px; }
.pr-ratio { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-rsz { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 70px; }
.pr-rsz input { text-align: center; }
.pr-est td, .pr-est th { white-space: nowrap; }
.pr-repsum { display: flex; gap: 24px; flex-wrap: wrap; }
.pr-repsum > div { display: flex; flex-direction: column; gap: 2px; }
.pr-repsum b { font-size: 18px; }
.pr-h { margin: 16px 0 4px; }
.rp-fab { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-top: 8px; }
.rp-fab-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-rolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.rp-roll { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; background: #fff; }
.rp-roll.on { border-color: var(--primary); background: var(--primary-soft); }
.rp-roll.rp-else { border-style: dashed; }
.rp-roll input[type=checkbox] { width: auto; }
.rp-left { width: 70px !important; margin-left: auto; padding: 3px 6px; }
.rp-grid input, .pv-grid input { width: 64px; }
.po-detail > .card { min-width: 0; }
.pr-detail { grid-template-columns: 1fr; max-width: 1100px; }
/* v6.4b — terima kain per roll (kotak sebanyak jumlah roll) */
.rc-fab-top { display: grid; grid-template-columns: 140px 280px; gap: 10px; align-items: end; }
.rc-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 6px 10px; margin: 8px 0; overflow-x: auto; padding-bottom: 4px; }
.rc-cell { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; background: #fafaf8; }
.rc-cell span { font-size: 11px; color: var(--muted); min-width: 16px; text-align: right; }
.rc-cell input { border: 0; padding: 4px 2px; background: transparent; min-width: 0; }
.rc-cell input.is-invalid { color: var(--red); }
.rc-cell:focus-within { border-color: var(--primary); background: #fff; }
.rc-fab-total { border-top: 1px dashed var(--line); padding-top: 6px; }
.rc-tot-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.rc-tot-line b { font-size: 16px; }
@media (max-width: 600px) { .rc-fab-top { grid-template-columns: 1fr 1fr; } }
.sup-types { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.fp-type { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.fp-type-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fp-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-color { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; cursor: pointer; background: #fff; }
.fp-color.on { border-color: var(--primary); background: var(--primary-soft); }
.fp-color input { width: auto; }
.fb-type { margin-bottom: 12px; }
.fb-type-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.fb-type-head h3 { margin: 0; }
.td-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.td-vendors { display: flex; flex-wrap: wrap; gap: 6px; }
.td-chips .chip { cursor: default; } .td-chips .chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--muted); font-size: 14px; }

/* ===== v6.6 Keuangan ===== */
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fin-grid > .card { min-width: 0; }
.fin-bars { display: flex; flex-direction: column; gap: 6px; }
.fin-bar { display: grid; grid-template-columns: 160px 1fr 110px; gap: 8px; align-items: center; }
.fin-bar-track { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.fin-bar-track i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.fin-bar b { text-align: right; }
.ac-group td { background: #f6f4ee; }
.je-card { margin-bottom: 10px; }
.je-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.mj-tbl select, .mj-tbl input { width: 100%; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } .fin-bar { grid-template-columns: 110px 1fr 90px; } }

/* ---------- v6.7: retur supplier, bayar dari rekening ---------- */
.rt-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rt-modes .check { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.rt-modes .check:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.rt-modes input { width: auto; margin-top: 3px; }
.rt-fab { margin-top: 12px; }
.rt-rolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.rt-roll { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; gap: 6px; }
.rt-roll input { width: auto; }
.rt-sum { margin: 10px 0; }
@media (max-width: 720px) { .rt-modes { grid-template-columns: 1fr; } }

/* ---------- v6.7: pengingat, laporan ---------- */
.dash-remind { margin-bottom: 14px; }
.remind-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.remind a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); border-left-width: 4px; color: inherit; text-decoration: none; background: var(--surface); }
.remind a:hover { background: var(--bg); }
.remind-danger a { border-left-color: #c0392b; }
.remind-warn a { border-left-color: #d68910; }
.remind-info a { border-left-color: #2e86c1; }
.remind-ico { font-size: 18px; line-height: 1.2; }
.remind-go { margin-left: auto; color: var(--muted); font-size: 18px; }
.rp-period { flex-wrap: wrap; }
.rp-table td { padding-top: 5px; padding-bottom: 5px; }
.rp-sec td { background: var(--bg); padding-top: 10px !important; }
.rp-ind { padding-left: 22px !important; }
.rp-tot td { border-top: 1px solid var(--line); font-weight: 600; }
.rp-grand td { border-top: 2px solid var(--text, #222); font-weight: 700; font-size: 15px; padding-top: 8px !important; }
.rp-statement { overflow-x: auto; }
.rp-bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 8px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rp-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 6px; }
.rp-bar i { display: block; width: 100%; max-width: 38px; background: var(--primary); border-radius: 3px 3px 0 0; }
.rp-bar i.neg { background: #c0392b; }
.rp-bar span { position: absolute; bottom: -19px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.rp-bars-wide { height: 180px; }
.st-calc { font-size: 20px; }
@media print { .no-print, .sidebar, #nav, .topbar, #page-actions { display: none !important; } .card { break-inside: avoid; box-shadow: none; } }

/* ---------- v6.8: Stok Kain & Master Kain ---------- */
.sk-table td { vertical-align: middle; }
.sk-color { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; margin-left: 4px; }
.sk-big { font-size: 17px; }
.sk-loc { display: inline-block; margin: 1px 8px 1px 0; white-space: nowrap; }
.sk-card { margin-bottom: 12px; }
.sk-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sk-card.is-off { opacity: .65; }
#fd-bar { position: sticky; top: 0; z-index: 3; margin: 12px 0; padding: 8px 12px; flex-wrap: wrap; }
.mk-colors { display: flex; flex-wrap: wrap; gap: 4px; }
.mk-color { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 2px 10px; font-size: 13px; cursor: pointer; }
.mk-color:hover { border-color: var(--primary); }
.sk-group { margin-bottom: 12px; }
.sk-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.sk-group-head h3 { margin: 0; }
.pf-group { margin-bottom: 10px; }
.pf-group-head { margin: 4px 0 6px; }
.pf-table tr[data-fid] { cursor: pointer; }
.pf-table tr.pf-on td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pf-table input[type=checkbox] { width: auto; }
.pf-colors { display: grid; gap: 6px; }
.pf-cmap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-cmap select { max-width: 260px; }
.pf-sum-line { padding: 2px 0; }
.rp-src { border: 1px dashed var(--line); border-radius: 8px; padding: 8px; margin-top: 8px; background: var(--bg); }
.rp-src-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.rp-rolls { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rp-rl { flex: 1; white-space: nowrap; font-size: 13px; }
.rp-roll .rp-left { width: 70px; flex: none; }
.tbl th.c, .tbl td.c { text-align: center; }
input.c { text-align: center; }
.rp-res input.mini { width: 64px; margin: 0 auto; display: block; }
.rp-res-group { margin-top: 10px; }
.rp-res-head { margin-bottom: 4px; }
.rp-res tfoot td { border-top: 2px solid var(--line); }
.rp-grand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--primary-soft, #eef4f1); }
.rp-gs { white-space: nowrap; }
.rp-gall { font-size: 15px; }
.pf-new { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--bg); }
.pr-pend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pl-hist { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.pl-hist li { white-space: nowrap; }
.pe-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pe-color span:first-child { font-weight: 600; }

/* Import Data Barang / file pilih */
.imp-drop { display: block; border: 2px dashed var(--border, #d9d4c7); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; background: var(--bg, #faf8f3); }
.imp-drop:hover { border-color: var(--primary, #2f5d50); }
.pi-scroll { max-height: 52vh; overflow: auto; }
.pi-tbl td { vertical-align: top; }
tr.pi-err td { background: #fff7f6; }
.pl-table tr.pl-cont td { border-bottom-style: dashed; }
.pl-table td[rowspan] { vertical-align: top; }

/* Laporan Harian */
.dr-ads input { width: 100%; min-width: 120px; }
.dr-ads input[readonly] { background: var(--bg, #f3f1ec); color: var(--muted, #666); }
.dr-cfg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-left: 10px; }
.dr-cfg input { width: 90px; }
.dr-tbl tr.dr-zero td { color: var(--muted, #888); }
.dr-tbl tfoot th { border-top: 2px solid var(--text, #222); }
.dr-sumgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 32px; }
.dr-line { display: flex; gap: 10px; padding: 3px 0; font-size: 14px; }
.dr-line span { min-width: 130px; }
.dr-line b { font-weight: 500; }
.dr-strong span, .dr-strong b { font-weight: 700; }
.dr-kpi .kpi { display: flex; flex-direction: column; gap: 4px; }
.dr-kpi .kpi b { font-size: 20px; }
tr.pu-warn td { background: #fff8e6; }

/* Pusat Bantuan & chat */
.hc-wrap { display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: start; }
.hc-nav { position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.hc-nav input { margin-bottom: 8px; }
.hc-nav .hc-g { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #888); margin: 10px 0 2px; }
.hc-nav a { padding: 5px 8px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 14px; }
.hc-nav a:hover, .hc-nav a.on { background: var(--bg, #f3f1ec); font-weight: 600; }
.hc-main { padding: 20px 24px; min-height: 60vh; }
.hc-art h2 { margin-top: 0; } .hc-art h4 { margin: 18px 0 6px; } .hc-art ol { padding-left: 22px; line-height: 1.6; }
.hc-sum { color: var(--muted, #666); font-size: 15px; }
.hc-faq { border: 1px solid var(--border, #e5e1d8); border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.hc-faq summary { cursor: pointer; font-weight: 600; } .hc-faq div { margin-top: 6px; }
.hc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.hc-card, .hc-res { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border, #e5e1d8); border-radius: 10px; color: inherit; text-decoration: none; }
.hc-card:hover, .hc-res:hover { border-color: var(--primary, #2f5d50); }
.hc-card span, .hc-res span { font-size: 12.5px; color: var(--muted, #777); }
.hc-res { margin-bottom: 8px; }
.hc-fab { position: fixed; right: 18px; bottom: 18px; z-index: 900; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--primary, #2f5d50); color: #fff; font-size: 15px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.18); display: flex; gap: 6px; align-items: center; }
.hc-fab span { font-size: 14px; font-weight: 600; }
.hc-chat { position: fixed; right: 18px; bottom: 70px; z-index: 950; width: 380px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 100px); background: var(--card, #fff); border: 1px solid var(--border, #e5e1d8); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; }
.hc-chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border, #e5e1d8); }
.hc-ctx { padding: 6px 12px; font-size: 13px; background: var(--bg, #f7f5f0); }
.hc-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hc-msg { max-width: 92%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.hc-msg ol, .hc-msg ul { padding-left: 18px; margin: 4px 0; }
.hc-bot { background: var(--bg, #f3f1ec); align-self: flex-start; }
.hc-me { background: var(--primary, #2f5d50); color: #fff; align-self: flex-end; }
.hc-links { margin-top: 6px; font-size: 13px; }
.hc-more { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.hc-chip { border: 1px solid var(--border, #d9d4c7); background: var(--card, #fff); border-radius: 999px; padding: 3px 9px; font-size: 12.5px; cursor: pointer; }
.hc-chip:hover { border-color: var(--primary, #2f5d50); }
.hc-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border, #e5e1d8); }
.hc-form input { flex: 1; }
@media (max-width: 800px) { .hc-wrap { grid-template-columns: 1fr; } .hc-nav { position: static; max-height: none; } .hc-fab span { display: none; } }
@media print { .hc-fab, .hc-chat { display: none !important; } }

/* Pengguna & Peran / login */
.no-sens .sens { display: none !important; }
.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; margin-top: 8px; }
.rl-group { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border, #e5e1d8); border-radius: 10px; padding: 10px; }
.rl-gh { border-bottom: 1px solid var(--border, #e5e1d8); padding-bottom: 4px; margin-bottom: 2px; }
.rl-sens { align-items: flex-start; border: 1px solid var(--border, #e5e1d8); border-radius: 10px; padding: 10px; background: var(--bg, #faf8f3); }
.rec-code { font: 700 26px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; text-align: center; padding: 14px; border: 2px dashed var(--primary, #2f5d50); border-radius: 10px; margin: 10px 0; }
.user-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: inherit; }
.user-box span { display: flex; flex-direction: column; } .user-box small { opacity: .7; }
.user-box .link { color: inherit; opacity: .85; }

/* Terima barang via Excel */
.ri-step { border: 1px solid var(--line, #e5e2da); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ri-step h4 { margin: 0; font-size: 14px; }
.ri-docs { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.ri-group { border: 1px solid var(--line, #e5e2da); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.ri-group .tbl { margin-top: 6px; }
.ri-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
@media (max-width: 720px) { .ri-meta { grid-template-columns: 1fr 1fr; } }
.ri-step > .btn { align-self: flex-start; }

/* Laporan cutting: acuan per roll */
.rp-res .rp-acu, .rp-res .rp-cacu { white-space: nowrap; }
.rp-res tr.rp-bad td { background: #fdecec; }
.rp-res tr.rp-bad .rp-rowtot b, .rp-res tr.rp-bad .rp-diff { color: #c0392b; }
.rp-diff { font-weight: 700; font-size: 11px; }
.rp-res tr.rp-good td { background: #e8f6ec; }
.rp-res tr.rp-good .rp-rowtot b, .rp-res tr.rp-good .rp-diff { color: #1e8449; }
.rp-totchk { padding: 8px 10px; border-radius: 8px; background: var(--bg-soft, #f4f2ec); margin-bottom: 12px; }
.rp-totchk.is-bad { background: #fdecec; color: #c0392b; }
.rp-totchk.is-good { background: #e8f6ec; color: #1e8449; }

/* Komplain & tukar */
.k-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.k-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.k-photo { position: relative; }
.k-photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #e5e2da); cursor: zoom-in; }
.k-photo .icon-btn { position: absolute; top: 2px; right: 2px; background: #fff; }
.k-cost td { padding: 5px 8px; }
.k-cost-total td { border-top: 2px solid var(--line, #e5e2da); }
.k-ex { border: 1px solid var(--line, #e5e2da); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.k-ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.k-ex-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.k-ex-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.k-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.k-step { padding: 3px 9px; border-radius: 999px; background: var(--bg-soft, #f4f2ec); color: var(--muted, #8a867d); }
.k-step.done { background: #e8f6ec; color: #1e8449; }
.k-step.cur { background: #2d5f4e; color: #fff; font-weight: 600; }
.k-step.bad { background: #fdecec; color: #c0392b; }
.k-arrow { color: var(--muted, #8a867d); }
.k-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.k-tl li { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: 13px; border-bottom: 1px dashed var(--line, #e5e2da); padding-bottom: 5px; }
.k-tl-at { color: var(--muted, #8a867d); font-size: 12px; white-space: nowrap; }
.k-results { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; margin-top: 6px; }
.k-res { text-align: left; border: 1px solid var(--line, #e5e2da); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.k-res:hover { background: var(--bg-soft, #f4f2ec); }
.k-sale { border: 1px solid var(--line, #e5e2da); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.k-box { border: 1px dashed var(--line, #e5e2da); border-radius: 8px; padding: 8px 10px; }
.k-diff { padding: 8px 10px; border-radius: 8px; background: var(--bg-soft, #f4f2ec); }
.kx-line { border: 1px solid var(--line, #e5e2da); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.kx-line.on { border-color: #2d5f4e; }
.kx-orig { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.kx-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-left: 26px; }
.kx-search { position: relative; min-width: 240px; }
.kx-qres { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.sd-after { margin-top: 12px; }
@media (max-width: 640px) { .k-tl li { grid-template-columns: 1fr; } .kx-pick { padding-left: 0; } }
.kx-pick .mini, .kx-orig .mini { width: 72px; flex: none; }

/* CEO Dashboard */
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dash-filters select, .dash-filters input { width: auto; }
.dash-head { margin-bottom: 10px; }
.dash-sub { font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.dash-status { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.dash-st { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px; letter-spacing: .02em; text-transform: uppercase; color: var(--text, #222); }
.dash-st:hover { box-shadow: var(--shadow); }
.dash-st.lv-red { border-color: #e5a29b; } .dash-st.lv-orange { border-color: #ecc58b; }
.dash-st.sk, .dash-kpi.sk { background: linear-gradient(90deg, #f1efe9 25%, #f8f7f3 50%, #f1efe9 75%); background-size: 200% 100%; animation: dashsk 1.2s infinite; border-color: transparent; }
.dash-kpi.sk { min-height: 118px; }
@keyframes dashsk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dash-reason { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.dash-reason.lv-red { border-left: 4px solid #c0392b; } .dash-reason.lv-orange { border-left: 4px solid #d68910; } .dash-reason.lv-green { border-left: 4px solid #1e8449; } .dash-reason.lv-gray { border-left: 4px solid #aaa; }
.dash-reason ul { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.dash-tabs { overflow-x: auto; flex-wrap: nowrap; margin: 8px 0 14px; }
.dash-tabs .tab { white-space: nowrap; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
a.dash-kpi:hover { border-color: #b9c9c2; }
.dash-kpi .kpi-l { display: flex; align-items: center; gap: 6px; }
.dash-kpi .kpi-s { line-height: 1.5; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-green { background: #1e8449; } .dot-orange { background: #d68910; } .dot-red { background: #c0392b; } .dot-gray { background: #b3b3b3; }
.dash-prog { height: 5px; border-radius: 3px; background: #eceae4; overflow: hidden; margin: 4px 0; }
.dash-prog i { display: block; height: 100%; background: #2d5f4e; }
.dash-prog.p-orange i { background: #d68910; } .dash-prog.p-red i { background: #c0392b; } .dash-prog.p-green i { background: #1e8449; }
.attn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attn a { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; background: var(--surface); }
.attn a:hover { background: var(--bg-soft, #f7f6f2); }
.attn-danger a { border-left: 4px solid #c0392b; } .attn-warn a { border-left: 4px solid #d68910; } .attn-info a { border-left: 4px solid #2e86c1; }
.attn-val { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.attn-go { font-size: 12px; color: var(--accent, #2d5f4e); white-space: nowrap; }
.dash-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
@media (max-width: 1100px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-status { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-kpis { grid-template-columns: 1fr; } .dash-status { grid-template-columns: repeat(2, minmax(0, 1fr)); } .attn a { grid-template-columns: 22px 1fr; } .attn-val, .attn-go { grid-column: 2; } }

/* Tugas tim */
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e7efe9; color: #2d5f4e; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.is-hot { background: #c0392b; color: #fff; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.task:hover { box-shadow: var(--shadow); }
.task.is-overdue { border-left: 4px solid #c0392b; }
.task.is-off { opacity: .6; }
.task-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.task-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; }
.task-comments { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
@media (max-width: 640px) { .task { flex-direction: column; align-items: stretch; } .task-acts { justify-content: flex-start; } }

/* ===== Risk & Anomaly (v8.3) ===== */
.rk-note { background: var(--blue-soft); color: var(--text, #333); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.rk-sum { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; align-items: stretch; }
.rk-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.rk-card.is-crit { border-left: 4px solid var(--red); } .rk-card.is-high { border-left: 4px solid var(--amber); }
.rk-n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-since { grid-column: 1 / -1; }
.rk-row { cursor: pointer; } .rk-row:hover, .rk-row.on { background: var(--bg-soft, #f7f6f2); }
.rk-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 11px; max-height: 140px; overflow: auto; }
.rk-explain { background: var(--bg-soft, #f7f6f2); border-radius: 8px; padding: 8px 12px; }
.rk-lims { display: flex; flex-wrap: wrap; gap: 6px 12px; } .rk-lim { width: 90px; }
.rk-hours { margin-bottom: 12px; padding: 12px 14px; }
.rk-users { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.rk-rep { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.rk-rep .card, .rk-users .card { padding: 12px 14px; } .rk-rep h4 { margin: 0 0 8px; }
.rk-bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 4px; }
.rk-bar i { display: block; height: 10px; background: var(--blue); border-radius: 5px; min-width: 2px; } .rk-bar b { text-align: right; }
.dash-risk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .rk-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rk-users, .rk-rep { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .rk-tbl th:nth-child(3), .rk-tbl td:nth-child(3), .rk-tbl th:nth-child(4), .rk-tbl td:nth-child(4), .rk-tbl th:nth-child(7), .rk-tbl td:nth-child(7) { display: none; } .rk-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== CEO Dashboard tahap 2–3 (v8.4) ===== */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-sec { margin: 0; min-width: 0; } .dash-wide { grid-column: 1 / -1; }
.dash-sec .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dash-sec .card-head h3 { margin: 0 0 8px; font-size: 15px; }
.dash-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.dbar { display: flex; flex-direction: column; gap: 4px; }
.dbar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 3px 4px; border-radius: 6px; color: inherit; text-decoration: none; }
.dbar-row:hover { background: var(--bg-soft, #f7f6f2); }
.dbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbar-t { height: 10px; background: transparent; }
.dbar-t i { display: block; height: 10px; background: var(--blue); border-radius: 0 4px 4px 0; min-width: 2px; }
.dbar-t i.is-neg { background: var(--red); }
.dbar-v { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.dl { width: 100%; height: 190px; display: block; overflow: visible; }
.dl-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dl-cur { fill: none; stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.dl-prev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; opacity: .7; }
.dl-dot { fill: var(--blue); stroke: var(--surface, #fff); stroke-width: 2; opacity: 0; vector-effect: non-scaling-stroke; }
.dl-hit:hover .dl-dot { opacity: 1; }
.dl-x { font-size: 11px; fill: var(--muted); }
.dl-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; color: var(--muted); }
.dl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dl-k { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--blue); } .dl-k-prev { border-top: 2px dashed var(--muted); }
.dash-health { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dh { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.dh b { font-size: 22px; font-variant-numeric: tabular-nums; }
.dh.c-red { border-left: 4px solid var(--red); } .dh.c-orange { border-left: 4px solid var(--amber); } .dh.c-green { border-left: 4px solid var(--green, #2e7d32); }
.dprog { display: inline-block; width: 70px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.dprog i { display: block; height: 8px; background: var(--blue); }
.dash-tbl td, .dash-tbl th { white-space: nowrap; }
.dash-tbl td:first-child { white-space: normal; min-width: 120px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-sec .tbl-wrap { overflow-x: auto; max-width: 100%; }
.dl { height: 170px; }
.dl-xs { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.dl-xs span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.dl-xs span.is-first { transform: none; } .dl-xs span.is-last { transform: translateX(-100%); }

/* ===== Asisten AI (v8.5) ===== */
.ai-wrap { display: flex; flex-direction: column; gap: 10px; max-width: 900px; height: calc(100vh - 150px); min-height: 420px; }
.ai-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 0; }
.ai-msg { display: flex; } .ai-user { justify-content: flex-end; }
.ai-bub { max-width: min(680px, 88%); padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.ai-user .ai-bub { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.ai-assistant .ai-bub { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-err .ai-bub { border-color: var(--red); }
.ai-bub p { margin: 0 0 6px; } .ai-bub p:last-child { margin-bottom: 0; }
.ai-bub ul, .ai-bub ol { margin: 4px 0 8px; padding-left: 20px; } .ai-bub li { margin: 2px 0; }
.ai-bub .ai-h { font-weight: 700; margin-top: 6px; }
.ai-bub code { background: var(--bg-soft, #f2f0ea); padding: 0 4px; border-radius: 4px; font-size: 12.5px; }
.ai-tr { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(70px, 1fr); gap: 8px; font-size: 13px; border-bottom: 1px solid var(--line); padding: 3px 0; font-variant-numeric: tabular-nums; }
.ai-think { color: var(--muted); font-style: italic; } .ai-think::after { content: ''; display: inline-block; width: 1em; animation: ai-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes ai-dots { 0% { width: 0; } 100% { width: 1em; } }
@media (prefers-reduced-motion: reduce) { .ai-think::after { animation: none; } }
.ai-hello, .ai-off { margin: auto; text-align: center; max-width: 460px; }
.ai-ex { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-ex .chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: inherit; font: inherit; font-size: 13px; }
.ai-ex .chip:hover { border-color: var(--blue); color: var(--blue); }
.ai-box { display: flex; gap: 8px; align-items: flex-end; }
.ai-box textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; }
.ai-note { margin: 0; }
@media (max-width: 640px) { .ai-wrap { height: calc(100vh - 120px); } .ai-bub { max-width: 94%; } }

/* ===== Data Iklan (v8.6) ===== */
.ad-cols { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.ad-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.ad-col i { display: block; width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 1px; }
.ad-col:hover i { opacity: .75; }
.ad-colx { display: flex; justify-content: space-between; margin-top: 4px; }
.dr-adsfill { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--blue-soft); }
.dh b.small-b { font-size: 18px; }
.dr-lock .dr-chg { margin-top: 6px; }
.dr-lock .dr-chg summary { cursor: pointer; }
