:root {
  color-scheme: light;
  --bg: #eef3f2;
  --nav: #0c2f2d;
  --nav-soft: #123d3a;
  --surface: #ffffff;
  --surface-soft: #f6f9f8;
  --line: #d8e2df;
  --line-strong: #afbeb9;
  --text: #17211f;
  --muted: #687773;
  --primary: #0f766e;
  --primary-dark: #0a5d57;
  --primary-soft: #ddf4ef;
  --warning: #b45309;
  --danger: #bd3d17;
  --good: #177245;
  --shadow: 0 14px 32px rgba(21, 39, 36, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  color: #fff;
  background: var(--nav);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--nav);
  background: #fff;
  font-size: 22px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: #a8c3bd;
  font-size: 12px;
}

.side-nav nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #d7e7e3;
  background: transparent;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: var(--nav-soft);
}

.side-note {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.side-note span {
  color: #a8c3bd;
  font-size: 12px;
}

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

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.user-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.icon-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  white-space: nowrap;
}

.icon-button svg,
.file-button svg {
  width: 18px;
  height: 18px;
}

.icon-button.primary {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.icon-button.primary:hover {
  background: var(--primary-dark);
}

.icon-button.danger {
  border-color: rgba(189, 61, 23, 0.32);
  color: var(--danger);
  background: #fff7f4;
}

.icon-button.secondary:hover,
.file-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button:disabled,
.mini-button:disabled,
.file-button.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.risk-banner {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid #f0b7a5;
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  background: #fff8f5;
}

.risk-banner-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
}

.risk-banner-icon svg {
  width: 20px;
  height: 20px;
}

.risk-banner strong {
  color: #7c2d12;
  font-size: 15px;
}

.risk-banner p {
  margin: 4px 0 0;
  color: #8c4a32;
  font-size: 12px;
}

.risk-banner > span {
  color: #7c2d12;
  font-size: 12px;
  font-weight: 800;
}

.risk-metrics .risk-critical-card strong {
  color: #b42318;
}

.risk-metrics .risk-warning-card strong {
  color: #b45309;
}

.risk-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.source-metrics-panel {
  margin-bottom: 14px;
  padding: 4px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.source-metrics-panel .panel-heading {
  padding-inline: 4px;
}

.source-metrics-grid {
  margin-bottom: 12px;
}

.weekly-analysis-panel {
  margin-bottom: 14px;
  overflow: hidden;
}

.weekly-analysis-table-wrap {
  max-height: 520px;
}

#customersView table {
  min-width: 1780px;
}

.risk-filters button {
  min-width: 88px;
}

.risk-visual-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.risk-donut-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 190px;
  padding: 18px;
}

