/* ERP Sinergi — tema "hijau tua" (terinspirasi dashboard keuangan modern). Tanpa CDN. */
@font-face { font-family: "Carlito"; src: url("../fonts/carlito-regular.7d94535bb671.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("../fonts/carlito-bold.20ad7209f678.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
:root {
  --bg: #eeefec;
  --surface: #f6f6f4;
  --panel: #ffffff;
  --ink: #1d2320;
  --muted: #727a76;
  --line: #e6e8e4;
  --brand: #0f3d34;
  --brand-2: #155247;
  --brand-3: #1f6b5e;
  --brand-soft: #e3efeb;
  --accent: #1f6b5e;
  --dark: #151917;
  --danger: #c2412d;
  --warn: #b7791f;
  --info: #1f6b5e;
  --ok-bg: #e2f1ea; --ok-ink: #17694f;
  --warn-bg: #fbf0dc; --warn-ink: #8a5a12;
  --err-bg: #fbe7e3; --err-ink: #a32f1e;
  --info-bg: #e3efeb; --info-ink: #155247;
  --grey-bg: #eff0ee; --grey-ink: #4d5551;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04);
  --sidebar-w: 248px;
  font-family: "Carlito", "Lato", "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  font-size: 15.5px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { -webkit-font-smoothing: antialiased; }
a { color: var(--brand-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Layout: kartu besar di atas latar abu ---------- */
.layout { display: flex; min-height: 100vh; max-width: 1680px; margin: 0 auto; padding: 18px; gap: 0; }
.sidebar {
  width: var(--sidebar-w); background: var(--panel); color: var(--ink); flex-shrink: 0; align-self: stretch;
  border-radius: var(--radius) 0 0 var(--radius); border-right: 1px solid var(--line);
}
.side-inner { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 0 14px 1.5rem; scrollbar-width: thin; }
.sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: 1.3rem .5rem 1.1rem; font-weight: 700; color: var(--ink); font-size: 1.12rem; text-decoration: none; }
.sidebar .brand small { display: block; color: var(--muted); font-weight: 400; font-size: .74rem; line-height: 1.2; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; flex-shrink: 0; }
.nav-group { padding: .9rem 0 .1rem; }
.nav-group > .label { padding: 0 .55rem .45rem; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; color: #3b433f; border-radius: 10px; font-size: .93rem; margin-bottom: 2px; }
.nav a svg.ic { color: #59625e; }
.nav a:hover { background: var(--surface); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active svg.ic { color: #fff; }
.nav .badge { margin-left: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.topbar { display: flex; align-items: center; gap: .9rem; margin: 0 1.75rem; padding: 1.15rem 0 1rem; border-bottom: 1px solid #dcdfda; position: sticky; top: 0; z-index: 20; background: var(--surface); }
.topbar .welcome b { display: block; font-size: 1.2rem; font-weight: 600; }
.topbar .welcome small { font-size: .82rem; }
.topbar .spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: .55rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid #2a302d; background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover { background: #fff; text-decoration: none; }
.icon-btn svg.ic { width: 17px; height: 17px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(140deg, #2b7a6a, #0f3d34); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; margin-left: .3rem; box-shadow: 0 0 0 3px #fff; }
.avatar:hover { text-decoration: none; filter: brightness(1.08); }
.menu-toggle { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .55rem; cursor: pointer; color: var(--ink); }
.content { padding: 1.4rem 1.75rem 2rem; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Kartu ---------- */
.panel { background: var(--panel); border: none; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; margin-bottom: 1.1rem; }
.panel > h2:first-child { margin-bottom: .85rem; }
.panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel-head .actions { margin-left: auto; display: flex; gap: .4rem; }
.grid { display: grid; gap: 1.1rem; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--panel); border-radius: var(--radius); padding: 1.05rem 1.2rem; box-shadow: var(--shadow); position: relative; }
.stat .k { font-size: .9rem; color: var(--ink); font-weight: 600; line-height: 1.25; }
.stat .v { font-size: 1.8rem; font-weight: 600; margin-top: .35rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .s { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.panel .stat { background: var(--surface); }
.stat.accent, .stat.info, .stat.warn, .stat.danger { border: none; }
.stat.warn .v { color: var(--warn-ink); }
.stat.danger .v { color: var(--danger); }
.stat.dark { background: var(--brand); color: #fff; }
.stat.dark .k, .stat.dark .s { color: #cfe3dc; }
.chip { display: inline-flex; align-items: center; gap: .15rem; font-size: .72rem; font-weight: 700; padding: .1rem .4rem; border-radius: 5px; border: 1px solid; }
.chip.up { color: var(--ok-ink); border-color: #a7d6c3; background: var(--ok-bg); }
.chip.down { color: var(--err-ink); border-color: #efb9ae; background: var(--err-bg); }
.chip.flat { color: var(--grey-ink); border-color: #d8dbd6; background: var(--grey-bg); }

/* ---------- Tabel: kepala gelap, sudut membulat ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: #f1f3f2; font-size: .82rem; padding: .85rem .8rem; background: var(--dark); white-space: nowrap; border: none; }
.table thead th:first-child { border-top-left-radius: 14px; }
.table thead th:last-child { border-top-right-radius: 14px; }
.table td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; background: #fff; }
.panel .table td { background: transparent; }
.table tbody tr:hover td { background: #f7f8f6; }
.table tfoot td { font-weight: 700; background: var(--surface); }
.table .empty { text-align: center; color: var(--muted); padding: 1.8rem; }
tr.row-muted td { color: #9aa29e; }
tr.row-muted td a { color: #9aa29e; }
/* tabel isian (editor baris) tetap terang */
.lines-table th { background: var(--surface); color: var(--muted); text-transform: uppercase; font-size: .74rem; letter-spacing: .04em; }
.lines-table thead th:first-child, .lines-table thead th:last-child { border-radius: 0; }

/* ---------- Badge ---------- */
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok-ink); }
.b-warn { background: var(--warn-bg); color: var(--warn-ink); }
.b-err { background: var(--err-bg); color: var(--err-ink); }
.b-info { background: var(--info-bg); color: var(--info-ink); }
.b-grey { background: var(--grey-bg); color: var(--grey-ink); }
.nav .badge.b-err { background: #d9573f; color: #fff; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: .85rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .32rem; }
.field .req { color: var(--danger); }
.help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.field .err { font-size: .82rem; color: var(--danger); margin-top: .25rem; }
.field.has-error .input { border-color: var(--danger); background: #fffafa; }
.input { width: 100%; padding: .58rem .75rem; border: 1px solid #d7dbd5; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.input:focus { outline: 3px solid rgba(31, 107, 94, .18); border-color: var(--brand-3); }
textarea.input { resize: vertical; }
.input.num { text-align: right; }
.checkbox { width: 1.05rem; height: 1.05rem; vertical-align: middle; accent-color: var(--brand); }
input[type=checkbox] { accent-color: var(--brand); }
.check-row { display: flex; align-items: center; gap: .5rem; }
.check-list { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: 0; }
.check-list label { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; }
.form-errors { background: var(--err-bg); color: var(--err-ink); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .9rem; }
.form-errors ul { margin: 0; padding-left: 1.1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

/* Bar filter: kotak cari berbentuk pil */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .f { display: flex; flex-direction: column; gap: .25rem; }
.filters .f label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.filters .input { width: auto; min-width: 140px; border-radius: 999px; background: var(--surface); border-color: transparent; padding-left: 1rem; }
.filters .input:focus { background: #fff; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .grow .input { width: 100%; padding-left: 2.4rem; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23727a76' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat .9rem center / 16px; }
.filters .grow .input:focus { background-color: #fff; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.05rem; border-radius: 999px; border: 1px solid #cdd2cc; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-success { background: var(--brand-3); border-color: var(--brand-3); color: #fff; }
.btn-success:hover { background: #185a4f; }
.btn-danger { background: #fff; border-color: #ebbcb2; color: var(--danger); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: .32rem .75rem; font-size: .82rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: wait; }
.btn-link { background: none; border: none; color: var(--brand-3); padding: 0; font: inherit; cursor: pointer; }
form.inline { display: inline; }

/* ---------- Pesan ---------- */
.messages { margin-bottom: 1rem; display: grid; gap: .5rem; }
.msg { padding: .75rem 1rem; border-radius: 12px; border: 1px solid transparent; }
.msg.success { background: var(--ok-bg); color: var(--ok-ink); border-color: #bfe0d1; }
.msg.error { background: var(--err-bg); color: var(--err-ink); border-color: #f1c4bd; }
.msg.warning { background: var(--warn-bg); color: var(--warn-ink); border-color: #f0d9ac; }
.msg.info { background: var(--info-bg); color: var(--info-ink); border-color: #c4ddd4; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .9rem; font-size: .88rem; color: var(--muted); }
.pagination .pages { margin-left: auto; display: flex; gap: .3rem; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: .45rem .9rem; font-size: .94rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

.clock-card { text-align: center; padding: 1.7rem 1rem; }
.clock-card .time { font-size: 2.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--brand); }
.clock-card .date { color: var(--muted); margin-bottom: 1rem; }
.clock-card .btns { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }

.totals { margin-left: auto; max-width: 400px; width: 100%; }
.totals .row { display: flex; justify-content: space-between; padding: .32rem 0; }
.totals .row.grand { border-top: 2px solid var(--ink); font-weight: 700; font-size: 1.12rem; margin-top: .3rem; padding-top: .55rem; }

.lines-table .input { min-width: 90px; }
.lines-table td.product-cell { min-width: 260px; }
.lines-table .stock-hint { font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.lines-table .stock-hint.short { color: var(--danger); font-weight: 600; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--bg); }
.login-card { background: #fff; border-radius: 22px; padding: 2.2rem; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(15, 61, 52, .12); }
.login-card h1 { font-size: 1.4rem; margin-bottom: .2rem; }

.callout { padding: .8rem 1rem; border-radius: 12px; background: var(--info-bg); color: var(--info-ink); font-size: .9rem; margin-bottom: .9rem; }
.callout.warn { background: var(--warn-bg); color: var(--warn-ink); }
.callout.err { background: var(--err-bg); color: var(--err-ink); }
.def-list { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }

dialog.modal { border: none; border-radius: 18px; padding: 1.4rem; width: min(470px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(12, 22, 18, .45); }

/* ---------- Dashboard ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .9fr); gap: 1.1rem; margin-bottom: 1.1rem; }
.dash-stack { display: grid; gap: 1.1rem; }
.kpi { background: var(--panel); border-radius: var(--radius); padding: 1rem 1.15rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .3rem 1rem; }
.kpi .k { font-size: .92rem; font-weight: 600; line-height: 1.2; max-width: 7rem; }
.kpi .v { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .side { text-align: right; font-size: .74rem; color: var(--muted); display: grid; gap: .4rem; justify-items: end; }
.kpi .trend { color: var(--muted); }
.revenue { background: var(--panel); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: grid; gap: .9rem; }
.revenue .head { display: flex; align-items: center; gap: 1.1rem; }
.revenue .head .t b { display: block; font-size: 1.25rem; font-weight: 600; }
.revenue .head .t small { font-size: .78rem; }
.revenue .head .sep { width: 1px; align-self: stretch; background: var(--line); }
.revenue .head .v { font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; }
.revenue .mini { background: var(--surface); border-radius: 14px; padding: .8rem 1rem; display: flex; align-items: center; gap: 1rem; }
.revenue .mini .lbl { font-size: .74rem; color: var(--muted); }
.revenue .mini .val { font-size: 1.7rem; font-weight: 600; }
.revenue .mini svg { flex: 1; height: 54px; }
.savings { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.savings .t { display: flex; justify-content: space-between; font-size: .9rem; color: #d7e9e3; }
.savings .v { font-size: 2.3rem; font-weight: 600; letter-spacing: -.02em; margin-top: auto; }
.savings .s { font-size: .82rem; color: #cfe3dc; }
.savings .s b { color: #f3d36b; }
.dash-mid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: 1.1rem; margin-bottom: 1.1rem; }
.donut-card { display: flex; flex-direction: column; align-items: center; }
.donut { position: relative; width: 210px; height: 210px; margin: .4rem auto 1rem; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 600; font-size: .9rem; line-height: 1.25; padding: 0 2.6rem; }
.legend { width: 100%; display: grid; gap: .7rem; }
.legend .row { display: grid; grid-template-columns: 14px 1fr auto 3.2rem; align-items: center; gap: .6rem; font-size: .92rem; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; }
.legend .pct { font-size: .8rem; color: var(--muted); text-align: right; border-left: 1px dashed #cfd4ce; padding-left: .5rem; }
.bars { position: relative; height: 290px; padding: .6rem 0 1.7rem 4.4rem; }
.bars .area { position: relative; height: 100%; }
.bars .gl { position: absolute; left: 0; right: 0; border-top: 1px solid #e3e6e1; }
.bars .gl span { position: absolute; right: 100%; top: 0; transform: translateY(-50%); margin-right: .6rem; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bars .cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3.5%; padding: 0 1.5%; }
.bars .bar { flex: 1; position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bars .bar i { display: block; width: 100%; max-width: 46px; background: var(--brand-3); border-radius: 10px; min-height: 3px; }
.bars .bar.now i { background: var(--brand); }
.bars .bar span { position: absolute; bottom: -1.55rem; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.bars .bar:hover i { filter: brightness(1.15); }

/* ---------- Responsif ---------- */
@media (max-width: 1250px) {
  .dash-top { grid-template-columns: 1fr 1fr; }
  .dash-top .savings { grid-column: 1 / -1; }
  .dash-mid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { padding: 0; }
  .main { border-radius: 0; }
  .side-inner { max-height: none; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; overflow-y: auto; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; border-radius: 0; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .topbar { top: 0; margin: 0; padding: .75rem 1rem; border-radius: 0; }
  .topbar .welcome small { display: none; }
  .topbar .welcome b { font-size: 1rem; }
  .top-actions .icon-btn { display: none; }
  .top-actions form .icon-btn { display: inline-grid; }
  .content { padding: 1rem; }
  h1 { font-size: 1.45rem; }
  .dash-top { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: .4rem; }
  .filters .input { min-width: 0; width: 100%; }
  .filters .f { flex: 1 1 45%; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: .3rem .4rem; text-align: right; background: transparent; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  .table.responsive td.num { justify-content: space-between; }
  .kpi .v { font-size: 1.6rem; }
  .bars { height: 230px; padding-left: 3.6rem; }
  .bars .bar span { font-size: .62rem; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 1.25rem; }
  .page-head .actions { margin-left: 0; width: 100%; }
}
@media print {
  .sidebar, .topbar, .no-print, .messages { display: none !important; }
  .layout { padding: 0; }
  .content { padding: 0; }
  body, .main { background: #fff; }
}

.table th.num { text-align: right; }
.table td:first-child a { white-space: nowrap; }
@media (max-width: 860px) {
  .lines-table thead { display: none; }
  .lines-table, .lines-table tbody { display: block; }
  .lines-table tr.line { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .lines-table td { display: block; border: none; padding: 0; }
  .lines-table td.product-cell { grid-column: 1 / -1; min-width: 0; }
  .lines-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
  .lines-table .input { min-width: 0; }
  .lines-table td.js-line-total { text-align: left; font-weight: 700; align-self: end; }
}
/* Pencarian barang (autocomplete) */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid #d7dbd5; border-radius: 12px; box-shadow: 0 12px 30px rgba(15,40,30,.14); max-height: 300px; overflow-y: auto; }
.ac-item { padding: .45rem .6rem; cursor: pointer; border-bottom: 1px solid var(--line); font-size: .88rem; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--info-bg); }
.ac-item .sku { font-weight: 700; }
.ac-item .meta { color: var(--muted); font-size: .78rem; }
.ac-empty { padding: .5rem .6rem; color: var(--muted); font-size: .85rem; }
.product-name { font-size: .8rem; color: var(--ink); margin-top: .2rem; }
.table-wrap.lines-wrap { overflow: visible; }
.lines-table td.product-cell { min-width: 320px; width: 36%; }
.lines-table tbody tr:hover { background: transparent; }
@media (max-width: 860px) { .lines-table td.product-cell { min-width: 0; width: auto; } }
.q-lines textarea.input { min-height: 3.2rem; font-size: .88rem; }
.q-lines td { vertical-align: top; }
@media (max-width: 860px) { .q-lines td[data-label="Desc"] { grid-column: 1 / -1; } .q-lines td[data-label="Type"] { grid-column: 1 / -1; } }
.sig-preview { border: 1px dashed #cfd6df; border-radius: 6px; padding: .6rem; margin-bottom: .8rem; background: repeating-conic-gradient(#f6f7f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.sig-preview img { max-height: 90px; max-width: 100%; display: block; margin-bottom: .3rem; }

/* v1.8 */
.lines-table .err { color: var(--danger); font-size: .8rem; }
.p1-cell { min-width: 205px; }
.p1-row { display: flex; gap: .3rem; align-items: center; margin-bottom: .25rem; }
.p1-row .js-cur { width: 3.6rem; min-width: 0; padding-left: .35rem; padding-right: .2rem; }
.p1-row .js-p1, .p1-row .js-factor { flex: 1; min-width: 0; }
.p1-x { width: 3.6rem; text-align: center; color: var(--muted); }
.p1-label { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.p1-label b { color: var(--ink, #111); }
.sn-box { margin-top: .3rem; font-size: .8rem; }
.sn-box summary { cursor: pointer; color: var(--muted); }
.sn-box textarea { width: 100%; min-height: 2.2rem; margin-top: .25rem; font-family: ui-monospace, monospace; font-size: .8rem; }
.price-calc { background: var(--surface); border-radius: 14px; padding: .6rem .8rem .1rem; margin-bottom: .6rem; }
.sn-list { font-family: ui-monospace, monospace; font-size: .8rem; }
.lines-table .p1-row .input { min-width: 0; }
.level-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.p1-row .js-lvl, .p1-row .js-minus, .p1-row .js-up { flex: 1; min-width: 0; padding-left: .35rem; padding-right: .2rem; }
.p1-row[hidden] { display: none; }
