@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap');

@view-transition {
  navigation: auto;
}

:root {
  /* Warm ledger: ivory paper, ink text, four illustration colours with fixed meanings. */
  --canvas: #faf9f5;        /* page */
  --surface: #ffffff;       /* panels, inputs */
  --sunken: #f5f4ed;        /* table heads, quiet fills, hover */
  --cream: #f0eee6;         /* sidebar, secondary areas */
  --line: #e8e6dc;
  --line-strong: #d9d6c9;
  --ink: #141413;
  --ink-2: #3d3d3a;         /* body copy */
  --muted: #6b6a65;         /* secondary text, >=4.5:1 on canvas */
  --faint: #8f8d86;         /* non-essential marks only */

  --clay: #d97757;          /* brand + primary action (ink text on it) */
  --clay-hover: #cb6a4a;
  --clay-ink: #a9502f;      /* clay as text/links */
  --clay-soft: #f7e3d9;
  --coral: #ec9b7c;         /* illustration tile tone (softer than clay) */
  --sky: #6a9fe0;           /* incoming stock, info, chart line */
  --sky-ink: #2f6aae;
  --sky-soft: #e3eefa;
  --sage: #bcd1ca;          /* healthy, final, success */
  --sage-ink: #3d6a5b;
  --sage-soft: #e5efea;
  --ochre-ink: #7e5410;     /* warning */
  --ochre-soft: #f6ead2;
  --danger-ink: #a23b30;
  --danger-soft: #f8e1dc;
  --danger-line: #edc3bb;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,20,19,.04), 0 8px 24px rgba(20,20,19,.06); /* overlays only */

  /* Legacy names kept so existing rules inherit the new roles. */
  --purple: var(--clay-ink);
  --purple-dark: #8a3f23;
  --purple-soft: var(--sunken);
  --blue: var(--sky-ink);
  --green: var(--sage-ink);
  --orange: var(--clay);
  --red: var(--danger-ink);
  --panel: var(--sunken);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-thumb:active { background: var(--muted); }
*::-webkit-scrollbar-corner { background: var(--canvas); }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* overflow-x: clip, not hidden: hidden makes the shell a scroll container and breaks the sticky topbar and opname bar. */
.app-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; background: var(--canvas); overflow-x: hidden; overflow-x: clip; }
.sidebar { height: 100vh; min-height: 100vh; position: fixed; top: 0; left: 0; width: 220px; display: flex; flex-direction: column; padding: 22px 14px; background: var(--cream); color: var(--ink); border-right: 1px solid var(--line); z-index: 20; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; flex-shrink: 0; }
.brand strong { display: block; font: 500 19px/1.1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; background: var(--clay); color: var(--ink); font: 600 18px/1 var(--serif); }
.brand-mark.small { width:32px;height:32px; }
.nav-label { padding: 0 10px; margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.nav-label-spaced { margin-top: 18px; }
.sidebar nav { display: grid; gap: 2px; flex-shrink: 0; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; color: var(--ink-2); border: 1px solid transparent; border-radius: 8px; font-weight: 500; font-size: 14px; transition: background .15s, color .15s; }
.sidebar nav a span { display: grid; place-items: center; width: 20px; color: var(--muted); }
.sidebar nav a:hover { color: var(--ink); background: rgba(20,20,19,.05); }
.sidebar nav a.active { color: var(--ink); background: var(--surface); border-color: var(--line); font-weight: 600; box-shadow: 0 1px 2px rgba(20,20,19,.05); view-transition-name: active-nav; }



.sidebar nav a.active span { color: var(--clay-ink); }

/* Sidebar nav dropdown (Setting group) */
.nav-dropdown-toggle { display:flex; align-items:center; gap:10px; min-height:38px; padding:8px 10px; color:var(--ink-2); border-radius:8px; font-weight:500; font-size:14px; width:100%; border:0; background:transparent; cursor:pointer; transition:background .15s, color .15s; }
.nav-dropdown-toggle > span:first-child { display:grid; place-items:center; width:20px; color:var(--muted); }
.nav-caret { margin-left:auto; font-size:11px; opacity:.6; transition:transform .22s; }
.nav-dropdown-toggle:hover { color:var(--ink); background:rgba(20,20,19,.05); }
.nav-dropdown-toggle.active { color:var(--ink); background:rgba(20,20,19,.05); }
.nav-dropdown-toggle[aria-expanded="true"] .nav-caret { transform:rotate(180deg); }
.nav-dropdown { display:none; flex-direction:column; gap:2px; overflow:visible; }
.nav-dropdown.open { display:flex; }
.nav-dropdown a { position:relative; display:flex; align-items:center; gap:10px; min-height:36px; padding:7px 10px 7px 30px; color:var(--ink-2); border:1px solid transparent; border-radius:8px; font-weight:500; font-size:13.5px; transition:background .15s; }
.nav-dropdown a span { display:grid; place-items:center; width:18px; color:var(--muted); }
.nav-dropdown a:hover { color:var(--ink); background:rgba(20,20,19,.05); }
.nav-dropdown a.active { color:var(--ink); background:var(--surface); border-color:var(--line); font-weight:600; }
.nav-dropdown a.active span { color:var(--clay-ink); }



/* Page transitions must never block a quick second click: the snapshot layer lets clicks through, and it is short. */
::view-transition { pointer-events: none; }
::view-transition-old(root),::view-transition-new(root) { animation-duration: .12s; }
::view-transition-group(active-nav) { animation-duration: .18s; animation-timing-function: cubic-bezier(.22,1,.36,1); }
::view-transition-old(active-nav),::view-transition-new(active-nav) { animation-duration: .18s; mix-blend-mode:normal; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(active-nav),::view-transition-old(active-nav),::view-transition-new(active-nav),::view-transition-old(root),::view-transition-new(root) { animation-duration: .01ms; }
}
.sidebar-foot { margin-top: auto; display: flex; gap: 9px; align-items: center; padding: 14px 10px 4px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sidebar-foot strong,.sidebar-foot small { display:block; }
.sidebar-foot strong { font-size:12px; font-weight:600; }
.sidebar-foot small { color:var(--muted); margin-top:1px; font-size:12px; }
.online-dot { width:8px;height:8px;border-radius:50%;background:var(--sage-ink);display:inline-block; }

.main-area { grid-column: 2; min-width:0; background:var(--canvas); }
.topbar { position:sticky; top:0; z-index:15; height:68px; display:flex; align-items:center; justify-content:space-between; gap:24px; padding:0 32px; background:rgba(250,249,245,.94); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
.topbar-search { position:relative; width:min(520px,44vw); min-width:0; }
.topbar-search input { height:40px; width:100%; min-width:0; padding:9px 80px 9px 38px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); transition:border-color .15s, box-shadow .15s; }
.topbar-search input:focus { border-color:var(--clay); box-shadow:0 0 0 3px rgba(217,119,87,.16); outline:none; }
.search-icon { position:absolute; left:12px; top:11px; z-index:1; display:grid; color:var(--muted); pointer-events:none; }
.gs-shortcut { position:absolute; right:12px; top:10px; z-index:1; padding:2px 6px; border:1px solid var(--line); border-radius:5px; background:var(--sunken); color:var(--muted); font-size:11px; font-weight:600; pointer-events:none; }
.gs-clear { display:none; position:absolute; right:11px; top:7px; z-index:2; width:28px; height:28px; border:0; border-radius:50%; background:transparent; color:var(--muted); cursor:pointer; }
.gs-clear.show { display:grid; place-items:center; }
.gs-clear:hover { background:var(--purple-soft); color:var(--purple); }
.topbar-search.has-value .gs-shortcut { display:none; }
.global-search-dropdown { display:none; position:absolute; top:50px; left:0; width:min(590px,calc(100vw - 32px)); max-height:min(560px,72vh); overflow-y:auto; background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:0 22px 55px rgba(20,20,19,.17); z-index:200; flex-direction:column; padding:8px; }
.global-search-dropdown.show { display:flex; animation:gs-in .13s ease-out; }
@keyframes gs-in { from{opacity:0;transform:translateY(-5px)} to{opacity:1;transform:translateY(0)} }
.gs-group + .gs-group { margin-top:6px; padding-top:6px; border-top:1px solid var(--line); }
.gs-group-title { display:flex; align-items:center; justify-content:space-between; padding:6px 10px 4px; color:var(--muted); font-size:11px; font-weight:600; }
.gs-group-title span { min-width:20px; height:18px; display:grid; place-items:center; border-radius:999px; background:var(--sunken); font-size:11px; letter-spacing:0; }
.global-search-item { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:54px; padding:9px 11px; border-radius:10px; text-decoration:none; color:var(--ink); border:1px solid transparent; }
.global-search-item:hover, .global-search-item.active { background:var(--sunken); border-color:var(--line); }
.gs-info { display:flex; flex-direction:column; gap:3px; min-width:0; }
.gs-title { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gs-meta { font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gs-highlight { padding:0 1px; border-radius:2px; background:var(--ochre-soft); color:inherit; }
.gs-badge { font-size:11px; font-weight:600; color:var(--ink-2); background:var(--sunken); padding:3px 7px; border-radius:6px; white-space:nowrap; align-self:center; }
.gs-badge[data-kind="Pembelian"] { color:var(--sky-ink); background:var(--sky-soft); }
.gs-badge[data-kind="Penjualan"] { color:var(--clay-ink); background:var(--clay-soft); }
.gs-badge[data-kind="Lapisan Lot"] { color:var(--ink-2); background:var(--sunken); }
.gs-badge[data-kind="Stock Opname"] { color:var(--ochre-ink); background:var(--ochre-soft); }
.gs-badge[data-kind="Distribusi"] { color:var(--clay-ink); background:var(--clay-soft); }
.gs-empty { padding:24px 14px; font-size:12px; color:var(--muted); text-align:center; }
.gs-footer { padding:8px 10px 3px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; text-align:right; }
.topbar-actions { display:flex; align-items:center; gap:11px; }
.topbar-actions form { margin:0; }
.quick-add-dropdown { position:relative; }
.add-button { border-radius:999px!important; min-height:36px!important; }
.add-menu { display:none; position:absolute; top:42px; right:0; width:180px; padding:7px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); z-index:50; }
.add-menu a { display:block; padding:9px 10px; border-radius:8px; font-size:11px; }
.add-menu a:hover { background:var(--purple-soft); color:var(--purple); }
.quick-add-dropdown:hover .add-menu { display:block; }
.branch-switcher select,.branch-chip { width:auto; min-height:36px; border:1px solid var(--line); border-radius:8px; padding:7px 11px; background:var(--surface); color:var(--ink); font-size:13px; }
.branch-chip { display:flex;align-items:center;gap:8px; }
.user-profile-badge { display:flex;align-items:center;gap:8px; }
.sidebar nav a.nav-mobile-only { display:none; }
.duplicate-hint { display:block; margin-top:6px; color:var(--danger-ink); font-size:12px; font-weight:600; line-height:1.4; }
.duplicate-hint.is-warning { color:var(--ochre-ink); }
.stack-form label .duplicate-hint { color:var(--danger-ink); font-weight:600; }  /* over .stack-form label small */
.stack-form label .duplicate-hint.is-warning { color:var(--ochre-ink); }
.field-row:has(.duplicate-hint:not([hidden])) { align-items:start; }  /* a hint must not stretch the field beside it */
.field-invalid { border-color:var(--danger-ink) !important; box-shadow:0 0 0 3px var(--danger-soft) !important; }
.contact-delete-form { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); }
.opname-cancel { margin-top:24px; padding:20px 24px; }
.opname-cancel h3 { margin:4px 0 6px; }
@media (max-width:800px) { .sidebar nav a.nav-mobile-only { display:flex; } }
.avatar { display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--clay-soft);color:var(--clay-ink);font-weight:700; }
.user-meta strong,.user-meta small { display:block; }
.user-meta strong { font-size:13px; font-weight:600; }
.user-meta small { color:var(--muted);font-size:12px;margin-top:1px; }
.icon-button,.menu-button { border:0;background:transparent;color:var(--muted);width:32px;height:32px;border-radius:8px; }
.icon-button:hover,.menu-button:hover { background:var(--sunken);color:var(--purple); }

.logout-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(107,106,101, 0.3);
  background: transparent;
  color: var(--ink-2);
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
}
.logout-button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.logout-button:hover {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger-ink);
}
.logout-button:hover svg {
  color: var(--danger-ink);
}

.lot-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
}
.lot-link:hover { color: var(--purple-dark); }

