:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #fff;
  --soft: #f3f5f7;
  --text: #191b20;
  --muted: #737985;
  --line: #e5e8ed;
  --line2: #d4d9e1;
  --accent: #191b20;
  --accent-text: #fff;
  --blue: #2563eb;
  --blue-soft: #eff4ff;
  --orange: #c7772b;
  --orange-dark: #a95f20;
  --orange-soft: #fff5eb;
  --green: #16834b;
  --green-bg: #eaf7ef;
  --red: #c33d3d;
  --red-bg: #fff1f1;
  --shadow: 0 16px 50px rgba(15, 23, 42, .13);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101216;
  --surface: #181b21;
  --soft: #22262e;
  --text: #f1f3f6;
  --muted: #9ba2ae;
  --line: #2c313b;
  --line2: #3b424e;
  --accent: #f1f3f6;
  --accent-text: #181b21;
  --blue: #8aa7ff;
  --blue-soft: #222c43;
  --orange: #e08d42;
  --orange-dark: #f0a763;
  --orange-soft: #2c2219;
  --green: #58c98e;
  --green-bg: #183528;
  --red: #ff7777;
  --red-bg: #351b1b;
  --shadow: 0 16px 50px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* App Shell */
.app { min-height: 100vh; display: flex; }

.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  height: 59px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 760;
  font-size: 17px;
  letter-spacing: -.04em;
}
.brandmark {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  flex: none;
}
.navcap {
  padding: 16px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  font-weight: 560;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background .12s, color .12s;
}
.nav button:hover { background: var(--soft); color: var(--text); }
.nav button.active { background: var(--blue-soft); color: var(--blue); font-weight: 660; }
.nav .ico { width: 16px; text-align: center; opacity: .85; flex: none; }

