:root {
  color-scheme: light;
  --ink: #1f2f3d;
  --muted: #536b7a;
  --line: #8fb4c9;
  --panel: #eef7fb;
  --bg: #dbeaf2;
  --nav: #0b5595;
  --nav-soft: #0f73bd;
  --teal: #1e76b6;
  --teal-soft: #d7edf7;
  --amber: #9a6a00;
  --amber-soft: #fff1c2;
  --red: #b00020;
  --red-soft: #ffe1e6;
  --blue: #075a9c;
  --erp-navy: #062b63;
  --erp-navy-deep: #031a3f;
  --erp-blue: #0b5fd3;
  --erp-red: #ed0b12;
  --erp-green: #15a34a;
  --erp-orange: #f59e0b;
  --erp-page: #f3f7fc;
  --erp-card: #ffffff;
  --erp-line: #dbe5f1;
  --erp-text: #071a3d;
  --erp-muted: #66758f;
  --shadow: 0 12px 32px rgba(6, 43, 99, 0.08);
  --font-sans: "Inter", "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(#eef8fc 0, #d8e9f2 118px, #cbdfe9 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f59e0b;
  color: #111827;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sync-card small {
  color: #bcc5d4;
  font-size: 0.82rem;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.menu-tree {
  gap: 4px;
}

.menu-group {
  display: grid;
  gap: 2px;
}

.menu-group-title {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c9d0dc;
  font-weight: 900;
  padding: 9px 8px;
  text-align: left;
}

.menu-arrow {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 3px;
  color: white;
  font-size: 0.8rem;
  line-height: 1;
}

.menu-branch {
  position: relative;
  display: grid;
  gap: 2px;
  margin-left: 16px;
  padding-left: 13px;
}

.menu-branch::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 16px;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.24);
}

.menu-group:not(.open) .menu-branch {
  display: none;
}

.nav-tab {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d5dbe6;
  padding: 12px 12px;
  text-align: left;
}

.menu-child {
  position: relative;
  padding: 9px 10px;
  min-height: 34px;
  font-size: 0.92rem;
}

.menu-child::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: rgba(255, 255, 255, 0.24);
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--nav-soft);
  color: white;
}

.sync-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex: 0 0 auto;
}

.status-dot.offline {
  background: #f59e0b;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--blue);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.top-actions,
.panel-heading,
.search-row,
.report-actions,
.settings-actions,
.session-actions,
.count-mode-actions,
.location-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric strong {
  font-size: 2rem;
  line-height: 1;
}

.metric.warning {
  background: var(--amber-soft);
  border-color: #f4d58a;
}

.metric.danger {
  background: var(--red-soft);
  border-color: #f5b5af;
}

.dashboard-frame {
  border: 1px solid #b7c6d4;
  background: #fdfefe;
  padding: 14px;
  min-height: calc(100vh - 150px);
}

.dashboard-tab {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #7fa8c8;
  border-bottom-color: white;
  background: white;
  color: var(--nav);
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.dashboard-card {
  min-height: 150px;
  border: 1px solid #b9c4cc;
  border-radius: 4px;
  background: white;
  box-shadow: 0 1px 2px rgba(31, 47, 61, 0.18);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.dashboard-card.compact {
  min-height: 134px;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-card-head h2 {
  color: #263845;
  font-size: 0.95rem;
}

.dashboard-card-head span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
}

.dashboard-bars {
  min-height: 112px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 0 6px;
}

.dashboard-vbar {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-items: end;
  gap: 4px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.dashboard-vbar i {
  display: block;
  width: 52%;
  min-height: 8px;
  border-radius: 1px 1px 0 0;
}

.dashboard-vbar i.blue,
.legend-blue {
  background: #2b70ad;
}

.dashboard-vbar i.green,
.legend-green {
  background: #54ad72;
}

.dashboard-vbar i.amber,
.legend-amber {
  background: #f2c04c;
}

.dashboard-vbar i.red {
  background: #e84d37;
}

.dashboard-vbar small {
  min-height: 28px;
  text-align: center;
  color: #334155;
}

.dashboard-kpi-row,
.dashboard-split-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  min-height: 84px;
}

.dashboard-split-kpi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-kpi-row article,
.dashboard-split-kpi div {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.dashboard-kpi-row strong,
.dashboard-split-kpi strong {
  font-size: 1.75rem;
  line-height: 1;
  color: #111827;
}

.dashboard-kpi-row span,
.dashboard-split-kpi span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-kpi-row .danger strong {
  color: var(--red);
}

.dashboard-kpi-row .warning strong {
  color: var(--amber);
}

.dashboard-donut-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.dashboard-donut {
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#2b70ad var(--donut-value, 0%), #f2c04c 0);
  position: relative;
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: white;
}

.dashboard-donut span {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 900;
}

.dashboard-legend {
  display: grid;
  gap: 7px;
}

.dashboard-legend div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
}

.horizontal-bars,
.dashboard-list {
  display: grid;
  gap: 8px;
}

.horizontal-bar-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.horizontal-bar-row div {
  height: 18px;
  background: #eef2f7;
}

.horizontal-bar-row i {
  display: block;
  height: 100%;
  background: #2b70ad;
}

.dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e6edf3;
  padding-bottom: 7px;
}

.dashboard-list-item strong,
.dashboard-list-item span {
  display: block;
}

.dashboard-list-item span {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.split,
.count-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 16px;
}

.count-layout {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 18px;
}

.drop-zone {
  position: relative;
  border: 2px dashed #aab3c2;
  border-radius: 8px;
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: #f8fafc;
}

.drop-zone.dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label:has(textarea),
.form-grid label:has(input[type="file"]),
.form-grid .checkbox-label,
.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  min-height: 44px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.16);
  border-color: var(--teal);
}

