.acc-stock-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}.acc-stock-line .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.acc-stock-line .form-grid>.fld:first-child{grid-column:1/-1}.acc-stock-line input,.acc-stock-line select{min-width:0;width:100%}.acc-stock-line [data-stock-line-preview]{margin:12px 0}.acc-stock-line .fld{min-width:0}
.acc-stock-modal .modal{display:flex;flex-direction:column;max-height:calc(100vh - 80px);max-height:calc(100dvh - 80px)}.acc-stock-modal .modal-body{overflow:auto;min-height:0}.acc-stock-modal .modal-head,.acc-stock-modal .modal-foot{flex-shrink:0}.acc-stock-modal .modal-foot{position:static}
@media(max-width:640px){.acc-stock-line .form-grid{grid-template-columns:1fr}.acc-stock-actions .btn{font-size:12px;padding:8px 10px}}
.vr-variant-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:14px 0 10px}.vr-variant-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.vr-variant{display:flex;align-items:center;gap:10px;border:1px solid var(--line);padding:12px;border-radius:10px;min-width:0;background:var(--surface)}.vr-variant>input[type=checkbox]{width:18px;height:18px;flex-shrink:0;accent-color:var(--primary)}.vr-variant>span{flex:1;min-width:0}.vr-variant small{display:block;font-size:11px;color:var(--muted);overflow-wrap:anywhere}.vr-variant>input[type=number]{width:78px;min-width:0;padding:7px}.vr-variant.is-added{background:var(--surface-2);color:var(--muted)}.vr-editor .modal{display:flex;flex-direction:column;max-height:calc(100vh - 80px);max-height:calc(100dvh - 80px)}.vr-editor .modal-body{overflow:auto;min-height:0}.vr-editor .modal-head,.vr-editor .modal-foot{flex-shrink:0}.vr-editor .modal-foot{position:static}
@media(max-width:640px){.vr-variant-grid{grid-template-columns:1fr}.vr-variant{padding:10px}.vr-variant>input[type=number]{width:72px}.vr-editor .rt-modes{grid-template-columns:1fr}}
/* Daily task workspace: deliberately scoped so other ERP forms stay unchanged. */
.task-day-intro{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px 28px;margin:0 0 22px;background:var(--surface);border:1px solid var(--line);border-radius:18px}
.task-day-intro h2{margin:8px 0;font-size:25px;letter-spacing:-.6px}.task-day-intro p{margin:0;color:var(--muted)}
.task-day-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:#e5f2eb;color:#356b55;font-size:34px;flex-shrink:0}
.task-form-section{border:1px solid var(--line);border-radius:12px;padding:16px;display:grid;gap:12px;min-width:0}
.task-form-section h4{margin:0}.task-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.task-edit-row{display:flex;align-items:center;gap:8px;min-width:0}.task-edit-row input{flex:1;min-width:0}.task-link-row input[data-label]{flex:.7}
.task-checklist{display:grid;gap:8px}.task-check-item{display:flex;align-items:flex-start;gap:12px;padding:10px;border-radius:8px;background:var(--surface-2);cursor:pointer}.task-check-item input{width:19px;height:19px;flex-shrink:0;margin-top:2px;accent-color:#3d705d}.task-check-item span{overflow-wrap:anywhere}.task-check-item small{display:block;color:var(--muted);font-size:11px}.task-check-item.is-done span{text-decoration:line-through;color:var(--muted)}
.task-reference-list{display:grid;gap:8px}.task-reference{padding:10px 12px;border-radius:8px;border:1px solid var(--line);overflow-wrap:anywhere;text-decoration:none}.task-file{white-space:normal;text-align:left;justify-content:flex-start;overflow-wrap:anywhere;max-width:100%}.task-file span{display:block}.task-photo-preview{display:block;max-width:100%;max-height:70vh;object-fit:contain;margin:auto}.task-progress{color:#356b55;background:#e5f2eb;border-radius:12px;padding:2px 8px}
.task .task-title b{overflow-wrap:anywhere}.task .task-main{min-width:0}.task .task-meta{flex-wrap:wrap}#t-tabs{flex-wrap:wrap}
@media(max-width:640px){.task-day-intro{padding:18px;gap:12px}.task-day-intro h2{font-size:20px}.task-day-icon{width:44px;height:44px;font-size:25px;border-radius:14px}.task-form-section{padding:12px}.task-link-row{flex-wrap:wrap}.task-link-row input[data-label]{flex-basis:100%}.task-form-section input[type=file]{max-width:100%;font-size:12px}.task{align-items:stretch}.task-acts{flex-wrap:wrap}#t-tabs .tab{font-size:12px;padding:8px 10px}}
: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: 13px; }
.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: 12.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: 12px; 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; min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.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: 13px; }
.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: 13px; 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: 13px; 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: 12.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: 12px; font-weight: 600; padding: 2px 7px; border-radius: 20px; background: #eeece6; color: var(--muted); white-space: nowrap; }
.badge-aman, .badge-green { 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: 13px; 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: 13px; 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); }
.vr-intro { margin: 0 0 16px; color: var(--muted); }
.vr-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.vr-summary .kpi-v { font-size: 25px; overflow-wrap: anywhere; }
.vr-panel { min-width: 0; }
.vr-tabs { gap: 16px; margin-bottom: 18px; }
.vr-tabs .tab { min-height: 44px; padding: 10px 4px; display: inline-flex; align-items: center; gap: 8px; }
.vr-tabs .tab.on { font-weight: 650; }
.vr-tabs .tab:focus-visible, .vr-page .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.vr-filters { gap: 10px; }
.vr-filters input[type=search] { flex: 1; max-width: none; min-width: 230px; }
.vr-filters select { min-height: 40px; }
.vr-list-caption { color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.vr-table { min-width: 860px; }
.vr-table td { padding: 16px 14px; text-align: left; }
.vr-table td:last-child { min-width: 210px; }
.vr-table .btn { text-decoration: none; min-height: 34px; justify-content: center; }
.vr-source { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; font-size: 12px; }
.vr-row-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.vr-progress { width: 140px; max-width: 100%; height: 5px; border-radius: 8px; background: var(--line); overflow: hidden; margin: 9px 0 5px; }
.vr-progress i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.vr-legacy { margin-top: 28px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.vr-legacy summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.vr-legacy[open] summary { margin-bottom: 12px; }
.vr-picker { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.vr-picker .row-gap { flex-wrap: nowrap; }
.vr-picker select { min-width: 0; flex: 1; }
.vr-items .vr-item-price { width: 118px; }
.vr-items th { white-space: normal; }
.vr-items td:first-child { min-width: 140px; }
@media (max-width: 720px) {
  .vr-summary { grid-template-columns: 1fr; gap: 8px; }
  .vr-summary .kpi { padding: 12px 14px; }
  .vr-summary .kpi-v { font-size: 22px; }
  .vr-tabs { gap: 12px; }
  .vr-tabs .tab { font-size: 13px; }
  .vr-filters input[type=search], .vr-filters select { width: 100%; min-width: 0; flex: auto; }
  .vr-page .table-card { overflow: hidden; }
  .vr-table { min-width: 0; display: block; }
  .vr-table thead { display: none; }
  .vr-table tbody { display: block; }
  .vr-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px; border-bottom: 1px solid var(--line); }
  .vr-table tr:last-child { border-bottom: 0; }
  .vr-table td, .vr-table td.r { display: block; min-width: 0; padding: 8px; border: 0; text-align: left; overflow-wrap: anywhere; }
  .vr-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .vr-table td:first-child, .vr-table td:last-child { grid-column: 1 / -1; }
  .vr-table td:first-child { background: var(--surface-2); border-radius: 6px; }
  .vr-row-actions { justify-content: flex-start; }
}
.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: 13px; 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: 12px; 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: 12px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; }
.sc-unit { width: 52px; font-size: 13px; color: var(--muted); }
.tbl-edit th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.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: 13px; 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: 12px; 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: 13px; 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: 13px; }
.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: 12px; color: var(--muted); font-weight: 400; padding-bottom: 4px; text-align: center; }
.sc-del { border: 0; background: none; color: #b8b2a3; cursor: pointer; font-size: 12px; 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: 13px; 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: 12.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: 13px; 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: 13px; 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-receipts > li { display: block; padding: 16px 0; }
.po-receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.po-receipt-head > div { min-width: 0; overflow-wrap: anywhere; }
.po-receipt-head > .r { flex-shrink: 0; }
.po-receipt-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.po-receipt-lines { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.po-receipt-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.po-receipt-line:last-child { border-bottom: 0; }
.po-receipt-product { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.po-receipt-qty { flex-shrink: 0; white-space: nowrap; }
.po-receipt-fabric { display: block; overflow-wrap: anywhere; }
.po-receipt-note { margin-top: 8px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .refund-review-table, .refund-review-table tbody, .refund-review-table tr, .refund-review-table td { display: block; width: 100%; min-width: 0; box-sizing: border-box; }
  .refund-review-table thead { display: none; }
  .refund-review-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .refund-review-table td, .refund-review-table td.r, .refund-review-table td.nowrap { text-align: left; white-space: normal; overflow-wrap: anywhere; border: 0; padding: 5px 8px; }
  .refund-review-table td[data-label]::before { content: attr(data-label); display: block; font: 12px sans-serif; color: var(--muted); margin-bottom: 3px; }
  .refund-review-table td button { margin: 3px 0; max-width: 100%; white-space: normal; }
  .po-receipt-head { flex-direction: column; gap: 6px; }
  .po-receipts .po-receipt-head > .r { align-items: flex-start; text-align: left; }
  .po-receipt-actions { justify-content: flex-start; }
}
.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: 13px; }
.as-nomatch td { background: var(--bg); }
.as-src { padding: 4px 6px; font-size: 13px; }
.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: 12.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: 13px; 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: 13px; 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(min(320px, 100%), 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(min(380px, 100%), 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: 12px; 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: 12.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: 13px; }
.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: 12.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: 12px; 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: 12.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: 13px; 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: 12.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: 12px; 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; }
.rc-session{margin-bottom:18px}.rc-document{padding:16px 0;border-top:1px solid var(--border,#e5e2dc);margin-top:12px}.rc-document details{margin-top:10px}.rc-document details button{margin:6px 4px 0 0}.rc-session>.row-gap,.rc-document>.row-gap{flex-wrap:wrap}
@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: 13px; }
.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: 12px; 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: 13px; 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: 13px; 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: 12px; }
.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: 13px; }
.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: 13px; 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: 13px; 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: 12px; 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: 12px; 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: 12px; 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: 12px; 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: 13px; }
.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; }