.modal-dialog.lot-modal { max-width: 720px; width: calc(100% - 32px); }
.journey-panel { margin:20px 0; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--sunken); }
.journey-panel-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.journey-panel-head strong { font-size:14px; color:var(--ink); }
.journey-list { display:grid; gap:10px; }
.journey-node { padding:12px 14px; border:1px solid var(--line); border-radius:9px; background:var(--surface); }
.journey-node.is-current { border-color:var(--purple); }
.journey-node-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.journey-code { display:block; color:var(--muted); font-size:11px; margin:5px 0 10px; overflow-wrap:anywhere; }
.journey-numbers { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.journey-numbers span { display:block; color:var(--muted); font-size:12px; }
.journey-numbers strong { font-size:15px; }
.journey-node > small { display:block; margin-top:7px; }
.journey-flows { margin-top:14px; border-top:1px solid var(--line); padding-top:10px; }
.journey-flow { display:flex; gap:10px; padding:6px 0; }
.journey-arrow { color:var(--purple); font-weight:700; }
.journey-flow small { display:block; margin-top:3px; }
@media (max-width:520px) { .journey-numbers { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.lot-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
.lot-summary-cards > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
}
.lot-summary-cards span { display: block; font-size: 11px; color: var(--muted); }
.lot-summary-cards strong { font-size: 18px; }
.lot-summary-cards small { display: block; margin-top: 4px; font-size:12px; }
.row-highlight { background: var(--ochre-soft) !important; animation: row-flash 1.6s ease-out; }
@keyframes row-flash { from { background: var(--ochre-soft) !important; } to { background: var(--ochre-soft) !important; } }
.status.warn { background: var(--ochre-soft); color: var(--ochre-ink); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.menu-button { display:none; }
.content { max-width: 100%; margin: 0; padding: 32px 40px; }

.page-heading { display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:24px; }
.page-heading h1 { margin:2px 0 6px;font:500 clamp(28px,3vw,36px)/1.15 var(--serif);letter-spacing:-.015em;color:var(--ink); }
.page-heading p:not(.eyebrow) { margin:0;max-width:680px;color:var(--muted);font-size:15px; }
.eyebrow,.section-kicker { margin:0;color:var(--muted);font-size:12px;font-weight:600;letter-spacing:0; }
.heading-actions { display:flex;align-items:center;gap:8px; }
.button { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:8px 16px;white-space:nowrap;border:1px solid transparent;border-radius:8px;font-weight:600;font-size:13.5px;line-height:1.2;transition:background .15s,border-color .15s,color .15s; }
.button:hover { transform:none; }
.button.primary { background:var(--clay);color:var(--ink); }
.button.primary:hover { background:var(--clay-hover); }
.button.secondary { background:var(--surface);border-color:var(--line-strong);color:var(--ink); }.button.secondary:hover { background:var(--sunken); }
.button.cyan { background:var(--surface);color:var(--ink);border-color:var(--line-strong); }
.button.ghost { background:transparent;color:var(--ink);border-color:var(--line-strong); }
.button.wide { width:100%; }
.button:disabled { cursor:not-allowed;opacity:.5; }
.mt-10 { margin-top:10px; }.mt-24 { margin-top:24px!important; }.mt-32 { margin-top:32px!important; }

/* Inventory: operational summary */
.kpi-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:24px; }
.kpi-card { min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:18px;box-shadow:none; }
.kpi-label { margin:0 0 8px;color:var(--ink-2);font-size:11px;font-weight:600; }
.kpi-body { display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap; }
.kpi-body strong { min-width:0;font:500 18px var(--serif);color:var(--ink);letter-spacing:-.01em;overflow-wrap:anywhere; }
.kpi-card:first-child .kpi-body strong { font-size:22px; }
.kpi-sub { margin:8px 0 0;color:var(--muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere; }
.chip-trend { font-size:12px;font-weight:700;color:var(--purple);background:var(--purple-soft);padding:3px 8px;border-radius:999px; }
.text-muted { color:var(--muted); }

/* Accordion Tables */
.lot-accordion { border-top:1px solid var(--line); }
.lot-group { border-bottom:1px solid var(--line); }
.lot-summary { display:flex;justify-content:space-between;align-items:center;padding:16px 20px;cursor:pointer;list-style:none;background:var(--surface);transition:.15s; }
.lot-summary::-webkit-details-marker { display:none; }
.lot-summary:hover { background:var(--sunken); }
.lot-summary-left { display:flex;align-items:center;gap:14px; }
.accordion-arrow { font-size:12px;color:var(--muted);transition:transform .2s;transform:rotate(-90deg); }
.lot-group[open] .accordion-arrow { transform:rotate(0); }
.lot-summary-left strong { display:block;font-size:14px;color:var(--ink); }
.lot-summary-left small { display:block;margin-top:2px;font-size:12px; }
.lot-summary-right { display:flex;align-items:center;gap:12px; }
.badge-qty { font-weight:700;font-size:12px;color:var(--purple); }
.badge-lots { font-size:12px;font-weight:600;color:var(--muted);background:var(--canvas);padding:4px 10px;border-radius:999px; }
.lot-table-wrap { background:var(--sunken);padding:0 20px 20px 45px; }
.nested-table { background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:hidden;box-shadow:none; }
.nested-table th { background:var(--sunken);font-size:11px;padding:10px 14px; }
.nested-table td { padding:10px 14px; }
.nested-table tr:last-child td { border-bottom:none; }

.audit-table th { background:var(--canvas); color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; padding:12px 18px; text-align:left; border-bottom:1px solid var(--line); }
.audit-table td { padding:14px 18px; border-bottom:1px solid var(--line); vertical-align:top; }
.audit-table tr:hover td { background:var(--sunken); }
.audit-time { width:110px; }
.audit-time strong { display:block; font-size:12px; }
.audit-time span { display:block; margin-top:2px; font-size:11px; color:var(--muted); }
.audit-user { display:flex; align-items:center; gap:10px; }
.audit-avatar { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:var(--purple-soft); color:var(--purple); font-size:11px; font-weight:800; }
.audit-user strong { font-size:13px; font-weight:600; }
.audit-action { display:inline-block; font-size:11px; font-weight:700; color:var(--blue); background:rgba(47,106,174,.1); padding:4px 10px; border-radius:999px; text-transform:capitalize; }
.audit-object { display:flex; flex-direction:column; gap:2px; }
.audit-object strong { font-size:13px; font-weight:600; }
.audit-object span { font-size:11px; color:var(--muted); font-family:monospace; }
.audit-detail details { font-size:12px; }
.audit-detail summary { cursor:pointer; color:var(--purple); font-weight:600; font-size:12px; outline:none; }
.audit-detail pre { margin:8px 0 0; padding:10px; background:var(--canvas); border-radius:8px; font-size:11px; color:var(--muted); white-space:pre-wrap; font-family:monospace; }
.badge-opname { display:inline-block;margin-left:8px;font-size:11px;font-weight:700;color:var(--sage-ink);background:var(--sage-soft);padding:2px 8px;border-radius:999px;vertical-align:middle; }
.opname-link { font-weight:700;color:var(--purple);text-decoration:none; }
.opname-link:hover { text-decoration:underline; }
.opname-trace { margin-bottom:6px; }
.opname-trace:last-child { margin-bottom:0; }
.opname-trace small { display:block;margin-top:2px; }
.fifo-trace-item { margin-bottom:8px; }
.fifo-trace-item:last-child { margin-bottom:0; }
.fifo-trace-item a { font-weight:700;color:var(--purple);text-decoration:none; }
.fifo-trace-item a:hover { text-decoration:underline; }
.fifo-trace-item small { display:block;margin-top:2px;color:var(--muted); }

/* Warehouse operations dashboard (clean, purposeful, anti-slop) */
.warehouse-heading { display:flex;justify-content:space-between;align-items:flex-end;gap:20px;padding-bottom:20px;border-bottom:1px solid var(--line);margin-bottom:24px; }
.warehouse-location { margin:0 0 6px;font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase; }
.warehouse-location span { color:var(--faint);margin:0 4px; }
.warehouse-heading h1 { margin:0 0 4px;font:500 clamp(24px,2.5vw,32px) var(--serif);letter-spacing:-.01em;color:var(--ink); }
.warehouse-heading p:not(.warehouse-location) { margin:0;color:var(--muted);font-size:13px; }
.warehouse-summary { display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:20px; }
.warehouse-summary-item { background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px 20px;display:flex;flex-direction:column; }
.warehouse-summary-item span { font-size:12px;font-weight:600;color:var(--muted);margin-bottom:8px; }
.warehouse-summary-item strong { font:500 28px/1 var(--serif);color:var(--ink);letter-spacing:-.01em; }
.warehouse-summary-item small { font-size:11px;color:var(--muted);margin-top:8px; }
.warehouse-movements { background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:20px;overflow:hidden; }
.warehouse-movement-list { list-style:none;margin:0;padding:0; }
.warehouse-movement-row { display:flex;align-items:flex-start;gap:14px;padding:14px 20px;border-bottom:1px solid var(--line); }
.warehouse-movement-row:last-child { border-bottom:0; }
.warehouse-movement-direction { display:grid;place-items:center;width:30px;height:30px;flex:0 0 auto;border-radius:8px;font-weight:800; }
.warehouse-movement-direction.in { background:var(--sky-soft);color:var(--sky-ink); }
.warehouse-movement-direction.out { background:var(--clay-soft);color:var(--clay-ink); }
.warehouse-movement-main { min-width:0;flex:1; }
.warehouse-movement-main strong { display:block;font-size:13px;color:var(--ink); }
.warehouse-movement-main small { display:block;color:var(--muted);font-size:11px;margin:2px 0 8px; }
.warehouse-movement-summary { display:block;font-size:12px;color:var(--ink-2); }
.warehouse-movement-row .button { flex:0 0 auto;align-self:flex-start;margin-left:auto; }
.warehouse-detail-meta { display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:16px;padding:12px 14px;background:var(--panel);border-radius:8px; }
.warehouse-detail-meta small { display:block;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em; }
.warehouse-detail-meta strong { display:block;margin-top:2px;font-size:13px;color:var(--ink); }
.warehouse-opname { margin-bottom:20px; }
.warehouse-opname .panel-head h2 { margin:0;font:500 15px var(--serif);letter-spacing:-.02em; }
.warehouse-opname-active { padding:18px 20px; }
.warehouse-opname-progress { height:8px;background:var(--sunken);border-radius:999px;overflow:hidden;margin-bottom:14px; }
.warehouse-opname-bar { height:100%;background:var(--sage-ink);border-radius:999px;transition:width .3s ease; }
.warehouse-opname-info { display:flex;justify-content:space-between;align-items:center;gap:16px; }
.warehouse-opname-info strong { font-size:14px;font-weight:700;color:var(--ink); }
.warehouse-opname-info p { margin:4px 0 0;font-size:12px;color:var(--muted); }
.warehouse-opname-idle { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px; }
.warehouse-opname-idle strong { font-size:14px;font-weight:700;color:var(--ink); }
.warehouse-opname-idle p { margin:4px 0 0;font-size:12px;color:var(--muted); }
.warehouse-columns { display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:20px; }
.warehouse-column { background:var(--surface);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;overflow:hidden; }
.warehouse-column-head { display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--sunken); }
.warehouse-column-head h2 { margin:0;font:500 15px var(--serif);letter-spacing:-.02em;color:var(--ink); }
.warehouse-column-head a { color:var(--purple);font-size:12px;font-weight:700;text-decoration:none; }
.warehouse-column-head p { margin:0;font-size:12px;color:var(--muted); }
.warehouse-critical-list { list-style:none;margin:0;padding:0; }
.warehouse-critical-list li { border-bottom:1px solid var(--line); }
.warehouse-critical-list li:last-child { border-bottom:0; }
.warehouse-critical-row { display:flex;align-items:center;gap:14px;padding:14px 20px;text-decoration:none;color:inherit;transition:background .15s ease; }
.warehouse-critical-row:hover { background:var(--sunken); }
.warehouse-critical-qty { display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:52px;height:42px;background:var(--danger-soft);border-radius:8px;color:var(--red);font-weight:800;font-size:14px; }
.warehouse-critical-qty small { font-size:11px;font-weight:700;text-transform:uppercase;margin-top:-2px; }
.warehouse-critical-main { flex:1;min-width:0; }
.warehouse-critical-main strong { display:block;font-size:13px;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.warehouse-critical-main small { display:block;color:var(--muted);font-size:12px;margin-top:2px; }
.warehouse-critical-go { color:var(--muted);font-weight:700;font-size:14px; }
.warehouse-activity-list { list-style:none;margin:0;padding:0;max-height:480px;overflow-y:auto; }
.warehouse-activity-item { display:flex;align-items:flex-start;gap:12px;padding:12px 20px;border-bottom:1px solid var(--line); }
.warehouse-activity-item:last-child { border-bottom:0; }
.warehouse-activity-marker { width:8px;height:8px;border-radius:50%;margin-top:6px;flex-shrink:0; }
.warehouse-activity-marker.in { background:var(--sky); }
.warehouse-activity-marker.out { background:var(--clay); }
.warehouse-activity-marker.pending { background:var(--ochre-ink); }
.warehouse-activity-marker.neutral { background:var(--faint); }
.warehouse-activity-item > div { flex:1;min-width:0; }
.warehouse-activity-title { margin:0;font-size:13px;font-weight:700;color:var(--ink); }
.warehouse-activity-meta { margin:2px 0;font-size:12px;color:var(--muted); }
.warehouse-activity-item time { font-size:11px;color:var(--muted);display:block; }
.warehouse-activity-item > a { font-size:11px;font-weight:700;color:var(--purple);align-self:center;text-decoration:none;margin-left:8px; }
.warehouse-other { background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-top:20px;overflow:hidden; }
.warehouse-other-list { list-style:none;margin:0;padding:0; }
.warehouse-other-row { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 20px;border-bottom:1px solid var(--line); }
.warehouse-other-row:last-child { border-bottom:0; }
.warehouse-other-row strong { font-size:14px;font-weight:700;color:var(--ink); }
.warehouse-other-row small { display:block;font-size:12px;color:var(--muted);margin-top:2px; }
.warehouse-other-row form { margin:0; }
.warehouse-empty { padding:32px 20px;text-align:center;color:var(--muted);font-size:13px; }
.warehouse-activity-count { color:var(--muted);font-size:11px;font-weight:600; }
@media (max-width:850px) {
  .warehouse-heading { flex-direction:column;align-items:stretch;gap:12px; }
  .warehouse-summary { grid-template-columns:1fr; }
  .warehouse-columns { grid-template-columns:1fr; }
  .warehouse-other-row { flex-direction:column;align-items:stretch;gap:10px; }
  .warehouse-movement-row { flex-wrap:wrap; }
  .warehouse-movement-row .button { width:100%; }
  .warehouse-opname-idle,.warehouse-opname-info { align-items:flex-start;flex-direction:column; }
}

/* Dashboard */
.dashboard-root { display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:30px; }
.dashboard-main { min-width:0; }
.dashboard-side { min-width:0; }
.section-header { display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px; }
.section-header h2 { margin:0;font:500 22px/1.2 var(--serif);letter-spacing:-.01em; }
.date-filter { padding:5px 11px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--muted);font-size:12px; }
.metric-grid-clean { display:grid;grid-template-columns:repeat(2,1fr);gap:14px; }
.metric-card-clean { min-height:105px;padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:none; }
.m-label { color:var(--muted);font-size:13px;font-weight:600; }
.m-val-row { display:flex;align-items:center;gap:12px;margin-top:10px; }
.m-val-row strong { min-width:0;max-width:100%;font:500 25px var(--serif);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.m-trend { display:grid;place-items:center;width:19px;height:19px;border-radius:50%;font-size:11px;font-weight:800; }
.m-trend.positive { background:var(--sage-soft);color:var(--green)!important; }.m-trend.negative { background:var(--danger-soft);color:var(--red)!important; }
.chart-tabs { display:flex;gap:16px;color:var(--muted);font-size:12px; }
.chart-tabs button { padding:0 0 5px;border:0;border-bottom:2px solid transparent;background:none;color:inherit;font:inherit;cursor:pointer; }.chart-tabs button:hover { color:var(--ink); }.chart-tabs .active { color:var(--ink);border-bottom-color:var(--clay);font-weight:600; }
.chart-panel { min-height:260px;padding:22px 24px;background:var(--surface);border:1px solid var(--line);border-radius:14px; }
.chart-header { display:flex;justify-content:space-between;align-items:flex-start; }
.c-legend { display:flex;gap:16px;color:var(--muted);font-size:12px; }
.c-legend span:before { content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--sky);margin-right:6px; }
.c-legend span+span:before { background:var(--clay); }
.c-val strong { font:500 32px var(--serif); letter-spacing:-.01em; color:var(--ink); }
.chart-graphic { position:relative;margin-top:24px;padding-bottom:22px; }
.area-chart { display:block;width:100%;height:100%;max-height:215px;overflow:visible; }
.chart-grid line { stroke:var(--sunken);stroke-width:1;stroke-dasharray:4 4; }
.area-fill { fill:url(#stockArea); }
.area-line { fill:none;stroke:var(--sky);stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.chart-points circle { fill:transparent; stroke:none; }
.chart-cursor { stroke:var(--sky);stroke-width:1.5;pointer-events:none; }
.chart-tooltip { position:absolute;top:-6px;transform:translateX(-50%);padding:6px 12px;background:var(--ink);border-radius:8px;font-size:12px;color:var(--canvas);white-space:nowrap;font-weight:500;pointer-events:none; }
.chart-tooltip b { font-weight:800; }
.chart-axis { display:flex;justify-content:space-between;padding-top:10px;margin-top:4px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;font-weight:500; }
.opname-clean-panel { min-height:160px;display:flex;align-items:center;gap:40px;padding:22px 34px;background:var(--surface);border:1px solid var(--line);border-radius:14px; }
.donut-clean { --progress:0;width:112px;height:112px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--sage-ink) calc(var(--progress)*1%),var(--sunken) 0);position:relative; }
.donut-clean:after { content:"";position:absolute;inset:14px;border-radius:50%;background:var(--surface); }.donut-clean span { z-index:1;font:500 20px var(--serif); }
.op-right { flex:1;display:grid;gap:13px; }.op-stat { display:flex;align-items:center;gap:11px; }.op-dot { width:9px;height:9px;border-radius:50%;background:var(--sage-ink); }.op-dot.cyan { background:var(--clay); }.op-dot.navy { background:var(--line-strong); }.op-stat div { flex:1;display:flex;justify-content:space-between; }.op-stat b { font-size:13px;font-weight:600; }.op-stat em { font-style:normal;color:var(--muted);font-size:13px; }
.side-header { min-height:24px; }.view-all { color:var(--clay-ink);font-size:12px;font-weight:600; }
.quick-links { padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius); }
.ql-card { display:flex;align-items:center;gap:13px;padding:9px;border-radius:9px;transition:.15s; }.ql-card:hover { background:var(--surface);box-shadow:none; }.ql-icon { display:grid;place-items:center;width:35px;height:35px;flex:0 0 auto;border-radius:9px;color:var(--ink);font-size:15px; }.ql-card span { color:var(--ink-2);font-size:13.5px;font-weight:600; }
.team-list { padding:8px;background:var(--sunken);border-radius:13px; }.team-item { display:flex;align-items:center;gap:10px;padding:9px;border-bottom:1px solid var(--line); }.team-item:last-child { border-bottom:0; }.t-avatar { display:grid;place-items:center;width:34px;height:34px;flex:0 0 auto;border-radius:8px;background:var(--sunken);color:var(--purple);font-weight:800; }.t-info { min-width:0;flex:1; }.t-info strong,.t-info span { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }.t-info strong { font-size:12px; }.t-info span { color:var(--muted);font-size:11px;margin-top:3px; }.t-action { width:27px;height:27px;border:0;border-radius:8px;background:var(--surface);color:var(--purple);font-weight:800; }.empty-clean { padding:25px;text-align:center;color:var(--muted);font-size:12px; }

/* Shared content */
.hero-card,.report-hero { position:relative;overflow:hidden;min-height:150px;display:flex;align-items:center;justify-content:space-between;padding:26px 30px;border-radius:var(--radius);color:var(--ink);background:var(--cream);border:1px solid var(--line); }
.hero-card h2,.report-hero h2 { margin:6px 0;font:500 25px var(--serif); }.hero-card p,.report-hero p { margin:0;max-width:650px;color:var(--muted); }.hero-kicker { color:var(--muted);font-size:12px;font-weight:600; }.hero-actions { display:flex;gap:8px;margin-top:18px; }.hero-watermark { display:none; }
.metric-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:16px 0; }.metric-grid.three { grid-template-columns:repeat(3,1fr); }.metric-card { min-width:0;padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:none; }.metric-card span,.metric-card small { display:block;color:var(--muted); }.metric-card span { font-size:12.5px;font-weight:600; }.metric-card strong { display:block;margin:8px 0 3px;font:500 21px var(--serif);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }.metric-card small { font-size:12px; }.metric-card.dark { color:var(--ink);background:var(--cream);border-color:var(--line); }.metric-card.dark span,.metric-card.dark small { color:var(--muted); }.negative { color:var(--red)!important; }.positive { color:var(--green)!important; }
.dashboard-grid { display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px; }.panel { background:var(--surface);border:1px solid var(--line);border-radius:var(--radius); }.panel-head { min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 20px;border-bottom:1px solid var(--line); }.panel-head h3,.form-panel h3,.review-panel h3 { margin:2px 0 0;font:500 18px/1.25 var(--serif);letter-spacing:-.01em;color:var(--ink); }.panel-head a { color:var(--clay-ink);font-size:13px;font-weight:600; }
.table-wrap { overflow-x:auto; }table { width:100%;border-collapse:collapse; }th,td { padding:14px 18px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle; }th { color:var(--muted);background:var(--sunken);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap; }td { color:var(--ink-2);font-size:14px;line-height:1.5; }td strong { color:var(--ink);font-size:14px;font-weight:600; }tr:last-child td { border-bottom:0; }tr:hover td { background:var(--canvas); }.num { text-align:right;font-variant-numeric:tabular-nums; }.empty { padding:36px;text-align:center;color:var(--muted); }.status { display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap; }.status.ok { background:var(--sage-soft);color:var(--sage-ink); }.status.warning { background:var(--ochre-soft);color:var(--ochre-ink); }.status.muted { background:var(--sunken);color:var(--muted); }.status.large { padding:6px 13px;font-size:13px; }
.split-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(330px,390px);gap:16px;align-items:start; }.grow { min-width:0; }.form-panel { position:sticky;top:18px;padding:22px; }.form-panel>h3 { margin-bottom:18px; }.stack-form { display:grid;gap:14px; }label { display:grid;gap:6px;color:var(--ink-2);font-size:13px;font-weight:600; }input,select,textarea { width:100%;min-height:40px;padding:9px 11px;border:1px solid var(--line-strong);border-radius:8px;color:var(--ink);background:var(--surface);transition:border-color .15s,box-shadow .15s; }textarea { resize:vertical; }input:focus,select:focus,textarea:focus { border-color:var(--clay);box-shadow:0 0 0 3px rgba(217,119,87,.16);outline:0; }.field-row { display:grid;grid-template-columns:1fr 1fr;gap:10px; }.line-items { display:grid;gap:10px; }.line-item { padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--sunken);display:grid;gap:10px; }.line-item:not(:first-child) { position:relative;padding-top:34px; }.remove-line { position:absolute;top:7px;right:7px;border:0;background:transparent;color:var(--red);font-size:12px; }.text-button { justify-self:start;border:0;background:transparent;color:var(--clay-ink);font-weight:600;font-size:13px;padding:0; }.form-note { display:grid;gap:3px;padding:12px 14px;background:var(--sunken);border:1px solid var(--line);border-radius:8px;color:var(--ink-2); }.form-note b { font-size:13px;color:var(--ink); }.form-note span { font-size:12.5px;line-height:1.5; }.form-note.cyan-note { background:var(--sky-soft);border-color:transparent;color:var(--ink-2); }.search-form { display:flex;gap:7px; }.search-form input { min-width:220px; }.count-input { width:100px;min-height:35px;text-align:right; }input.count-input[type="number"]::-webkit-inner-spin-button,
input.count-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: auto;
  opacity: 1;
}
input.count-input[type="number"] {
  -moz-appearance: auto;
}
.opname-group-row td { padding:12px 16px 8px;background:var(--sunken);border-top:1px solid var(--line-strong); }
.opname-group-row:first-child td { border-top:0; }
.opname-group-row strong,.opname-group-row small { display:block; }
.opname-group-row small { margin-top:2px; }
.opname-lot-row td { padding-top:9px;padding-bottom:9px; }
.lot-product-spacer { width:24px;background:linear-gradient(90deg,var(--sunken) 3px,transparent 3px); }
.table-actions { display:flex;justify-content:flex-end;padding:16px 18px;border-top:1px solid var(--line); }.review-panel { display:flex;justify-content:space-between;gap:28px;align-items:center;margin-top:16px;padding:22px;border:1px solid var(--line);border-radius:var(--radius);background:var(--cream); }.review-panel p { color:var(--muted);margin:6px 0 0; }.finalize-form { min-width:min(520px,50%);display:grid;grid-template-columns:1fr auto;gap:9px;align-items:end; }.finalize-form small { grid-column:1/-1;color:var(--clay-ink); }

