:root {
  --bg: #eaf6fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #60728a;
  --line: #cfe2ee;
  --blue: #075da8;
  --teal: #0d9488;
  --gold: #d89016;
  --shadow: 0 22px 70px rgba(15, 31, 52, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(7, 93, 168, 0.18), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(13, 148, 136, 0.18), transparent 58%),
    linear-gradient(180deg, #f9fdff, var(--bg));
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

.hero, .card, .panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero {
  padding: 42px;
  background: linear-gradient(135deg, #08213d, #0b5f93 52%, #0d9488);
  color: white;
}

.badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 950;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 22px 0 12px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: 0; }
h3 { margin: 0 0 8px; font-size: 22px; }
p { color: var(--muted); line-height: 1.55; }
.hero p { color: rgba(255, 255, 255, 0.82); font-size: 18px; }

.card { padding: 30px; }
label { display: block; margin: 14px 0 7px; color: #53667e; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.04em; }
input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #b8cee0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(7, 93, 168, 0.14); }

button, .button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  font-weight: 950;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary { background: white; color: var(--blue); border: 1px solid #acd2ef; }
.notice { margin-top: 16px; background: #fff8e8; border: 1px solid #f0d49b; border-radius: 16px; padding: 12px; color: #62420d; font-weight: 800; }
.run-progress { margin-top: 16px; padding: 16px; border: 1px solid #9fd8d3; border-radius: 16px; background: #f2fbfa; }
.run-progress-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #073f47; }
.run-progress-summary span { color: #456274; font-size: 14px; font-weight: 700; }
.run-progress-track { height: 14px; margin: 12px 0 9px; overflow: hidden; border-radius: 999px; background: #d9e9ee; }
.run-progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .25s ease; }
.run-progress-detail { color: #456274; font-size: 14px; font-weight: 700; }
.run-progress.success { border-color: #74c69d; background: #f0fbf5; }
.run-progress.error { border-color: #ef9a9a; background: #fff5f5; }
button:disabled { opacity: .62; cursor: wait; }
.wholesaler-empty { margin: 12px 0; background: #fff3e0; border: 1px solid #e5b46a; border-radius: 16px; padding: 14px 16px; color: #7a4a0e; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.wholesaler-empty .alert-icon { font-size: 18px; }


.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  color: white;
  background: linear-gradient(135deg, #08213d, #0d7d76);
  box-shadow: 0 14px 36px rgba(15, 31, 52, 0.2);
}

.brand strong { display: block; font-size: 22px; }
.brand span { color: rgba(255, 255, 255, 0.75); font-weight: 750; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); border-radius: 999px; padding: 9px 12px; font-weight: 900; }

.page { width: min(1720px, calc(100% - 40px)); margin: 22px auto; display: grid; gap: 18px; }
.panel { padding: 22px; }
.dashboard-shell { display: grid; gap: 14px; }
.upload-panel { border-top: 5px solid var(--teal); }
.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.upload-grid > div {
  border: 1px dashed #acd2ef;
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}
.upload-grid h3 { margin: 0 0 10px; }
.upload-grid p { margin: 10px 0 0; font-size: 14px; }
.upload-panel > button { margin-top: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary-strip { margin: 12px 0 16px; }
.hidden { display: none !important; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.metric { border: 1px solid #c9e4f3; border-radius: 18px; padding: 16px; background: #f7fcff; }
.metric span { display: block; color: var(--muted); text-transform: uppercase; font-size: 12px; font-weight: 950; }
.metric strong { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.04em; }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: visible;
  margin: 6px 0 14px;
  padding: 10px;
  background: rgba(231, 243, 249, 0.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  align-items: center;
}
.result-tab {
  --tab-color: var(--blue);
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tab-color) 32%, #ffffff);
  background: color-mix(in srgb, var(--tab-color) 9%, #ffffff);
  color: color-mix(in srgb, var(--tab-color) 84%, #102033);
  padding: 8px 12px;
  box-shadow: inset 0 3px 0 var(--tab-color);
  white-space: nowrap;
  flex: 0 0 auto;
}
.result-tab[data-result-tab="overview"] { --tab-color: #1565c0; }
.result-tab[data-result-tab="insurance"] { --tab-color: #0d9488; }
.result-tab[data-result-tab="patients"] { --tab-color: #7c3aed; }
.result-tab[data-result-tab="medications"] { --tab-color: #b07d12; }
.result-tab[data-result-tab="reconciliation"] { --tab-color: #dd6b1f; }
.result-tab[data-result-tab="controls"] { --tab-color: #d4304a; }
.result-tab[data-result-tab="pickup"] { --tab-color: #0ea5e9; }
.result-tab[data-result-tab="reimbursement"] { --tab-color: #0f9d58; }
.result-tab[data-result-tab="ordering"] { --tab-color: #8b5cf6; }
.result-tab.active { background: var(--tab-color); color: white; }
.result-panel { margin-top: 12px; }
.global-filters { margin-bottom: 12px; }
.global-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}
.global-filter-panel .filter-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}
.global-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  padding-bottom: 2px;
}
.result-panel > .table-card + .table-card,
.result-panel > .subgrid + .table-card,
.result-panel > .grid + .table-card,
.result-panel > .grid + .subgrid {
  margin-top: 16px;
}
.table-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 31, 52, 0.08);
}
.table-card.full-span,
.overview-share-grid.full-span {
  grid-column: 1 / -1;
}
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f7fcff);
}
.table-head h4 { margin: 0; font-size: 18px; }
.table-head p { margin: 4px 0 0; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.table-note { color: var(--muted); font-size: 13px; font-weight: 700; }
.table-filters { padding: 14px 16px; background: #eef7fd; border-bottom: 1px solid var(--line); }
.pbm-bin-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; }
.pbm-bin-summary strong { color: var(--ink); }
.pbm-bin-summary span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pbm-bin-summary i { padding: 3px 7px; border-radius: 999px; background: #dff7f5; color: #087f78; font-style: normal; font-weight: 800; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-field {
  margin: 0;
  display: grid;
  gap: 6px;
}
.filter-field span {
  color: #53667e;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #b8cee0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--ink);
  background: white;
}
select[multiple] { min-height: 96px; padding: 8px; }
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(7, 93, 168, 0.14); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: white; max-height: 520px; }
.table-card .table-wrap { border: 0; border-radius: 0; max-height: 540px; }
.mini-card .table-card { box-shadow: none; }
table { width: 100%; border-collapse: collapse; min-width: 860px; table-layout: auto; }
th, td { padding: 9px 11px; border-bottom: 1px solid #e6eef6; text-align: left; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  background: #c5edf7;
  z-index: 1;
  color: #102033;
  font-size: 12px;
  text-transform: uppercase;
  min-width: 72px;
  user-select: none;
}
th .col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  border: 0;
}
th .col-resize-handle:hover {
  background: rgba(13, 148, 136, 0.18);
  box-shadow: inset -2px 0 0 var(--teal);
}
td.num, th.num { text-align: right; }
.data-table tbody tr.total-row td {
  background: linear-gradient(180deg, #d8f2fb, #b9e5f5);
  color: #064f90;
  font-weight: 950;
  border-top: 2px solid #75c8e8;
  border-bottom-color: #9fd7ec;
}
.data-table tbody tr.total-row td:first-child {
  color: #0057a3;
}
.table-card th:first-child,
.table-card td:first-child {
  min-width: 160px;
  max-width: 320px;
  white-space: normal;
}
.table-card.compact table { min-width: 720px; }
.table-card.compact th,
.table-card.compact td { padding: 7px 9px; }
.table-card.compact th:first-child,
.table-card.compact td:first-child {
  min-width: 135px;
  max-width: 280px;
}
.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 950;
  text-decoration: underline;
  box-shadow: none;
}
.link-button:hover { color: var(--teal); }
.subgrid, .dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.overview-share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.insurance-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1.2fr) minmax(460px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.controls-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1.2fr) minmax(460px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.insurance-main,
.insurance-side,
.controls-main,
.controls-side {
  display: grid;
  gap: 16px;
  align-items: start;
}
.insurance-side .share-card .table-head,
.insurance-side .table-card .table-head,
.controls-side .table-card .table-head {
  min-height: 72px;
}
.controls-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.insurance-side .share-list {
  padding: 14px 16px 16px;
  gap: 12px;
}
.insurance-side .share-track {
  height: 14px;
}
.stack { display: grid; gap: 16px; }
.panel h4 { margin: 18px 0 10px; font-size: 18px; }
.mini-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfdff; }
.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ops-grid + .ops-grid {
  padding-top: 0;
}
.ops-grid-detail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ops-grid .metric {
  min-height: 92px;
  display: grid;
  align-content: center;
}
.ops-grid .metric strong { font-size: 24px; margin-top: 4px; }
.section-head.compact { margin-bottom: 8px; }
.section-head.compact h4 { margin: 0; }
.mini { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.metric-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.padded { padding: 16px; }
.metric.teal { background: #ecfdfb; border-color: #8ee6dc; color: #0f766e; }
.metric.green { background: #f0fdf4; border-color: #98e8b1; color: #166534; }
.metric.gold { background: #fff8e8; border-color: #f5cf7a; color: #9a6507; }
.metric.red { background: #fff1f3; border-color: #ff9aaa; color: #a50f2d; }
.metric.purple { background: #f6f0ff; border-color: #d6bdff; color: #6d3bd3; }
.empty { border: 1px dashed #b8cee0; border-radius: 16px; padding: 18px; color: var(--muted); background: #f7fbff; font-weight: 750; }
.empty.tight { padding: 12px; }
.share-list { padding: 16px; display: grid; gap: 14px; }
.share-line { display: grid; gap: 7px; }
.share-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  font-weight: 900;
}
.share-label span { color: var(--ink); white-space: nowrap; }
.share-track {
  height: 18px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}
.share-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.share-line:nth-child(2n) .share-track span { background: var(--teal); }
.share-line:nth-child(3n) .share-track span { background: var(--gold); }
.share-line:nth-child(4n) .share-track span { background: #b63d52; }
.share-line:nth-child(5n) .share-track span { background: #2f8650; }

.panel,
.table-card {
  border-radius: 20px;
}

.table-head h4 {
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.table-note {
  line-height: 1.35;
}

.metric {
  min-height: 82px;
  display: grid;
  align-content: center;
}

.metric span {
  letter-spacing: 0.02em;
}

.metric strong {
  margin-top: 3px;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.18;
}

th,
td {
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.28;
}

th {
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.filter-field span {
  letter-spacing: 0.02em;
}

select,
input {
  min-height: 46px;
  border-radius: 12px;
  font-size: 15px;
}

button,
.button {
  border-radius: 13px;
  font-size: 14px;
}

.result-tab {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13.5px;
  letter-spacing: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff, #f4f9fd);
  padding: 14px;
}

.detail-block h5 {
  margin: 0 0 10px;
  color: #53667e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-block dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.detail-block dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-block dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.3;
  white-space: normal;
}

.recon-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(220px, 1.05fr);
  gap: 14px;
}

.recon-summary-metrics {
  display: grid;
  gap: 10px;
}

.recon-comment p {
  margin: 0;
  color: #4b3711;
  font-weight: 750;
}

.ordering-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ordering-chart-card .filter-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.ordering-chart {
  min-height: 360px;
  padding: 28px 24px 18px;
  display: flex;
  align-items: end;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.ordering-chart-group {
  min-width: 72px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.ordering-bars {
  height: 260px;
  display: flex;
  align-items: end;
  gap: 8px;
  position: relative;
}

.ordering-bar {
  width: 24px;
  border-radius: 6px 6px 3px 3px;
  position: relative;
  box-shadow: 0 8px 18px rgba(15, 31, 52, 0.12);
}

.ordering-bar.paid { background: #0f766e; }
.ordering-bar.wholesale { background: #dd6b1f; }

.ordering-bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  color: inherit;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.ordering-bars strong {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  color: #102033;
  font-size: 11px;
  white-space: nowrap;
}

.ordering-chart-group small {
  color: var(--muted);
  font-weight: 750;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.chart-legend i.paid { background: #0f766e; }
.chart-legend i.wholesale { background: #dd6b1f; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; padding: 24px 0; }
  .grid, .subgrid, .dashboard-grid, .controls-layout, .controls-metrics, .filter-grid, .upload-grid, .overview-share-grid, .global-filter-panel, .global-filter-panel .filter-grid, .detail-grid, .recon-summary, .ordering-summary, .ordering-chart-card .filter-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

/* Product UI refresh: visual-only layer. Dashboard calculations stay in app.js. */
:root {
  --bg: #eef7fb;
  --panel: #ffffff;
  --ink: #0d1b2d;
  --muted: #66778e;
  --line: #d8e7f1;
  --blue: #075da8;
  --teal: #0a8f86;
  --gold: #c38308;
  --shadow: 0 18px 48px rgba(13, 31, 51, 0.1);
  --soft-shadow: 0 10px 26px rgba(13, 31, 51, 0.07);
}

body {
  font-size: 14px;
  line-height: 1.44;
  background:
    radial-gradient(900px 520px at -8% -12%, rgba(7, 93, 168, 0.14), transparent 62%),
    radial-gradient(900px 500px at 105% -6%, rgba(10, 143, 134, 0.16), transparent 60%),
    linear-gradient(180deg, #f8fcff 0%, #eef7fb 48%, #f5fbfd 100%);
}

.topbar {
  min-height: 64px;
  padding: 12px 24px;
  background: linear-gradient(120deg, #09243d 0%, #0b6073 54%, #0d9488 100%);
  box-shadow: 0 16px 34px rgba(13, 31, 51, 0.18);
}

.brand strong {
  font-size: 21px;
  letter-spacing: 0;
}

.brand span {
  font-size: 13px;
}

.pill {
  padding: 8px 13px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.page {
  width: min(1800px, calc(100% - 48px));
  gap: 20px;
}

.panel,
.dashboard-shell,
.table-card,
.mini-card {
  border-color: var(--line);
  border-radius: 18px;
}

.panel,
.dashboard-shell {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.upload-panel {
  border-top: 4px solid var(--teal);
}

.upload-grid > div {
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  border-color: #bed8ea;
  border-radius: 16px;
}

.upload-grid h3,
.table-head h4,
.panel h4 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.22;
}

.upload-grid p,
.table-note,
p {
  color: var(--muted);
}

input,
select {
  min-height: 42px;
  border-radius: 10px;
  border-color: #bcd1e2;
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
}

select[multiple] {
  min-height: 94px;
}

button,
.button {
  min-height: 42px;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(7, 93, 168, 0.16);
}

.secondary {
  box-shadow: 0 8px 18px rgba(7, 93, 168, 0.08);
}

.tabs {
  gap: 10px;
  padding: 10px;
  background: rgba(235, 246, 251, 0.92);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.result-tab {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 2px 0 var(--tab-color);
}

.result-tab.active {
  box-shadow: 0 9px 20px color-mix(in srgb, var(--tab-color) 24%, transparent);
}

.table-card {
  box-shadow: var(--soft-shadow);
}

.table-head {
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.table-filters {
  padding: 13px 16px;
  background: #f0f7fb;
}

.filter-field span,
label,
.metric span,
.detail-block dt {
  color: #5d6d83;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.metric {
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.metric strong {
  font-size: 23px;
  line-height: 1.16;
}

.ops-grid {
  gap: 11px;
}

.ops-grid .metric {
  min-height: 78px;
}

.ops-grid .metric strong {
  font-size: 21px;
}

.table-wrap {
  border-radius: 14px;
}

.table-card .table-wrap {
  max-height: 560px;
}

table {
  font-size: 13.5px;
}

th,
td {
  padding: 7px 10px;
  font-size: 13.5px;
}

th {
  background: #c8eef6;
  font-size: 11px;
  letter-spacing: 0.015em;
}

tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

tbody tr:hover td {
  background: #eef8fc;
}

.data-table tbody tr.total-row td {
  background: linear-gradient(180deg, #d8f4fb, #bfeaf6);
}

.share-track {
  height: 15px;
  background: #e5edf5;
}

.detail-block {
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff, #f7fbfe);
}

.detail-block h5 {
  font-size: 11.5px;
}

.detail-block dd {
  font-weight: 800;
}

.ordering-chart {
  min-height: 330px;
  gap: 18px;
}

.ordering-bars {
  height: 238px;
}

.ordering-bar {
  width: 22px;
}

@media (max-width: 860px) {
  body {
    font-size: 14px;
  }

  .page {
    width: min(100% - 22px, 1800px);
  }

  .metric strong {
    font-size: 21px;
  }
}

/* Onboarding Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden {
  display: none !important;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 46, 0.55);
  backdrop-filter: blur(6px);
}
.modal-content {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  z-index: 101;
}
.modal-content h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
}
.modal-content p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.modal-content label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
}
.modal-content input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-2);
  color: var(--ink);
}
.modal-content input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.modal-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 0;
}
.modal-actions .primary {
  background: var(--brand);
  color: white;
}
.modal-actions .primary:hover {
  background: var(--brand-600);
}
.modal-actions .secondary {
  background: var(--line);
  color: var(--ink-soft);
}
.modal-actions .secondary:hover {
  background: var(--line-strong);
}
#usageDisplay {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.3);
  background: rgba(94, 234, 212, 0.12);
}

@media (max-width: 620px) {
  .run-progress-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
}
