/* Tema navy semi-dark */
:root {
  --fg: #e4e9f2; --muted: #93a1bc; --line: #2a3a5c;
  --bg: #0f1a30; --bar: #0a1326; --card: #16233f; --head: #1d2d4f; --field: #0f1a30;
  --accent: #4c8dff; --accent-hover: #6aa1ff;
  --in: rgba(46, 160, 98, .16); --out: rgba(229, 83, 83, .16); --stock: rgba(76, 141, 255, .18);
  --warn: rgba(240, 180, 41, .16); --warn-fg: #f5c95a; --err: #ff7b7b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 22px; margin: 4px 0; color: #fff; }
h2 { font-size: 16px; margin: 0 0 10px; color: #fff; }
.sub { color: var(--muted); margin: 0 0 16px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.filters, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
input, select, button, .btn { font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--fg); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
button, .btn { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary { background: transparent; color: var(--accent); }
button.secondary:hover { background: rgba(76, 141, 255, .12); }
button:disabled { opacity: .6; cursor: wait; }
section, details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
summary { font-weight: 600; cursor: pointer; color: #fff; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--head); font-weight: 600; white-space: nowrap; color: #c9d4ea; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
.summary { max-width: 760px; }
.summary.narrow { max-width: 360px; }
.summary tbody th { font-weight: 600; }
.summary small { color: var(--muted); font-weight: 400; }
tr.in, tr.in:hover { background: var(--in); } tr.out, tr.out:hover { background: var(--out); } tr.stock, tr.stock:hover { background: var(--stock); }
tr.long, tr.long:hover { background: var(--warn); }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split .summary { flex: 1 1 360px; }
.split .summary.narrow { flex: 0 1 300px; }
h2 small { font-size: 13px; font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.scroll { overflow-x: auto; margin-top: 8px; }
.detail { font-size: 13px; }
.detail td { white-space: nowrap; }
.flash { padding: 10px 12px; border-radius: 6px; white-space: pre-wrap; font-size: 12px; border: 1px solid var(--line); }
.flash.ok { background: var(--in); } .flash.err { background: var(--out); }
.warn { background: var(--warn); color: var(--warn-fg); padding: 8px 12px; border-radius: 6px; }
.err { color: var(--err); }
.login { display: grid; place-items: center; min-height: 100vh; }
.login .card { display: grid; gap: 10px; width: 300px; background: var(--card); padding: 24px; border-radius: 10px; border: 1px solid var(--line); }

/* Cetak tetap hitam di atas putih */
@media print {
  :root { --fg: #000; --muted: #555; --line: #ccc; --head: #eef1f6; --card: #fff;
          --in: #e8f5ec; --out: #fdecec; --stock: #eaf1fd; --warn: #fff6e0; --warn-fg: #000; color-scheme: light; }
  body { background: #fff; }
  h1, h2, summary, thead th { color: #000; }
  .no-print { display: none !important; }
  details { border: 0; padding: 0; }
  details:not([open]) { display: none; }
  section { border: 0; padding: 0; }
}