/* Product picker: single autocomplete */
.product-field { display: grid; gap: 6px; }
.product-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-field-head label { margin: 0; }
.product-field-head a { font-size:12px; color: var(--clay-ink); font-weight: 600; white-space: nowrap; }
.product-filter-status { color: var(--muted); font-size: 12px; min-height: 16px; }

.autocomplete { position: relative; width: 100%; }
.autocomplete > input[type="text"] { padding-right: 40px; }
.autocomplete-clear { position:absolute;top:50%;right:10px;z-index:2;display:none;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:7px;background:var(--sunken);color:var(--muted);font-size:17px;line-height:1;cursor:pointer;transform:translateY(-50%); }
.autocomplete.has-value .autocomplete-clear { display:grid; }
.autocomplete-clear:hover { background:var(--danger-soft);color:var(--red); }
.autocomplete-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(32, 34, 52, 0.12);
  z-index: 100;
  display: none;
  flex-direction: column;
}
.autocomplete-options.show { display: flex; }
.autocomplete-options button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  border-radius: 0;
  transition: background 0.15s;
}
.autocomplete-options button:last-child { border-bottom: none; }
.autocomplete-options button:hover,
.autocomplete-options button:focus,
.autocomplete-options button.active {
  background: var(--purple-soft);
  outline: none;
}
.autocomplete-options button strong { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.autocomplete-options button span { font-size: 12.5px; color: var(--ink-2); }

.fifo-layer-preview { grid-column: 1 / -1; margin-top: -2px; padding: 9px 10px; background: var(--sunken); border-radius: 8px; border: 1px solid var(--line); }
.fifo-preview-title { font-size:12px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.fifo-preview-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fifo-preview-item { min-width: 0; background:var(--surface); padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); }
.fifo-preview-item-top { display: flex; justify-content: space-between; gap: 8px; font-size:11px; margin-bottom: 4px; }
.fifo-preview-code { overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: var(--purple); font-family: monospace; }
.fifo-preview-qty { flex: 0 0 auto; font-weight: 600; color: var(--ink); }
.fifo-preview-date { display: block; font-size:11px; color: var(--muted); margin-bottom: 5px; }
.fifo-preview-bar { height: 3px; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.fifo-preview-fill { height: 100%; background: var(--sky); border-radius: 999px; transition: width 0.3s ease; }
@media (max-width: 520px) {
  .fifo-preview-list { grid-template-columns: minmax(0, 1fr); }
}

/* Modal */
.modal-dialog { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 60px rgba(20,20,19,.18); max-width: 500px; width: 100%; margin: auto; color: var(--ink); }
.modal-dialog.wide-modal { max-width: min(1040px, calc(100% - 32px)) !important; width: min(1040px, calc(100% - 32px)) !important; }
.modal-dialog.transaction-modal { max-width: none; }
.modal-dialog::backdrop { background: rgba(20,20,19,.38); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font: 500 20px/1.2 var(--serif); letter-spacing: -.01em; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; }
.modal-close:hover { background: var(--sunken); color: var(--red); }
.modal-body { padding: 24px; max-height: 80vh; overflow-y: auto; }
.modal-body .stack-form { gap: 16px; }
.opname-modal { max-width: 560px; }
.opname-modal .field-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.opname-modal label { align-content: start; }
.opname-modal input { min-height: 44px; }
.opname-modal label small { min-height: 30px; margin-top: 2px; line-height: 1.45; }
.opname-modal textarea { min-height: 82px; }
.opname-modal .form-note { padding: 13px 14px; }
.opname-modal .button.wide { min-height: 44px; }
.field-hint { margin: 0 0 4px; font-size:12px; color: var(--muted); line-height: 1.45; }

/* Transaction modal — larger, more readable typography */
.transaction-modal .modal-header h3 { font-size: 18px; }
.transaction-modal .modal-body label { font-size: 11px; gap: 6px; }
.transaction-modal .modal-body input,
.transaction-modal .modal-body select,
.transaction-modal .modal-body textarea { font-size: 13px; min-height: 42px; }
.transaction-modal .modal-body small,
.transaction-modal .product-filter-status,
.transaction-modal .field-hint { font-size:12px; line-height: 1.45; }
.transaction-modal .product-field-head a { font-size: 11px; }
.transaction-modal .text-button { font-size: 11px; }
.transaction-modal .form-note b { font-size: 11px; }
.transaction-modal .form-note span { font-size:12px; }
.transaction-modal .autocomplete-options button { font-size: 13px; padding: 10px 14px; }
.transaction-modal .autocomplete-options button strong { font-size: 12px; }
.transaction-modal .autocomplete-options button span { font-size: 11px; }
.transaction-modal .fifo-preview-title { font-size:12px; }
.transaction-modal .fifo-preview-item-top { font-size:12px; }
.transaction-modal .button.wide { font-size: 12px; min-height: 42px; }

/* Contacts module */
.contacts-page { position:relative; z-index:10; max-width:1180px; margin:0 auto; }
.contacts-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:28px; margin-bottom:22px; }
.contacts-heading h1 { margin:4px 0 7px; font:500 clamp(27px,3vw,36px)/1.08 var(--serif); letter-spacing:-.01em; }
.contacts-heading p:not(.eyebrow) { max-width:660px; margin:0; color:var(--muted); line-height:1.55; }
.contacts-add { min-height:44px; padding-inline:18px; white-space:nowrap; }
.contacts-add span { margin-right:7px; font-size:18px; line-height:1; }
.contacts-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.contact-metric { display:flex; align-items:center; gap:14px; min-width:0; padding:17px 18px; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:none; }
.contact-metric small,.contact-metric strong { display:block; }
.contact-metric small { color:var(--muted); font-size:12px; font-weight:700; }
.contact-metric strong { margin-top:3px; font:500 23px var(--serif); letter-spacing:-.01em; }
.contacts-directory { overflow:hidden; }
.contacts-toolbar { display:flex; align-items:center; justify-content:space-between; gap:22px; min-height:84px; padding:17px 20px; border-bottom:1px solid var(--line); }
.contacts-toolbar h2 { margin:4px 0 2px; font:500 17px var(--serif); letter-spacing:-.025em; }
.contacts-toolbar p { margin:0; color:var(--muted); font-size:12px; }
.contacts-search { position:relative; display:block; width:min(350px,42%); }
.contacts-search > span[aria-hidden] { position:absolute; left:14px; top:50%; z-index:1; color:var(--muted); font-size:18px; transform:translateY(-52%); pointer-events:none; }
.contacts-search input { width:100%; min-height:42px; padding:9px 14px 9px 40px; border:1px solid var(--line-strong); border-radius:10px; background:var(--sunken); color:var(--ink); }
.contacts-search input:focus { outline:0; border-color:rgba(217,119,87,.5); background:var(--surface); box-shadow:0 0 0 3px rgba(217,119,87,.09); }
.contacts-table th { padding-block:12px; font-size:11px; }
.contacts-table td { padding-block:14px; }
.contact-identity { display:flex; align-items:center; gap:11px; min-width:190px; }
.contact-identity > span { display:grid; place-items:center; width:34px; height:34px; flex:0 0 auto; border-radius:10px; background:var(--purple-soft); color:var(--purple); font-weight:800; }
.contact-identity strong,.contact-identity small,.contact-detail span,.contact-detail small { display:block; }
.contact-identity small,.contact-detail small { margin-top:2px; color:var(--muted); font-size:12px; }
.contact-kind { display:inline-flex; align-items:center; padding:5px 9px; border-radius:999px; font-size:11px; font-weight:800; }
.contact-kind.supplier { background:var(--sky-soft); color:var(--sky-ink); }
.contact-kind.customer { background:var(--clay-soft); color:var(--clay-ink); }
.contact-detail { min-width:150px; }
.contact-detail span { color:var(--ink-2); font-size:12px; }
.terms-value { font-variant-numeric:tabular-nums; }
.contacts-empty-row:hover td { background:var(--surface); }
.contacts-empty { display:grid; justify-items:center; max-width:420px; margin:0 auto; padding:40px 20px 44px; text-align:center; }
.contacts-empty > span { display:grid; place-items:center; width:48px; height:48px; margin-bottom:13px; border-radius:14px; background:var(--purple-soft); color:var(--purple); font-size:23px; }
.contacts-empty h3 { margin:0 0 5px; font:500 15px var(--serif); }
.contacts-empty p { margin:0 0 16px; color:var(--muted); font-size:11px; line-height:1.55; }
.contact-dialog { width:min(680px,calc(100% - 32px)); }
.contact-dialog .modal-header { align-items:flex-start; }
.contact-dialog .modal-header h3 { margin-top:4px; }
.contact-form-intro { margin:0 0 18px; color:var(--muted); font-size:11px; line-height:1.55; }
.contact-form label > small { float:right; margin:1px 0 0; color:var(--faint); font-size:11px; font-weight:500; }
.contact-form textarea { resize:vertical; min-height:82px; }
.contact-active-toggle { display:flex!important; align-items:center; gap:11px; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--sunken); }
.contact-active-toggle input { width:17px; height:17px; min-height:0; flex:0 0 auto; accent-color:var(--purple); }
.contact-active-toggle span,.contact-active-toggle strong,.contact-active-toggle small { display:block; }
.contact-active-toggle strong { font-size:11px; }
.contact-active-toggle small { float:none!important; margin-top:2px!important; font-size:11px!important; }
.contact-form-actions { display:flex; justify-content:flex-end; gap:9px; padding-top:3px; }
.contact-form-actions .button { min-width:115px; }
@media (max-width:900px) {
  .contacts-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .contacts-heading { align-items:stretch; flex-direction:column; gap:16px; margin-bottom:18px; }
  .contacts-heading h1 { font-size:28px; }
  .contacts-heading p:not(.eyebrow) { font-size:13px; }
  .contacts-add { width:100%; }
  .contacts-summary { gap:9px; }
  .contact-metric { gap:10px; padding:13px; }
  .contact-metric strong { font-size:20px; }
  .contacts-toolbar { align-items:stretch; flex-direction:column; gap:14px; padding:16px; }
  .contacts-search { width:100%; }
  .contacts-table-wrap { overflow:visible; }
  .contacts-table { min-width:0!important; }
  .contacts-table thead { display:none; }
  .contacts-table tbody,.contacts-table tr,.contacts-table td { display:block; }
  .contacts-table tr:not(.contacts-empty-row) { position:relative; padding:15px 16px; border-bottom:1px solid var(--line); }
  .contacts-table tr:not(.contacts-empty-row):last-child { border-bottom:0; }
  .contacts-table tr:not(.contacts-empty-row) td { padding:4px 0; border:0; }
  .contacts-table tr:not(.contacts-empty-row) td:nth-child(2) { position:absolute; top:17px; right:16px; }
  .contacts-table tr:not(.contacts-empty-row) td:nth-child(3) { padding-top:10px; }
  .contacts-table tr:not(.contacts-empty-row) td:nth-child(4),.contacts-table tr:not(.contacts-empty-row) td:nth-child(5),.contacts-table tr:not(.contacts-empty-row) td:nth-child(6) { display:inline-flex; align-items:center; margin:8px 12px 0 0; }
  .contacts-table tr:not(.contacts-empty-row) td:nth-child(4):before { content:"Termin "; margin-right:4px; color:var(--muted); font-size:12px; }
  .contacts-table tr:not(.contacts-empty-row) td:nth-child(6):before { content:"Transaksi "; margin-right:5px; color:var(--muted); font-size:12px; }
  .contact-identity { padding-right:90px; min-width:0; }
  .contact-detail { min-width:0; }
  .contacts-empty { padding:34px 18px; }
  .contact-form-actions { flex-direction:column-reverse; }
  .contact-form-actions .button { width:100%; }
}