/* Tulis untuk mencari, tanpa mengganti select/form aslinya. */
.ss-search { position: relative; width: 100%; min-width: 0; }
.ss-search > select { width: 100%; min-width: 0; box-sizing: border-box; }
.ss-trigger { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; padding: 0; }
.ss-trigger:disabled { cursor: not-allowed; }
.ss-panel { position: fixed; z-index: 10050; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #fff; border: 1px solid #c8d4cf; border-radius: 10px; box-shadow: 0 8px 24px #0003; }
.ss-panel[hidden] { display: none; }
.ss-query { width: 100%; min-width: 0; box-sizing: border-box; }
.ss-results { min-height: 0; max-height: 220px; overflow-y: auto; border-radius: 8px; background: #fff; padding: 4px; }
.ss-results[hidden] { display: none; }
.ss-result { display: block; width: 100%; padding: 10px 12px; background: transparent; border: 0; border-radius: 5px; color: #222; font: inherit; text-align: left; cursor: pointer; }
.ss-result:hover, .ss-result.ss-active { background: #eaf2ef; }
.ss-empty { padding: 12px; color: #777; font-size: 14px; }
.input-row > .ss-search { flex: 1; width: auto; }
.vendor-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 8px; margin-bottom: 12px; }
.vendor-tabs .tab { flex: 0 0 auto; white-space: nowrap; }
.st-tabs { flex-wrap: wrap; gap: 6px; }

/* Sample lifecycle: keyboard-accessible serpentine milestones, not status toggles. */
.sample-toolbar { margin: 14px 0; }
.sample-metrics { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px; }
.sample-metrics>div { background:white;border:1px solid var(--border,#e2e5e2);border-radius:14px;padding:16px; }
.sample-metrics small,.sample-overview strong small { display:block;color:#71847d;font-size:12px;font-weight:400; }
.sample-metrics b { display:block;font-size:28px;color:#315e50; }
.sample-filters { display:flex;flex-wrap:wrap;gap:10px; }.sample-filters input { flex:1;min-width:200px; }.sample-filters select { flex:1;min-width:160px; }
.sample-track { height:8px;background:#e7ece9;border-radius:20px;overflow:hidden;margin:10px 0; }.sample-track>span { display:block;height:100%;background:linear-gradient(90deg,#7aa590,#315e50);border-radius:20px;transition:width .35s ease; }
.sample-mini { min-width:160px; }.sample-mini .sample-track { height:5px; }.sample-mini small { font-size:11px; }
.sample-overview { display:flex;align-items:center;justify-content:space-between;gap:20px;background:#f1f6f3;border-radius:14px;padding:18px; }.sample-overview strong { font-size:32px;color:#315e50;text-align:right; }.sample-overview p { margin:8px 0; }
.sample-path { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px 18px;margin:24px 0; }
.sample-step { position:relative;z-index:0;min-height:112px;border:1px solid #dce5df;border-radius:12px;background:#f7f9f7;padding:14px 10px;color:#71847d;text-align:center;cursor:pointer; }
.sample-step span { display:block;margin:0 auto 8px;width:28px;height:28px;border-radius:50%;background:#e2eae5;line-height:28px;font-weight:700; }.sample-step b,.sample-step small { display:block; }.sample-step small { font-size:11px;margin-top:6px; }
.sample-step:after { content:'';position:absolute;top:50%;left:100%;width:20px;height:2px;background:#c8d8ce; }
.sample-step:nth-child(4):after { left:50%;top:100%;width:2px;height:24px; }
.sample-step:nth-child(5) { grid-column:4;grid-row:2; }.sample-step:nth-child(6) { grid-column:3;grid-row:2; }.sample-step:nth-child(7) { grid-column:2;grid-row:2; }
.sample-step:nth-child(5):after,.sample-step:nth-child(6):after { left:auto;right:100%; }.sample-step:last-child:after { display:none; }
.sample-step.passed { background:#eef5ef;color:#315e50;border-color:#adc7b6; }.sample-step.passed span { background:#cce0d0; }.sample-step.current { border:2px solid #315e50;background:#e8f2eb;color:#244d3e;box-shadow:0 4px 12px #315e5015; }.sample-step.current span { background:#315e50;color:white; }.sample-step.selected,.sample-step:focus-visible { outline:3px solid #dfb560;outline-offset:3px; }
.sample-stage-info { background:#fff9e9;border:1px solid #ecdbaf;border-radius:10px;padding:14px;font-size:13px;line-height:1.6; }
.sample-actions,.sample-rounds { display:flex;flex-wrap:wrap;gap:8px;margin:12px 0; }.sample-rounds .on { background:#315e50;color:white; }
.sample-event { border-left:3px solid #94b6a3;padding:12px 16px;margin:12px 0;background:#f8faf8;border-radius:0 10px 10px 0; }.sample-event small { display:block;color:#71847d;margin-top:8px; }.sample-event p { white-space:pre-wrap;overflow-wrap:anywhere; }
.sample-photos { display:flex;flex-wrap:wrap;gap:10px; }.sample-photos img { width:96px;height:96px;object-fit:cover;border-radius:8px;border:1px solid #dce5df; }.sample-photos>div { display:flex;flex-direction:column;gap:6px; }
@media(max-width:650px){.sample-path { grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px; }.sample-step:nth-child(n){grid-column:auto;grid-row:auto;}.sample-step:after{display:none;}.sample-step{min-height:104px;}.sample-overview{padding:12px;gap:10px;}.sample-overview strong{font-size:26px;}.sample-metrics>div{padding:10px;}.sample-metrics small{font-size:11px;}.sample-filters input,.sample-filters select{min-width:0;width:100%;flex-basis:100%;}}
@media(prefers-reduced-motion:reduce){.sample-track>span{transition:none;}}
.po-goods-labels{margin-bottom:8px;overflow-wrap:anywhere;min-width:150px;max-width:340px}
.po-goods-labels>div+div{margin-top:4px}

/* ---------- v8.50: Daftar Bayar ---------- */
.pb-kpi .kpi b { font-size: 20px; }
.pb-tools { flex-wrap: wrap; margin: 10px 0 4px; }
.pb-tools input[type=search] { max-width: 240px; }
.pb-vendor { margin-top: 10px; }
.pb-vhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pb-row { display: grid; grid-template-columns: 1fr auto 170px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.pb-row:last-child { border-bottom: 0; }
.pb-row.is-off { opacity: .55; }
.pb-chk { align-items: flex-start; }
.pb-amt input { text-align: right; }
.pb-bar { position: sticky; bottom: 8px; margin-top: 12px; z-index: 20; border: 2px solid var(--primary, #2f5d50); }
.pb-bar-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.pb-total { font-size: 18px; }
.pb-vendor.is-off { opacity: .6; }
@media (max-width: 640px) {
  .pb-row { grid-template-columns: 1fr; gap: 4px; }
  .pb-rem { padding-left: 28px; }
  .pb-amt { margin-left: 28px; }
  .pb-bar-in .btn { width: 100%; }
}

/* ---------- v8.50: perbaikan tampilan HP ---------- */
.tabs { flex-wrap: wrap; }
.modal-foot { flex-wrap: wrap; }
.modal-body { min-width: 0; }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.ld-stage { max-width: 100%; }
body.has-modal .hc-fab { display: none; }
@media (max-width: 820px) {
  /* tabel lebar di dalam kartu / jendela digeser di tabelnya sendiri (kartu tidak di-overflow agar dropdown pencarian tidak terpotong) */
  .card table.tbl, .modal-body table.tbl { display: block; max-width: 100%; overflow-x: auto; }
  .table-scroll table.tbl, .tbl-wrap table.tbl { display: table; }
  .modal-body { max-width: 100%; }
  .po-search-row { flex-wrap: wrap; }
  .po-search-row .po-search { flex: 1 1 100%; }
  .po-search-row > .btn { flex: 1 1 auto; }
  .dr-cfg { margin-left: 0; }
  .card-head { flex-wrap: wrap; }
  #page-actions { flex-wrap: wrap; }
}
.pb-kpi .kpi { display: flex; flex-direction: column; gap: 4px; }
.pb-kpi { margin-bottom: 12px; }
.pb-vendor .tbl td { white-space: nowrap; }
body:has(.pb-bar) .hc-fab { display: none; }
body:has(.form-actions) .hc-fab { display: none; }
@media (max-width: 900px) { .ld-grid > * { min-width: 0; max-width: 100%; } .ld-stage-wrap { padding: 10px; } .ld-num input, .ld-size input { min-width: 0; width: 100%; } }
@media (max-width: 820px) { .modal { min-width: 0; } .modal-body > * { min-width: 0; max-width: 100%; } }

/* ---------- v8.52: Produksi di HP (kartu) + salin ---------- */
.pr-cards { display: none; }
.pr-card { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.pr-card.is-off { opacity: .55; }
.pr-card-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.pr-card-h .mono { margin-right: auto; }
.pr-card-k { font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.pr-card-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; }
.pr-copy { white-space: nowrap; }
@media (max-width: 820px) {
  #pr-list .table-card { display: none; }
  .pr-cards { display: block; }
  .pr-card .pr-copy { padding: 8px 14px; }
}
.mc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.mc-code { word-break: break-all; background: var(--surface-2, #f6f5f1); padding: 6px 8px; border-radius: 6px; font-size: 13px; flex: 1 1 260px; }

/* v8.57 Data Iklan — pengamatan otomatis */
.ad-obs { margin-bottom: 14px; }
.ad-obs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ad-obs-list li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--bg-soft, rgba(0,0,0,.03)); line-height: 1.45; }
.ad-obs-bad { border-left: 3px solid #d64545; } .ad-obs-warn { border-left: 3px solid #e08a1e; } .ad-obs-good { border-left: 3px solid #2e9e5b; } .ad-obs-info { border-left: 3px solid var(--line, #ccc); }


/* =========================================================
 * v8.59 Keterbacaan (review tampilan 10 Okt 2026): tulisan lebih besar & kontras, warna tetap
 * ========================================================= */
:root { font-size: 15px; --muted: #5f5b53; --amber: #8a5508; }
.small { font-size: 13px; }
.tbl td { font-size: 14px; }
/* menu samping: kelompok bisa dilipat + Sering dipakai */
.nav-toggle { display: flex; align-items: center; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-toggle:hover { color: #b9c7c1; }
.nav-caret { margin-left: auto; font-size: 11px; }
.nav-toggle.is-folded .nav-caret { transform: rotate(-90deg); }
/* v8.96 accordion halus: item kelompok menyusut / muncul perlahan (bukan hilang mendadak) */
.nav-item.in-group { max-height: 64px; overflow: hidden; }
.nav-item.is-hidden { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; visibility: hidden; pointer-events: none; }
.nav-item.active.is-hidden { max-height: 64px; opacity: 1; padding-top: 8px; padding-bottom: 8px; visibility: visible; pointer-events: auto; }
/* animasi hanya setelah menu siap (tidak bergoyang saat halaman pertama dimuat) */
#nav.nav-anim .nav-caret { transition: transform .3s ease; }
#nav.nav-anim .nav-item.in-group { transition: max-height .3s ease, opacity .25s ease .05s, padding .3s ease, margin .3s ease; }
#nav.nav-anim .nav-item.in-group.is-hidden { transition: max-height .3s ease, opacity .15s ease, padding .3s ease, margin .3s ease, visibility 0s linear .3s; }
@media (prefers-reduced-motion: reduce) { #nav.nav-anim .nav-caret, #nav.nav-anim .nav-item.in-group, #nav.nav-anim .nav-item.in-group.is-hidden { transition: none; } }
.nav-fav { color: #c9b26b; }
/* pembuat dokumen: ikon kecil, nama muncul saat kursor diarahkan */
.by-who { cursor: help; font-size: 12px; opacity: .55; margin-left: 4px; }
.by-who:hover { opacity: 1; }
/* tombol Bantuan: bulat kecil, tidak menutupi isi tabel */
.hc-fab { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; font-size: 18px; right: 14px; bottom: 14px; opacity: .9; }
.hc-fab span { display: none; }
.hc-fab:hover { opacity: 1; }
#view, .view { padding-bottom: 72px; }
/* judul tidak terpotong jadi 2 baris; tombol turun ke baris berikutnya bila sempit */
.topbar h1 { white-space: normal; overflow-wrap: anywhere; }
.topbar { flex-wrap: wrap; row-gap: 8px; }
/* Dashboard: status pakai kata, peringatan data penjualan tertinggal */
.dash-st { flex-wrap: wrap; }
.dash-st-txt { flex-basis: 100%; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.dash-st.lv-red .dash-st-txt { color: var(--red); } .dash-st.lv-orange .dash-st-txt { color: var(--amber); } .dash-st.lv-green .dash-st-txt { color: var(--green); }
.alert-warn-strong { background: var(--amber-soft); color: #5c3b05; border: 1px solid #e9c98a; border-left: 4px solid #d68910; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }

/* v8.60 — kabar saat menyimpan lambat */
.save-note { margin: 0 20px 10px; padding: 8px 12px; border-radius: 8px; background: #fff4df; color: #6b4300; font-size: 13px; border: 1px solid #f0d9a8; }

/* v8.61 — Kode Produksi Baru di HP: tanpa geser, tanpa rincian nota */
.pf-mloc { display: none; }
@media (max-width: 820px) {
  .pf-table .pf-free, .pf-table .pf-loc, .pf-table tr.pf-src { display: none; }
  .pf-mloc { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; }
  .pf-table { min-width: 0 !important; width: 100%; }
  .pf-table th:last-child, .pf-table td:last-child { width: 86px !important; }
  .pf-table input.pf-n { width: 70px; }
  .pf-group .table-scroll { overflow-x: visible; }
}

/* v8.66 hasil scan paket kembali */
.alert-success { background: var(--green-soft, #e6f4ea); color: #1e5b32; border-color: #bfe0c9; }
.alert-danger { background: var(--red-soft, #fdecea); color: #8a1f17; border-color: #f3c4bf; }

/* v8.67 serah terima COD gagal (ramah HP) */
.ho-form { max-width: 760px; }
.ho-form .fld { margin-bottom: 10px; }
.ho-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ho-form input, .ho-form select { min-height: 44px; font-size: 16px; }
.ho-scan { font-size: 18px !important; min-height: 52px !important; border: 2px solid var(--primary) !important; letter-spacing: .03em; }
.ho-total { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); }
.ho-total span { font-size: 14px; font-weight: 600; }
.ho-total b { font-size: 30px; line-height: 1; }
.ho-total small { font-size: 13px; }
.ho-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 55vh; overflow-y: auto; }
.ho-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ho-flash { animation: hoFlash 1s ease; }
@keyframes hoFlash { 0% { background: #fff3c4; border-color: #e0b400; } 100% { background: var(--surface); } }
.ho-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; flex: 1; }
.ho-main .mono { word-break: break-all; }
.ho-no { flex: 0 0 auto; min-width: 26px; height: 26px; border-radius: 13px; background: var(--primary-soft); color: var(--primary-2); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.ho-act { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ho-act .icon-btn { min-width: 40px; min-height: 40px; font-size: 18px; }
.ho-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ho-seg button { border: 0; background: var(--surface-2); padding: 0 10px; min-height: 40px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.ho-seg button.on { background: var(--primary); color: #fff; font-weight: 600; }
.ho-seg button.on[data-c="damaged"] { background: var(--red); }
.ho-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.ho-ph { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.ho-ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 10px; border: 1px solid var(--line); }
.ho-ph .btn { min-height: 46px; }
.ho-bar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 10px 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 5; }
.ho-bar .btn { min-height: 48px; }
.ho-bar .btn-primary { flex: 1; min-width: 0; font-size: 16px; white-space: normal; }
.ho-item .badge { white-space: normal; }
.ho-cam { background: #000; border-radius: 10px; overflow: hidden; margin: 8px 0; }
.ho-cam video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.ho-hist { display: flex; flex-direction: column; gap: 8px; }
.ho-hrow { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ho-hrow:hover { border-color: var(--primary); }
@media (max-width: 640px) {
  .ho-grid { grid-template-columns: 1fr; }
  .ho-item { flex-direction: column; align-items: stretch; }
  .ho-act { justify-content: flex-end; }
  .ho-seg { flex: 1; }
  .ho-seg button { flex: 1; }
  .ho-form .btn-sm { min-height: 44px; width: 100%; }
}

/* v8.68 perencanaan stok */
.sp-events { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sp-ev { font-size: 12.5px; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.sp-ev.up { background: var(--amber-soft); border-color: transparent; }
.sp-ev.down { background: var(--blue-soft); border-color: transparent; }
.sp-tbl .sp-row td { vertical-align: top; }
.sp-sub > td { background: var(--surface-2); padding: 6px 10px 12px 28px !important; }
.sp-tg { text-decoration: none; font-size: 13px; }
/* v8.69 ABC & stok mati */
.sp-seg { max-width: 420px; }
.sp-mx { display: grid; grid-template-columns: 36px repeat(3, minmax(0, 1fr)); gap: 6px; }
.sp-mx-h { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.sp-mx-c { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.sp-mx-c b { font-size: 18px; }
.sp-mx-c span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.sp-mx-c.on { outline: 2px solid var(--primary); }
.sp-AX, .sp-AY, .sp-AZ { background: var(--green-soft); }
.sp-BX, .sp-BY, .sp-BZ { background: var(--blue-soft); }
.sp-CZ { background: var(--red-soft); }
.sp-spark { color: var(--primary); line-height: 0; margin-top: 3px; }
@media (max-width: 640px) { .sp-mx-c span { display: none; } .sp-mx-c { min-height: 44px; } }
/* v8.70 diskon pembelian */
.seg-mini { display: inline-flex; vertical-align: middle; margin: 0 0 0 6px; padding: 2px; gap: 2px; }
.seg-mini button { padding: 1px 9px; font-size: 12px; flex: 0 0 auto; }
.po-items input[data-k="disc"] { min-width: 80px; }

/* ---------- Panduan cara ukur (master size chart) ---------- */
.scg { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, #ddd); display: grid; gap: 10px; min-width: 0; }
.scg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.scg-head h4 { margin: 0; }
.scg-thumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scg-thumb { font: inherit; font-size: 13px; color: inherit; background: transparent; border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.scg-thumb.on { border-color: var(--accent, #0f7a6b); color: var(--accent, #0f7a6b); font-weight: 600; }
.scg-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.scg-add input[name=view] { width: 150px; max-width: 100%; }
.scg-stage { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.scg-canvas { position: relative; max-width: 100%; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 10px; overflow: hidden; }
.scg-canvas.marking { cursor: crosshair; }
.scg-canvas img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.scg-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.scg-svg line { vector-effect: non-scaling-stroke; stroke-linecap: round; }
.scg-guide { stroke: rgba(15, 122, 107, .35); stroke-width: 1.5; stroke-dasharray: 4 4; }
.scg-guide.on { stroke: var(--accent, #0f7a6b); stroke-dasharray: none; stroke-width: 2; }
.scg-anim { stroke: var(--accent, #0f7a6b); stroke-width: 3; }
.scg-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent, #0f7a6b); border: 2px solid #fff; pointer-events: none; }
.scg-dot.pending { background: #e0a100; }
.scg-anim-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 3px solid var(--accent, #0f7a6b); pointer-events: none; }
.scg-anim-dot[hidden] { display: none; }
.scg-badge { position: absolute; transform: translate(-50%, -100%); background: var(--accent, #0f7a6b); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.scg-badge[hidden] { display: none; }
.scg-hint { margin: 0; text-align: center; }
.scg-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scg-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line, #ddd); border-radius: 8px; min-width: 0; }
.scg-row.on { border-color: var(--accent, #0f7a6b); }
.scg-row input[data-note] { flex: 1; min-width: 140px; }
.scm-cols { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.scm-col { border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
/* Panduan cara ukur, mode baca saja (detail barang) */
.scg-ro .scg-add, .scg-ro .scg-tools, .scg-ro .scg-hint, .scg-ro [data-rm] { display: none !important; }
.scg-ghost { stroke: var(--accent, #0f7a6b); stroke-width: 2; stroke-dasharray: 6 4; opacity: .85; }
.scm-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.scm-opt { border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.scm-opt.on { border-color: var(--accent, #0f7a6b); color: var(--accent, #0f7a6b); font-weight: 600; }
.scm-opt input { margin-right: 6px; }
.scm-cols button.link { margin-left: 4px; font-size: 14px; line-height: 1; }
.scz-size-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.scz-size-chips .on { background: var(--accent, #0f7a6b); color: #fff; border-color: transparent; }
.scg-svg path { vector-effect: non-scaling-stroke; }
.scg-ring-front { fill: none; stroke: var(--accent, #0f7a6b); stroke-width: 3; stroke-linecap: round; }
.scg-ring-back { fill: none; stroke: var(--accent, #0f7a6b); stroke-width: 1.5; opacity: .45; stroke-linecap: round; }

/* ---------- v9.02 Banding Skor Ulasan / Pengembalian (#/komplain/banding-ulasan) ---------- */
.ra-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.ra-kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); border-top: 3px solid var(--line); }
.ra-kpi:hover { border-color: #c9c3b5; }
.ra-kpi.on { outline: 2px solid var(--primary); outline-offset: -1px; }
.ra-k-none { border-top-color: #b9b3a6; } .ra-k-prog { border-top-color: var(--amber); } .ra-k-done { border-top-color: var(--green); } .ra-k-no { border-top-color: var(--red); }
.ra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 12px; }
.ra-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ra-card:hover, .ra-card:focus-visible { border-color: var(--primary); box-shadow: 0 2px 10px rgba(47, 93, 80, .14); outline: none; }
.ra-del { position: absolute; top: 6px; right: 6px; opacity: .45; }
.ra-card:hover .ra-del { opacity: 1; }
.ra-head { display: flex; gap: 12px; padding: 14px 40px 8px 14px; }
.ra-thumb { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: #f3f1ec; }
.ra-thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); }
.ra-thumb.lg { width: 84px; height: 84px; }
.ra-main { min-width: 0; flex: 1; }
.ra-cat { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.ra-cat-b { background: var(--amber-soft); color: #7a4c06; }
.ra-cat-r { background: var(--blue-soft); color: var(--blue); }
.ra-stars { color: #d39a0b; letter-spacing: 1px; font-size: 13px; }
.ra-name { font-weight: 600; margin: 4px 0 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ra-oid { font-size: 12.5px; color: var(--muted); }
.ra-oid [data-copy-order] { cursor: copy; }
.ra-review { padding: 0 14px 10px; font-size: 13px; color: #4a4741; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.ra-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ra-pvs { display: flex; gap: 6px; }
.ra-pv { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.ra-pv.empty { display: flex; align-items: center; justify-content: center; color: #bdb7aa; background: #f7f6f2; cursor: default; font-size: 14px; }
.ra-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ra-copy.ok { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.ra-tks { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 12px; border-top: 1px dashed var(--line); }
.ra-tk { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); text-decoration: none; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a.ra-tk:hover { background: #d3e5de; }
.ra-detail .ra-h { margin: 0 0 8px; font-size: 14px; }
.ra-dhead { display: flex; gap: 14px; align-items: flex-start; }
.ra-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; color: var(--muted); }
.ra-meta b { color: var(--text); }
.ra-sale { font-size: 13px; background: var(--blue-soft); color: #1f3f70; padding: 8px 12px; border-radius: 8px; }
.ra-revbox { background: #f7f6f2; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.ra-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ra-slots.one { grid-template-columns: minmax(0, 360px); }
.ra-slot { position: relative; min-height: 140px; border: 2px dashed #cfc9bb; border-radius: 10px; background: #faf9f6; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; outline: none; }
.ra-slot.active { border-color: var(--primary); background: var(--primary-soft); }
.ra-slot img { width: 100%; height: 100%; max-height: 220px; object-fit: contain; cursor: zoom-in; background: #fff; }
.ra-hint { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); text-align: center; padding: 10px; }
.ra-hint b { color: var(--text); font-size: 13.5px; }
.ra-slot.filled .ra-hint { display: none; }
.ra-slot .ra-rm { position: absolute; top: 4px; right: 4px; background: #fff; display: none; }
.ra-slot.filled .ra-rm { display: inline-flex; }
.ra-slot .ra-pick { position: absolute; bottom: 6px; right: 6px; }
.ra-tkrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ra-tkrow .tk-no { flex: 1; min-width: 0; }
.ra-tkrow .tk-date { width: 160px; flex-shrink: 0; }
.ra-hist { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; }
.ra-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.ra-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 18, 16, .86); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px; }
.ra-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, .4); }
@media (max-width: 1100px) { .ra-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .ra-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ra-kpi { padding: 8px 10px; }
  .ra-kpi .kpi-v { font-size: 19px; margin: 2px 0 0; }
  .ra-kpi .kpi-l { font-size: 12px; line-height: 1.25; }
  .ra-kpi .kpi-s { display: none; }
  .ra-slot { min-height: 96px; }
  .ra-grid { grid-template-columns: 1fr; }
  .ra-slots { grid-template-columns: 1fr; }
  .ra-tkrow .tk-date { width: 132px; }
}
