/* ===== Sistem Akuntansi Usaha — dark professional ERP ===== */
:root {
  --bg: #070b11;
  --bg-soft: #0a111a;
  --panel: #0f1722;
  --panel-2: #131d2a;
  --panel-3: #172434;
  --line: #1e2b3c;
  --line-soft: #16202d;
  --text: #e8eff9;
  --text-2: #9aabbd;
  --muted: #6c7f95;
  --accent: #3d7dff;
  --accent-soft: rgba(61, 125, 255, .14);
  --teal: #14c8b1;
  --ok: #23c48a;
  --warn: #f2b53c;
  --danger: #ff5f5f;
  --violet: #9180ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.app {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(61, 125, 255, .10), transparent 60%),
    radial-gradient(700px 400px at 10% 110%, rgba(20, 200, 177, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: 0 0 252px; background: linear-gradient(180deg, #0b121b 0%, #080d14 100%);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #1b2737; border-radius: 8px; }
.brand {
  display: flex; gap: 11px; align-items: center; padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .03em;
  color: #fff; background: linear-gradient(135deg, #3d7dff, #14c8b1);
  box-shadow: 0 6px 18px rgba(61, 125, 255, .28);
}
.brand-text strong { display: block; font-size: 13.5px; line-height: 1.25; }
.brand-text small { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.nav { padding: 12px 10px 24px; flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #56677c;
  padding: 8px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: #a9b8ca; font-size: 13px; text-decoration: none; margin-bottom: 1px;
  border-left: 2px solid transparent; transition: background .13s, color .13s;
}
.nav-item .ico { width: 17px; height: 17px; opacity: .8; flex: 0 0 17px; }
.nav-item:hover { background: #121c28; color: #e8eff9; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(61, 125, 255, .18), rgba(61, 125, 255, .04));
  color: #fff; border-left-color: var(--accent); font-weight: 600;
}
.nav-item.active .ico { opacity: 1; color: #7aa7ff; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line-soft); background: #080d14; position: sticky; bottom: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #1b2737; color: #9ab4ff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 32px;
  border: 1px solid #26384d;
}
.user-meta strong { display: block; font-size: 12.5px; line-height: 1.2; }
.user-meta small { color: var(--muted); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 13px 28px; border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 13, 20, .82); backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 16px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 24px 28px 56px; max-width: 1440px; width: 100%; }
.content.wide { max-width: none; }
.only-mobile { display: none; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.page-head p { font-size: 12.5px; margin-top: 3px; }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, #101a26, #0d1620);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .18);
  margin-bottom: 20px; overflow: hidden;
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 13.5px; letter-spacing: .01em; }
.card-head > :last-child { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g-2-1 { grid-template-columns: 2fr 1fr; }
.grid.g-1-2 { grid-template-columns: 1fr 2fr; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* ---------- stat ---------- */
.stat {
  background: linear-gradient(165deg, #121e2c, #0d1621);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #2a3b50; }
.stat.ok::after { background: var(--ok); }
.stat.warn::after { background: var(--warn); }
.stat.danger::after { background: var(--danger); }
.stat.accent::after { background: var(--accent); }
.stat.teal::after { background: var(--teal); }
.stat.violet::after { background: var(--violet); }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.stat-top .ico { margin-left: auto; width: 16px; height: 16px; opacity: .55; }
.stat-value { font-size: 21px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.stat-sub .up { color: var(--ok); }
.stat-sub .down { color: var(--danger); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  background: linear-gradient(180deg, #4a86ff, #3468e0); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 4px 12px rgba(52, 104, 224, .25);
  transition: filter .12s, transform .06s;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; }
.btn.ghost { background: #14202e; border-color: #24344a; color: #cfdcec; box-shadow: none; }
.btn.ghost:hover { background: #1a2939; }
.btn.soft { background: rgba(61, 125, 255, .12); border-color: rgba(61, 125, 255, .3); color: #9dc0ff; box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ef5350, #d13c3c); box-shadow: 0 4px 12px rgba(209, 60, 60, .22); }
.btn.success { background: linear-gradient(180deg, #22c98d, #16a06e); box-shadow: 0 4px 12px rgba(22, 160, 110, .22); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.xs { padding: 4px 8px; font-size: 11.5px; border-radius: 6px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.link-btn.danger { color: var(--danger); }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 4; }
.field.s2 { grid-column: span 2; }
.field.s3 { grid-column: span 3; }
.field.s4 { grid-column: span 4; }
.field.s6 { grid-column: span 6; }
.field.s8 { grid-column: span 8; }
.field.s12 { grid-column: span 12; }
.field > label { font-size: 11.5px; color: var(--text-2); font-weight: 500; letter-spacing: .02em; }
.field .hint { font-size: 11px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 11px; border-radius: 8px;
  background: #0b131d; border: 1px solid #22303f; color: var(--text);
  font-family: inherit; font-size: 13px; outline: none; transition: border-color .13s, box-shadow .13s;
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: #3d7dff; box-shadow: 0 0 0 3px rgba(61, 125, 255, .16);
}
.input::placeholder { color: #5a6b7f; }
textarea.input { min-height: 72px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 49%, #8899ad 50%), linear-gradient(135deg, #8899ad 50%, transparent 51%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input.money { text-align: right; font-variant-numeric: tabular-nums; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.checkline input { accent-color: var(--accent); width: 15px; height: 15px; }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { flex: 0 0 auto; min-width: 130px; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.tbl thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: #7a8da3; font-weight: 600; padding: 10px 14px; background: #0d1723;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: rgba(61, 125, 255, .045); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tfoot td { padding: 10px 14px; font-weight: 650; border-top: 1px solid var(--line); background: #0c1520; }
table.tbl th.num, table.tbl td.num { text-align: right; }
table.tbl td.strong, table.tbl td b { font-weight: 600; }
table.tbl.compact tbody td, table.tbl.compact thead th { padding: 7px 12px; }
.empty { text-align: center; color: var(--muted); padding: 28px 14px !important; font-size: 12.5px; }
.t-main { font-weight: 600; color: #e8eff9; }
.t-sub { font-size: 11.5px; color: var(--muted); }
.code { font-family: var(--mono); font-size: 11.8px; color: #8fb4ff; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2.5px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.badge.ok { background: rgba(35, 196, 138, .12); color: #4fdda6; border: 1px solid rgba(35, 196, 138, .25); }
.badge.warn { background: rgba(242, 181, 60, .12); color: #f5c869; border: 1px solid rgba(242, 181, 60, .25); }
.badge.danger { background: rgba(255, 95, 95, .12); color: #ff8a8a; border: 1px solid rgba(255, 95, 95, .25); }
.badge.info { background: rgba(61, 125, 255, .13); color: #9dc0ff; border: 1px solid rgba(61, 125, 255, .28); }
.badge.muted { background: #17222f; color: #9aabbd; border: 1px solid #24344a; }
.badge.violet { background: rgba(145, 128, 255, .13); color: #b6a8ff; border: 1px solid rgba(145, 128, 255, .28); }
.chip { display: inline-block; padding: 2px 7px; border-radius: 6px; background: #16212e; border: 1px solid #233346; font-size: 11px; color: var(--text-2); }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 14px; border-radius: 9px;
  font-size: 12.8px; margin-bottom: 16px; border: 1px solid transparent;
}
.alert .ico { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.alert.ok { background: rgba(35, 196, 138, .09); border-color: rgba(35, 196, 138, .28); color: #7ee7bb; }
.alert.danger { background: rgba(255, 95, 95, .09); border-color: rgba(255, 95, 95, .28); color: #ff9d9d; }
.alert.warn { background: rgba(242, 181, 60, .09); border-color: rgba(242, 181, 60, .28); color: #f5cd80; }
.alert.info { background: rgba(61, 125, 255, .08); border-color: rgba(61, 125, 255, .25); color: #a9c7ff; }

/* ---------- login ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(61, 125, 255, .16), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(20, 200, 177, .12), transparent 60%),
    #070b11;
}
.auth-card {
  width: 100%; max-width: 400px; background: linear-gradient(180deg, #101a26, #0c141d);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 42px; height: 42px; flex: 0 0 42px; font-size: 14px; }
.auth-card .field { margin-bottom: 14px; }
.auth-foot { margin-top: 18px; font-size: 11.5px; color: var(--muted); line-height: 1.7; border-top: 1px solid var(--line-soft); padding-top: 14px; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.bar { width: 100%; max-width: 46px; border-radius: 5px 5px 3px 3px; background: linear-gradient(180deg, #4a86ff, #2a5bd0); min-height: 2px; }
.bar-col:hover .bar { filter: brightness(1.18); }
.bar-val { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.bar-lbl { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.empty-chart { text-align: center; color: var(--muted); font-size: 12.5px; padding: 40px 0; }

/* ---------- misc ---------- */
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.8px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv.total { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 8px; padding-top: 12px; font-size: 14px; }
.kv.total .v { font-size: 16px; color: #fff; }
.progress { height: 6px; border-radius: 999px; background: #17222f; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3d7dff, #14c8b1); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 14px; font-size: 12.5px; color: var(--text-2); border-bottom: 2px solid transparent; text-decoration: none; }
.tab.active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }
.tab:hover { color: #fff; text-decoration: none; }
.notice { font-size: 12px; color: var(--muted); line-height: 1.65; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #63758a; font-weight: 600; margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.pos-products { max-height: 60vh; overflow-y: auto; }
.item-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #0c141d; border: 1px solid #1d2a3a; border-radius: 9px; padding: 9px 12px;
  color: var(--text); cursor: pointer; font-family: inherit; font-size: 12.8px; margin-bottom: 6px;
}
.item-pick:hover { border-color: #34527c; background: #101d2b; }
.item-pick .grow { flex: 1; min-width: 0; }
.item-pick .price { font-variant-numeric: tabular-nums; font-weight: 600; color: #9dc0ff; }
.item-pick[disabled] { opacity: .45; cursor: not-allowed; }
.cart-line { display: grid; grid-template-columns: 1fr 74px 86px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.cart-line .input { padding: 6px 8px; font-size: 12.5px; }
.cart-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 22px 0; }
.totals { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12.8px; }
.totals .row .lbl { color: var(--text-2); }
.totals .row .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals .row.grand { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; font-size: 15px; }
.totals .row.grand .val { color: #7ee7bb; font-size: 17px; font-weight: 700; }
.bom-row { display: grid; grid-template-columns: 1fr 96px 110px 74px; gap: 8px; align-items: center; margin-bottom: 8px; }
.sticky-side { position: sticky; top: 84px; }
.warn-box { background: rgba(242, 181, 60, .07); border: 1px solid rgba(242, 181, 60, .25); border-radius: 9px; padding: 10px 13px; font-size: 12.3px; color: #f0cd8a; margin-bottom: 14px; }
.info-box { background: rgba(61, 125, 255, .07); border: 1px solid rgba(61, 125, 255, .22); border-radius: 9px; padding: 10px 13px; font-size: 12.3px; color: #a9c7ff; margin-bottom: 14px; }
.pill-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; }

/* ---------- print ---------- */
.print-page { background: #fff; color: #16202b; min-height: 100vh; padding: 0; }
.print-toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center;
  padding: 12px 24px; background: #0f1722; border-bottom: 1px solid #1e2b3c; color: #e8eff9;
}
.print-toolbar .spacer { flex: 1; }
.print-sheet { max-width: 820px; margin: 26px auto; background: #fff; padding: 38px 42px; border-radius: 6px; color: #17212b; }
.print-sheet, .print-sheet * { color: #17212b; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #17212b; padding-bottom: 16px; margin-bottom: 20px; }
.doc-company strong { font-size: 17px; display: block; }
.doc-company div { font-size: 11.5px; color: #4a5b6d !important; line-height: 1.6; }
.doc-title { text-align: right; }
.doc-title h1 { font-size: 20px; letter-spacing: .08em; text-transform: uppercase; }
.doc-title .doc-code { font-family: var(--mono); font-size: 12px; color: #44566a !important; margin-top: 4px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; font-size: 12px; }
.doc-meta .box { border: 1px solid #d6dde5; border-radius: 5px; padding: 10px 12px; }
.doc-meta .box .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #6b7c8f !important; margin-bottom: 4px; }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-sheet th { background: #eef2f7; text-align: left; padding: 8px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid #c9d3de; }
.print-sheet td { padding: 8px 10px; border-bottom: 1px solid #e3e9ef; }
.print-sheet th.num, .print-sheet td.num { text-align: right; }
.doc-totals { margin-left: auto; width: 300px; margin-top: 14px; font-size: 12.5px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 5px 0; }
.doc-totals .row.grand { border-top: 2px solid #17212b; margin-top: 6px; padding-top: 9px; font-size: 15px; font-weight: 700; }
.doc-foot { margin-top: 34px; display: flex; justify-content: space-between; gap: 30px; font-size: 11px; color: #4a5b6d !important; }
.sign-box { text-align: center; width: 180px; }
.sign-line { border-top: 1px solid #17212b; margin-top: 58px; padding-top: 6px; }
.badge-print { display: inline-block; border: 1.5px solid #17212b; border-radius: 4px; padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .print-toolbar, .no-print { display: none !important; }
  .print-sheet { margin: 0; padding: 0; max-width: none; box-shadow: none; }
  .print-sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1180px) {
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .pos-grid, .grid.g-2-1, .grid.g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 11px 16px; }
  .grid.g2, .grid.g4, .grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .field, .field.s2, .field.s3, .field.s4, .field.s6, .field.s8 { grid-column: span 12; }
  .page-head h2 { font-size: 18px; }
  .stat-value { font-size: 19px; }
  .cart-line { grid-template-columns: 1fr 62px 78px 30px; }
}

/* ---------- cetak laporan (halaman aplikasi) ---------- */
@media print {
  body.app { background: #fff !important; color: #111 !important; }
  body.app .sidebar, body.app .topbar, body.app .head-actions,
  body.app .filter-bar, body.app .alert, body.app .no-print, body.app .btn { display: none !important; }
  body.app .content { padding: 0 !important; max-width: none !important; }
  body.app .card, body.app .stat {
    background: #fff !important; border: 1px solid #ccc !important;
    box-shadow: none !important; color: #111 !important; break-inside: avoid;
  }
  body.app h1, body.app h2, body.app h3, body.app .stat-value,
  body.app table.tbl tbody td, body.app .kv .v, body.app .kv .k { color: #111 !important; }
  body.app .muted, body.app .t-sub, body.app .stat-top, body.app .stat-sub,
  body.app .notice, body.app .bar-lbl, body.app .bar-val { color: #555 !important; }
  body.app table.tbl thead th { background: #eef2f7 !important; color: #333 !important; border-color: #ccc !important; }
  body.app table.tbl tbody td, body.app table.tbl tfoot td { border-color: #ddd !important; }
  body.app .badge { background: none !important; border: 1px solid #999 !important; color: #111 !important; }
  body.app .chip { background: #f3f4f6 !important; border-color: #ccc !important; color: #333 !important; }
  body.app .stat::after { display: none !important; }
  body.app .section-title { color: #333 !important; }
  body.app .progress { background: #eee !important; }
  body.app .grid.g4, body.app .grid.g3 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* topbar refinements */
.topbar h1 { font-size: 14.5px; font-weight: 600; color: #cddaea; }
.topbar .crumb { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #62748a; margin-bottom: 1px; }
.topbar .role-chip { color: #9dc0ff; border-color: #2a3f5e; background: rgba(61, 125, 255, .1); }
@media (max-width: 900px) { .hide-sm { display: none; } }

/* ---------- editor resep (BOM) ---------- */
.bom-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px 122px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.bom-row .input { padding: 7px 9px; font-size: 12.6px; }
.bom-row [data-bom="cost"] { text-align: right; color: #9dc0ff; font-variant-numeric: tabular-nums; background: #0a1119; }
@media (max-width: 700px) {
  .bom-row { grid-template-columns: minmax(0, 1fr) 92px 34px; }
  .bom-row [data-bom="cost"] { display: none; }
}

/* ---------- pratinjau invoice (Desain Invoice) ---------- */
.inv-preview-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.inv-preview-bar .input { padding: 6px 8px; font-size: 12px; }
.inv-preview-wrap {
  position: relative; width: 100%; height: 470px; overflow: hidden;
  background: #e9edf3; border: 1px solid var(--line); border-radius: 10px;
}
.inv-preview-wrap:empty::after { content: ""; }
.inv-preview-wrap iframe {
  border: 0; width: 794px; height: 1123px; transform-origin: top left;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  position: absolute; top: 0; left: 0;
}
@media (max-width: 1180px) {
  .inv-preview-wrap { height: 420px; }
}

/* peringatan hapus permanen pada dialog konfirmasi bawaan tidak bisa digaya,
   tapi tombol Nonaktifkan memakai gaya ghost yang sama agar konsisten */

/* ---------- dokumen daftar/data (cetak & simpan CSV) ---------- */
.print-sheet.wide-doc { max-width: 1120px; }
.doc-sub { font-size: 11.5px; color: #44566a !important; margin-top: 4px; }
.doc-meta-line { font-size: 10px; color: #6b7c8f !important; margin-top: 6px; }
.doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.doc-stat { flex: 1 1 150px; border: 1px solid #d6dde5; border-radius: 5px; padding: 8px 11px; }
.doc-stat .lbl { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: #6b7c8f !important; margin-bottom: 3px; }
.doc-stat .val { font-size: 14px; font-weight: 700; }
.doc-sec { margin-top: 22px; }
.doc-sec:first-of-type { margin-top: 14px; }
.doc-sec-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1px solid #c9d3de; }
.doc-sec-sub { font-size: 10.5px; color: #5b6b7d !important; margin-bottom: 8px; }
.print-sheet table.doc-table { font-size: 10.6px; }
.print-sheet table.doc-table th { font-size: 9.3px; padding: 6px 7px; }
.print-sheet table.doc-table td { padding: 5px 7px; }
.print-sheet table.doc-table tbody tr.grp td {
  background: #eef2f7; font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: .06em; color: #33475b !important;
  border-top: 1px solid #c9d3de; border-bottom: 1px solid #c9d3de;
}
.print-sheet table.doc-table tfoot td { font-weight: 700; border-top: 1.5px solid #17212b; border-bottom: 0; background: #f5f8fb; }
.print-sheet table.doc-table tbody tr { break-inside: avoid; }
.doc-sec-summary { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; font-size: 11px; }
.doc-sec-summary .item .k { color: #5b6b7d !important; }
.doc-note { margin-top: 10px; font-size: 10.3px; color: #4a5b6d !important; line-height: 1.55; }
.doc-break { break-before: page; page-break-before: always; }
.doc-sign-row { display: flex; justify-content: space-between; gap: 30px; margin-top: 46px; }
.doc-sign-row .sign-box { width: 210px; text-align: center; }
.print-toolbar { flex-wrap: wrap; }