/* User management */
.user-role-guide { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px; }
.user-role-guide article { display:flex;align-items:center;gap:12px;padding:15px 17px;border:1px solid var(--line);border-radius:13px;background:var(--surface); }
.user-role-guide p { margin:0;color:var(--muted);font-size:12px;line-height:1.5; }
.role-badge { display:inline-flex;align-items:center;justify-content:center;min-width:76px;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em; }
.role-badge.owner { background:var(--sunken);color:var(--ink-2); }
.role-badge.supervisor { background:var(--sky-soft);color:var(--sky-ink); }
.role-badge.operator { background:var(--sage-soft);color:var(--sage-ink); }
.managed-user { display:flex;align-items:center;gap:10px; }
.managed-user small { display:block;margin-top:3px;color:var(--muted);font-size:12px; }
.managed-avatar { display:grid;place-items:center;width:34px;height:34px;flex:0 0 auto;border-radius:10px;background:var(--purple-soft);color:var(--purple);font-weight:800; }
.branch-list { display:flex;flex-wrap:wrap;gap:5px; }
.branch-list span { padding:4px 7px;border:1px solid var(--line);border-radius:6px;background:var(--sunken);color:var(--ink-2);font-size:11px;white-space:nowrap; }
.button.compact { min-height:30px;padding:5px 10px;font-size:12px; }
.user-modal { max-width:680px; }
.branch-fieldset { margin:0;padding:12px;border:1px solid var(--line-strong);border-radius:10px; }
.branch-fieldset legend { padding:0 6px;color:var(--ink-2);font-size:12px;font-weight:700; }
.branch-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.branch-options label,.active-toggle { display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--sunken); }
.branch-options input,.active-toggle input { width:16px;height:16px;min-height:0;flex:0 0 auto;accent-color:var(--purple); }
.active-toggle span,.active-toggle small { display:block; }
.active-toggle small { margin-top:3px;color:var(--muted);font-size:11px;font-weight:400; }
@media (max-width: 700px) {
  .modal-dialog.transaction-modal,.modal-dialog.user-modal { width: calc(100% - 24px); }
  .transaction-modal .line-item { grid-template-columns: 1fr; }
  .user-role-guide { grid-template-columns:1fr; }
  .branch-options { grid-template-columns:1fr; }
}