.compact-input {
  max-width: 260px;
}

.session-actions {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 14px;
}

.count-mode-actions {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  margin-bottom: 14px;
}

.count-mode-actions .mode-active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

#countModeStatus {
  border: 1px solid #9bd7d1;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  padding: 9px 11px;
}

.location-zone {
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  margin-bottom: 14px;
}

.location-zone label {
  flex: 1 1 220px;
}

#count .location-zone label {
  flex: 0 1 340px;
}

.session-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.checkbox-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 10px 12px;
}

.checkbox-label input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.primary-button,
.secondary-button,
.danger-button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 13px;
  min-height: 42px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.secondary-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: var(--red);
  color: white;
}

.notice {
  margin-top: 14px;
  padding: 12px;
  border-radius: 7px;
  background: #eef2f7;
  color: var(--muted);
}

.origin-warning {
  margin-top: 0;
  margin-bottom: 12px;
  background: var(--amber-soft);
  border: 1px solid #f4d58a;
  color: #7a4d00;
}

.attached-files {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.attached-file-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attached-file-card strong,
.attached-file-card span {
  display: block;
}

.attached-file-card span {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.remove-file-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--red);
  font-weight: 900;
  flex: 0 0 auto;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.results,
.activity-list {
  display: grid;
  gap: 9px;
}

.results {
  margin: 12px 0 16px;
}

.result-item,
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.result-item button {
  align-self: center;
}

.empty-state {
  color: var(--muted);
  min-height: 72px;
  align-content: center;
}

.validation {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.validation div {
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 12px;
  min-height: 82px;
}

.validation dt {
  color: var(--muted);
}

.validation dd {
  margin: 0;
  font-weight: 900;
}

.sticky-summary {
  align-self: start;
  position: static;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table-wrap {
  max-height: min(62vh, 620px);
}

.dashboard-table-wrap {
  margin-top: 14px;
}

.dashboard-stock-metrics {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.manual-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.manual-panel h3 {
  margin: 14px 0 8px;
  color: var(--nav);
  font-size: 1rem;
}

.manual-block {
  padding: 0 10px 12px;
}

.manual-steps {
  margin: 0;
  padding-left: 22px;
  line-height: 1.55;
}

.manual-steps li + li {
  margin-top: 6px;
}

.scan-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.count-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.count-control-block {
  display: grid;
  gap: 10px;
}

.count-top-grid .session-actions,
.count-top-grid .count-mode-actions,
.count-top-grid .location-zone {
  margin-bottom: 0;
}

.count-location-zone {
  align-content: end;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.locations-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(520px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.location-summary-grid,
.import-summary-grid,
.inventory-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.import-summary-grid {
  margin-top: 14px;
}

.inventory-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.summary-title {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--nav);
  font-size: 0.95rem;
}

.map-actions {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.location-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.location-summary-card span,
.location-summary-card strong {
  display: block;
}

.location-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.location-summary-card strong {
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1;
}

.location-mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.order-tables {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.compact-drop {
  min-height: 112px;
}

.dispatch-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.active-orders-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.active-order-card,
.packing-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.active-order-card strong,
.active-order-card span {
  display: block;
}

.active-order-card span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.order-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.compact-heading {
  margin-top: 16px;
  margin-bottom: 10px;
}

.dispatch-map {
  position: relative;
  margin-top: 12px;
  padding: 10px;
  border: 2px solid #343a40;
  border-radius: 8px;
  background: #eef0f2;
  overflow: hidden;
}

.compact-map {
  margin-top: 0;
}

.warehouse-grid {
  display: grid;
  grid-template-columns: 70px repeat(2, minmax(82px, 1fr));
  grid-auto-rows: minmax(34px, auto);
  gap: 4px;
}

.map-row-label {
  display: grid;
  align-content: center;
  color: #11356a;
  font-weight: 900;
  line-height: 1.05;
}

.map-row-label span {
  display: block;
  color: #31527e;
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 2px;
}

.shelf-zone {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid #1e4f82;
  border-radius: 4px;
  background: linear-gradient(180deg, #e8f4ff, #cfe7fb);
  color: #111827;
  font-weight: 900;
  min-height: 42px;
  box-shadow: inset 0 0 0 2px rgba(30, 79, 130, 0.22);
}

.compact-map .shelf-zone {
  min-height: 34px;
  font-size: 0.86rem;
}

.shelf-zone span {
  display: block;
  color: #31527e;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  margin-top: -6px;
}

.shelf-zone.target {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.22), inset 0 0 0 2px rgba(180, 35, 24, 0.14);
}

.shelf-zone.target span {
  color: var(--red);
}

.shelf-zone.row-selected:not(.target) {
  border-color: var(--blue);
  background: #eff6ff;
}

.shelf-zone.has-stock:not(.target) {
  border-color: #0f766e;
  background: #dff7f4;
  color: #064e3b;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.shelf-zone.has-stock:not(.target) span {
  color: #064e3b;
}

.shelf-zone.target::after {
  content: attr(data-count);
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.aisle-label {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  border-top: 2px dashed white;
  border-bottom: 2px dashed white;
  color: #4b5563;
  font-weight: 900;
  min-height: 16px;
  font-size: 0.72rem;
}

.location-table-wrap {
  max-height: 440px;
}

.map-room,
.main-aisle {
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 900;
}

.map-room.receiving {
  grid-column: 1 / span 2;
  background: #edf7e8;
  color: #2f6d2d;
}

.main-aisle {
  grid-column: 3 / span 2;
  border-style: dashed;
  background: #f8fafc;
  color: #374151;
}

.map-room.dispatch {
  grid-column: 5 / span 2;
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.map-legend {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.order-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.order-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.order-metric span,
.order-metric strong {
  display: block;
}

.order-metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.order-metric strong {
  margin-top: 6px;
  font-size: 1.6rem;
  line-height: 1;
}

.order-table-wrap {
  max-height: 440px;
}

.packing-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: 440px;
  overflow: auto;
}

.packing-board-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.packing-board-head strong,
.packing-board-head span {
  display: block;
}

.packing-board-head span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.packing-board-lines {
  display: grid;
  gap: 6px;
}

.dispatch-print-area {
  display: none;
}

.dispatch-print-document {
  background: white;
  color: #111827;
  padding: 14mm;
}

.dispatch-print-document h1 {
  font-size: 20pt;
  margin-bottom: 8mm;
}

.dispatch-print-document h2 {
  font-size: 13pt;
  margin: 0 0 2mm;
}

.dispatch-print-document p {
  font-size: 9pt;
  margin: 0 0 3mm;
}

.dispatch-print-document table {
  min-width: 0;
  font-size: 9pt;
  page-break-inside: auto;
}

.dispatch-print-document article {
  page-break-inside: avoid;
  margin-bottom: 8mm;
}

.shipping-label-print {
  display: none;
}

.shipping-label {
  width: 210mm;
  height: 148mm;
  padding: 14mm;
  background: white;
  color: #111827;
  border: 2px solid #111827;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.label-brand {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 2px solid #111827;
  padding-bottom: 8mm;
}

.label-brand strong {
  font-size: 28pt;
  line-height: 1;
}

.label-brand span {
  font-size: 13pt;
  font-weight: 900;
}

.label-grid {
  display: grid;
  gap: 6mm;
}

.label-grid div {
  border-bottom: 1px solid #111827;
  padding-bottom: 4mm;
}

.label-grid span,
.label-footer span {
  display: block;
  font-size: 10pt;
  font-weight: 900;
  color: #4b5563;
}

.label-grid strong {
  display: block;
  margin-top: 2mm;
  font-size: 20pt;
  line-height: 1.12;
}

.label-footer {
  display: flex;
  justify-content: space-between;
  gap: 10mm;
  border-top: 2px solid #111827;
  padding-top: 5mm;
}

.scan-table-wrap {
  max-height: 480px;
  overflow: auto;
}

.scan-table-wrap table {
  min-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: white;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  font-size: 0.9rem;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  z-index: 2;
}

.report-positive td {
  background: #ecfdf3;
  color: #05603a;
  font-weight: 900;
}

.report-negative td {
  background: #fef3f2;
  color: #b42318;
  font-weight: 900;
}

.report-th-title {
  display: block;
  color: var(--ink);
}

.excel-filter-th {
  position: sticky;
  overflow: visible;
  min-width: 170px;
}

.excel-filter-trigger {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: none;
}

.excel-filter-trigger.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.excel-filter-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 8px;
  z-index: 20;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 16px 35px rgba(31, 41, 55, 0.18);
  padding: 10px;
  text-transform: none;
}

.excel-filter-action {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  padding: 7px 9px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.excel-filter-search {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 0.84rem;
  margin: 4px 0 8px;
}

.excel-filter-checks {
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}

.excel-filter-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.excel-filter-option input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.excel-filter-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.excel-filter-footer button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge.pending {
  background: #e8edf5;
  color: #475467;
}

.badge.cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.deleted {
  background: #e5e7eb;
  color: #374151;
}

.badge.diff {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.surplus {
  background: #e7fbef;
  color: #12833c;
}

.badge.missing {
  background: #ffe8ee;
  color: #ef1736;
}

.badge.recount {
  background: var(--red-soft);
  color: var(--red);
}

.number-mark {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 9px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.number-mark.positive {
  border-color: #9ed8b6;
  background: #ecfdf3;
  color: #05603a;
}

.number-mark.negative {
  border-color: #f0b3ab;
  background: #fef3f2;
  color: #b42318;
}

.number-mark.neutral {
  border-color: #b8c7d8;
  background: #eef6fb;
  color: var(--blue);
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  max-width: min(720px, calc(100vw - 24px));
  width: 100%;
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.5);
}

.dialog-card {
  padding: 18px;
}

.correction-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.packing-board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.packing-board-table th,
.packing-board-table td {
  padding: 5px 6px;
}


.phone-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.phone-help strong,
.phone-help span {
  display: block;
}

.phone-help span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.pair-request-list {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.pair-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.pair-request-item strong,
.pair-request-item span {
  display: block;
}

.pair-request-item span {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.pair-request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.error-notice {
  background: var(--red-soft);
  color: var(--red);
}

video {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111827;
  border-radius: 8px;
  object-fit: cover;
}


.camera-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 10px 13px;
  font-weight: 800;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}


/* SAP classic-inspired theme */
.app-shell {
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  background: #1f2d3f;
  border-right: 1px solid #33465f;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
  padding: 14px 8px;
  gap: 14px;
}

.brand {
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: white;
  box-shadow: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #2d6cdf;
  color: white;
  text-shadow: none;
}

.brand strong {
  font-size: 1.15rem;
  color: white;
}

.brand span,
.sync-card small {
  color: #aab6c7;
}

.menu-group {
  border: 0;
  background: transparent;
}

.menu-group-title {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 7px;
  background: transparent;
  border-bottom: 0;
  color: #e9eef6;
  text-shadow: none;
  gap: 11px;
}

.menu-arrow {
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #dfe7f2;
  font-size: 0;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.menu-arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.menu-group.open .menu-arrow {
  transform: rotate(90deg);
}

.menu-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: #b8c4d4;
  display: inline-grid;
  place-items: center;
}

.menu-icon::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.menu-icon-control::before {
  border-radius: 2px;
  box-shadow: inset 0 -5px 0 rgba(184, 196, 212, 0.38);
}

.menu-icon-dispatch::before {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  box-shadow: 5px 4px 0 -2px #b8c4d4;
}

.menu-icon-dashboard::before {
  border-radius: 50%;
}

.menu-icon-summary::before {
  width: 15px;
  height: 11px;
  border-top-width: 5px;
}

.menu-icon-import::before {
  border-radius: 50%;
  border-top-color: transparent;
}

.menu-icon-locations::before {
  width: 13px;
  height: 17px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.menu-icon-master::before {
  border-radius: 2px;
  box-shadow: inset 0 5px 0 rgba(184, 196, 212, 0.34);
}

.menu-icon-reports::before {
  height: 16px;
  border-radius: 2px;
  box-shadow: inset 0 -4px 0 rgba(184, 196, 212, 0.34);
}

.menu-icon-personal::before {
  border-radius: 50% 50% 44% 44%;
  box-shadow: 0 9px 0 -3px currentColor;
}

.menu-icon-system::before {
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(184, 196, 212, 0.22);
}

.menu-label {
  flex: 1 1 auto;
}

.menu-branch {
  gap: 4px;
  margin: 2px 0 6px 36px;
  padding-left: 0;
  background: transparent;
}

.menu-branch::before {
  display: none;
}

.nav-tab {
  border-radius: 7px;
  color: #d9e3ef;
  min-height: 34px;
}

.menu-child {
  padding: 7px 10px 7px 24px;
  font-size: 0.9rem;
  border-bottom: 0;
}

.menu-child::before {
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8392a7;
}

.nav-tab:hover,
.nav-tab.active {
  background: #34465d;
  color: white;
  font-weight: 900;
}

.sync-card {
  border-radius: 8px;
  background: #25364b;
  color: #edf3fb;
  border-color: #3b4e67;
}

.main {
  padding: 0 10px 12px;
}

.topbar {
  min-height: 74px;
  margin: 0 -10px 10px;
  padding: 10px 16px 8px;
  background: linear-gradient(#ffffff 0, #dcecf5 46%, #b7d6e8 100%);
  border-bottom: 1px solid #7daeca;
  box-shadow: inset 0 -1px 0 white;
}

.eyebrow {
  color: #245d83;
  font-size: 0.72rem;
}

h1 {
  font-size: 1.35rem;
  font-style: italic;
  color: #031f39;
}

h2 {
  font-size: 0.95rem;
  color: #123d5c;
}

.panel,
.metric {
  border-radius: 0;
  border-color: #8fb4c9;
  background: #edf7fb;
  box-shadow: 0 1px 1px rgba(0, 50, 90, 0.16);
}

.panel {
  padding: 0;
}

.panel-heading {
  min-height: 32px;
  margin: 0;
  padding: 6px 9px;
  border-bottom: 1px solid #8fb4c9;
  background: linear-gradient(#dff2fa, #b7d8e9);
  box-shadow: inset 0 1px 0 white;
}

.panel > :not(.panel-heading) {
  margin-left: 10px;
  margin-right: 10px;
}

.panel > .table-wrap,
.panel > .drop-zone,
.panel > .locations-layout,
.panel > .order-tables {
  margin-left: 10px;
  margin-right: 10px;
}

.metric {
  min-height: 76px;
  padding: 10px;
  background: linear-gradient(#f8fdff, #d7eaf4);
}

.metric strong {
  font-size: 1.55rem;
  color: #073d70;
}

input,
select,
textarea {
  min-height: 28px;
  border-radius: 0;
  border-color: #8ea7b5;
  background: #fdfefe;
  padding: 5px 7px;
  box-shadow: inset 1px 1px 1px rgba(0, 42, 80, 0.12);
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid #f7b500;
  border-color: #bb8d00;
  background: #fffbe8;
}

.primary-button,
.secondary-button,
.danger-button,
.file-button {
  border-radius: 0;
  min-height: 28px;
  padding: 5px 10px;
  font-size: 0.88rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.primary-button {
  background: linear-gradient(#ffe88a, #f3c13a);
  border-color: #a97500;
  color: #2f2600;
}

.secondary-button,
.file-button {
  background: linear-gradient(#ffffff, #c7dce9);
  border-color: #7aa6bd;
  color: #073d70;
}

.danger-button {
  background: linear-gradient(#ffd6d6, #d25c5c);
  border-color: #9b1b1b;
  color: #3b0000;
}


.drop-zone,
.session-actions,
.count-mode-actions,
.location-zone,
.notice,
.attached-file-card,
.result-item,
.activity-item,
.phone-help,
.active-order-card,
.packing-board,
.order-metric {
  border-radius: 0;
  background: #f5fbfe;
  border-color: #a5c2d2;
}

.notice {
  color: #244a60;
}

.order-status-select {
  width: 150px;
  min-height: 24px;
  padding: 2px 5px;
  font-size: 0.78rem;
  background: #fffef2;
}

.order-status-select:disabled {
  color: #536879;
  background: #e7f0f5;
}

.active-order-card.active-window {
  border-color: #07508f;
  background: #dff1fb;
  box-shadow: inset 3px 0 0 #07508f;
}

.mini-window-button {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 0.76rem;
}

.table-wrap {
  border-radius: 0;
  border-color: #8fb4c9;
  background: white;
}

table {
  background: #ffffff;
  font-size: 0.84rem;
}

th,
td {
  padding: 6px 7px;
  border-color: #c5d9e4;
}

th {
  background: linear-gradient(#edf8fd, #bdd9e8);
  color: #143d59;
  font-size: 0.74rem;
  text-transform: none;
}

tbody tr:nth-child(even) td {
  background: #f3f8fb;
}

.order-line-status.pending td,
.order-line-status.pending:nth-child(even) td {
  background: #b42318;
  color: #ffffff;
}

.order-line-status.ok td,
.order-line-status.ok:nth-child(even) td {
  background: #dcfce7;
  color: #166534;
}

.order-line-status .badge {
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.pick-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-weight: 900;
}

.pick-check-label input {
  width: 24px;
  height: 24px;
  accent-color: #15803d;
}

.badge {
  border-radius: 0;
  min-height: 20px;
  padding: 2px 7px;
}

.excel-filter-trigger,
.excel-filter-menu,
.excel-filter-action,
.excel-filter-checks,
dialog,
.dialog-card,
video,
.dispatch-map,
.shelf-zone,
.map-room,
.main-aisle {
  border-radius: 0;
}

/* Damasa ERP final override */
body {
  background:
    radial-gradient(circle at 0 0, rgba(8, 86, 184, 0.28), transparent 34%),
    linear-gradient(135deg, #021538 0%, #062e69 42%, #f3f7fc 42%, #f3f7fc 100%);
  color: var(--erp-text);
}

.app-shell {
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  background:
    radial-gradient(circle at 30px 46px, rgba(14, 103, 219, 0.45), transparent 62px),
    linear-gradient(180deg, #062f70 0%, #041f4c 55%, #031738 100%);
  border-right: 0;
  padding: 24px 16px;
  gap: 22px;
}

.brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 4px 8px 20px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-mark {
  width: auto;
  height: auto;
  background: transparent;
  font-size: 0;
  border-radius: 0;
}

.brand-mark::before {
  content: "damasa";
  color: var(--erp-red);
  font-size: 2.15rem;
  line-height: 1;
  font-weight: 900;
}

.brand strong {
  display: none;
}

.brand span {
  max-width: 170px;
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.menu-group-title {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: #eaf1fb;
  font-size: 0.98rem;
}

.menu-group-title:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-icon,
.menu-arrow {
  color: #eaf1fb;
}

.menu-branch {
  margin: 6px 0 10px 0;
  gap: 6px;
  background: transparent;
}

.menu-child {
  min-height: 42px;
  padding: 9px 12px 9px 48px;
  border-radius: 7px;
  color: #eaf1fb;
}

.menu-child::before {
  left: 18px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: transparent;
  border: 2px solid currentColor;
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--erp-red);
  color: white;
  box-shadow: 0 10px 24px rgba(237, 11, 18, 0.24);
}

.sync-card {
  border: 0;
  background: rgba(0, 0, 0, 0.12);
  color: white;
  border-radius: 14px;
}

.main {
  padding: 16px 18px 22px;
  background: var(--erp-page);
}

.topbar {
  min-height: 76px;
  margin-bottom: 16px;
  padding: 14px 20px;
  border: 1px solid var(--erp-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(220px, 380px) auto;
  align-items: center;
  gap: 18px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.top-menu-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #0f274a;
  font-size: 1.4rem;
  font-weight: 900;
}
.top-menu-button::before,
.top-menu-button::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #0f274a;
  border-radius: 2px;
}

.top-menu-button::before {
  top: 11px;
  box-shadow: 0 6px 0 #0f274a;
}

.top-menu-button::after {
  top: 23px;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.35rem;
}

.top-brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--erp-blue);
  border-right-color: transparent;
  border-radius: 50%;
  color: transparent;
}

.top-brand strong {
  color: var(--erp-red);
}

.topbar h1 {
  font-size: 1.35rem;
  color: #061635;
}

.eyebrow {
  display: none;
}

.panel,
.metric,
.dashboard-card,
.dashboard-frame,
.order-metric,
.packing-board,
.active-order-card {
  border: 1px solid var(--erp-line);
  border-radius: 12px;
  background: var(--erp-card);
  box-shadow: var(--shadow);
}

.panel-heading {
  border: 0;
  background: transparent;
  padding: 0;
}

.dashboard-tab {
  display: none;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.dashboard-card:nth-child(1),
.dashboard-card:nth-child(5),
.dashboard-card:nth-child(7) {
  grid-column: span 2;
}

.primary-button {
  border-color: var(--erp-red);
  background: var(--erp-red);
  color: white;
}

/* Dashboard 100% Damasa mockup */
.topbar {
  grid-template-columns: minmax(360px, 1fr) auto;
}

.top-actions {
  gap: 12px;
}

#backupBtn,
#restoreBtn {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 9px;
  border-color: #d8e3f2;
  color: #08275a;
  background: white;
}

.dashboard-frame {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card,
.dashboard-card.compact {
  min-height: 178px;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(6, 43, 99, 0.06);
}

.dashboard-card:nth-child(1),
.dashboard-card:nth-child(5),
.dashboard-card:nth-child(7) {
  grid-column: span 1;
}

.erp-icon-head {
  justify-content: flex-start;
  gap: 16px;
}

.erp-icon-head > div {
  min-width: 0;
}

.erp-icon-head h2 {
  margin-bottom: 4px;
}

.erp-icon-head span:not(.erp-card-icon) {
  display: block;
  text-align: left;
}

.erp-icon-head strong {
  display: block;
  margin-top: 12px;
  font-size: 1.9rem;
  line-height: 1;
  color: #071a3d;
}

.erp-card-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  position: relative;
}

.erp-card-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-radius: 5px;
}

.erp-card-icon.purple::before {
  width: 16px;
  height: 22px;
  border-radius: 4px;
  box-shadow: inset 0 6px 0 rgba(113, 72, 232, 0.18);
}

.erp-card-icon.cyan::before {
  border-radius: 50%;
}

.erp-card-icon.pin::before {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.erp-card-icon.red::before {
  content: "!";
  width: auto;
  height: auto;
  border: 0;
  font-size: 1.6rem;
  font-weight: 900;
}

.erp-card-icon.blue {
  background: #e8edff;
  color: #0b5fd3;
}

.erp-card-icon.purple {
  background: #efe9ff;
  color: #7148e8;
}

.erp-card-icon.cyan {
  background: #dcfafa;
  color: #0891b2;
}

.erp-card-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.erp-card-icon.red {
  background: #ffe4e8;
  color: var(--erp-red);
}

.dashboard-bars {
  min-height: 54px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  padding: 0;
  margin-top: 8px;
}

.dashboard-vbar {
  gap: 5px;
}

.dashboard-vbar i {
  width: 100%;
  height: 4px;
  min-height: 4px;
  border-radius: 999px;
}

.dashboard-vbar span {
  font-size: 0.8rem;
  font-weight: 900;
}

.dashboard-vbar small {
  min-height: 0;
  font-size: 0.72rem;
}

.dashboard-kpi-row,
.dashboard-split-kpi {
  min-height: 92px;
}

.dashboard-kpi-row strong,
.dashboard-split-kpi strong {
  font-size: 1.55rem;
}

.dashboard-kpi-row article + article,
.dashboard-split-kpi div + div {
  border-left: 1px solid #dfe7f2;
}

.dashboard-donut-row {
  grid-template-columns: 132px minmax(0, 1fr);
}

.dashboard-donut {
  width: 108px;
}

.horizontal-bar-row {
  grid-template-columns: 54px minmax(0, 1fr) 28px;
}

.horizontal-bar-row div {
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
}

.horizontal-bar-row i {
  border-radius: 3px;
}

.dashboard-list-item {
  min-height: 34px;
}

/* Damasa reference match */
:root {
  --erp-navy: #062b63;
  --erp-navy-deep: #031a3f;
  --erp-blue: #0b5fd3;
  --erp-red: #ed0b12;
  --erp-page: #f5f8fd;
  --erp-card: #ffffff;
  --erp-line: #dbe6f4;
  --erp-text: #071638;
  --erp-muted: #50658a;
  --shadow: 0 10px 28px rgba(15, 37, 77, 0.06);
}

html {
  background: var(--erp-page);
}

body {
  background: var(--erp-page);
  color: var(--erp-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 18px 42px;
  gap: 34px;
  background:
    radial-gradient(circle at 60px 42px, rgba(0, 111, 255, 0.34), transparent 92px),
    linear-gradient(180deg, #062f70 0%, #05285f 44%, #031738 100%);
  color: #ffffff;
}

.brand {
  display: grid;
  min-height: 86px;
  padding: 0 12px;
  gap: 12px;
  align-content: start;
}

.brand-logo {
  display: block;
  width: 178px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  transform: translateX(-4px);
}

.brand-mark,
.brand strong {
  display: none;
}

.brand span {
  max-width: none;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
  padding-left: 40px;
}

.menu-tree {
  gap: 15px;
}

.menu-group {
  gap: 0;
}

.menu-group-title {
  min-height: 58px;
  padding: 0 14px;
  border-radius: 9px;
  gap: 13px;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 900;
}

.menu-group:first-child > .menu-group-title,
.menu-group-title:hover {
  background: linear-gradient(180deg, #ff2638 0%, #ed0b12 100%);
  box-shadow: 0 15px 28px rgba(237, 11, 18, 0.28);
}

.menu-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

.menu-icon::before {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: currentColor;
}

.menu-arrow {
  margin-left: auto;
  color: #ffffff;
}

.menu-arrow::before {
  width: 9px;
  height: 9px;
  border-width: 2px;
}

.menu-branch {
  margin: 8px 0 2px 42px;
  gap: 6px;
}

.menu-child {
  min-height: 36px;
  padding: 8px 12px;
}

.menu-child::before {
  display: none;
}

.sync-card {
  min-height: 78px;
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(0, 15, 43, 0.24);
  color: #ffffff;
}

.sync-card strong {
  font-size: 0.88rem;
}

.sync-card small {
  color: #e1e8f5;
  font-size: 0.78rem;
}

.status-dot {
  width: 15px;
  height: 15px;
  background: #22c55e;
}

.main {
  min-width: 0;
  padding: 0 26px 38px;
  background: var(--erp-page);
}

.topbar {
  min-height: 110px;
  margin: 0 -26px 0;
  padding: 28px 26px;
  border: 0;
  border-bottom: 1px solid #e4ebf5;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 20px rgba(15, 37, 77, 0.04);
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(300px, 410px) minmax(500px, auto);
  align-items: center;
  gap: 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.top-menu-button {
  position: relative;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b254f;
  flex: 0 0 auto;
}

.top-menu-button::before,
.top-menu-button::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.top-menu-button::before {
  top: 10px;
  box-shadow: 0 7px 0 currentColor;
}

.top-menu-button::after {
  top: 24px;
}

.top-brand {
  width: 128px;
  height: 42px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.top-brand-logo {
  width: 128px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.top-brand-mark,
.top-brand strong {
  display: none;
}

.topbar h1 {
  margin: 0;
  color: #071638;
  font-size: 1.32rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.top-search {
  height: 54px;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  box-shadow: 0 8px 24px rgba(15, 37, 77, 0.04);
}

.top-search input {
  min-height: 0;
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #19345e;
  font-size: 0.84rem;
  outline: 0;
  padding: 0;
}

.top-search input::placeholder {
  color: #8190ad;
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #6d82a6;
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 2px;
  background: #6d82a6;
  transform: rotate(45deg);
}

.search-dot {
  width: 16px;
  height: 16px;
  border: 2px solid #7f90b1;
  border-radius: 50%;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.install-button {
  display: none;
}

#backupBtn,
#restoreBtn {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid #d5e0ef;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: none;
  color: #082454;
  font-size: 0.84rem;
  font-weight: 900;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-button span {
  width: 20px;
  height: 20px;
  display: inline-block;
  position: relative;
  color: #082454;
}

.backup-action span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 16px;
  height: 9px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 8px 8px 5px 5px;
}

.backup-action span::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.restore-action span::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 3px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.restore-action span::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid currentColor;
}

.refresh-action span::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-action span::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transform: rotate(-20deg);
}

.notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #071638;
  padding: 0;
}

.notification-button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 11px;
  width: 15px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 5px 5px;
}

.notification-button::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 29px;
  width: 7px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: currentColor;
}

.notification-button span {
  position: absolute;
  right: 2px;
  top: 0;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--erp-red);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
  z-index: 1;
}

.admin-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f9dcc9;
  color: #c54508;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.admin-menu {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #082454;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-weight: 900;
}

.admin-menu span {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.origin-warning {
  position: relative;
  min-height: 80px;
  margin: 0 0 24px;
  padding: 23px 64px 18px 66px;
  border: 1px solid #bcd2fb;
  border-radius: 10px;
  background: #f4f8ff;
  color: #092653;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.45;
  box-shadow: none;
}

.origin-warning::before {
  content: "i";
  position: absolute;
  left: 24px;
  top: 27px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1e62d0;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
}

.origin-warning::after {
  content: "x";
  position: absolute;
  right: 25px;
  top: 27px;
  color: #315d9d;
  font-size: 1.25rem;
  font-weight: 400;
}

.dashboard-frame {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.dashboard-card,
.dashboard-card.compact {
  min-height: 214px;
  padding: 26px;
  border: 1px solid var(--erp-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.dashboard-card:nth-child(1),
.dashboard-card:nth-child(5),
.dashboard-card:nth-child(7) {
  grid-column: span 1;
}

.dashboard-card:nth-child(n + 7) {
  min-height: 288px;
}

.dashboard-card-head {
  gap: 18px;
}

.dashboard-card-head h2 {
  color: #071638;
  font-size: 1rem;
  font-weight: 900;
}

.dashboard-card-head span {
  color: #42567f;
  font-size: 0.8rem;
  font-weight: 700;
}

.erp-icon-head {
  justify-content: flex-start;
  align-items: flex-start;
}

.erp-icon-head strong {
  margin-top: 20px;
  color: #020817;
  font-size: 2.08rem;
  font-weight: 900;
  letter-spacing: 0;
}

.erp-card-icon {
  width: 70px;
  height: 70px;
  border-radius: 14px;
}

.erp-card-icon::before {
  width: 24px;
  height: 24px;
}

.dashboard-bars {
  min-height: 74px;
  margin-top: 4px;
  gap: 28px;
}

.dashboard-vbar {
  gap: 8px;
}

.dashboard-vbar span {
  color: #071638;
  font-size: 0.88rem;
  font-weight: 900;
}

.dashboard-vbar i {
  width: 100%;
  height: 5px;
  min-height: 5px;
  border-radius: 999px;
}

.dashboard-vbar i.blue,
.legend-blue,
.horizontal-bar-row i {
  background: #1767d8;
}

.dashboard-vbar i.green,
.legend-green {
  background: #23c266;
}

.dashboard-vbar i.amber,
.legend-amber {
  background: #ff9f16;
}

.dashboard-vbar i.red {
  background: #ed0b12;
}

.dashboard-vbar small {
  color: #33476e;
  font-size: 0.76rem;
  font-weight: 700;
}

.dashboard-kpi-row,
.dashboard-split-kpi {
  min-height: 128px;
  gap: 18px;
}

.dashboard-kpi-row strong,
.dashboard-split-kpi strong {
  color: #020817;
  font-size: 1.72rem;
  font-weight: 900;
}

.dashboard-kpi-row span,
.dashboard-split-kpi span {
  color: #41577f;
  font-size: 0.82rem;
}

.dashboard-kpi-row .danger strong {
  color: #ed0b22;
}

.dashboard-kpi-row .warning strong {
  color: #f04f00;
}

.dashboard-kpi-row article + article,
.dashboard-split-kpi div + div {
  border-left: 1px solid #dfe7f2;
}

.dashboard-donut-row {
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 130px;
}

.dashboard-donut {
  width: 118px;
  background: conic-gradient(#1767d8 var(--donut-value, 0%), #ff9f16 0 8%, #22c55e 8% 100%);
}

.dashboard-donut::after {
  inset: 31px;
}

.dashboard-donut span {
  color: #071638;
  font-size: 1.45rem;
}

.dashboard-legend {
  gap: 11px;
}

.dashboard-legend div {
  color: #41577f;
  font-size: 0.86rem;
  font-weight: 700;
}

.dashboard-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.horizontal-bars,
.dashboard-list {
  gap: 13px;
}

.horizontal-bar-row {
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  gap: 14px;
  color: #071638;
  font-size: 0.86rem;
  font-weight: 900;
}

.horizontal-bar-row div {
  height: 20px;
  border-radius: 3px;
  background: #edf1f6;
  overflow: hidden;
}

.horizontal-bar-row i {
  border-radius: 3px;
}

.dashboard-list-item {
  min-height: 43px;
  border-bottom: 1px solid #edf1f7;
}

.dashboard-list-item strong {
  color: #153466;
  font-size: 0.88rem;
}

.dashboard-list-item span {
  color: #1c376a;
  font-size: 0.78rem;
}

.number-mark {
  min-width: 62px;
  min-height: 34px;
  border: 1px solid #c5d8f4;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: #f3f8ff;
  color: #0757bf;
  font-weight: 900;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(300px, 1fr) minmax(260px, 360px);
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .menu-group {
    flex: 0 0 auto;
  }

  .nav-tab {
    flex: 0 0 auto;
  }

  .sync-card {
    display: none;
  }

  .metrics-grid,
  .dashboard-grid,
  .split,
  .count-layout,
  .scan-dashboard,
  .locations-layout,
  .order-layout,
  .order-tables,
  .manual-layout,
  .form-grid,
  .validation,
  .location-summary-grid,
  .import-summary-grid,
  .inventory-summary-grid,
  .count-top-grid {
    grid-template-columns: 1fr;
  }

  .location-mode-group {
    grid-template-columns: 1fr;
  }

  .order-actions {
    grid-template-columns: 1fr;
  }

  .dispatch-details {
    grid-template-columns: 1fr;
  }

  .sticky-summary {
    position: static;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 88px;
  }

  .metric strong {
    font-size: 1.55rem;
  }

  .dashboard-frame {
    padding: 10px;
  }

  .dashboard-donut-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .search-row {
    align-items: stretch;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: white;
  }

  body.printing-label * {
    visibility: hidden;
  }

  body.printing-dispatch * {
    visibility: hidden;
  }

  body.printing-label #shippingLabelPrintArea,
  body.printing-label #shippingLabelPrintArea * {
    visibility: visible;
  }

  body.printing-dispatch #dispatchPrintArea,
  body.printing-dispatch #dispatchPrintArea * {
    visibility: visible;
  }

  body.printing-label #shippingLabelPrintArea {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 210mm;
    height: 148mm;
  }

  body.printing-label .shipping-label {
    display: flex;
    box-shadow: none;
  }

  body.printing-dispatch #dispatchPrintArea {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm;
  }

  body:not(.printing-label):not(.printing-dispatch) .sidebar,
  body:not(.printing-label):not(.printing-dispatch) .topbar {
    display: none;
  }

  body:not(.printing-label):not(.printing-dispatch) .app-shell,
  body:not(.printing-label):not(.printing-dispatch) .main,
  body:not(.printing-label):not(.printing-dispatch) .view {
    display: block;
    padding: 0;
  }

  body:not(.printing-label):not(.printing-dispatch) .panel {
    box-shadow: none;
    border: 0;
  }
}
