:root {
  color-scheme: light;
  --bg: #f5fafc;
  --surface: #fff;
  --soft: #e9f4f9;
  --tint: #f4f9fd;
  --ink: #102a40;
  --muted: #405e72;
  --line: #d0e2ec;
  --primary: #235aa5;
  --accent: #00a6e7;
  --navactive: #e3effb;
  --navtext: #174a88;
  --thead: #102a40;
  --ok: #065f46;
  --okbg: #d1fae5;
  --warn: #92400e;
  --warnbg: #fef3c7;
  --bad: #a52c24;
  --badbg: #ffe6e4;
  --info: #075985;
  --infobg: #e0f2fe;
  --shadow: 0 2px 6px rgba(16, 42, 64, 0.045);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1d2e;
  --surface: #102a40;
  --soft: #1b3a53;
  --tint: #142f47;
  --ink: #e9f4f9;
  --muted: #b8d4e3;
  --line: #284b66;
  --primary: #7cc4fa;
  --navactive: #1d3f5e;
  --navtext: #a4dbff;
  --thead: #244b6e;
  --ok: #a2ebd1;
  --okbg: #154c43;
  --warn: #ffda90;
  --warnbg: #503c1b;
  --bad: #ffb4ab;
  --badbg: #552b31;
  --info: #a1dfff;
  --infobg: #1d405a;
  --shadow: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.47 Arimo,
    Arial,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
}
button {
  cursor: pointer;
}
button:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 21px;
  line-height: 1.32;
  letter-spacing: -0.25px;
}
h3 {
  font-size: 16px;
}
.muted,
.sub {
  color: var(--muted);
}
.sub {
  margin-top: 5px;
  font-size: 14px;
}
.mono,
.doc {
  font-family: "Reddit Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
.doc {
  font-size: 13px;
  font-weight: 700;
}
.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  background: var(--surface);
  padding: 10px;
}
.skip:focus {
  top: 8px;
}
[hidden] {
  display: none !important;
}
#sidebar {
  width: 240px;
  height: 100dvh;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.brand {
  height: 73px;
  display: flex;
  align-items: center;
  padding: 10px 22px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 175px;
}
[data-theme="dark"] .brand img {
  height: 32px;
}
.brand a {
  display: block;
}
.sidebar-foot {
  margin-top: auto;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
#nav {
  padding: 16px 12px;
  overflow: auto;
}
#nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0;
}
#nav a:hover {
  background: var(--tint);
}
#nav a[aria-current="page"] {
  background: var(--navactive);
  color: var(--navtext);
}
.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#workspace {
  margin-left: 240px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.home-link {
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}
.divider {
  opacity: 0.5;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.icon-button {
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
}
.mobile {
  display: none;
}
.icon-button:hover,
.btn:hover {
  filter: brightness(0.96);
}
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 26px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  outline: none;
}
#status:not([hidden]) {
  margin: 16px 26px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--okbg);
  color: var(--ok);
  font-weight: 600;
}
#status.error {
  background: var(--badbg);
  color: var(--bad);
}
#status button {
  margin-left: 8px;
}
.lead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}
.back {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin-bottom: 9px;
}
.back .ico {
  width: 15px;
  height: 15px;
}
.panel,
.card,
.metric,
.lane,
.emptybox,
.callout {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel {
  padding: 22px;
}
.panel > * + *,
.stack > * + * {
  margin-top: 16px;
}
.section-head,
.row,
.actions,
.inline,
.filterbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.section-head {
  justify-content: space-between;
}
.section-head h2 {
  margin-right: auto;
}
.actions {
  gap: 8px;
}
.filterbar {
  align-items: end;
}
.actions.end {
  justify-content: flex-end;
}
.btn,
button.primary,
button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  min-height: 39px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.btn .ico {
  width: 17px;
  height: 17px;
}
.btn.primary,
button.primary {
  background: #235aa5;
  color: white;
  border-color: #235aa5;
}
.btn.danger {
  color: var(--bad);
  border-color: var(--bad);
}
.btn.small {
  font-size: 13px;
  min-height: 32px;
  padding: 5px 10px;
}
.btn.text {
  color: var(--primary);
  background: none;
  border-color: transparent;
}
.metrics,
.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr));
  gap: 12px;
}
.metric {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.metric span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.metric strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
.metric.highlight {
  background: linear-gradient(115deg, #006794, #235aa5);
  color: white;
  border-color: transparent;
}
.metric.highlight span {
  color: #e9f4f9;
}
.metric.bad strong,
.negative {
  color: var(--bad);
}
.board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.lane {
  padding: 14px;
  background: var(--tint);
}
.lane .section-head {
  margin-bottom: 12px;
}
.lane .card + .card {
  margin-top: 10px;
}
.card {
  display: block;
  padding: 15px;
  color: var(--ink);
  text-decoration: none;
}
.card:hover {
  border-color: var(--primary);
}
.card .doc {
  color: var(--primary);
}
.card strong {
  display: block;
  margin: 6px 0;
}
.card small {
  color: var(--muted);
}
.badge,
.count {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
  line-height: 1.35;
}
.count,
.badge.neutral {
  background: var(--soft);
  color: var(--muted);
}
.badge.info {
  background: var(--infobg);
  color: var(--info);
}
.badge.ok {
  background: var(--okbg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.badge.bad {
  background: var(--badbg);
  color: var(--bad);
}
.tablewrap {
  overflow-x: auto;
  border-radius: 9px;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
  font-size: 14px;
}
th {
  color: #fff;
  background: var(--thead);
  padding: 11px 12px;
  font-size: 12px;
  letter-spacing: 0.15px;
}
td {
  padding: 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:hover {
  background: var(--tint);
}
td.wrap {
  white-space: normal;
  min-width: 140px;
}
.empty {
  padding: 14px 0;
  color: var(--muted);
  font-size: 14px;
}
.emptybox {
  padding: 25px;
}
.callout {
  padding: 13px 15px;
  background: var(--infobg);
  color: var(--info);
  box-shadow: none;
}
.callout.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.callout.error {
  background: var(--badbg);
  color: var(--bad);
}
.callout strong {
  display: block;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  align-items: end;
  gap: 14px;
}
label.field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
input,
select,
textarea {
  min-height: 39px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 14px;
}
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  width: 100%;
}
input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  accent-color: #235aa5;
}
textarea {
  min-height: 64px;
  resize: vertical;
}
.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
legend {
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
}
.line-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tint);
}
.line-item + .line-item {
  margin-top: 14px;
}
.line-item .actions {
  justify-content: space-between;
}
.bom {
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.bom p {
  margin: 4px 0;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs a,
.tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}
.tabs [aria-current="page"] {
  background: var(--primary);
  color: var(--surface);
}
.loading,
.errorbox {
  padding: 28px;
  color: var(--muted);
}
.errorbox .actions {
  margin-top: 12px;
}
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.details {
  color: var(--muted);
  font-size: 13px;
}
details > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
details[open] > summary {
  margin-bottom: 12px;
}
@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.15s;
  }
  body.menu-open #sidebar {
    transform: none;
  }
  #workspace {
    margin-left: 0;
  }
  #backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    background: #07152288;
    z-index: 4;
  }
  .mobile {
    display: inline-grid;
  }
  .brand {
    justify-content: space-between;
  }
  .topbar {
    padding: 0 16px;
  }
  main {
    padding: 24px 18px 42px;
  }
}
@media (max-width: 700px) {
  main {
    gap: 15px;
    padding: 20px 13px 40px;
  }
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .top-actions {
    gap: 6px;
  }
  .home-link,
  .divider,
  .role-label {
    display: none;
  }
  #crumb {
    font-size: 12px;
  }
  .panel {
    padding: 15px;
  }
  .board,
  .split {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding: 12px;
  }
  .top-actions select {
    max-width: 145px;
  }
  .lead {
    align-items: start;
  }
  .fields {
    grid-template-columns: repeat(auto-fit, minmax(min(139px, 100%), 1fr));
  }
  #status:not([hidden]) {
    margin: 10px 13px;
  }
  h2 {
    font-size: 18px;
  }
  .top-actions .icon-button {
    width: 32px;
  }
  .filterbar .field {
    flex: 1 1 145px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

a.metric {
  text-decoration: none;
  color: var(--ink);
}
a.metric.highlight {
  color: white;
}
a.metric:hover {
  border-color: var(--primary);
}
#transaksi,
.anchor-panel {
  scroll-margin-top: 82px;
}
.warehouse-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint);
}
.warehouse-picker .field {
  display: grid;
  gap: 4px;
  min-width: min(100%, 170px);
}
.warehouse-picker .details {
  flex: 1 1 250px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1023px) {
  body:not(.menu-open) #sidebar {
    visibility: hidden;
  }
  body.menu-open {
    overflow: hidden;
  }
}

.trend-legend,
.trend-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.trend-legend {
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.trend-legend small {
  margin-left: auto;
}
.trend-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.sales-key,
.sales-bar {
  fill: #008bc4;
  background: #008bc4;
}
.gp-key,
.gp-bar {
  fill: var(--primary);
  background: var(--primary);
}
.plot-scroll {
  overflow: auto;
}
.trend-plot {
  width: 100%;
  max-height: 290px;
  display: block;
}
.trend-plot text {
  font:
    13px Arimo,
    Arial,
    sans-serif;
  fill: var(--muted);
}
.plot-grid line {
  stroke: var(--line);
}
.trend-plot a:hover rect:not([fill]),
.trend-plot a:focus-visible rect:not([fill]) {
  stroke: var(--ink);
  stroke-width: 2;
}