.report-hero { min-height:140px;margin-bottom:14px;padding:24px; }.report-hero h2 { font-size:19px; }.report-hero a { display:inline-block;color:var(--clay-ink);margin-top:12px;font-size:12px;font-weight:750; }.report-icon { display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--surface);color:var(--purple); }.report-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px; }.report-grid article { min-height:145px;padding:18px;border:1px solid var(--line);border-radius:13px;background:var(--surface); }.report-grid article>span { display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--purple-soft);color:var(--purple);font-size:11px;font-weight:850; }.report-grid h3 { margin:14px 0 7px;font-size:13px; }.report-grid p { min-height:35px;margin:0;color:var(--muted);font-size:11px;line-height:1.55; }.report-grid a { display:inline-block;margin-top:12px;color:var(--purple);font-size:11px;font-weight:750; }.flash { margin:0 0 16px;padding:12px 14px;border-radius:8px;border:1px solid;font-size:14px;font-weight:500; }.flash.success { background:var(--sage-soft);border-color:var(--sage);color:var(--sage-ink); }.flash.error { background:var(--danger-soft);border-color:var(--danger-line);color:var(--danger-ink); }.flash.warning { background:var(--ochre-soft);border-color:color-mix(in srgb,var(--ochre-ink) 28%,transparent);color:var(--ochre-ink); }.flash.warning a { color:inherit;font-weight:650;white-space:nowrap; }code { font:12px/1.4 ui-monospace,Consolas,monospace;color:var(--ink-2);white-space:normal; }

/* Maintenance — tab bar */
.maintenance-tabs { display:flex; gap:6px; width:fit-content; max-width:100%; padding:4px; margin-bottom:18px; border-radius:12px; background:var(--sunken); overflow-x:auto; scrollbar-width:none; }
.maintenance-tabs::-webkit-scrollbar { display:none; }
.maintenance-tab { display:inline-flex; align-items:center; gap:7px; flex:0 0 auto; padding:9px 16px; border:none; border-radius:9px; background:transparent; color:var(--ink-2); font-size:13px; font-weight:700; white-space:nowrap; cursor:pointer; transition:.15s; }
.maintenance-tab:hover { background:var(--surface); }
.maintenance-tab.active { background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(20,20,19,.08); }
.maintenance-tab .tab-icon { font-size:14px; line-height:1; }
.maintenance-panels { min-width:0; }
.maintenance-panel { display:none; }
.maintenance-panel.active { display:block; }
#panel-numbering.active { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(260px,.75fr); gap:16px; align-items:start; }
#panel-numbering.active .panel { padding:22px; }
.token-panel h3 { margin:5px 0 18px; }
.token-list { display:grid;grid-template-columns:max-content 1fr;gap:10px 14px;align-items:center; }
.token-list code { padding:5px 8px;border-radius:7px;background:var(--purple-soft);color:var(--purple);font-weight:750; }
.token-list span { color:var(--muted);font-size:11px;line-height:1.45; }
.stack-form label small { display:block;margin-top:6px;color:var(--muted);font-size:12px; }
.stack-form input[readonly], .stack-form select:disabled { color:var(--ink-2);background:var(--sunken);cursor:not-allowed; }
.maintenance-notif { margin-top:0; }
@media (max-width:800px) { #panel-numbering.active { grid-template-columns:1fr; } }

.mobile-nav { display:none; }

@media (max-width:1050px){.app-shell{grid-template-columns:190px minmax(0,1fr)}.sidebar{width:190px}.content{padding:24px}.dashboard-root{grid-template-columns:1fr}.dashboard-side{display:grid;grid-template-columns:1fr 1fr;gap:16px}.side-header.mt-32{margin-top:0!important}.metric-grid{grid-template-columns:repeat(2,1fr)}.report-grid{grid-template-columns:repeat(2,1fr)}.user-meta{display:none}}
@media (max-width:800px){body{padding-bottom:69px}.app-shell{display:block;width:100%;margin:0;border-radius:0;min-height:100vh}.sidebar{position:fixed;left:-250px;top:0;width:220px;height:100vh;min-height:0;border-radius:0;transition:left .2s;box-shadow:16px 0 40px rgba(20,20,19,.2)}.sidebar.open{left:0}.topbar{height:64px;padding:0 15px;gap:10px}.menu-button{display:inline-grid;place-items:center}.topbar-search{flex:1;width:auto}.topbar-actions .quick-add-dropdown,.topbar-actions .user-profile-badge,.topbar-actions .icon-button,.topbar-actions .logout-button{display:none}.branch-switcher select,.branch-chip{max-width:135px}.content{padding:22px 15px}.page-heading{align-items:stretch;flex-direction:column}.dashboard-side{grid-template-columns:1fr}.metric-grid-clean{grid-template-columns:1fr 1fr}.dashboard-grid,.split-layout{grid-template-columns:1fr}.form-panel{position:static}.review-panel{align-items:stretch;flex-direction:column}.finalize-form{min-width:0;grid-template-columns:1fr}.mobile-nav{position:fixed;z-index:30;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,1fr);height:68px;border-top:1px solid var(--line);background:rgba(255,255,255,.96);backdrop-filter:blur(16px)}.mobile-nav a{display:grid;place-items:center;align-content:center;gap:2px;color:var(--muted);font-size:11px;font-weight:700}.mobile-nav a span{color:var(--purple);font-size:16px}}
@media (max-width:520px){.metric-grid-clean,.metric-grid,.metric-grid.three,.kpi-grid{grid-template-columns:1fr 1fr}.metric-card-clean{min-height:92px;padding:15px}.m-val-row strong{font-size:19px}.opname-clean-panel{padding:20px;gap:20px;flex-direction:column}.op-right{width:100%}.field-row{grid-template-columns:1fr}.report-grid{grid-template-columns:1fr}.search-form{flex-direction:column;width:100%}.search-form input{min-width:0}.topbar-search input{font-size:12px}.table-filter-input{width:100%}}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}

/* Real-time table filter and pagination */
.table-filter-wrap { position:relative;display:inline-block;min-width:190px;max-width:300px; }
.table-filter-wrap .table-filter-input { width:100%;max-width:none;padding-right:36px; }
.table-filter-clear { position:absolute;top:50%;right:8px;z-index:2;display:none;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:var(--sunken);color:var(--muted);font-size:15px;line-height:1;cursor:pointer;transform:translateY(-50%); }
.table-filter-wrap.has-value .table-filter-clear { display:grid; }
.table-filter-clear:hover { background:var(--danger-soft);color:var(--red); }
.table-filter-input { min-width:190px;max-width:300px;min-height:36px;padding:7px 11px;border:1px solid var(--line-strong);border-radius:8px;font-size:12px;color:var(--ink);background:var(--surface);transition:.18s; }
.table-filter-input:focus { border-color:var(--clay);box-shadow:0 0 0 3px rgba(217,119,87,.1);outline:0; }
.table-filter-input::placeholder { color:var(--faint); }
.table-pagination { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;border-top:1px solid var(--line);background:var(--sunken);color:var(--muted);font-size:11px; }
.pagination-controls { display:flex;align-items:center;gap:10px; }
.pagination-controls button { display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--purple);font-size:18px;cursor:pointer; }
.pagination-controls button:hover:not(:disabled) { border-color:var(--line-strong);background:var(--sunken); }
.pagination-controls button:disabled { color:var(--faint);background:var(--sunken);cursor:not-allowed; }
.no-filter-match td { padding:32px;text-align:center;color:var(--muted); }

/* Expandable transaction rows */
.detail-toggle-column { width:52px; }
.row-detail-toggle { display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface);color:var(--purple); }
.row-detail-toggle:hover { border-color:var(--line-strong);background:var(--purple-soft); }
.row-detail-toggle span { display:block;font-size:21px;line-height:1;transition:transform .18s ease; }
.row-detail-toggle[aria-expanded="true"] span { transform:rotate(90deg); }
.transaction-row.expanded td { background:var(--sunken);border-bottom-color:transparent; }
.transaction-detail-row[hidden] { display:none; }
.transaction-detail-row > td { padding:0 18px 16px 52px;background:var(--sunken); }
.transaction-detail-row:hover > td { background:var(--sunken); }
.transaction-detail { padding:14px;border:1px solid var(--line);border-radius:11px;background:var(--surface);box-shadow:none; }
.transaction-detail-head { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px; }
.transaction-detail-head strong { font:500 13px var(--serif); }
.transaction-detail-head span { padding:4px 9px;border-radius:999px;background:var(--purple-soft);color:var(--purple);font-size:12px;font-weight:700; }
.detail-table-wrap { overflow-x:auto;border:1px solid var(--line);border-radius:8px; }
.detail-table th { padding:9px 12px;background:var(--sunken);font-size:11px; }
.detail-table td { padding:10px 12px;font-size:12px; }
.detail-table td strong { font-size:12px; }
.lot-allocation-list { display:grid;gap:4px;margin:0;padding:0;list-style:none; }
.lot-allocation-list li { display:flex;align-items:center;gap:8px;white-space:nowrap; }
.lot-allocation-list code { padding:2px 7px;border-radius:6px;background:var(--purple-soft);color:var(--purple);font-weight:700; }
.lot-allocation-list span { color:var(--ink-2); }
.transaction-note { margin:11px 2px 0;color:var(--muted);font-size:11px; }
.transaction-note strong { color:var(--ink); }

/* Audit log */
.audit-table { table-layout:fixed; }
.audit-table th:nth-child(1) { width:130px; }.audit-table th:nth-child(2) { width:190px; }.audit-table th:nth-child(3) { width:170px; }.audit-table th:nth-child(4) { width:145px; }
.audit-table td { padding-top:15px;padding-bottom:15px; }
.audit-time strong,.audit-time span,.audit-object strong,.audit-object span { display:block; }
.audit-time strong,.audit-object strong { color:var(--ink);font-size:12px; }.audit-time span,.audit-object span { margin-top:3px;color:var(--muted);font-size:12px; }
.audit-user { display:flex;align-items:center;gap:9px; }.audit-avatar { display:grid;place-items:center;width:32px;height:32px;flex:0 0 auto;border-radius:9px;background:var(--sunken);color:var(--purple);font-size:11px;font-weight:800; }.audit-user strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.audit-action { display:inline-flex;padding:5px 9px;border-radius:7px;background:var(--sunken);color:var(--ink-2);font-size:12px;font-weight:750;text-transform:capitalize; }
.audit-detail details { max-width:100%; }.audit-detail summary { color:var(--purple);font-size:11.5px;font-weight:700;cursor:pointer;list-style:none; }.audit-detail summary::-webkit-details-marker { display:none; }.audit-detail pre { max-width:100%;max-height:150px;margin:8px 0 0;padding:10px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--sunken);color:var(--ink-2);font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;word-break:break-word; }
@media (max-width:700px){.table-pagination{align-items:flex-start;flex-direction:column}.pagination-controls{width:100%;justify-content:space-between}.audit-table{min-width:760px}}

