:root {
  color-scheme: light;
  --ink: #18201f;
  --ink-soft: #3d4745;
  --muted: #697572;
  --muted-light: #929c99;
  --line: #dde3e1;
  --line-strong: #c9d1ce;
  --surface: #ffffff;
  --surface-soft: #f7f8f8;
  --canvas: #f3f5f4;
  --brand: #137562;
  --brand-strong: #0a594b;
  --brand-soft: #e8f3f0;
  --accent: #d8881b;
  --accent-soft: #fff5e5;
  --danger: #d4443e;
  --danger-soft: #fff0ef;
  --success: #27784b;
  --success-soft: #edf7f1;
  --shadow-sm: 0 1px 2px rgba(20, 40, 34, .04);
  --shadow-md: 0 8px 24px rgba(20, 31, 28, .06);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); font-size: 12px; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 1.15fr) minmax(420px, .85fr);
  background: #edf1ef;
}
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(48px, 8vw, 120px);
  overflow: hidden;
  color: #fff;
  background: #123f37;
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: #d09a55;
}
.login-brand::after {
  content: "BATCH  ·  WEIGHT  ·  INVENTORY  ·  FINANCE";
  position: absolute;
  left: clamp(48px, 8vw, 120px);
  bottom: 42px;
  color: rgba(255,255,255,.38);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
}
.brand-mark {
  align-self: flex-start;
  padding: 6px 0;
  color: #e6bd84;
  border-bottom: 1px solid rgba(230,189,132,.7);
  font-size: 13px;
  font-weight: 600;
}
.login-brand h1 {
  max-width: 680px;
  margin: 30px 0 16px;
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.13;
  font-weight: 650;
  letter-spacing: 0;
}
.login-brand p { max-width: 560px; margin: 0; color: #c9d9d5; font-size: 17px; }
.login-form {
  align-self: center;
  width: min(420px, calc(100% - 56px));
  margin: auto;
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}
.login-form::before {
  content: "OPERATIONS SYSTEM";
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.login-form h2 { margin: 0 0 28px; font-size: 24px; font-weight: 650; }
.login-form label { margin-bottom: 17px; }

label { display: grid; gap: 7px; color: #4a5753; font-size: 12px; font-weight: 600; }
input, select {
  width: 100%;
  height: 40px;
  padding: 7px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover { border-color: #aab9b4; }
input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23,107,91,.11);
}
input::placeholder { color: #a3adaa; }

button {
  min-height: 38px;
  padding: 7px 14px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
button:hover { color: var(--brand-strong); background: var(--surface-soft); border-color: #9fb2ac; }
button:active { transform: translateY(1px); }
.primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 1px 2px rgba(13,81,70,.15); }
.primary:hover { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.secondary { color: var(--brand-strong); background: var(--brand-soft); border-color: #bfd4ce; }
.secondary:hover { background: #dcebe7; border-color: #9ebeb5; }
.text-button { color: var(--brand); background: transparent; border-color: transparent; box-shadow: none; }
.text-button:hover { background: var(--brand-soft); border-color: transparent; }
.full { width: 100%; margin-top: 8px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 14px 16px;
  color: var(--ink);
  background: #f9fbfa;
  border-right: 1px solid #d8e0dd;
  box-shadow: 4px 0 18px rgba(19,47,41,.035);
}
.sidebar-brand {
  margin: 0 -14px;
  padding: 22px 24px 20px;
  color: #fff;
  background: #153e37;
  border-bottom: 4px solid #d6a05b;
}
.sidebar-brand span { display: block; color: #a9c7c0; font-size: 10px; font-weight: 600; }
.sidebar-brand strong { display: block; margin-top: 6px; font-size: 17px; font-weight: 650; }
.sidebar nav {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.nav-group-label {
  margin: 13px 10px 4px;
  color: #8b9793;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
}
.nav-group-label:first-child { margin-top: 4px; }
.sidebar nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 39px;
  padding: 6px 10px;
  color: #46534f;
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  font-weight: 550;
}
.sidebar nav button span {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  color: #668079;
  background: #eef3f1;
  border: 1px solid #d8e2df;
  border-radius: 5px;
  font-size: 11px;
}
.sidebar nav button:hover { color: var(--brand-strong); background: #edf4f1; border-color: transparent; }
.sidebar nav button.active { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px rgba(23,107,91,.15); }
.sidebar nav button.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #e0a45a;
}
.sidebar nav button.active span { color: #fff0d8; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); }
.logout-button { margin-top: 14px; color: #596762; background: #fff; border-color: #d7dfdc; font-weight: 550; }
.logout-button:hover { color: var(--danger); background: var(--danger-soft); border-color: #e0b7b3; }

.workspace { min-width: 0; padding: 0 34px 46px; background: #eef2f0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -34px;
  padding: 0 34px;
  color: #fff;
  background: #1b4b43;
  border-bottom: 4px solid #d7a15c;
  backdrop-filter: blur(10px);
}
.topbar p, .section-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.topbar p { color: #a9c7c0; }
.topbar h1 { margin: 0; color: #fff; font-size: 29px; font-weight: 650; letter-spacing: 0; }
.user-chip {
  position: relative;
  display: grid;
  justify-items: end;
  min-width: 130px;
  padding-left: 42px;
}
.user-chip::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 30px;
  height: 30px;
  background: var(--brand-soft);
  border: 1px solid #c7d9d4;
  border-radius: 50%;
  transform: translateY(-50%);
}
.user-chip::before { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.user-chip strong { color: #fff; font-size: 13px; font-weight: 650; }
.user-chip span { color: #b7cec8; font-size: 11px; }
.view { padding-top: 26px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
.stats article {
  position: relative;
  min-height: 116px;
  padding: 18px 19px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}
.stats article::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
  opacity: .75;
}
.stats article:nth-child(4)::after { background: var(--accent); }
.stats span, .stats small { display: block; color: var(--muted); font-size: 11px; }
.stats span { font-weight: 650; }
.stats strong { display: block; margin: 10px 0 7px; font-size: 25px; font-weight: 650; }

.content-section, .form-band {
  margin-top: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(26,55,48,.055);
}
.form-band {
  position: relative;
  background: #f7fbf9;
  border-color: #cadbd6;
  border-left: 5px solid var(--brand);
}
.form-band::after {
  content: "业务录入";
  position: absolute;
  right: 20px;
  top: -11px;
  padding: 3px 9px;
  color: var(--brand-strong);
  background: #dfeee9;
  border: 1px solid #bed6cf;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}
.content-section { background: #fff; }
.content-section > .section-heading { padding-bottom: 14px; border-bottom: 1px solid #e5eae8; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; color: #1d2926; font-size: 20px; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 14px; align-items: end; }
.form-grid.six { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.form-grid.compact { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
.form-grid.compact-filter { grid-template-columns: repeat(4, minmax(130px, 1fr)) repeat(3, auto); gap: 10px; margin: 8px 0 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0ef; }
.form-actions strong { margin-right: auto; font-size: 14px; font-weight: 650; }
.validation-message {
  margin-top: 13px;
  padding: 10px 12px;
  color: #8e352e;
  background: var(--danger-soft);
  border: 1px solid #e1b6b2;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
}
.finance-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.finance-forms .form-band { margin-top: 16px; }
.inline-filter { display: flex; align-items: center; gap: 8px; }
.inline-filter input { width: 150px; }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.archive-search {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-width: min(340px, 100%);
}
.archive-search input { width: 270px; }
.report-toolbar {
  position: sticky;
  top: 90px;
  z-index: 5;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(247,249,248,.96);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.report-toolbar label { min-width: 170px; }
.positive-value { color: var(--success); font-weight: 650; }
.negative-value { color: var(--danger); background: var(--danger-soft); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e8ecea;
  border-radius: 4px;
  scrollbar-width: thin;
  scrollbar-color: #b8c4c0 #eef2f0;
}
.wide-table table { min-width: 1080px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  height: 43px;
  padding: 9px 11px;
  border-bottom: 1px solid #e9edeb;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #596662;
  background: #e9efec;
  border-bottom-color: #dce3e0;
  font-size: 11px;
  font-weight: 700;
}
th:first-child { border-top-left-radius: 5px; }
th:last-child { border-top-right-radius: 5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f8fbf9; }
td strong { font-weight: 650; }
.empty-row td { height: 92px; padding: 28px; color: var(--muted-light); text-align: center; }
.actions { display: flex; gap: 6px; }
.table-action { min-height: 29px; padding: 4px 9px; font-size: 11px; font-weight: 650; }
.table-action.primary { box-shadow: none; }
.table-action.danger { color: var(--danger); background: #fff; border-color: #e1bbb7; }
.table-action.danger:hover { background: var(--danger-soft); border-color: #cf938d; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  color: #53605c;
  background: #f1f4f3;
  border: 1px solid #d4ddda;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
}
.status.active { color: #8a5719; background: var(--accent-soft); border-color: #e5c79e; }
.status.done { color: var(--success); background: var(--success-soft); border-color: #b5d5c1; }
.status.void { color: var(--danger); background: var(--danger-soft); border-color: #e0b1ad; }

.entry-table { margin-top: 15px; border-color: var(--line-strong); background: #fff; }
.entry-table table { min-width: 1040px; }
.entry-table .outbound-entry-table { min-width: 1760px; }
.entry-table input { min-width: 90px; height: 33px; background: #fbfcfb; }
.outbound-entry-table input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.outbound-entry-table input[type="number"]::-webkit-outer-spin-button,
.outbound-entry-table input[type="number"]::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.entry-table select { min-width: 104px; height: 33px; background: #fbfcfb; }
.mini-button { min-height: 28px; padding: 4px 9px; font-size: 11px; }
.batch-picker-cell { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 6px; align-items: center; min-width: 320px; }
.batch-picker-cell select { min-width: 210px; }
.small-text { margin-top: 5px; min-width: 170px; max-width: 220px; white-space: normal; line-height: 1.45; }
.entry-table th { height: 38px; background: #eef3f1; }
.entry-table td { height: 44px; padding: 5px; }
.icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--danger);
  background: #fff;
  border-color: #e1c3c0;
  font-size: 18px;
}
.icon-button:hover { color: #8f3029; background: var(--danger-soft); border-color: #d6a19c; }
.statement-detail td { padding: 10px 16px 15px; color: var(--text); background: #f8faf9; line-height: 1.7; white-space: normal; }
.statement-ledger-table { min-width: 760px; width: auto; border: 1px solid #1f2f2b; border-collapse: collapse; background: #fff; }
.statement-ledger-table th,
.statement-ledger-table td { min-width: 70px; padding: 7px 10px; border: 1px solid #1f2f2b; text-align: center; vertical-align: middle; background: #fff; }
.statement-ledger-table th { font-weight: 650; color: var(--text); }
.statement-merged-row { background: #edf9f6; }
.statement-ledger-product { display: block; font-weight: 650; color: var(--text); }
.statement-ledger-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.statement-ledger-total { color: var(--danger); font-size: 20px; font-weight: 750; letter-spacing: 1px; }
.statement-ledger-subtotal td { background: #fbfcfb; font-weight: 650; }
.wrap-cell { min-width: 220px; white-space: normal; line-height: 1.6; }
.overdue { color: var(--danger); background: var(--danger-soft); font-weight: 650; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16,29,26,.52);
  backdrop-filter: blur(3px);
}
.dialog {
  width: min(460px, 100%);
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(10,30,24,.24);
}
.wide-dialog { width: min(720px, 100%); }
.statement-extra-dialog { width: min(1080px, 100%); }
.allocation-table { margin: 12px 0; }
.allocation-table table { min-width: 100%; }
.allocation-table select { min-width: 320px; }
.allocation-table input { min-width: 140px; }
.dialog-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.statement-extra-table { margin: 12px 0; }
.statement-extra-table table { min-width: 980px; }
.statement-extra-table select { min-width: 120px; }
.statement-extra-table input { min-width: 90px; }
.statement-extra-table input[data-field="product_name"],
.statement-extra-table input[data-field="remark"] { min-width: 140px; }
.dialog h2 { margin: 0 0 10px; font-size: 20px; font-weight: 650; }
.dialog p { color: var(--muted); line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  color: #fff;
  background: #194f46;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(13,47,40,.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .18s ease;
}
#toast.error { background: #963d35; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .form-grid.six { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .finance-forms { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .workspace { padding-inline: 22px; }
}

@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 230px; padding: 34px 24px 42px; justify-content: flex-end; }
  .login-brand::before { width: 4px; }
  .login-brand::after { display: none; }
  .login-brand h1 { margin: 15px 0 8px; font-size: 32px; }
  .login-brand p { font-size: 14px; }
  .login-form { margin: 28px auto; padding: 30px; }
  .app-shell { display: block; }
  .sidebar { position: sticky; width: 100%; height: auto; padding: 0 12px 10px; background: #153e37; border-right: 0; box-shadow: 0 3px 14px rgba(19,47,41,.12); }
  .sidebar-brand { margin: 0 -12px; padding: 14px 110px 12px 16px; border-bottom-width: 2px; }
  .sidebar-brand strong { font-size: 16px; }
  .sidebar nav { display: flex; overflow-x: auto; margin-top: 8px; padding: 0; scrollbar-width: none; }
  .nav-group-label { display: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav button { flex: 0 0 auto; width: auto; min-height: 35px; padding: 6px 10px; color: #cfe0dc; }
  .sidebar nav button:hover { color: #fff; background: rgba(255,255,255,.07); }
  .sidebar nav button span { display: none; }
  .sidebar nav button.active::before { left: 9px; right: 9px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .logout-button { position: absolute; right: 12px; top: 12px; min-height: 31px; margin: 0; }
  .workspace { padding: 0 12px 26px; }
  .topbar { position: static; min-height: 76px; margin: 0 -12px; padding: 0 14px; }
  .topbar h1 { font-size: 21px; }
  .view { padding-top: 14px; }
  .stats, .form-grid, .form-grid.six, .form-grid.compact, .form-grid.compact-filter { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
  .content-section, .form-band { padding: 15px; }
  .report-toolbar { position: static; flex-wrap: wrap; }
  .table-wrap { border-radius: 5px; }
}

@media (max-width: 480px) {
  .stats, .form-grid, .form-grid.six, .form-grid.compact, .form-grid.compact-filter { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .topbar { align-items: center; padding: 13px 0; }
  .user-chip { min-width: auto; padding-left: 0; }
  .user-chip::before { display: none; }
  .stats article { min-height: 102px; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions strong { width: 100%; margin-right: 0; }
}

/* 2026-06-13 selected dashboard direction */
.app-shell {
  grid-template-columns: 210px minmax(0, 1fr);
  background: var(--canvas);
  transition: grid-template-columns .18s ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: 70px minmax(0, 1fr); }
.sidebar {
  padding: 0 10px 14px;
  color: #d9e2df;
  background: #111b21;
  border-right: 1px solid #233039;
  box-shadow: none;
}
.sidebar-brand {
  margin: 0 -10px;
  min-height: 66px;
  padding: 16px 18px;
  background: #111b21;
  border-bottom: 1px solid #2a363d;
}
.sidebar-brand span { color: #829099; font-size: 9px; }
.sidebar-brand strong { margin-top: 4px; color: #f6f8f7; font-size: 16px; white-space: nowrap; }
.sidebar nav { gap: 1px; margin-top: 8px; }
.nav-group-label {
  margin: 13px 10px 5px;
  color: #77858c;
  font-size: 10px;
  letter-spacing: 0;
}
.sidebar nav button {
  min-height: 37px;
  gap: 9px;
  padding: 6px 9px;
  color: #c4cecb;
  font-size: 13px;
  font-weight: 500;
}
.sidebar nav button span {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
  color: #aebbb7;
  background: transparent;
  border: 0;
}
.sidebar nav button span svg { width: 16px; height: 16px; stroke-width: 1.7; }
.sidebar nav button:hover { color: #fff; background: #1b292f; }
.sidebar nav button.active {
  color: #fff;
  background: #117764;
  border-color: #117764;
  box-shadow: none;
}
.sidebar nav button.active::before { left: -10px; top: 0; bottom: 0; width: 3px; background: #54d0b4; }
.sidebar nav button.active span { color: #fff; background: transparent; border: 0; }
.logout-button {
  margin-top: auto;
  color: #b8c3c0;
  background: transparent;
  border-color: #334148;
}
.logout-button:hover { color: #fff; background: #202c32; border-color: #45545b; }
.sidebar-collapsed .sidebar-brand { padding-inline: 13px; }
.sidebar-collapsed .sidebar-brand span,
.sidebar-collapsed .sidebar-brand strong,
.sidebar-collapsed .nav-group-label,
.sidebar-collapsed .sidebar nav button:not(.active)::after,
.sidebar-collapsed .logout-button { overflow: hidden; color: transparent; font-size: 0; }
.sidebar-collapsed .sidebar nav button { justify-content: center; padding-inline: 6px; font-size: 0; }
.sidebar-collapsed .sidebar nav button span { flex-basis: 28px; width: 28px; height: 28px; }

.workspace { padding: 0 16px 32px; background: var(--canvas); }
.topbar {
  min-height: 60px;
  margin: 0 -16px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #d8dfdc;
  backdrop-filter: none;
}
.page-identity, .topbar-tools, .business-date, .global-search, .user-chip {
  display: flex;
  align-items: center;
}
.page-identity { gap: 12px; min-width: 220px; }
.topbar-icon, .notification-button, .icon-command {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: #3f4b48;
  background: transparent;
  border-color: transparent;
}
.topbar-icon svg, .notification-button svg, .icon-command svg { width: 17px; height: 17px; stroke-width: 1.8; }
.topbar p { display: none; }
.topbar h1 { color: var(--ink); font-size: 18px; font-weight: 650; }
.topbar-tools { justify-content: flex-end; gap: 12px; min-width: 0; flex: 1; }
.business-date { gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.business-date svg { width: 15px; height: 15px; }
.business-date strong { color: #313b39; font-weight: 600; }
.global-search {
  position: relative;
  width: min(390px, 34vw);
}
.global-search svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: #8a9692;
}
.global-search input {
  height: 34px;
  padding-left: 34px;
  background: #fafbfb;
  border-color: #d8dfdc;
  border-radius: 3px;
  font-size: 12px;
}
.notification-button { position: relative; }
.notification-button span {
  position: absolute;
  right: 1px;
  top: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: #fff;
  background: var(--danger);
  border: 2px solid #fff;
  border-radius: 10px;
  font-size: 9px;
  line-height: 12px;
}
.user-chip {
  grid-template-columns: 24px auto;
  justify-items: start;
  gap: 0 8px;
  min-width: 120px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.user-chip::before { display: none; }
.user-chip > svg { grid-row: span 2; width: 18px; height: 18px; color: #26312f; }
.user-chip strong { color: var(--ink); font-size: 12px; }
.user-chip span { color: var(--muted); font-size: 10px; }
.view { padding-top: 12px; }

.dashboard-stats {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.dashboard-stats article {
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border: 0;
  border-right: 1px solid #e2e7e5;
  border-radius: 0;
  box-shadow: none;
}
.dashboard-stats article:last-child { border-right: 0; }
.dashboard-stats article::after { display: none; }
.dashboard-stats article > svg { width: 32px; height: 32px; color: #17211f; stroke-width: 1.5; }
.dashboard-stats article > div { min-width: 0; }
.dashboard-stats span { color: #4c5855; font-size: 12px; font-weight: 550; }
.dashboard-stats strong {
  margin: 5px 0 3px;
  color: #111817;
  font-size: 25px;
  line-height: 1.1;
  white-space: nowrap;
}
.dashboard-stats small { color: #7b8783; font-size: 10px; white-space: nowrap; }

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, .95fr);
  gap: 12px;
}
.content-section, .form-band {
  margin-top: 12px;
  padding: 15px;
  border-radius: 5px;
  box-shadow: none;
}
.content-section > .section-heading { padding-bottom: 10px; }
.section-heading { gap: 12px; margin-bottom: 10px; }
.section-heading p { margin-bottom: 2px; color: #7a8682; font-size: 9px; letter-spacing: 0; }
.section-heading h2 { font-size: 16px; }
.dashboard-link { min-height: 28px; padding: 3px 5px; font-size: 11px; }
.section-count { color: var(--brand); font-size: 11px; font-weight: 650; }

.batch-board { min-height: 330px; }
.batch-board-row {
  padding: 12px 4px 14px;
  border-bottom: 1px solid #e4e9e7;
}
.batch-board-row:last-child { border-bottom: 0; }
.batch-board-summary {
  display: grid;
  grid-template-columns: 118px minmax(100px, 1.2fr) 45px 70px 78px auto;
  align-items: center;
  gap: 9px;
  color: #4b5754;
  font-size: 11px;
}
.batch-board-summary > strong { color: #18211f; font-size: 12px; }
.batch-board-summary b { color: #1a2422; font-weight: 700; }
.batch-stage-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 14px 0 0 3px;
}
.batch-stage-track::before {
  content: "";
  position: absolute;
  left: 8.5%;
  right: 8.5%;
  top: 5px;
  height: 1px;
  background: #cfd7d4;
}
.batch-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #8b9692;
  font-size: 10px;
  text-align: center;
}
.batch-stage > span {
  z-index: 1;
  width: 9px;
  height: 9px;
  background: #cfd6d3;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #cfd6d3;
}
.batch-stage strong { color: #616d69; font-size: 10px; font-weight: 600; }
.batch-stage small { color: #929c99; font-size: 9px; }
.batch-stage.done > span { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.batch-stage.done strong, .batch-stage.done small { color: var(--brand-strong); }
.batch-stage.active > span { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.batch-stage.active strong, .batch-stage.active small { color: #9a6113; }

.pending-list { min-height: 330px; }
.pending-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 3px 9px 12px;
  border-bottom: 1px solid #e3e8e6;
  border-left: 3px solid var(--accent);
}
.pending-item.danger { border-left-color: var(--danger); }
.pending-item > div { display: grid; gap: 3px; min-width: 0; }
.pending-item > div strong { color: #1c2624; font-size: 12px; }
.pending-item > div span {
  overflow: hidden;
  color: #73807c;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-item > b { color: #3c4744; font-size: 11px; white-space: nowrap; }
.dashboard-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-empty.compact { min-height: 180px; }

.business-overview { padding-top: 13px; }
.overview-heading { align-items: end; }
.overview-tools { display: flex; align-items: end; gap: 7px; }
.overview-tools label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.overview-tools input { width: 132px; height: 32px; font-size: 11px; }
.overview-tools select { width: 118px; height: 32px; font-size: 11px; }
.overview-tools > span { padding-bottom: 8px; color: var(--muted-light); font-size: 10px; }
.business-overview table { min-width: 1160px; }

th, td { height: 42px; padding: 8px 10px; font-size: 13px; }
th { color: #53605c; background: #f1f4f3; font-size: 12px; }
.status { min-height: 22px; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.table-action { font-size: 12px; }
.form-band label { font-size: 13px; }
.form-band input, .form-band select, .form-band textarea { font-size: 13px; }
.form-band { background: #fafcfb; border-left-width: 3px; }
.form-band::after { display: none; }

@media (max-width: 1260px) {
  .app-shell { grid-template-columns: 188px minmax(0, 1fr); }
  .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
  .dashboard-stats article:nth-child(3) { border-right: 0; }
  .dashboard-stats article:nth-child(n+4) { border-top: 1px solid #e2e7e5; }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .batch-board, .pending-list { min-height: auto; }
}

@media (max-width: 760px) {
  .app-shell, .app-shell.sidebar-collapsed { display: block; }
  .sidebar { background: #111b21; }
  .sidebar-brand { margin: 0 -12px; }
  .sidebar-collapsed .sidebar-brand span,
  .sidebar-collapsed .sidebar-brand strong { color: inherit; font-size: inherit; }
  .sidebar-collapsed .sidebar nav button { font-size: 13px; }
  .topbar { min-height: 58px; }
  .page-identity { min-width: auto; }
  .topbar-icon, .business-date, .global-search { display: none; }
  .topbar-tools { gap: 6px; }
  .user-chip { min-width: auto; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-stats article, .dashboard-stats article:nth-child(3) {
    min-height: 94px;
    border-right: 1px solid #e2e7e5;
    border-top: 1px solid #e2e7e5;
  }
  .dashboard-stats article:nth-child(odd) { border-right: 1px solid #e2e7e5; }
  .dashboard-stats article:nth-child(even) { border-right: 0; }
  .dashboard-stats article:first-child, .dashboard-stats article:nth-child(2) { border-top: 0; }
  .batch-board-summary { grid-template-columns: 1fr 1fr auto; }
  .batch-board-summary > span:nth-of-type(n+3) { display: none; }
  .batch-stage-track {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 14px;
  }
  .batch-stage-track::before { display: none; }
  .batch-board-row { min-width: 0; max-width: 100%; overflow: hidden; }
  .overview-heading { align-items: flex-start; }
  .overview-tools { width: 100%; flex-wrap: wrap; }
  .overview-tools label:first-child { display: none; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-stats article,
  .dashboard-stats article:nth-child(odd),
  .dashboard-stats article:nth-child(even) { border-right: 0; border-top: 1px solid #e2e7e5; }
  .dashboard-stats article:first-child { border-top: 0; }
  .dashboard-stats article > svg { width: 26px; height: 26px; }
  .dashboard-stats strong { font-size: 22px; }
  .pending-item { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pending-item > b { display: none; }
}

@media print {
  .sidebar, .topbar, .form-band, button, #toast, .report-toolbar { display: none !important; }
  .app-shell { display: block; }
  .workspace { padding: 0; }
  .content-section { border: 0; box-shadow: none; }
  .view { display: none !important; }
  #reports { display: block !important; padding: 0; }
  .report-section { break-inside: avoid; margin: 0 0 18px; padding: 0; }
  th, td { height: auto; padding: 6px; font-size: 10px; }
}