.risk-donut {
  position: relative;
  display: grid;
  place-content: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(#cbd5d1 0 100%);
  text-align: center;
}

.risk-donut::after {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.risk-donut strong,
.risk-donut span {
  position: relative;
  z-index: 1;
}

.risk-donut strong {
  font-size: 25px;
}

.risk-donut span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.risk-legend {
  display: grid;
  gap: 10px;
}

.risk-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.risk-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.risk-legend-item span {
  color: var(--muted);
}

.risk-bars {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 190px;
  max-height: 228px;
  overflow: auto;
  padding: 16px;
}

.risk-bar-item {
  display: grid;
  grid-template-columns: minmax(84px, 0.75fr) minmax(100px, 1.4fr) 42px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.risk-bar-item > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.risk-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #e7ecea;
}

.risk-bar-track span {
  display: block;
  height: 100%;
  background: #cf5b32;
}

.risk-bar-item strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.risk-table-panel {
  overflow: hidden;
}

.risk-table-wrap {
  max-height: calc(100vh - 370px);
  min-height: 360px;
}

.risk-table {
  min-width: 1780px;
}

.risk-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line, #dfe9e6);
  color: var(--muted, #6b7c78);
  font-size: 12px;
}

.pagination-actions {
  display: inline-flex;
  gap: 8px;
}

.risk-table-pagination .icon-button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.risk-table tbody tr.risk-critical-row {
  background: #fff5f2;
}

.risk-table tbody tr.risk-warning-row {
  background: #fffbeb;
}

.risk-table tbody tr.risk-critical-row:hover {
  background: #fee9e2;
}

.risk-table tbody tr.risk-warning-row:hover {
  background: #fef3c7;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.risk-badge.abnormal {
  color: #9f2d11;
  background: #fee4dc;
}

.risk-badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.risk-badge.normal {
  color: #166534;
  background: #dcfce7;
}

.risk-reason {
  display: block;
  max-width: 128px;
  margin-top: 3px;
  color: var(--muted);
  white-space: normal;
  font-size: 10px;
  line-height: 1.25;
}

.risk-value-danger {
  color: #b42318;
}

.risk-value-warning {
  color: #b45309;
}

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

.dashboard-grid .wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  margin: 0;
  font-size: 16px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.table-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.table-pagination .icon-only:disabled {
  cursor: default;
  opacity: 0.45;
}

.panel-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.panel-sort select {
  width: auto;
  min-width: 150px;
  height: 32px;
  padding: 0 28px 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.mini-button,
.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
}

.mini-button {
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.mini-button svg,
.icon-only svg {
  width: 16px;
  height: 16px;
}

.icon-only {
  width: 32px;
  height: 32px;
}

.mini-button:hover,
.icon-only:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.progress-list {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.progress-item {
  display: grid;
  gap: 8px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.progress-top span {
  color: var(--muted);
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe8;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.table-wrap {
  max-height: calc(100vh - 300px);
  overflow: auto;
}

.table-wrap.tall {
  max-height: calc(100vh - 190px);
}

.table-wrap.compact {
  max-height: 420px;
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

th,
td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #edf4f2;
  font-weight: 800;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.number {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.surplus-text {
  color: var(--good);
}

.shortage-text {
  color: var(--danger);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.matched {
  color: var(--good);
  background: #e3f5eb;
}

.status.shortage {
  color: var(--danger);
  background: #fde8df;
}

.status.surplus {
  color: var(--warning);
  background: #fff1db;
}

.status.unvisited,
.status.systemless {
  color: #475569;
  background: #e8eef4;
}

.exception-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
}

.mini-link-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.mini-link-content {
  min-width: 0;
}

.mini-link-box strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.mini-link-box p {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0 0;
}

.handoff-grid div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.handoff-grid dt,
.handoff-grid dd {
  margin: 0;
}

.handoff-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.handoff-grid dd {
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.exception-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.exception-item span {
  color: var(--muted);
  font-size: 12px;
}

.exception-item em {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--warning);
  background: #fff1db;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.exception-bind {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.exception-bind select {
  min-width: 0;
  height: 32px;
  font-size: 12px;
}

.empty-state {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #162320;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.risk-metrics .risk-critical-card strong,
.risk-metrics .metric-card:nth-child(4) strong,
.risk-metrics .metric-card:nth-child(5) strong {
  color: #b42318;
}

.risk-metrics .risk-warning-card strong {
  color: #b45309;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 20, 18, 0.46);
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(12, 47, 45, 0.2);
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-heading h3 {
  margin: 0;
  font-size: 17px;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.panel-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-actions .icon-button {
  min-height: 30px;
  padding: 0 9px;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf3f1;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(12, 47, 45, 0.14);
}

.login-brand {
  margin-bottom: 22px;
  color: var(--text);
}

.login-brand .brand-mark {
  color: #fff;
  background: var(--primary);
}

.login-brand p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form .icon-button {
  width: 100%;
  margin-top: 4px;
}

.login-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

body {
  background:
    linear-gradient(90deg, rgba(8, 51, 52, 0.95) 0 248px, transparent 248px),
    linear-gradient(180deg, #dff4f3 0, #f6fbfb 220px, #edf7f6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(13, 148, 136, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.side-nav {
  background:
    linear-gradient(180deg, rgba(6, 78, 78, 0.98), rgba(2, 37, 42, 0.98)),
    var(--nav);
  box-shadow: inset -1px 0 rgba(20, 184, 166, 0.42), 12px 0 34px rgba(2, 44, 46, 0.18);
}

.brand-mark {
  color: #043b3a;
  background: linear-gradient(135deg, #f7ffff, #b8fff3);
  box-shadow: 0 0 0 1px rgba(125, 255, 229, 0.36), 0 0 24px rgba(45, 212, 191, 0.28);
}

.nav-item {
  position: relative;
  overflow: hidden;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.34), rgba(34, 197, 94, 0.18));
  box-shadow: inset 0 0 0 1px rgba(125, 255, 229, 0.3), 0 0 18px rgba(45, 212, 191, 0.22);
}

.side-note {
  border-color: rgba(94, 234, 212, 0.34);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(2, 44, 46, 0.72)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 28px rgba(20, 184, 166, 0.15), 0 0 28px rgba(20, 184, 166, 0.12);
}

.main {
  padding: 18px;
}

.topbar {
  min-height: 76px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(232, 253, 250, 0.88), rgba(248, 255, 255, 0.72));
  box-shadow: 0 16px 34px rgba(6, 78, 78, 0.1), inset 0 1px rgba(255, 255, 255, 0.8);
}

.topbar h2 {
  color: #073a3b;
  font-size: 28px;
  font-weight: 900;
}

.eyebrow {
  color: #0f9f8f;
}

.top-actions {
  flex: 1 1 680px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar > div:first-child {
  flex: 0 0 180px;
  min-width: 0;
}

.panel,
.metric-card,
.login-card,
.modal-card {
  border-color: rgba(19, 164, 150, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 254, 252, 0.92)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(6, 78, 78, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 184, 166, 0.24), transparent 24%, transparent 76%, rgba(20, 184, 166, 0.18)),
    linear-gradient(180deg, rgba(20, 184, 166, 0.12), transparent 42%);
  opacity: 0.62;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card[role="button"] {
  cursor: pointer;
}

.metric-card[role="button"]:hover,
.metric-card[role="button"]:focus-visible {
  border-color: rgba(20, 184, 166, 0.58);
  box-shadow: 0 18px 42px rgba(6, 78, 78, 0.14), 0 0 24px rgba(45, 212, 191, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.metric-card strong {
  color: #073a3b;
}

.metric-card:nth-child(2) strong,
.metric-card:nth-child(5) strong {
  color: #059669;
}

.metric-card:nth-child(4) strong {
  color: #0f766e;
}

.filters {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 253, 250, 0.82));
}

input,
select {
  border-color: rgba(15, 118, 110, 0.24);
  background: rgba(255, 255, 255, 0.92);
}

input:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18), 0 0 18px rgba(45, 212, 191, 0.12);
}

.icon-button,
.file-button,
.mini-button,
.icon-only {
  border-color: rgba(15, 118, 110, 0.25);
  background: linear-gradient(180deg, #ffffff, #effcf9);
}

.icon-button.primary,
.file-button:hover,
.mini-button:hover,
.icon-only:hover {
  border-color: rgba(20, 184, 166, 0.56);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.2), 0 0 18px rgba(20, 184, 166, 0.16);
}

.icon-button.primary {
  background: linear-gradient(135deg, #0f766e, #10b981);
}

.icon-only.danger,
.mini-button.danger,
.icon-button.danger {
  border-color: rgba(220, 38, 38, 0.32);
  color: #b42318;
  background: linear-gradient(180deg, #fff, #fff0ee);
}

.customer-actions {
  position: sticky;
  z-index: 2;
  right: 0;
  min-width: 218px;
  background: #f6fffd;
  box-shadow: -8px 0 14px rgba(15, 118, 110, 0.08);
  white-space: nowrap;
}

.customer-action-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.customer-action {
  min-width: 46px;
  height: 32px;
  padding: 0 6px;
}

.readonly-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

#customersView table {
  min-width: 1400px;
}

#customersView th:last-child {
  position: sticky;
  z-index: 4;
  right: 0;
  min-width: 286px;
  box-shadow: -8px 0 14px rgba(15, 118, 110, 0.08);
}

.panel-heading {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.12), rgba(255, 255, 255, 0));
}

.panel-heading h3 {
  color: #073a3b;
  font-weight: 900;
}

th {
  color: #0a4b4b;
  background: linear-gradient(180deg, #e7fbf7, #d9f6f2);
}

tbody tr:hover {
  background: rgba(219, 250, 244, 0.65);
}

.progress-bar {
  background: #deebe8;
}

.progress-bar span {
  background: linear-gradient(90deg, #10b981, #22d3ee);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.42);
}

.text-link {
  padding: 0;
  border: 0;
  color: #0f766e;
  background: transparent;
  font-weight: 800;
}

.text-link:hover {
  color: #0b5f5a;
  text-decoration: underline;
}

.detail-modal-card {
  width: min(920px, 100%);
}

.collection-modal-card {
  width: min(1280px, 100%);
}

.collection-modal-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.collection-summary {
  padding: 0 18px 4px;
}

.collection-summary .metric-formula {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.collection-body {
  max-height: min(62vh, 720px);
}

.collection-body .detail-table {
  max-height: 260px;
}

.collection-body .detail-section[hidden] {
  display: none;
}

.collection-row-actions {
  white-space: nowrap;
}

.collection-row-actions .mini-button + .mini-button {
  margin-left: 6px;
}

.detail-body {
  display: grid;
  gap: 14px;
  max-height: min(68vh, 680px);
  overflow: auto;
  padding: 18px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.detail-metrics article {
  min-height: 84px;
  padding: 12px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #edfdfa);
}

.detail-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-metrics strong {
  display: block;
  margin-top: 8px;
  color: #073a3b;
  font-size: 26px;
  line-height: 1;
}

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

.detail-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid dd {
  margin-top: 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section > strong {
  color: #073a3b;
  font-size: 15px;
}

.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.detail-table {
  max-height: 300px;
  overflow: auto;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
}

.detail-table table {
  min-width: 680px;
}

.detail-actions {
  padding: 0 18px 18px;
}

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

.pos-live-panel {
  margin-bottom: 14px;
  overflow: hidden;
}

.pos-live-panel > .panel-heading:first-child > div:first-child {
  display: grid;
  gap: 3px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf4f2;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segmented-control button.active {
  color: #fff;
  background: #0f766e;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
}

.pos-live-metrics {
  margin: 14px;
}

.pos-live-metrics .metric-card {
  min-height: 96px;
  box-shadow: none;
}

.pos-live-metrics .metric-card strong {
  font-size: 25px;
}

.pos-table-heading {
  border-top: 1px solid var(--line);
}

.pos-live-table-wrap {
  max-height: 460px;
}

.pos-live-table {
  min-width: max-content;
}

.pos-live-table th,
.pos-live-table td {
  min-width: 112px;
  max-width: 220px;
}

.pos-live-table th:nth-child(-n + 4),
.pos-live-table td:nth-child(-n + 4) {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.pos-live-table th:nth-child(-n + 4) {
  z-index: 4;
  background: #dff7f2;
}

.pos-live-table th:nth-child(1),
.pos-live-table td:nth-child(1) { left: 0; min-width: 142px; }
.pos-live-table th:nth-child(2),
.pos-live-table td:nth-child(2) { left: 142px; min-width: 126px; }
.pos-live-table th:nth-child(3),
.pos-live-table td:nth-child(3) { left: 268px; min-width: 126px; }
.pos-live-table th:nth-child(4),
.pos-live-table td:nth-child(4) { left: 394px; min-width: 210px; box-shadow: 8px 0 12px rgba(15, 118, 110, 0.08); }

#remindersView.active {
  display: grid;
  gap: 14px;
}

.report-import-options {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-import-options > label,
.template-field-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.report-import-options input,
.report-import-options select,
.template-field-picker select {
  width: auto;
  min-width: 126px;
  height: 34px;
  padding: 0 30px 0 9px;
  font-size: 12px;
  font-weight: 700;
}

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

.reminder-template-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reminder-template-grid textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.reminder-template-grid textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.reminder-template-grid textarea[readonly] {
  color: #526568;
  background: #f6faf9;
}

.reminder-ready {
  color: #166534 !important;
}

.reminder-unavailable {
  color: #b42318 !important;
}

.reminder-manager-table-wrap table {
  min-width: 1160px;
}

.reminder-row-actions {
  display: flex;
  gap: 6px;
  width: max-content;
}

.mini-button.warning {
  border-color: rgba(217, 150, 20, 0.38);
  color: #92400e;
  background: linear-gradient(180deg, #fff, #fff8e7);
}

.pairing-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
}

.login-screen {
  background:
    linear-gradient(180deg, rgba(232, 253, 250, 0.9), rgba(5, 57, 59, 0.26)),
    #edf8f6;
}

.toast {
  border: 1px solid rgba(94, 234, 212, 0.32);
  background: #063c3f;
  box-shadow: 0 18px 42px rgba(6, 78, 78, 0.26), 0 0 22px rgba(20, 184, 166, 0.16);
}

@media (max-width: 1300px) {
  .customer-actions {
    min-width: 108px;
  }

  .customer-action-list {
    display: grid;
    grid-template-columns: repeat(2, 46px);
    width: max-content;
  }

  #customersView th:last-child {
    min-width: 108px;
  }
}

@media (max-width: 980px) {
  body {
    min-width: 0;
    background: linear-gradient(180deg, #dff4f3 0, #f6fbfb 220px, #edf7f6 100%);
  }

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

  .panel-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .panel-sort select {
    min-width: 138px;
  }

  .side-nav {
    position: sticky;
    z-index: 20;
    top: 0;
    height: auto;
    padding: 8px 10px;
  }

  .brand {
    margin-bottom: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand p {
    display: none;
  }

  .side-nav nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 10px;
  }

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

  .side-note {
    display: none;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar > div:first-child {
    flex: none;
  }

  .top-actions {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .dashboard-grid,
  .risk-visual-grid,
  .form-grid,
  .handoff-grid {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .filters,
  .risk-filters,
  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions .user-chip,
  .filters .search-field,
  .risk-filters #resetRiskFilters,
  .risk-metrics .metric-card:first-child {
    grid-column: 1 / -1;
  }

  .top-actions .icon-button,
  .top-actions .file-button {
    min-width: 0;
    white-space: normal;
  }

  .risk-table-wrap {
    min-height: 340px;
    max-height: 540px;
  }

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

  .pos-live-metrics .metric-card:first-child,
  .pos-live-metrics .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .report-import-options {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .report-import-options > label,
  .report-import-options input,
  .report-import-options select,
  .report-import-options .segmented-control {
    width: 100%;
  }

  .reminder-template-grid {
    grid-template-columns: 1fr;
  }

  .pairing-code-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .risk-banner {
    grid-template-columns: 40px 1fr;
  }

  .risk-banner > span {
    grid-column: 2;
  }

  .risk-donut-layout {
    grid-template-columns: 120px 1fr;
  }

  .mini-link-box {
    flex-direction: column;
  }

  .span-2 {
    grid-column: auto;
  }
}

#metricAbnormal,
#metricRatioAbnormal,
#metricInventoryAbnormal {
  color: #b42318;
}

#metricWarning {
  color: #b45309;
}

.selection-cell { width: 42px; text-align: center; }
.selection-cell input { width: 17px; height: 17px; accent-color: #0f766e; }
.dispatch-modal-card { width: min(680px, calc(100vw - 32px)); }
.dispatch-manager-groups { display: grid; gap: 8px; max-height: 250px; overflow: auto; }
.dispatch-manager-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border: 1px solid #b9d9d4; border-radius: 6px; background: #f4fbf9; }
.dispatch-manager-group p { grid-column: 1 / -1; margin: 0; color: #55706c; font-size: 12px; line-height: 1.5; }
.form-error { padding: 9px 12px; border-left: 3px solid #b42318; background: #fff3f1; color: #8e2018; }
.task-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 8px; }
.task-summary-grid article { min-height: 78px; padding: 12px; border: 1px solid #c5dfdb; border-radius: 6px; background: #f6fbfa; }
.task-summary-grid span, .task-filter-row span { display: block; color: #58706c; font-size: 12px; }
.task-summary-grid strong { display: block; margin-top: 7px; color: #123f3b; font-size: 24px; }
.task-filter-row { display: grid; grid-template-columns: repeat(3, minmax(160px, 240px)); gap: 10px; margin-top: 12px; }
.task-filter-row label { display: grid; gap: 5px; }
.task-filter-row select, .task-filter-row input, .task-admin-actions select { min-height: 34px; border: 1px solid #b8d2ce; border-radius: 5px; background: #fff; color: #173f3b; }
.task-type-badge, .task-status-badge, .task-receiver-warning { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.task-type-badge.assigned { background: #e5f3ff; color: #185a8d; }
.task-type-badge.adhoc { background: #ecf8ef; color: #25713d; }
.task-type-badge.legacy { background: #f0f1f2; color: #5d656b; }
.task-status-badge.pending, .task-status-badge.draft { background: #fff6d8; color: #835d00; }
.task-status-badge.in_progress { background: #e5f3ff; color: #185a8d; }
.task-status-badge.submitted { background: #e8f7ec; color: #24683a; }
.task-status-badge.cancelled { background: #f0f1f2; color: #62686d; }
.task-status-badge.overdue { background: #ffebe8; color: #a3261d; }
.task-receiver-warning { margin-left: 5px; background: #fff2df; color: #9a4f00; }
.task-instruction { min-width: 150px; max-width: 260px; white-space: normal; }
.task-id { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-accuracy { min-width: 112px; text-align: right; white-space: nowrap; }
.task-actions, .task-admin-actions { display: flex; align-items: center; gap: 6px; }
.task-admin-actions select { width: 120px; }

@media (max-width: 1000px) {
  .task-summary-grid { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
  .task-filter-row { grid-template-columns: 1fr; }
}

.scan-business { min-width: 0; max-width: 100%; color: var(--text); }
.scan-business-active .filters { grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(180px, 2fr); }
.scan-business-active .filters > label:not(:has(#countyFilter)):not(:has(#managerFilter)):not(:has(#customerTypeFilter)):not(:has(#keywordSearch)),
.scan-business-active .top-actions .file-button,
.scan-business-active #templateBtn,
.scan-business-active #customerTemplateBtn,
.scan-business-active #exportBtn { display: none; }
.scan-business h3, .scan-business h4 { margin: 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.scan-business h4 { font-size: 15px; }
.scan-business svg { width: 17px; height: 17px; flex: 0 0 17px; }
.sb-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sb-toolbar label { display: grid; gap: 5px; min-width: 136px; color: var(--muted); font-size: 11px; }
.sb-toolbar label span { line-height: 1.2; }
.sb-toolbar label select, .sb-toolbar label input { min-width: 0; height: 36px; }
.sb-store-filter { flex: 1 1 215px; max-width: 330px; }
.sb-toolbar .sb-store-filter { display: grid; gap: 5px; min-width: 136px; color: var(--muted); font-size: 11px; }
.sb-store-filter input, .sb-store-filter select { width: 100%; min-width: 0; height: 36px; }
.sb-store-filter small { font-size: 10px; line-height: 1.4; }
.sb-range { display: flex; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.sb-range button { height: 36px; padding: 0 13px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; }
.sb-range button:last-child { border-right: 0; }
.sb-range button.active { background: var(--primary); color: #fff; }
.sb-period { align-self: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sb-status-filter { margin-left: 0; }
.sb-command { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--primary-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.sb-command:hover { border-color: var(--primary); background: #f2faf7; }
.sb-command:disabled { cursor: default; color: #9ba8a4; opacity: .65; }
.sb-toolbar-error { flex-basis: 100%; color: #b42318; font-size: 12px; line-height: 1.5; }
.scan-business .icon-only { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--primary-dark); }
.scan-business .icon-only:disabled { cursor: default; color: #9ba8a4; opacity: .65; }
.sb-connection { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; min-height: 44px; padding: 10px 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sb-connection-state { display: inline-flex; gap: 6px; align-items: center; color: #8b6419; }
.sb-connection-state.is-connected { color: var(--good); }
.sb-connection .sb-error { flex-basis: 100%; }
.sb-error { color: #b42318; margin: 6px 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.sb-muted { color: var(--muted); }
.sb-warning { color: #97561c; }
.sb-metrics, .sb-inventory-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 20px; padding: 14px 0; border-bottom: 1px solid var(--line); background: #fff; }
.sb-metrics > div, .sb-inventory-metrics > div { min-width: 0; min-height: 98px; padding: 12px 18px; border-right: 1px solid var(--line); }
.sb-metrics > div:nth-child(4n), .sb-inventory-metrics > div:last-child { border-right: 0; }
.sb-metrics > div:nth-child(n+5) { border-top: 1px solid var(--line); }
.sb-metrics dt, .sb-inventory-metrics dt { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sb-metrics dd, .sb-inventory-metrics dd { margin: 9px 0; font-size: 24px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sb-metrics small, .sb-inventory-metrics small { display: block; min-height: 32px; font-size: 11px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.sb-metrics > div:nth-child(2) dd, .sb-metrics > div:nth-child(4) dd { color: var(--primary-dark); }
.sb-metrics > div:nth-child(6) dd, .sb-metrics > div:nth-child(8) dd { color: #a23e29; }
.sb-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; }
.sb-heading > span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sb-table-wrap { max-width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--line); background: #fff; }
.sb-table-wrap table { width: 100%; min-width: 610px; border-collapse: collapse; }
.sb-overview-table table { min-width: 1570px; }
.sb-records-table table { min-width: 920px; }
.sb-products-table table { min-width: 840px; }
.sb-table-wrap th { position: sticky; top: 0; padding: 11px 12px; background: #f1f6f5; white-space: nowrap; color: #4c655e; font-size: 12px; font-weight: 700; }
.sb-table-wrap td { padding: 11px 12px; font-size: 12px; vertical-align: middle; border-bottom: 1px solid #e7edeb; }
.sb-table-wrap tr:last-child td { border-bottom: 0; }
.sb-table-wrap td strong { display: block; max-width: 250px; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.sb-table-wrap td small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.sb-table-wrap td.number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-overview-table, .sb-records-table { min-height: 280px; max-height: 610px; }
.sb-link-reason { max-width: 190px; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.sb-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; border-radius: 4px; background: #edf0ef; color: #53635e; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.sb-linked { color: #176940; background: #e4f4eb; }
.sb-unmatched, .sb-master { color: #8a601a; background: #fff4d7; }
.sb-conflict { color: #a1392c; background: #ffebe6; }
.sb-suspended { color: #66706c; background: #e9edeb; }
.sb-scanned { color: #176940; background: #e4f4eb; }
.sb-unscanned { color: #a1392c; background: #ffebe6; }
.sb-unknown { color: #66706c; background: #e9edeb; }
.sb-overview-table .sb-badge + .sb-badge { margin-left: 5px; }
.sb-cigarette-value { display: inline-grid; gap: 4px; min-width: 78px; }
.sb-cigarette-value strong { font-size: 12px; white-space: nowrap; }
.sb-cigarette-value small { margin: 0 !important; font-size: 10px !important; font-weight: 400; white-space: normal; }
.sb-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; min-height: 260px; padding: 28px 20px; text-align: center; color: var(--muted); }
.sb-empty svg { width: 25px; height: 25px; flex-basis: 25px; }
.sb-empty strong { color: #4d625b; font-size: 15px; font-weight: 600; }
.sb-empty span { max-width: 560px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.sb-detail-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 66px; margin-bottom: 12px; }
.sb-detail-heading > div { min-width: 0; flex: 1; }
.sb-detail-heading span { color: var(--muted); font-size: 12px; }
.sb-band { padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.sb-band:last-child { border-bottom: 0; }
.sb-inventory-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 0; }
.sb-inventory-metrics dd { font-size: 22px; }
.sb-quality { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; background: #fff6df; color: #885918; font-size: 12px; line-height: 1.5; }
.sb-quality span { overflow-wrap: anywhere; }
.sb-stock-details { margin-top: 14px; }
.sb-stock-details summary { padding: 8px 0; cursor: pointer; color: var(--primary-dark); font-size: 13px; }
.sb-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-height: 56px; padding-top: 12px; }
.sb-pagination span { margin-right: auto; font-size: 12px; color: var(--muted); }
.customer-live-business { margin: 20px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.customer-live-business .sb-inventory-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.customer-live-business .sb-metrics dd { font-size: 20px; }
.customer-live-business .sb-empty { min-height: 170px; }

@media (max-width: 1180px) {
  .sb-inventory-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-inventory-metrics > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .scan-business-active .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-business-active .filters .search-field { grid-column: 1 / -1; }
  .sb-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 36px; grid-template-areas: "range range range" "end period period" "scan status status" "store store store" "export export refresh"; gap: 12px 10px; align-items: end; }
  .sb-range { grid-area: range; justify-self: start; }
  .sb-end-filter { grid-area: end; }
  .sb-start-filter, .sb-period { grid-area: period; }
  .sb-period { display: flex; align-items: center; min-height: 36px; justify-self: start; }
  .sb-status-filter { margin-left: 0; }
  .sb-toolbar label { min-width: 0; max-width: none; }
  .sb-scan-filter { grid-area: scan; }
  .sb-status-filter { grid-area: status; }
  .sb-store-filter { grid-area: store; }
  .sb-export { grid-area: export; }
  .sb-refresh { grid-area: refresh; align-self: end; }
  .sb-toolbar-error { grid-column: 1 / -1; }
  .sb-metrics, .sb-inventory-metrics, .customer-live-business .sb-inventory-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-metrics > div, .sb-inventory-metrics > div { padding: 11px; border-bottom: 1px solid var(--line); }
  .sb-metrics dd, .sb-inventory-metrics dd { font-size: 21px; }
  .sb-metrics > div:nth-child(even), .sb-inventory-metrics > div:nth-child(even) { border-right: 0; }
  .sb-connection { align-items: flex-start; flex-direction: column; gap: 7px; }
  .sb-heading { align-items: flex-start; }
  .sb-heading .mini-button { max-width: 100%; white-space: normal; }
  .sb-pagination { flex-wrap: wrap; }
  .sb-pagination span { flex-basis: 100%; }
}