/* Mobile-only layout: desktop geometry and navigation stay unchanged. */
.mobile-menu-close, .mobile-menu-backdrop { display:none; }
@media (max-width:800px) {
  body { padding-bottom:calc(112px + env(safe-area-inset-bottom, 0px)); }

  .mobile-nav { left:14px; right:14px; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); height:76px; padding:0 8px; gap:4px; border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:0 8px 28px rgba(20,20,19,.10); backdrop-filter:none; align-items:flex-end; }
  .mobile-nav a, .mobile-nav button { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:0; height:100%; padding:8px 4px 10px; border:0; background:transparent; color:var(--muted); font-size:11px; font-weight:600; z-index:2; transition:color .2s; }
  .mobile-nav svg { width:23px; height:23px; flex-shrink:0; stroke-width:1.9; }
  .mobile-nav a span, .mobile-nav button span { color:inherit; font-size:12px; line-height:1.2; }
  .mobile-nav .active { color:var(--clay-ink); font-weight:700; }
  .mobile-nav .active::before { content:""; position:absolute; inset:6px 4px 4px; background:var(--clay-soft); border-radius:14px; z-index:-1; }
  .mobile-nav :focus-visible { outline-color:var(--purple); outline-offset:0; }
  .sidebar { z-index:60; height:100dvh; overflow-x:hidden; overflow-y:auto; padding-bottom:calc(20px + env(safe-area-inset-bottom, 0px)); }
  .mobile-menu-open { overflow:hidden; }
  .mobile-menu-backdrop:not([hidden]) { display:block; position:fixed; inset:0; z-index:55; border:0; background:rgba(20,20,19,.4); }
  .mobile-menu-close { display:grid; place-items:center; align-self:flex-end; flex-shrink:0; width:44px; height:44px; margin:-12px -4px 0 0; border:0; border-radius:10px; background:transparent; color:var(--ink-2); font-size:28px; }
  .sidebar nav a, .nav-dropdown-toggle, .nav-dropdown a { min-height:44px; }
  .sidebar-foot { margin-top:24px; flex-shrink:0; }
  .topbar { height:auto; min-height:64px; flex-wrap:wrap; padding:10px 12px; gap:8px; }
  .menu-button { width:44px; height:44px; flex-shrink:0; }
  .topbar-search { min-width:0; flex:1 1 auto; }
  .topbar-search input { min-height:44px; font-size:16px; padding-right:44px; }
  .gs-shortcut { display:none; }
  .topbar-actions { gap:6px; min-width:0; flex-shrink:0; }
  .topbar-actions .icon-button { display:inline-grid; place-items:center; width:44px; height:44px; }
  .topbar-actions .logout-button { display:flex; width:auto; min-width:92px; height:44px; padding:0 13px; flex-shrink:0; white-space:nowrap; }
  .branch-switcher select, .branch-chip { min-height:44px; max-width:125px; }
  .branch-chip { overflow:hidden; overflow-wrap:anywhere; }
  .global-search-dropdown { top:calc(100% + 6px); width:min(400px,calc(100vw - 24px)); left:auto; right:0; max-height:50dvh; }
  .global-search-item { min-height:44px; }
  .content { padding:22px 15px; }
  .page-heading > *, .panel-head > *, .heading-actions > *, .field-row > *, .line-item > *, .stack-form > *, .maintenance-grid > * { min-width:0; }
  .page-heading h1, .page-heading p, .modal-header h3, .flash, .transaction-note { overflow-wrap:anywhere; }
  .heading-actions, .hero-actions { flex-wrap:wrap; }
  .panel-head { flex-wrap:wrap; align-items:flex-start; gap:12px; padding:16px; }
  .panel-head .heading-actions { width:100%; }
  .table-filter-input { width:100%; min-width:0; max-width:none; }
  .panel-head > .table-filter-input { flex-basis:100%; }
  .search-form { min-width:0; max-width:100%; }
  .search-form input { min-width:0; }
  .button, .pagination-controls button, .row-detail-toggle, .text-button, .remove-line, .modal-close, .t-action { min-height:44px; }
  .pagination-controls button, .row-detail-toggle, .modal-close, .t-action { min-width:44px; }
  input, select, textarea, .table-filter-input { font-size:16px; min-height:44px; min-width:0; max-width:100%; }
  .count-input { width:100px; }
  .table-wrap, .detail-table-wrap { max-width:100%; overscroll-behavior-x:contain; }
  .table-wrap > table { min-width:560px; }
  .table-wrap > .audit-table { min-width:760px; }
  .detail-table { min-width:520px; }
  .table-actions { flex-wrap:wrap; }
  .lot-summary { flex-wrap:wrap; gap:12px; padding:16px; }
  .lot-summary-left { min-width:0; flex:1 1 180px; }
  .lot-summary-left strong, .lot-summary-left small { overflow-wrap:anywhere; }
  .lot-summary-right { flex-wrap:wrap; gap:8px; }
  .lot-table-wrap { padding:0 12px 16px; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kpi-card { min-width:0; padding:15px; }
  .kpi-body { flex-wrap:wrap; }
  .kpi-body strong { font-size:20px; overflow-wrap:anywhere; }
  .metric-grid, .metric-grid.three, .metric-grid-clean { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric-card strong, .m-val-row strong { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
  .m-val-row { flex-wrap:wrap; gap:6px; }
  .section-header, .chart-header, .transaction-detail-head { flex-wrap:wrap; gap:12px; }
  .chart-panel { padding:18px 16px; }
  .c-val { min-width:0; max-width:100%; }
  .c-val strong { font-size:24px; overflow-wrap:anywhere; }
  .chart-tabs { gap:12px; }
  .chart-tooltip { max-width:100%; white-space:normal; }
  .hero-card, .report-hero { padding:22px; }
  .modal-dialog, .modal-dialog.transaction-modal, .modal-dialog.user-modal { width:calc(100% - 24px); max-height:calc(100dvh - 24px); overflow:hidden; }
  .modal-dialog[open] { display:flex; flex-direction:column; }
  .modal-header { padding:14px 16px; gap:12px; flex-shrink:0; }
  .modal-close { flex-shrink:0; }
  .modal-body { padding:18px 16px; max-height:none; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
  .opname-modal .field-row { grid-template-columns:minmax(0,1fr); gap:12px; }
  .opname-modal label small { min-height: 0; }
.opname-modal .field-hint { margin: 0 0 2px; }
  .report-filter-form { grid-template-columns:minmax(0,1fr); gap:12px; }
  .transaction-modal .line-item { grid-template-columns:minmax(0,1fr); }
  .transaction-modal .line-item:not(:first-child) { padding-top:58px; padding-right:12px; }
  .autocomplete-options button { min-height:44px; overflow-wrap:anywhere; }
  .branch-fieldset { min-width:0; }
  .branch-options label { overflow-wrap:anywhere; }
  .token-list { grid-template-columns:minmax(0,1fr); gap:6px; }
  .token-list code { justify-self:start; max-width:100%; overflow-wrap:anywhere; }
  .token-list span { margin-bottom:8px; }
  .maintenance-grid .panel { padding:18px; }

}
@media (max-width:520px) {
  .topbar-search { flex-basis:calc(100% - 60px); }
  .topbar-actions { width:100%; justify-content:space-between; padding-left:52px; gap:8px; }
  .branch-switcher { flex:1 1 auto; min-width:0; }
  .branch-switcher select, .branch-chip { max-width:100%; }
  .topbar-actions .logout-button { flex-shrink:0; }
  .global-search-dropdown { width:calc(100vw - 24px); }
  .field-row { grid-template-columns:minmax(0,1fr); }
  .product-field-head { flex-wrap:wrap; }
  .heading-actions .button { flex:1 1 130px; }
  .search-form { width:100%; }



}

.report-filter-panel { margin-bottom:16px; }
.report-filter-panel .panel-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.report-filter-form { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; padding:4px 0 6px; }
.report-filter-form label { display:grid; gap:7px; color:var(--muted); font-size:12px; font-weight:650; min-width:160px; flex:1; }
.report-filter-form label[hidden] { display:none !important; }
.report-filter-form select, .report-filter-form input { width:100%; height:44px; padding:0 12px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:10px; font-size:14px; }
.report-filter-form .button { height:44px; white-space:nowrap; padding:0 24px; }
.report-filter-panel .field-hint { margin:8px 0 0; color:var(--muted); font-size:12px; }
@media (max-width:600px) {
  .report-filter-form { flex-direction:column; align-items:stretch; }
  .report-filter-form .button { width:100%; }
}

.logistics-summary-panel { margin-bottom:16px; }
.logistics-filter-panel, .report-period-panel { padding:12px 16px; }
.logistics-filter-form, .report-period-form { display:flex; flex-direction:column; align-items:stretch; gap:10px; }
.period-horizontal-wrap { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.period-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.period-pills-bar { display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
/* Period chips size to their text; the generic .report-filter-form label rule (min-width 160px, flex:1) must not stretch them. */
.period-pill, .report-filter-form .period-pill { position:relative; display:inline-flex; flex:0 0 auto; min-width:0; gap:0; align-items:center; justify-content:center; min-height:30px; padding:4px 12px; border:1px solid transparent; border-radius:9999px; background:transparent; color:var(--ink-2); font-size:12.5px; font-weight:600; cursor:pointer; transition:background .15s ease, color .15s ease; user-select:none; }
.period-pill input[type="radio"] { position:absolute; opacity:0; pointer-events:none; width:0; height:0; margin:0; }
.period-pill:hover { background:var(--sunken); color:var(--ink); }
.period-pill.active, .period-pill:has(input:checked) { background:var(--clay-soft); border-color:var(--clay-soft); color:var(--clay-ink); }
.period-pill:has(input:focus-visible) { outline:2px solid var(--clay-ink); outline-offset:1px; }
.period-custom-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; padding-top:8px; border-top:1px dashed var(--line); }
.period-custom-row[hidden] { display:none !important; }
.report-filter-form .period-custom-field { flex:0 0 auto; min-width:150px; }
.report-filter-form .period-custom-row .button { height:36px; padding:0 14px; }
.period-custom-field { display:flex; flex-direction:column; gap:4px; font-size:11px; font-weight:650; color:var(--muted); min-width:150px; }
.period-custom-field input[type="date"] { height:36px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:13px; color:var(--ink); }
.period-custom-field input[type="date"]:focus { border-color:var(--purple); outline:2px solid rgba(217,119,87,.18); }
.logistics-detail-panel { margin-bottom:24px; overflow:hidden; }
.logistics-tabs { display:flex; gap:4px; overflow-x:auto; padding:12px 16px 0; border-bottom:1px solid var(--line); scrollbar-width:thin; }
.logistics-tab { flex:0 0 auto; padding:12px 14px; border:0; border-bottom:3px solid transparent; background:transparent; color:var(--muted); font:inherit; font-size:13px; font-weight:650; cursor:pointer; white-space:nowrap; }
.logistics-tab:hover { color:var(--ink); background:var(--sunken); }
.logistics-tab.active { color:var(--ink); border-bottom-color:var(--clay); }
.logistics-tab:focus-visible { outline:2px solid var(--purple); outline-offset:-2px; }
.logistics-tab-content { padding:18px 16px; }
.logistics-tab-content[hidden] { display:none; }
.logistics-table-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:14px; }
.logistics-table-heading h3 { margin:0 0 4px; }
.logistics-table-heading .table-filter-input { max-width:300px; }
.logistics-opname-state { margin-top:16px; }
.logistics-empty-state { margin:16px 0 0; padding:20px; border:1px dashed var(--line); border-radius:12px; color:var(--muted); }
@media (max-width:600px) {
  .logistics-tabs { padding:8px 12px 0; }
  .logistics-tab-content { padding:16px 12px; }
  .logistics-table-heading .table-filter-input { width:100%; max-width:none; }
}

/* Operational control center */
.report-page-heading { align-items:center; }
.operations-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.operation-kpi { display:flex; gap:12px; align-items:flex-start; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:none; }
.operation-kpi small { display:block; color:var(--muted); font-size:12.5px; font-weight:600; }
.operation-kpi strong { display:block; margin:6px 0 4px; font-size:22px; letter-spacing:-.02em; }
.operation-kpi p { margin:0; color:var(--muted); font-size:12px; }
.operation-kpi.attention strong { color:var(--red); }
.operation-kpi.emphasis { border-color:var(--line-strong); background:var(--cream); }
.transaction-grid-full { display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:16px; }
.report-control-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:16px; margin-bottom:16px; }
.report-control-grid.lower { align-items:start; }
.report-attention-panel .panel-head, .opname-report-panel .panel-head { align-items:center; }
.attention-list { display:flex; flex-direction:column; }
.attention-item { display:flex; align-items:center; gap:12px; padding:12px 20px; border-top:1px solid var(--line); text-decoration:none; color:inherit; }
.attention-item:first-child { border-top:0; }
.attention-item:hover { background:var(--danger-soft); }
.attention-rank { display:grid; place-items:center; width:28px; height:28px; flex:0 0 auto; border-radius:50%; background:var(--danger-soft); color:var(--red); font-size:12px; font-weight:800; }
.attention-item div { min-width:0; }
.attention-item strong { display:block; font-size:13px; }
.attention-item small { display:block; color:var(--muted); font-size:11px; }
.attention-stock { margin-left:auto; text-align:right; }
.attention-stock strong { color:var(--red); font-size:16px; }
.report-good-state { display:flex; gap:12px; align-items:center; padding:22px; color:var(--ink); }
.report-good-state span { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:var(--sage-soft); color:var(--sage-ink); font-size:18px; font-weight:800; }
.report-good-state p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.opname-report-body { display:flex; gap:18px; align-items:center; padding:20px; }
.report-progress { --progress:0; display:grid; place-items:center; width:104px; height:104px; flex:0 0 auto; border-radius:50%; background:conic-gradient(var(--sage-ink) calc(var(--progress)*1%), var(--sunken) 0); }
.report-progress strong { display:grid; place-items:center; width:78px; height:78px; border-radius:50%; background:var(--surface); font-size:18px; }
.opname-report-copy h4 { margin:8px 0 4px; font-size:15px; }
.opname-report-copy p { margin:0 0 10px; color:var(--muted); font-size:12px; }
.opname-difference { display:flex; align-items:baseline; gap:8px; margin-bottom:12px; }
.opname-difference small { color:var(--muted); font-size:11px; }
.opname-difference strong { font-size:18px; }
.report-flow-panel { margin-bottom:16px; }
.flow-legend { display:flex; gap:8px; font-size:11px; font-weight:700; }
.flow-legend .in { color:var(--sky-ink); background:var(--sky-soft); padding:5px 10px; border-radius:999px; }
.flow-legend .out { color:var(--clay-ink); background:var(--clay-soft); padding:5px 10px; border-radius:999px; }
.transaction-columns { display:grid; grid-template-columns:1fr 1fr; gap:0; }
.transaction-columns > div + div { border-left:1px solid var(--line); }
.transaction-column-head { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--line); }
.transaction-column-head strong { font-size:13px; }
.transaction-column-head a { color:var(--purple); font-size:11px; font-weight:700; }
.report-transaction-row { display:flex; align-items:center; gap:12px; padding:12px 20px; border-bottom:1px solid var(--sunken); text-decoration:none; color:inherit; }
.report-transaction-row:last-child { border-bottom:0; }
.report-transaction-row:hover { background:var(--sunken); }
.report-transaction-row div { min-width:0; flex:1; }
.report-transaction-row strong { display:block; font-size:12px; }
.report-transaction-row small { display:block; color:var(--muted); font-size:11px; }
.report-transaction-row > span:last-child { font-size:12px; font-weight:800; white-space:nowrap; }
.movement-symbol { display:grid; place-items:center; width:30px; height:30px; flex:0 0 auto; border-radius:9px; font-weight:800; }
.movement-symbol.in { background:var(--sky-soft); color:var(--sky-ink); }
.movement-symbol.out { background:var(--clay-soft); color:var(--clay-ink); }
.report-stock-table td strong { font-size:13px; }
.activity-panel .activity-list { display:flex; flex-direction:column; max-height:520px; overflow:auto; }
.activity-item { display:flex; gap:12px; padding:12px 20px; border-top:1px solid var(--sunken); }
.activity-item:first-child { border-top:0; }
.activity-dot { width:9px; height:9px; margin-top:6px; flex:0 0 auto; border-radius:50%; background:var(--purple); }
.activity-item strong { display:block; font-size:12px; }
.activity-item p { margin:2px 0; color:var(--muted); font-size:11px; }
.activity-item small { color:var(--muted); font-size:12px; }
.report-export-strip { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--cream); }
.report-export-strip > div { display:flex; gap:12px; align-items:center; min-width:0; }
.report-export-strip p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.report-export-icon { display:grid; place-items:center; width:40px; height:40px; flex:0 0 auto; border-radius:12px; background:var(--surface); color:var(--purple); font-size:18px; font-weight:800; }
.empty.compact { padding:18px; font-size:12px; }
@media (max-width:1050px) {
  .operations-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-control-grid { grid-template-columns:1fr; }
  .transaction-columns { grid-template-columns:1fr; }
  .transaction-columns > div + div { border-left:0; border-top:1px solid var(--line); }
}
@media (max-width:600px) {
  .operations-kpi-grid { grid-template-columns:1fr; }
  .report-export-strip { flex-direction:column; align-items:stretch; }
}