.sidebottom {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-reset {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  text-align: left;
}
.side-reset:hover { color: var(--text); border-color: var(--line2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 59px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.toplabel { font-size: 13px; color: var(--muted); font-weight: 560; display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 560;
}
.user-role {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: capitalize;
}
.theme-btn {
  border: 1px solid var(--line2);
  background: var(--surface);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
}
.theme-btn:hover { background: var(--soft); }

.content {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 26px 30px 56px;
}

/* Pages & Visibility */
.page { display: none; }
.page.active { display: block; }
.hidden { display: none !important; }

/* Page Heading */
.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
h1 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 14.5px; font-weight: 660; }
.subhead { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Buttons */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 13px;
  min-height: 34px;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover:not(:disabled) { opacity: .9; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--line2); }
.btn.danger:hover:not(:disabled) { background: var(--red-bg); border-color: var(--red); }
.btn.sm { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.iconbtn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
.iconbtn:hover { background: var(--soft); color: var(--text); }
.backlink {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.backlink:hover { color: var(--text); }

/* KPI Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.cols-2 { grid-template-columns: repeat(2, minmax(0, 200px)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  text-align: left;
}
.stat.stat-clickable {
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.stat.stat-clickable:hover { border-color: var(--blue); background: var(--soft); }
.statlabel { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.statvalue { margin-top: 5px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Panels & Tables */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panelhead {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panelbody { padding: 16px; }

.toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.search, .control, .filter {
  border: 1px solid var(--line2);
  background: var(--surface);
  border-radius: 7px;
  padding: 0 11px;
  height: 35px;
  line-height: 33px;
  outline: none;
  font-size: 13px;
}
.search:focus, .control:focus, .filter:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.search { flex: 1; min-width: 210px; }
.control { width: 100%; }
textarea.control { height: auto; min-height: 68px; padding: 7px 11px; line-height: 1.5; resize: vertical; }

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(125, 135, 155, .04); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.name { font-weight: 620; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rowactions { display: flex; gap: 6px; justify-content: flex-end; }
.tablefoot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.pill.active, .pill.green { background: var(--green-bg); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.orange { background: var(--orange-soft); color: var(--orange-dark); }
.pill.red { background: var(--red-bg); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Forms */
.formsection {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  margin-bottom: 14px;
}
.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text); }
.hint { font-size: 11.5px; color: var(--muted); }
.field-error { color: var(--red); font-size: 12px; font-weight: 560; margin-top: 6px; }
.toggleline { display: flex; align-items: center; gap: 8px; font-weight: 560; cursor: pointer; }
.formactions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Unit Configurator (Products & Categories) */
.unitblock {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
  margin-top: 10px;
}
.unitblockhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 650;
  font-size: 12.5px;
}
.unitgridhead, .unitrow {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 34px;
  gap: 8px;
  align-items: center;
}
.unitgridhead { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.unitrow { margin-bottom: 8px; }
.unitinput {
  border: 1px solid var(--line2);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
  min-height: 32px;
}
.parentpreview {
  border: 1px dashed var(--line2);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--soft);
  margin-top: 10px;
}
.miniunits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
}
.chip button { border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 0 2px; }
.chip button:hover { color: var(--red); }

.desc-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.desc-del {
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--red);
  border-radius: 5px;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.desc-del:hover { background: var(--red-bg); border-color: var(--red); }

/* Design Picker */
.design-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}
.pickresults {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
  margin-top: 8px;
}
.pickresult {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.pickresult:hover { border-color: var(--blue); }
.selectedproducts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Steppers */
.steps {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.step { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.step b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  background: var(--soft);
  border: 1px solid var(--line2);
}
.step.active { color: var(--blue); }
.step.active b { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.step.done { color: var(--green); }
.step.done b { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.step-line { flex: 1; min-width: 18px; height: 1px; background: var(--line); }

/* Split Layouts */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  gap: 14px;
  align-items: start;
}
.split.hsn-split { grid-template-columns: 1fr 320px; }

/* Create Bill Catalog */
.catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 14px;
  max-height: 520px;
  overflow-y: auto;
}
.product {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--surface);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  transition: border-color .12s;
}
.product:hover { border-color: var(--blue); }
.productprice { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.modebar {
  display: inline-flex;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}
.modebar button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.modebar button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sumcheck {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}
.sumcheck.valid { background: var(--green-bg); color: var(--green); }
.sumcheck.invalid { background: var(--red-bg); color: var(--red); }

.totals { display: flex; flex-direction: column; gap: 8px; }
.totalrow { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.totalrow.final { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-weight: 700; font-size: 15px; }
.stageactions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; flex-wrap: wrap; }
.bulk-scroll { max-height: calc(100vh - 330px); overflow-y: auto; }
.bulk-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  z-index: 10;
}

/* Document Detail / Paper */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.detail-paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  gap: 12px;
}
.doc-brand { font-size: 18px; font-weight: 760; letter-spacing: -.03em; }
.doc-type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.doc-number { font-size: 17px; font-weight: 700; text-align: right; }
.doc-meta { font-size: 12px; color: var(--muted); text-align: right; margin-top: 2px; }
.doc-summary { max-width: 310px; margin-left: auto; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.sumrow { display: flex; justify-content: space-between; font-size: 13px; }
.sumrow.total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-weight: 700; font-size: 15px; }
.sidecard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  margin-bottom: 12px;
}
.sidekv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; }
.receipt-amount {
  background: var(--green-bg);
  color: var(--green);
  border-radius: 9px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.receipt-amount b { font-size: 24px; display: block; margin-top: 2px; }

/* HSN Expandable & Group Editor */
details.hsn-expand summary { cursor: pointer; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.hsn-expand summary::-webkit-details-marker { display: none; }
details.hsn-expand summary::before { content: "＋"; font-size: 11px; color: var(--muted); }
details.hsn-expand[open] summary::before { content: "−"; }
.nested-table { width: 100%; border-collapse: collapse; margin-top: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.nested-table th, .nested-table td { padding: 6px 10px; font-size: 12px; border-bottom: 1px solid var(--line); }
.group-editor-layout { display: grid; grid-template-columns: 1.1fr 1.3fr; gap: 16px; align-items: start; }
.group-details-panel { position: sticky; top: 74px; }
.available-product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  margin-top: 10px;
}
.product-pick-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface);
  cursor: pointer;
}
.product-pick-card:hover { border-color: var(--blue); }

/* Staff / Salesmen */
.id-badge { font-family: ui-monospace, monospace; font-weight: 700; color: var(--orange-dark); }
.username-tag { color: var(--muted); font-size: 12px; }
.notice {
  padding: 10px 14px;
  border-radius: 7px;
  margin-bottom: 14px;
  font-weight: 560;
  border: 1px solid var(--line);
}
.notice.success { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.notice.error { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* Modals */
.dialogback {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  place-items: center;
  padding: 18px;
  z-index: 100;
}
.dialogback.open { display: grid; }
.dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog.sm { max-width: 420px; }
.dialoghead {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialogbody { padding: 16px 18px; overflow-y: auto; }
.dialogfoot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #20242b;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 560;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Minimal Login Page */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}
.login-topbar {
  position: fixed;
  top: 16px;
  right: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.04em;
  margin-bottom: 18px;
}
.login-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.login-sub { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-demo {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.login-demo code {
  background: var(--soft);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Mobile Responsive */
.mobile-list { display: none; }
@media (max-width: 960px) {
  .split, .split.hsn-split, .detail-layout, .group-editor-layout { grid-template-columns: 1fr; }
  .available-product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { width: 64px; flex: 0 0 64px; }
  .brand span:not(.brandmark), .navcap, .nav button span:not(.ico), .sidebottom { display: none; }
  .nav button { justify-content: center; padding: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .staff-desktop { display: none; }
  .mobile-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .card-staff {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
  }
  .avatar-id {
    width: 37px;
    height: 37px;
    border-radius: 7px;
    background: var(--orange-soft);
    color: var(--orange-dark);
    font-weight: 700;
    display: grid;
    place-items: center;
    flex: none;
  }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .content { padding: 18px 14px 40px; }
  .grid, .catalog, .pickresults, .available-product-list { grid-template-columns: 1fr; }
}
.print-sheets { display: none; }
.a4-sheet {
  border: 1px solid #000;
  page-break-after: always;
  break-after: page;
  background: #fff;
  color: #000;
  font: 10.5px/1.35 var(--font);
}
.a4-sheet:last-child { page-break-after: auto; break-after: auto; }
.a4-copy-bar {
  background: #e5e7eb;
  text-align: center;
  font-weight: 700;
  font-size: 9.5px;
  padding: 2px 0;
  border-bottom: 1px solid #000;
  letter-spacing: .06em;
}
.a4-title-bar {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px solid #000;
}
.a4-store-bar {
  text-align: center;
  padding: 3px 6px;
  border-bottom: 1px solid #444;
  font-size: 9.5px;
}
.a4-meta-grid {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid #000;
  font-size: 10px;
}
.a4-table { width: 100%; border-collapse: collapse; }
.a4-table th, .a4-table td {
  border-right: 1px solid #000;
  padding: 2.5px 4px;
  vertical-align: top;
  font-size: 10px;
}
.a4-table th:last-child, .a4-table td:last-child { border-right: 0; }
.a4-table thead th {
  background: #e5e7eb;
  border-bottom: 1px solid #000;
  font-weight: 700;
  text-align: center;
}
.a4-table tbody td { border-bottom: 1px solid #e5e7eb; }
.a4-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.a4-table .ctr { text-align: center; }
.a4-subtotal td {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  font-weight: 700;
  padding: 3px 4px;
}
.a4-footer { padding: 6px 8px; font-size: 9.5px; }
.a4-est-grid { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.a4-box {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  padding: 6px 8px;
}
.a4-pay-box { width: 210px; margin-left: auto; }
.a4-pay-row { display: flex; justify-content: space-between; padding: 1px 0; }
.a4-pay-row.bold { font-weight: 700; }
.a4-pay-row.sep { border-top: 1px solid #666; margin-top: 2px; padding-top: 2px; }
.a4-tamil { font-size: 8.5px; color: #222; margin-top: 3px; line-height: 1.3; }
.a4-bottom-bar {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  border-top: 1px solid #000;
  font-size: 8.5px;
  color: #555;
}
@media print {
  @page { size: A4; margin: 8mm 10mm; }
  .app, .dialogback, .toast { display: none !important; }
  .print-sheets { display: block !important; color: #000; background: #fff; }
}