/* Notifications */
.notif-page { max-width:1180px; margin:0 auto; }
.notif-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.notif-metric { display:flex; align-items:center; gap:12px; min-width:0; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:none; }
.notif-metric.danger strong { color:var(--red); }
.notif-metric.warning strong { color:var(--clay-ink); }
.notif-metric small,.notif-metric strong { display:block; }
.notif-metric small { color:var(--muted); font-size:12px; font-weight:700; line-height:1.3; }
.notif-metric strong { margin-top:3px; font:500 23px var(--serif); letter-spacing:-.01em; }
.notif-settings { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:20px 22px; margin-bottom:16px; }
.notif-settings h3 { margin:4px 0 4px; font:500 16px var(--serif); letter-spacing:-.02em; }
.notif-settings p { margin:0; max-width:420px; color:var(--muted); font-size:12px; line-height:1.5; }
.notif-days-form { display:flex; align-items:flex-end; flex-wrap:wrap; justify-content:flex-end; gap:12px; }
.notif-presets { display:flex; gap:6px; padding:4px; border-radius:11px; background:var(--sunken); }
.notif-presets a,
.notif-presets button { padding:8px 12px; border:none; border-radius:8px; background:transparent; color:var(--ink-2); font-size:12px; font-weight:700; white-space:nowrap; cursor:pointer; }
.notif-presets a:hover,
.notif-presets button:hover { background:var(--surface); }
.notif-presets a.active,
.notif-presets button.active { background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(20,20,19,.08); }
.maintenance-notif { margin-top:18px; }
.notif-custom { gap:5px; font-size:12px; }
.notif-custom > span { display:flex; align-items:center; gap:8px; }
.notif-custom input { width:90px; min-height:40px; }
.notif-custom em { font-style:normal; color:var(--muted); font-size:12px; font-weight:600; }
.notif-days-form .button { min-height:40px; }
.notif-list { overflow:hidden; }
.notif-badge { display:inline-flex; align-items:center; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:800; white-space:nowrap; }
.notif-badge.danger { background:var(--danger-soft); color:var(--red); }
.notif-badge.warning { background:var(--clay-soft); color:var(--clay-ink); }
.notif-badge.info { background:var(--sky-soft); color:var(--sky-ink); }
@media (max-width:1100px) { .notif-summary { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:800px) {
  .notif-settings { flex-direction:column; align-items:stretch; }
  .notif-days-form { justify-content:flex-start; }
}
@media (max-width:600px) {
  .notif-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .notif-metric { padding:13px; gap:10px; }
  .notif-presets { flex-wrap:wrap; }
  .notif-days-form .button { width:100%; }
}

/* Transaction composer */
.modal-dialog.transaction-modal { width:min(1140px,calc(100% - 24px));height:min(800px,calc(100vh - 24px));height:min(800px,calc(100dvh - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:hidden; }
.modal-dialog.transaction-modal[open] { display:flex;flex-direction:column; }
.transaction-modal .modal-header { flex:0 0 auto; }
.transaction-modal .modal-body { display:flex;flex:1 1 0;min-height:0;padding:0;overflow:hidden; }
.transaction-modal .stack-form { display:block;width:100%;height:100%;min-height:0; }
.transaction-composer { display:grid;width:100%;height:100%;min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.transaction-entry { display:flex;min-height:0;flex-direction:column;gap:16px;padding:26px 32px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain; }
.transaction-item-entry { display:flex!important;flex-direction:column;gap:14px!important;padding:18px!important;border:1px solid var(--line)!important;border-radius:var(--radius)!important;background:var(--sunken)!important; }
.transaction-item-entry .field-row { margin:0; }
.cart-add-button { margin-top:6px;min-height:42px;border-color:var(--line-strong)!important;color:var(--ink)!important;background:var(--surface)!important; }
.cart-add-button:hover { color:var(--ink)!important;background:var(--sunken)!important; }
.transaction-cart { display:flex;min-width:0;min-height:0;flex-direction:column;padding:26px 32px;border-left:1px solid var(--line);background:var(--canvas);overflow:hidden; }
.transaction-cart-head { flex:0 0 auto;padding-bottom:16px;border-bottom:1px solid var(--line); }
.transaction-cart-head span,.transaction-cart-head strong { display:block; }
.transaction-cart-head span { color:var(--muted);font-size:12px;font-weight:600; }
.transaction-cart-head strong { margin-top:6px;font:500 18px var(--serif); }
.transaction-cart-list { display:flex;flex:1 1 0;min-height:0;flex-direction:column;gap:10px;padding:18px 6px 18px 0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain; }
.transaction-cart-empty { display:grid;flex:1;place-content:center;justify-items:center;padding:32px;text-align:center;color:var(--muted); }
.transaction-cart-empty[hidden] { display:none; }
.transaction-cart-empty>span { display:grid;place-items:center;width:44px;height:44px;margin-bottom:12px;border-radius:14px;background:var(--sunken);color:var(--purple);font-size:20px;font-weight:800; }
.transaction-cart-empty strong { color:var(--ink-2);font-size:14px; }
.transaction-cart-empty small { max-width:200px;margin-top:6px;font-size:11px;line-height:1.5; }
.cart-item { position:relative;display:flex;flex-shrink:0;align-items:center;gap:12px;padding:14px 42px 14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:none; }
.cart-item-info { min-width:0; }
.cart-item-info strong,.cart-item-info span { display:block; }
.cart-item-info strong { overflow:hidden;color:var(--ink-2);font-size:12px;text-overflow:ellipsis;white-space:nowrap; }
.cart-item-info span { margin-top:6px;color:var(--muted);font-size:11px;font-weight:650; }
.cart-item-remove { position:absolute;top:50%;right:12px;width:28px;height:28px;padding:0;border:0;border-radius:8px;color:var(--danger-ink);background:var(--danger-soft);font-size:18px;line-height:1;cursor:pointer;transform:translateY(-50%); }
.transaction-submit { flex:0 0 auto;margin-top:14px;min-height:48px; }
.transaction-submit:disabled { cursor:not-allowed;opacity:.45; }
/* The distribution page takes exactly 1 screen height so it scrolls internally. */
.transfer-create-panel { min-width:0; height:calc(100vh - 145px); min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.transfer-create-panel > .stack-form { flex:1 1 0; min-height:0; display:flex; flex-direction:column; }
.transfer-create-panel .transaction-composer { flex:1 1 0; min-height:0; height:100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
/* The send form sits on the page, not in a dialog: when its own scroll ends, the wheel moves the page. */
.transfer-create-panel .transaction-entry { flex:1 1 0; min-height:0; gap:12px; padding:20px 24px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:auto; }
.transfer-create-panel .transaction-cart { flex:1 1 0; min-height:0; padding:20px 24px; overflow:hidden; display:flex; flex-direction:column; }
.transfer-create-panel .transaction-cart-list { flex:1 1 0; min-height:0; overflow-y:auto; overscroll-behavior:auto; }
.transfer-create-panel .transaction-cart-empty { flex:1 1 0; min-height:0; padding:16px; }
.transfer-create-panel .transaction-submit { flex:0 0 auto; margin-top:14px; }
.transfer-create-panel .transaction-item-entry { gap:8px!important; padding:12px!important; }
.transfer-create-panel .transfer-top-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
.transfer-create-panel .transfer-item-row { grid-template-columns:minmax(0,2fr) minmax(110px,1fr); align-items:start; }
.transfer-create-panel .transfer-item-row label { align-self:start; }

@media (max-width:800px) {
  .transfer-create-panel { height:calc(100dvh - 240px); min-height:0; }
  .transfer-create-panel .transaction-composer { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,2fr) minmax(0,3fr); }
  .transfer-create-panel .transaction-entry { overflow-y:auto; }
  .transfer-create-panel .transaction-cart { border-top:1px solid var(--line); border-left:0; overflow:hidden; }
  .transfer-create-panel .transaction-cart-list { flex:1 1 0; min-height:0; max-height:none; overflow-y:auto; }
}
@media (max-width:760px) {
  .transfer-create-panel .transfer-top-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .transfer-create-panel .transfer-top-row > :last-child { grid-column:1/-1; }
}
@media (max-width:520px) {
  .transfer-create-panel .transfer-top-row,
  .transfer-create-panel .transfer-item-row { grid-template-columns:minmax(0,1fr); }
  .transfer-create-panel .transfer-top-row > :last-child { grid-column:auto; }
}
@media (max-width:760px) {
  .transfer-create-panel .transaction-composer { display:grid; height:100%; max-height:none; }
  .transfer-create-panel .transaction-entry { overflow-x:hidden; overflow-y:auto; overscroll-behavior:auto; }
  .transfer-create-panel .transaction-cart { display:flex; overflow:hidden; }
  .transfer-create-panel .transaction-cart-list { display:flex; flex:1 1 0; max-height:none; overflow-x:hidden; overflow-y:auto; overscroll-behavior:auto; }
  .modal-dialog.transaction-modal { width:calc(100% - 16px);height:auto;max-height:94dvh; }
  .transaction-modal .modal-body { display:block;overflow-y:auto;overscroll-behavior:contain; }
  .transaction-modal .stack-form { height:auto; }
  .transaction-composer { display:block;height:auto;max-height:none; }
  .transaction-entry { padding:20px;overflow:visible;overscroll-behavior:auto; }
  .transaction-cart { display:block;min-height:0;padding:20px;border-top:1px solid var(--line);border-left:0;overflow:visible; }
  .transaction-cart-list { display:flex;flex:none;max-height:none;overflow:visible;overscroll-behavior:auto;padding:18px 0; }
  .transaction-cart-empty { flex:none; }
}

.nav-badge { margin-left:auto; min-width:20px; padding:1px 7px; border-radius:999px; background:var(--clay); color:var(--ink); font-size:11px; font-weight:700; text-align:center; }

.ql-icon.sale { background:var(--clay-soft); color:var(--clay-ink); }
.ql-icon.purchase { background:var(--sky-soft); color:var(--sky-ink); }
.ql-icon.product { background:var(--sage-soft); color:var(--sage-ink); }

/* Line icons (one family, 1.7px stroke) */
.ico { width:18px; height:18px; flex:0 0 auto; display:block; }
.menu-button .ico { width:22px; height:22px; margin:auto; }

/* Login — four steps of the real flow in the four illustration colours */
.login-body { min-height:100vh; min-height:100dvh; margin:0; padding:clamp(20px,4vw,48px); display:grid; place-items:center; background:var(--canvas); }
.login-shell { width:min(1080px,100%); display:grid; grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr); gap:clamp(28px,5vw,72px); align-items:center; }
.login-story { display:flex; flex-direction:column; gap:28px; min-width:0; }
.login-story .brand { padding:0; }
.login-copy h1 { margin:0 0 10px; font:400 clamp(38px,4.6vw,58px)/1.05 var(--serif); letter-spacing:-.02em; color:var(--ink); }
.login-copy p { margin:0; max-width:440px; color:var(--muted); font-size:16px; }
.login-flow { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; counter-reset:step; }
.flow-step { display:grid; grid-template-columns:auto 1fr; column-gap:12px; row-gap:2px; align-items:start; padding:16px; border-radius:var(--radius); color:var(--ink); }
.flow-step svg { grid-row:span 2; width:26px; height:26px; fill:none; stroke:var(--ink); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.flow-step strong { font:500 17px/1.3 var(--serif); }
.flow-step span { font-size:13px; line-height:1.45; color:var(--ink-2); }
.flow-step.sky { background:var(--sky); }
.flow-step.clay { background:var(--coral); }
.flow-step.cream { background:var(--cream); border:1px solid var(--line); }
.flow-step.sage { background:var(--sage); }
.login-panel { min-width:0; }
.login-card { padding:clamp(24px,3.5vw,40px); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.login-card h2 { margin:0 0 6px; font:500 30px/1.15 var(--serif); letter-spacing:-.01em; }
.login-card > p { margin:0 0 24px; color:var(--muted); }
.login-form { gap:16px; }
.login-submit { min-height:46px; margin-top:6px; font-size:15px; }
.password-field { position:relative; display:block; }
.password-field input { padding-right:46px; }
.password-field input::-ms-reveal, .password-field input::-ms-clear { display:none; }
.password-toggle { position:absolute; top:50%; right:5px; transform:translateY(-50%); display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.password-toggle:hover { background:var(--sunken); color:var(--ink); }
.password-toggle:focus-visible { outline:2px solid var(--clay-ink); outline-offset:1px; }
.password-toggle svg { width:19px; height:19px; }
.password-toggle .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display:none; }
.password-toggle[aria-pressed="true"] .eye-closed { display:block; }
@media (max-width:860px) {
  .login-body { place-items:start center; padding:24px 16px; }
  .login-shell { grid-template-columns:minmax(0,1fr); gap:22px; }
  .login-story { gap:18px; }
  .login-copy h1 { font-size:clamp(32px,9vw,42px); }
  .login-copy p { font-size:15px; }
  .login-flow { display:none; }
  .login-card { padding:22px 18px; }
}

/* Forms that live directly inside a panel (below its head) */
.panel-head p.text-muted { margin:6px 0 0; max-width:60ch; font-size:13.5px; line-height:1.5; }
.panel-form { padding:18px 20px 20px; gap:16px; }
.panel-form input, .panel-form select { font-size:14px; }
.panel-form .button.primary { justify-self:start; min-width:180px; }
input::placeholder, textarea::placeholder { color:var(--faint); }
.label-optional { color:var(--muted); font-weight:400; }
.input-affix { position:relative; display:block; }
.input-affix > span { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:14px; font-weight:500; pointer-events:none; }
.input-affix > input { padding-left:36px; font-variant-numeric:tabular-nums; }
.panel-subhead { padding:14px 20px 10px; border-top:1px solid var(--line); }
.panel-subhead h4 { margin:0; font:500 15px/1.3 var(--serif); }

/* Harga & HPP layout */
.pricing-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(340px,1fr); gap:18px; align-items:start; margin-top:18px; }
.pricing-table td small { display:block; margin-top:2px; font-size:12px; font-variant-numeric:tabular-nums; }
.panel-search { display:flex; gap:6px; flex:0 1 300px; min-width:0; }
.price-list-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:flex-end; flex:0 1 auto; min-width:0; }
.price-list-panel { margin-top:18px; }
.price-dialog .price-dialog-intro { margin:0 0 14px; font-size:13px; }
.price-dialog .price-history { margin-top:18px; }
tr.row-highlight > td { animation: row-highlight 2.4s ease-out 1; }
@keyframes row-highlight { from { background:var(--clay-soft); } to { background:transparent; } }
@media (prefers-reduced-motion: reduce) { tr.row-highlight > td { animation:none; background:var(--clay-soft); } }
.panel-search input { min-height:36px; font-size:13.5px; }
.history-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; margin-top:28px; }
.history-toolbar h2 { margin:0; font-family:var(--serif); font-size:20px; font-weight:600; color:var(--ink); }
.history-toolbar + .panel.mt-24, .history-toolbar + section.mt-24 { margin-top:12px; }
@media (max-width:640px) { .history-toolbar .panel-search { flex:1 1 100%; } }
@media (max-width:1100px) { .pricing-grid { grid-template-columns:minmax(0,1fr); } }
.pricing-table td:first-child { min-width:180px; }
.pricing-table th, .pricing-table td { padding-left:12px; padding-right:12px; }
.cell-action { width:1%; white-space:nowrap; text-align:right; }
.panel-form .product-filter-status:empty { display:none; }

/* Server pager links share the client pager look */
.pagination-controls a { display:grid; place-items:center; width:30px; height:30px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--clay-ink); font-size:18px; text-decoration:none; }
.pagination-controls a:hover { border-color:var(--line-strong); background:var(--sunken); }
.pagination-controls button:disabled { color:var(--faint); background:var(--sunken); }
.pagination-summary { font-variant-numeric:tabular-nums; }
@media (max-width:800px) { .pagination-controls a { min-width:44px; min-height:44px; } }

/* Stock opname: steps, picker, review */
.opname-steps { list-style:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 16px; padding:0; }
.opname-steps li { padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--muted); }
.opname-steps li strong { display:block; color:var(--ink-2); font-size:14px; }
.opname-steps li span { font-size:12.5px; }
.opname-steps li.done { background:var(--sage-soft); border-color:transparent; }
.opname-steps li.current { border-color:var(--clay); box-shadow:inset 0 0 0 1px var(--clay); }
.opname-steps li.current strong { color:var(--ink); }
.opname-hint { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; padding:12px 16px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--cream); }
.opname-add { margin-bottom:16px; padding:16px 20px; }
.opname-add-form { display:flex; align-items:flex-end; gap:10px; }
.opname-add-form .product-field { flex:1; min-width:0; }
.opname-add .field-hint { margin:8px 0 0; }
.opname-table tr.row-diff td { background:var(--ochre-soft); }
.panel-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; padding:16px 20px; }
.panel-filter label { flex:1 1 180px; }
.opname-cycle-form .panel { margin-top:16px; }
.check-all { display:flex !important; align-items:center; gap:8px; white-space:nowrap; }
.check-all input, .cell-check input { width:18px; height:18px; min-height:0; accent-color:var(--clay); }
.cell-check { width:44px; }
.opname-start-bar { position:sticky; bottom:0; z-index:5; display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin-top:16px; padding:14px 20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:0 -4px 16px rgba(20,20,19,.05); }
.opname-start-bar .grow { flex:1 1 220px; }
.opname-start-action { display:flex; align-items:center; gap:12px; margin-left:auto; }
.opname-start-action small { color:var(--muted); font-variant-numeric:tabular-nums; }
@media (max-width:800px) {
  .opname-steps { grid-template-columns:minmax(0,1fr); }
  .opname-add-form { flex-direction:column; align-items:stretch; }
  .opname-hint { flex-direction:column; align-items:stretch; }
  /* On a phone both bars are tall: sticking them would leave little room for the list. */
  .topbar, .opname-start-bar { position:static; }
  .opname-start-action { width:100%; justify-content:space-between; }
}

/* Secondary line under a name in any table cell (barcode, lot, note) sits on its own line. */
td > small.text-muted { display:block; margin-top:2px; font-size:12px; font-variant-numeric:tabular-nums; }
.sidebar nav a { white-space:nowrap; }
.sidebar nav a .nav-badge { flex:0 0 auto; }
/* Keep absolutely positioned helpers (e.g. .sr-only labels in headers) inside the scrolling table. */
.table-wrap { position:relative; }
/* Cancelled documents */
.transaction-row.is-cancelled td { color:var(--muted); }
.transaction-row.is-cancelled td strong { color:var(--muted); text-decoration:line-through; text-decoration-color:var(--line-strong); }
.cancel-note { color:var(--muted); }
.cancel-form { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:14px; padding-top:12px; border-top:1px dashed var(--line); }
.cancel-form input[name="reason"] { flex:1 1 220px; min-width:0; }
@media (max-width: 800px) {
  /* Detail rows sit in a sideways-scrolling table: keep the cancel controls inside the screen. */
  .cancel-form, .cancel-note { position:sticky; left:0; max-width:calc(100vw - 64px); }
}
