/* =========================================================
   运策 · 物流控制塔
   Palette: dataviz reference instance, validated in both modes
   ========================================================= */
:root {
  color-scheme: dark;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-raised: #212120;
  --surface-soft: #242422;
  --surface-inset: #151514;
  --topbar: rgba(13, 13, 13, 0.78);
  --tooltip: #262624;

  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;

  --border: rgba(255, 255, 255, 0.095);
  --border-strong: rgba(255, 255, 255, 0.17);
  --grid: #2c2c2a;
  --axis: #383835;
  --track: #2b2b29;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-soft: rgba(57, 135, 229, 0.14);
  --accent-ink: #ffffff;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #0ca30c;
  --warning-text: #fab219;
  --critical-text: #e66767;

  --sev-critical-soft: rgba(208, 59, 59, 0.14);
  --sev-serious-soft: rgba(236, 131, 90, 0.14);
  --sev-warning-soft: rgba(250, 178, 25, 0.13);
  --sev-good-soft: rgba(12, 163, 12, 0.13);

  --map-bg: #121211;
  --map-grid: rgba(255, 255, 255, 0.035);
  --map-outline: rgba(195, 194, 183, 0.34);
  --map-fill: rgba(195, 194, 183, 0.06);
  --map-route: rgba(195, 194, 183, 0.21);
  --map-node: #c3c2b7;
  --map-label: #898781;
  --page-glow: rgba(57, 135, 229, 0.10);

  --shadow-card: 0 18px 56px rgba(0, 0, 0, 0.16);
  --shadow-pop: 0 22px 60px rgba(0, 0, 0, 0.38);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-raised: #f4f3ee;
  --surface-soft: #eeece6;
  --surface-inset: #f5f4ef;
  --topbar: rgba(249, 249, 247, 0.82);
  --tooltip: #ffffff;

  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #706e67;

  --border: rgba(11, 11, 11, 0.095);
  --border-strong: rgba(11, 11, 11, 0.18);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --track: #e9e7e0;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --accent: #2a78d6;
  --accent-hover: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --accent-ink: #ffffff;

  --good-text: #006300;
  --warning-text: #7a5200;
  --critical-text: #b42323;

  --sev-critical-soft: rgba(208, 59, 59, 0.09);
  --sev-serious-soft: rgba(236, 131, 90, 0.10);
  --sev-warning-soft: rgba(250, 178, 25, 0.13);
  --sev-good-soft: rgba(12, 163, 12, 0.09);

  --map-bg: #f4f3ed;
  --map-grid: rgba(11, 11, 11, 0.035);
  --map-outline: rgba(82, 81, 78, 0.30);
  --map-fill: rgba(82, 81, 78, 0.05);
  --map-route: rgba(82, 81, 78, 0.22);
  --map-node: #6d6b66;
  --map-label: #6e6b64;
  --page-glow: rgba(42, 120, 214, 0.08);

  --shadow-card: 0 18px 56px rgba(31, 30, 26, 0.04);
  --shadow-pop: 0 22px 60px rgba(31, 30, 26, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(900px 460px at 82% -12%, var(--page-glow), transparent 66%),
    var(--page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 12px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

section[id],
aside[id],
article[id] {
  scroll-margin-top: 84px;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--topbar);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.topbar-inner {
  width: min(100%, 1580px);
  height: 66px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  border-radius: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(145deg, #4b96ef, #2366ba);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 22px rgba(42, 120, 214, 0.22);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.brand-copy span {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.primary-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 520;
  transition: color 0.16s ease;
  white-space: nowrap;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.16s ease;
}

.primary-nav a:hover {
  color: var(--text-secondary);
}

.primary-nav a.is-active {
  color: var(--text-primary);
}

.primary-nav a.is-active::after {
  background: var(--accent);
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.external-link .icon {
  width: 12px;
  height: 12px;
}

.external-link:hover {
  color: var(--text-primary);
  background: var(--surface-raised);
  border-color: var(--border-strong);
}

.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  min-width: 160px;
}

.connection-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.connection-copy > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
}

.connection-copy time {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.signal-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--sev-good-soft);
}

.signal-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--good);
  opacity: 0;
  animation: signalPulse 2.8s ease-out infinite;
}

.connection.is-paused .signal-dot,
.connection.is-paused .signal-dot::after {
  background: var(--text-muted);
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(137, 135, 129, 0.12);
  animation: none;
}

.connection.is-paused .connection-copy > span {
  color: var(--text-muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-button:hover {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.theme-icon {
  width: 17px;
  height: 17px;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: block;
}

html[data-theme="light"] .theme-icon-moon {
  display: none;
}

.operator {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 5px;
}

.operator-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.16), transparent 48%),
    var(--surface-raised);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.operator-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.operator-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.operator-copy span {
  font-size: 10px;
  color: var(--text-muted);
}

/* ---------- Page shell ---------- */
main {
  width: min(100%, 1580px);
  margin: 0 auto;
  padding: 30px 32px 40px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(28px, 2.5vw, 34px);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 9px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--axis);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  background: var(--surface);
}

.heading-status {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}

.heading-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 118px;
  padding: 12px 18px;
}

.heading-status-item + .heading-status-item {
  border-left: 1px solid var(--border);
}

.heading-status-item > span {
  color: var(--text-muted);
  font-size: 10px;
}

.heading-status-item strong {
  font-size: 13px;
  font-weight: 600;
}

.status-good {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-good i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--sev-good-soft);
}

/* ---------- Filters ---------- */
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.filter-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 540;
  white-space: nowrap;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-inset);
}

.segmented button {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 520;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.segmented button:hover {
  color: var(--text-secondary);
}

.segmented button.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  height: 34px;
  min-width: 102px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--surface-inset);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 520;
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.select-wrap select:hover,
.select-wrap select:focus-visible {
  border-color: var(--border-strong);
}

.select-chevron {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-spacer {
  flex: 1;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.sync-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
}

.filter-row.is-paused .sync-pulse {
  background: var(--text-muted);
}

.filter-row.is-paused .sync-status {
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.button:active {
  transform: translateY(1px);
}

.button .icon {
  width: 15px;
  height: 15px;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 5px 18px rgba(42, 120, 214, 0.18);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text-secondary);
}

.button-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.button .play-icon {
  display: none;
}

.button[aria-pressed="true"] .pause-icon {
  display: none;
}

.button[aria-pressed="true"] .play-icon {
  display: block;
}

.spin {
  animation: spin 0.8s linear infinite;
}

#main.is-refreshing .kpi-grid,
#main.is-refreshing .primary-grid,
#main.is-refreshing .analysis-grid,
#main.is-refreshing .carrier-card {
  opacity: 0.58;
  transition: opacity 0.16s ease;
}

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  position: relative;
  min-width: 0;
  min-height: 154px;
  padding: 18px 19px 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.kpi-primary {
  border-color: color-mix(in srgb, var(--accent) 23%, var(--border));
  background:
    radial-gradient(115% 150% at 102% -8%, var(--accent-soft), transparent 58%),
    var(--surface);
}

.kpi-alert {
  background:
    radial-gradient(110% 150% at 102% -8%, rgba(208, 59, 59, 0.055), transparent 56%),
    var(--surface);
}

.kpi-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 560;
}

.kpi-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.kpi-icon .icon {
  width: 14px;
  height: 14px;
}

.kpi-primary .kpi-icon {
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.kpi-alert .kpi-icon {
  border-color: rgba(208, 59, 59, 0.22);
  background: var(--sev-critical-soft);
  color: var(--critical);
}

.live-chip,
.monitor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(12, 163, 12, 0.22);
  border-radius: 999px;
  background: var(--sev-good-soft);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.live-chip .signal-dot,
.monitor-chip .signal-dot {
  width: 5px;
  height: 5px;
}

.live-chip-quiet {
  height: 20px;
  font-size: 8px;
}

.kpi-note,
.kpi-target {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.kpi-target .icon {
  width: 12px;
  height: 12px;
}

.kpi-value-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 15px;
}

.kpi-value {
  font-size: 31px;
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}

.kpi-primary .kpi-value {
  font-size: 48px;
  font-weight: 670;
}

.kpi-unit {
  margin-right: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  padding: 2px 6px 2px 4px;
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 620;
  line-height: 1.3;
  white-space: nowrap;
}

.delta .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.delta.is-up,
.delta.is-good {
  color: var(--good-text);
  background: var(--sev-good-soft);
}

.delta.is-down,
.delta.is-bad {
  color: var(--critical-text);
  background: var(--sev-critical-soft);
}

.delta.is-neutral {
  color: var(--text-muted);
}

.kpi-footer {
  position: absolute;
  z-index: 1;
  left: 19px;
  right: 19px;
  bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 10px;
  min-height: 28px;
}

.kpi-footer > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkline {
  width: 78px;
  height: 26px;
  flex: none;
  color: var(--text-muted);
}

.sparkline svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline .spark-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
}

.sparkline .spark-end {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.kpi-footer-meter {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  justify-content: flex-end;
}

.kpi-footer-meter > span {
  align-self: flex-start;
}

.mini-meter {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--track);
  overflow: visible;
}

.mini-meter-fill {
  display: block;
  height: 100%;
  width: 96.8%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-meter-target {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  opacity: 0.7;
}

.kpi-footer-severity {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  justify-content: flex-end;
}

.kpi-footer-severity > span {
  align-self: flex-start;
}

.severity-meter {
  display: flex;
  gap: 2px;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--track);
}

.severity-meter > span {
  height: 100%;
  min-width: 3px;
  border-radius: 1px;
}

.severity-meter > .seg-critical {
  background: var(--critical);
}

.severity-meter > .seg-serious {
  background: var(--serious);
}

.severity-meter > .seg-warning {
  background: var(--warning);
}

/* ---------- Cards & layout ---------- */
.primary-grid,
.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.74fr) minmax(348px, 0.96fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.analysis-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(400px, 1fr);
}

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 15px;
}

.card-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.015em;
}

.card-header p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--sev-critical-soft);
  color: var(--critical-text);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.map-header-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.map-header-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot-route {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.legend-dot-alert {
  background: var(--critical);
  box-shadow: 0 0 0 3px var(--sev-critical-soft);
}

.legend-dot-hub {
  background: var(--text-secondary);
}

/* ---------- Map ---------- */
.map-card {
  overflow: hidden;
}

.map-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    radial-gradient(65% 72% at 72% 42%, var(--accent-soft), transparent 66%),
    var(--map-bg);
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.china-map {
  width: 100%;
  height: 430px;
  display: block;
}

.map-outline {
  fill: var(--map-fill);
  stroke: var(--map-outline);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-island {
  fill: var(--map-fill);
  stroke: var(--map-outline);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-route {
  fill: none;
  stroke: var(--map-route);
  stroke-width: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.map-route.is-hot {
  stroke: var(--accent);
  opacity: 0.34;
}

.map-route.is-blocked {
  stroke: var(--critical);
  opacity: 0.48;
}

.map-route.is-muted {
  opacity: 0.1;
}

.map-moving-dot {
  fill: var(--series-1);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--series-1) 70%, transparent));
  pointer-events: none;
}

.map-moving-dot.is-blocked {
  fill: var(--critical);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--critical) 65%, transparent));
}

.map-city {
  transition: opacity 0.24s ease;
}

.map-city.is-muted {
  opacity: 0.2;
}

.map-city-hit {
  fill: transparent;
  cursor: pointer;
}

.map-city-dot {
  fill: var(--map-node);
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.map-city.is-major .map-city-dot {
  fill: var(--text-primary);
}

.map-city-halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.28;
  transform-box: fill-box;
  transform-origin: center;
  animation: mapHalo 3.4s ease-out infinite;
  pointer-events: none;
}

.map-city-label {
  fill: var(--map-label);
  font-size: 10px;
  font-weight: 540;
  paint-order: stroke;
  stroke: var(--map-bg);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
  user-select: none;
}

.map-alert-marker {
  cursor: pointer;
  outline: none;
}

.map-alert-hit {
  fill: transparent;
  pointer-events: all;
}

.map-alert-marker:focus-visible .map-alert-core {
  stroke: var(--text-primary);
  stroke-width: 2.5;
}

.map-alert-core {
  fill: var(--critical);
  stroke: var(--surface);
  stroke-width: 1.5;
  pointer-events: none;
}

.map-alert-ring {
  fill: none;
  stroke: var(--critical);
  stroke-width: 1;
  opacity: 0.62;
  transform-box: fill-box;
  transform-origin: center;
  animation: alertRing 2.2s ease-out infinite;
  pointer-events: none;
}

.map-alert-marker.is-serious .map-alert-core {
  fill: var(--serious);
}

.map-alert-marker.is-serious .map-alert-ring {
  stroke: var(--serious);
}

.map-alert-marker.is-warning .map-alert-core {
  fill: var(--warning);
}

.map-alert-marker.is-warning .map-alert-ring {
  stroke: var(--warning);
}

.map-alert-marker.is-selected .map-alert-core {
  stroke: var(--text-primary);
  stroke-width: 2;
}

.map-alert-marker.is-muted {
  opacity: 0.18;
}

.map-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 8px 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.map-hud > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 70px;
  padding: 2px 12px;
}

.map-hud > div + div {
  border-left: 1px solid var(--border);
}

.map-hud span {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.map-hud strong {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.map-zoom-note {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--text-muted);
  font-size: 9px;
  opacity: 0.8;
  pointer-events: none;
}

/* ---------- Alerts ---------- */
.alerts-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.alerts-card .card-header {
  padding-bottom: 12px;
}

.monitor-chip {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.alert-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 12px;
}

.chip-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 540;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip span {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.chip.is-active {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.alert-list {
  flex: 1;
  min-height: 0;
  max-height: 348px;
  overflow-y: auto;
  padding: 0 10px 6px;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--axis) transparent;
}

.alert-list::-webkit-scrollbar {
  width: 5px;
}

.alert-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--axis);
}

.alert-list.can-scroll {
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 38px), rgba(0, 0, 0, 0.08) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 38px), rgba(0, 0, 0, 0.08) 100%);
}

.alert-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: start;
  gap: 10px;
  width: 100%;
  padding: 13px 9px;
  border: 1px solid transparent;
  border-bottom-color: var(--border);
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.alert-item:last-child {
  border-bottom-color: transparent;
}

.alert-item:hover,
.alert-item:focus-visible {
  border-color: var(--border);
  background: var(--surface-raised);
}

.alert-item.is-new {
  animation: itemIn 0.35s ease both;
}

.alert-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
}

.alert-icon .icon {
  width: 15px;
  height: 15px;
}

.alert-icon.is-critical {
  border-color: rgba(208, 59, 59, 0.2);
  background: var(--sev-critical-soft);
  color: var(--critical);
}

.alert-icon.is-serious {
  border-color: rgba(236, 131, 90, 0.2);
  background: var(--sev-serious-soft);
  color: var(--serious);
}

.alert-icon.is-warning {
  border-color: rgba(250, 178, 25, 0.18);
  background: var(--sev-warning-soft);
  color: var(--warning);
}

.alert-content {
  min-width: 0;
}

.alert-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.severity-label {
  flex: none;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.05em;
}

.severity-label.is-critical {
  color: var(--critical-text);
}

.severity-label.is-serious {
  color: var(--text-secondary);
}

.severity-label.is-warning {
  color: var(--text-muted);
}

.alert-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.alert-title {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 590;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-dispatched {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.6;
  white-space: nowrap;
}

.alert-dispatched::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.alert-chevron {
  width: 13px;
  height: 13px;
  align-self: center;
  color: var(--text-muted);
  opacity: 0.5;
}

.alert-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
}

.alert-empty .icon {
  width: 24px;
  height: 24px;
  opacity: 0.5;
}

.alert-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}

.alert-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert-footer .signal-dot {
  width: 4px;
  height: 4px;
}

/* ---------- Chart cards ---------- */
.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 378px;
}

.chart-card .card-header {
  padding-bottom: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.legend-key {
  position: relative;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--series-1);
}

.legend-key::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: inherit;
  transform: translate(-50%, -50%);
}

.legend-item:nth-child(2) .legend-key {
  background: var(--series-2);
}

.legend-item:nth-child(3) .legend-key {
  background: var(--series-3);
}

.trend-target-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 540;
  white-space: nowrap;
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 540;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.table-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.table-toggle .icon {
  width: 13px;
  height: 13px;
}

.table-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.chart-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 4px 12px 12px;
}

.line-chart {
  width: 100%;
  height: 286px;
  border-radius: 8px;
  outline: none;
}

.line-chart:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-hint {
  margin: 1px 8px 0;
  color: var(--text-muted);
  font-size: 9px;
  text-align: right;
}

.chart-axis-label {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.chart-grid-line {
  stroke: var(--grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-target-line {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.5;
  vector-effect: non-scaling-stroke;
}

.chart-target-label {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.chart-baseline {
  stroke: var(--axis);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-series-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-series-line.series-1 {
  stroke: var(--series-1);
}

.chart-series-line.series-2 {
  stroke: var(--series-2);
}

.chart-series-line.series-3 {
  stroke: var(--series-3);
}

.chart-end-dot {
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-end-dot.series-1 {
  fill: var(--series-1);
}

.chart-end-dot.series-2 {
  fill: var(--series-2);
}

.chart-end-dot.series-3 {
  fill: var(--series-3);
}

.chart-direct-key {
  stroke-width: 2;
  stroke-linecap: round;
}

.chart-direct-key.series-1 {
  stroke: var(--series-1);
}

.chart-direct-key.series-2 {
  stroke: var(--series-2);
}

.chart-direct-key.series-3 {
  stroke: var(--series-3);
}

.chart-direct-label {
  fill: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.chart-leader {
  stroke: var(--axis);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-crosshair {
  stroke: var(--text-muted);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
  pointer-events: none;
}

.chart-hover-dot {
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.chart-hover-dot.series-1 {
  fill: var(--series-1);
}

.chart-hover-dot.series-2 {
  fill: var(--series-2);
}

.chart-hover-dot.series-3 {
  fill: var(--series-3);
}

.chart-tooltip {
  position: absolute;
  z-index: 12;
  min-width: 172px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--tooltip);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
}

.tooltip-time {
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 21px;
  color: var(--text-muted);
  font-size: 10px;
}

.tooltip-row + .tooltip-row {
  margin-top: 1px;
}

.tooltip-key {
  width: 12px;
  height: 2px;
  flex: none;
  border-radius: 2px;
}

.tooltip-value {
  min-width: 42px;
  margin-left: 2px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tooltip-name {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.chart-table-wrap {
  max-height: 305px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--axis) transparent;
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-table th,
.chart-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.chart-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chart-table td {
  color: var(--text-secondary);
}

.chart-table td:first-child {
  color: var(--text-primary);
}

.chart-table td.is-numeric,
.chart-table th.is-numeric {
  text-align: right;
}

.chart-table tbody tr:hover {
  background: var(--surface-raised);
}

/* ---------- Capacity chart ---------- */
.capacity-body {
  padding-top: 9px;
}

.capacity-chart {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capacity-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  min-height: 35px;
  padding: 2px 8px;
  border-radius: 7px;
  outline: none;
  transition: background 0.15s ease;
}

.capacity-row:hover,
.capacity-row:focus-visible {
  background: var(--surface-raised);
}

.capacity-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.capacity-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.capacity-name span {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.capacity-track {
  position: relative;
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: var(--track);
}

.capacity-fill {
  height: 100%;
  width: 0;
  border-radius: 0 4px 4px 0;
  background: var(--series-1);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.capacity-fill.is-high {
  background: var(--serious);
}

.capacity-threshold {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 85%;
  width: 1px;
  background: var(--warning-text);
  opacity: 0.74;
  pointer-events: none;
}

.capacity-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.load-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--sev-serious-soft);
  color: var(--serious);
}

.load-flag .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2;
}

.capacity-axis {
  display: flex;
  justify-content: space-between;
  padding: 8px 84px 0 98px;
  color: var(--text-muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.capacity-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 8px 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}

.capacity-note .icon {
  width: 12px;
  height: 12px;
  color: var(--warning);
}

.threshold-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.threshold-legend i {
  width: 1px;
  height: 13px;
  background: var(--warning-text);
}

/* ---------- Carrier table ---------- */
.carrier-card {
  margin-bottom: 16px;
  overflow: hidden;
}

.carrier-card .card-header {
  padding-bottom: 13px;
}

.table-header-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 3px;
}

.legend-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-dot-good {
  background: var(--good);
}

.status-dot-warning {
  background: var(--warning);
}

.status-dot-critical {
  background: var(--critical);
}

.mobile-table-hint {
  display: none;
  margin: 0;
  padding: 8px 16px 0;
  color: var(--text-muted);
  font-size: 9px;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 580;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: var(--surface-raised);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.carrier-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carrier-logo {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.carrier-name-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.carrier-name {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 590;
}

.carrier-volume {
  color: var(--text-muted);
  font-size: 9px;
}

.carrier-volume strong {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.on-time-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.on-time-number {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-bar {
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}

.cell-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--series-1);
}

.exception-value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 560;
  white-space: nowrap;
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.is-good {
  border-color: rgba(12, 163, 12, 0.18);
  background: var(--sev-good-soft);
}

.status-pill.is-good i {
  background: var(--good);
}

.status-pill.is-warning {
  border-color: rgba(250, 178, 25, 0.18);
  background: var(--sev-warning-soft);
}

.status-pill.is-warning i {
  background: var(--warning);
}

.status-pill.is-critical {
  border-color: rgba(208, 59, 59, 0.2);
  background: var(--sev-critical-soft);
}

.status-pill.is-critical i {
  background: var(--critical);
}

/* ---------- Footer ---------- */
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 2px 0;
  color: var(--text-muted);
  font-size: 9px;
}

/* ---------- Global tooltip / toast ---------- */
.global-tooltip {
  position: fixed;
  z-index: 100;
  min-width: 140px;
  max-width: 240px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--tooltip);
  box-shadow: var(--shadow-pop);
  color: var(--text-secondary);
  font-size: 10px;
  pointer-events: none;
}

.global-tooltip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 650;
}

.global-tooltip span {
  color: var(--text-muted);
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--tooltip);
  box-shadow: var(--shadow-pop);
  color: var(--text-primary);
  font-size: 11px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: var(--good);
}

/* ---------- Dialog ---------- */
.alert-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-pop);
}

.alert-dialog::backdrop {
  background: rgba(7, 7, 7, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.alert-dialog[open] {
  animation: dialogIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.dialog-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--critical-text);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.dialog-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.dialog-close {
  width: 30px;
  height: 30px;
  flex: none;
}

.dialog-close .icon {
  width: 16px;
  height: 16px;
}

.dialog-body {
  padding: 18px 22px;
}

.dialog-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.severity-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--sev-critical-soft);
  color: var(--critical);
}

.severity-icon .icon {
  width: 18px;
  height: 18px;
}

.dialog-description {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.55;
}

.dialog-meta {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}

.detail-grid > div {
  padding: 11px 13px;
  background: var(--surface-raised);
}

.detail-grid dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 9px;
}

.detail-grid dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
}

.dialog-timeline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-inset);
}

.timeline-dot {
  width: 7px;
  height: 7px;
  flex: none;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dialog-timeline strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.dialog-timeline p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px 20px;
  border-top: 1px solid var(--border);
}

.dialog-actions .button {
  height: 36px;
  padding: 0 16px;
  font-size: 11px;
}

/* ---------- Motion ---------- */
@keyframes signalPulse {
  0% {
    transform: scale(0.75);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

@keyframes mapHalo {
  0% {
    transform: scale(0.6);
    opacity: 0.32;
  }
  80%,
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

@keyframes alertRing {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  80%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .topbar-inner {
    gap: 22px;
    padding: 0 24px;
  }

  .primary-nav a {
    padding: 0 8px;
    font-size: 12px;
  }

  .operator-copy {
    display: none;
  }

  main {
    padding-left: 24px;
    padding-right: 24px;
  }

  .primary-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  }

  .analysis-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  }
}

@media (max-width: 1120px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-grid,
  .analysis-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .alert-list {
    max-height: 320px;
  }

  .map-header-legend {
    display: none;
  }

  .chart-card {
    min-height: auto;
  }

  .line-chart {
    height: 270px;
  }
}

@media (max-width: 860px) {
  .primary-nav {
    display: none;
  }

  .mobile-table-hint {
    display: block;
    padding-bottom: 9px;
  }

  .topbar-inner {
    height: 60px;
    gap: 14px;
    padding: 0 16px;
  }

  .header-tools {
    gap: 8px;
  }

  .connection {
    min-width: 0;
    padding: 6px 9px;
  }

  .connection-copy {
    gap: 0;
  }

  .connection-copy > span {
    display: none;
  }

  .connection-copy time {
    font-size: 10px;
  }

  .operator {
    display: none;
  }

  main {
    padding: 22px 16px 30px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .heading-status {
    display: none;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .filter-row {
    padding: 10px 10px 10px 12px;
    gap: 9px;
  }

  .filter-spacer {
    display: none;
  }

  .sync-status {
    order: 4;
    margin-left: auto;
  }

  #pauseButton,
  #exportButton {
    order: 5;
  }

  #refreshButton {
    order: 3;
    margin-left: auto;
  }

  .filter-group {
    gap: 7px;
  }

  .filter-label {
    display: none;
  }

  .segmented button {
    padding: 0 9px;
  }

  .card-header {
    padding: 15px 16px 12px;
  }

  .map-stage,
  .china-map {
    min-height: 330px;
    height: 330px;
  }

  .map-hud {
    top: 11px;
    left: 11px;
    transform: scale(0.92);
    transform-origin: top left;
  }

  .alerts-card .card-header {
    padding-bottom: 10px;
  }

  .alert-toolbar {
    padding: 0 12px 10px;
  }

  .alert-list {
    padding: 0 6px 6px;
  }

  .alert-footer {
    padding: 10px 14px;
  }

  .chart-body {
    padding-left: 4px;
    padding-right: 4px;
  }

  .chart-hint {
    display: none;
  }

  .chart-card .card-header {
    flex-direction: column;
    gap: 10px;
  }

  .card-actions {
    width: 100%;
    justify-content: space-between;
  }

  .legend {
    justify-content: flex-start;
  }

  .capacity-row {
    grid-template-columns: 80px minmax(0, 1fr) 68px;
    gap: 8px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .capacity-axis {
    padding-left: 94px;
    padding-right: 74px;
  }

  .table-header-note {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Keep the carrier identity readable while the table scrolls sideways. */
  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }

  .data-table thead th:first-child {
    background: var(--surface);
  }

  .data-table tbody tr:hover td:first-child {
    background: var(--surface-raised);
  }
}

@media (max-width: 620px) {
  .brand-copy span {
    display: none;
  }

  .external-link {
    width: 34px;
    padding: 0;
  }

  .external-link span {
    display: none;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 142px;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .page-subtitle .demo-badge {
    margin-left: 2px;
  }

  .filter-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .filter-group:first-child {
    order: 1;
    width: 100%;
  }

  .filter-group:first-child .segmented {
    width: 100%;
  }

  .filter-group:first-child .segmented button {
    flex: 1;
  }

  .select-wrap,
  .select-wrap select {
    width: 100%;
  }

  .filter-group:nth-child(2) {
    order: 2;
    flex: 1;
    min-width: 100px;
  }

  #refreshButton span,
  #pauseButton span,
  #exportButton span {
    display: none;
  }

  #refreshButton,
  #pauseButton,
  #exportButton {
    width: 34px;
    padding: 0;
  }

  #refreshButton {
    order: 4;
    margin-left: 0;
  }

  .sync-status {
    order: 3;
    margin-left: 0;
    font-size: 10px;
  }

  #pauseButton {
    order: 5;
  }

  #exportButton {
    order: 6;
  }

  .map-stage,
  .china-map {
    min-height: 280px;
    height: 280px;
  }

  .map-hud > div {
    min-width: 57px;
    padding: 1px 8px;
  }

  .map-hud strong {
    font-size: 12px;
  }

  .map-hud span {
    font-size: 8px;
  }

  .map-zoom-note {
    display: none;
  }

  .alert-list {
    max-height: 380px;
  }

  .alert-footer > span:last-child {
    display: none;
  }

  .legend {
    gap: 8px;
  }

  .legend-item {
    font-size: 9px;
  }

  .trend-target-chip {
    display: none;
  }

  .line-chart {
    height: 250px;
  }

  .capacity-row {
    grid-template-columns: 66px minmax(0, 1fr) 58px;
    min-height: 34px;
  }

  .capacity-name {
    font-size: 10px;
  }

  .capacity-name span {
    display: none;
  }

  .capacity-value {
    font-size: 10px;
  }

  .capacity-axis {
    padding-left: 76px;
    padding-right: 62px;
  }

  .threshold-legend {
    font-size: 8px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .dialog-header {
    padding: 18px 18px 14px;
  }

  .dialog-body {
    padding: 16px 18px;
  }

  .dialog-actions {
    padding: 14px 18px 18px;
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Xuanyuan live data
   ========================================================================== */

.xy-live {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 0% 0%, var(--accent-soft), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 84px;
}

.xy-live::before {
  content: "";
  position: absolute;
  inset: 0 20px auto;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.75;
}

.xy-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.xy-live-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.xy-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-primary);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.xy-live-badge .signal-dot {
  width: 5px;
  height: 5px;
}

.xy-live-title h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.xy-live-title p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.xy-live-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.xy-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xy-scope > span:first-child {
  color: var(--text-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.xy-scope-select select {
  min-width: 104px;
  height: 30px;
  background: var(--surface);
}

.xy-live-update {
  color: var(--text-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.xy-live-notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.5;
}

.xy-live-notice::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.xy-live-notice.is-warn {
  border-color: rgba(250, 178, 25, 0.24);
  background: var(--sev-warning-soft);
}

.xy-live-notice.is-warn::before {
  background: var(--warning);
}

.xy-live-notice.is-error {
  border-color: rgba(208, 59, 59, 0.24);
  background: var(--sev-critical-soft);
}

.xy-live-notice.is-error::before {
  background: var(--critical);
}

.xy-live-notice a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.xy-live-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.xy-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 116px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  overflow: hidden;
}

.xy-kpi.is-primary {
  background:
    linear-gradient(165deg, var(--accent-soft), transparent 68%),
    var(--surface-raised);
}

.xy-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.xy-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.xy-kpi-label .icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.xy-kpi.is-primary .xy-kpi-label .icon {
  color: var(--accent);
}

.xy-kpi-note {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.xy-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.xy-kpi-value {
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.xy-kpi.is-primary .xy-kpi-value {
  font-size: 30px;
}

.xy-kpi-unit {
  color: var(--text-muted);
  font-size: 10px;
}

.xy-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xy-kpi-delta .icon {
  width: 10px;
  height: 10px;
}

.xy-kpi-delta.is-good {
  color: var(--good-text);
  background: var(--sev-good-soft);
}

.xy-kpi-delta.is-bad {
  color: var(--critical-text);
  background: var(--sev-critical-soft);
}

.xy-kpi-delta.is-flat {
  color: var(--text-muted);
  background: var(--surface);
}

.xy-kpi-foot {
  margin-top: auto;
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.xy-live-placeholder {
  grid-column: 1 / -1;
  padding: 24px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.xy-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 10px;
}

.xy-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
}

.xy-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.xy-panel-head h3 {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 620;
}

.xy-panel-head p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.xy-panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.xy-metric-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.xy-metric-switch button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 7px;
  font-size: 9.5px;
  cursor: pointer;
  white-space: nowrap;
}

.xy-metric-switch button:hover {
  color: var(--text-primary);
}

.xy-metric-switch button.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.xy-trend-body {
  position: relative;
  min-height: 240px;
}

.xy-trend-chart {
  width: 100%;
  height: 240px;
  border-radius: 6px;
}

.xy-trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.xy-trend-chart:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.xy-trend-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.xy-trend-tooltip {
  min-width: 160px;
}

.xy-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.xy-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.xy-stat-label {
  color: var(--text-muted);
  font-size: 9px;
}

.xy-stat-value {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.xy-stat-value small {
  margin-left: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
}

.xy-share {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.xy-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 9px;
}

.xy-share-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--track);
}

.xy-share-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
}

.xy-share-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.xy-share-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.xy-share-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
}

.xy-share-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 9px;
}

.xy-table-panel {
  gap: 8px;
}

.xy-table-note {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.xy-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.xy-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 10.5px;
}

.xy-table th {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}

.xy-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.xy-table tbody tr:last-child td {
  border-bottom: 0;
}

.xy-table tbody tr:hover {
  background: var(--surface);
}

.xy-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.xy-table .xy-line-name {
  color: var(--text-primary);
  font-weight: 600;
}

.xy-table tr.is-aggregate td {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
}

.xy-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 9.5px;
  white-space: nowrap;
}

.xy-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}

.xy-status.is-good i {
  background: var(--good);
}

.xy-status.is-warning i {
  background: var(--warning);
}

.xy-status.is-critical i {
  background: var(--critical);
}

.view-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 0;
  color: var(--text-muted);
  font-size: 9px;
}

.view-divider::before,
.view-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.view-divider-label {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.view-divider-note {
  white-space: nowrap;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.view-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.view-toggle .icon {
  width: 11px;
  height: 11px;
  transition: transform 0.18s ease;
}

.view-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.mock-view {
  display: contents;
}

.xy-live.is-loading .xy-live-kpis,
.xy-live.is-loading .xy-live-grid,
.xy-live.is-loading .xy-table-panel {
  opacity: 0.62;
  transition: opacity 0.15s ease;
}

@media (max-width: 1120px) {
  .xy-live-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xy-live-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .xy-live {
    padding: 12px;
  }

  .xy-live-head {
    flex-direction: column;
  }

  .xy-live-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .xy-live-update {
    order: 3;
    width: 100%;
  }

  .xy-live-kpis {
    gap: 8px;
  }

  .xy-kpi {
    min-height: 108px;
    padding: 11px 12px;
  }

  .xy-kpi-value {
    font-size: 22px;
  }

  .xy-kpi.is-primary .xy-kpi-value {
    font-size: 26px;
  }

  .xy-trend-chart {
    height: 220px;
  }

  .xy-trend-body {
    min-height: 220px;
  }

  .xy-panel-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 460px) {
  .xy-live-kpis {
    grid-template-columns: 1fr;
  }

  .xy-live-title {
    flex-direction: column;
  }

  .xy-stats {
    grid-template-columns: 1fr 1fr;
  }

  .view-divider {
    flex-wrap: wrap;
    gap: 6px;
  }

  .view-divider::before,
  .view-divider::after {
    display: none;
  }

  .view-divider-note {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .xy-table th:first-child,
  .xy-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface-raised);
    box-shadow: 1px 0 0 var(--border);
  }

  .xy-table th:first-child {
    background: var(--surface);
  }

  .xy-table tbody tr:hover td:first-child {
    background: var(--surface);
  }

  .xy-table tr.is-aggregate td:first-child {
    background: var(--surface);
  }
}

/* ==========================================================================
   Xuanyuan operations view
   ========================================================================== */

.ops-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 84px;
}

#operations,
#opsAlerts,
#opsCharts {
  scroll-margin-top: 84px;
}

.ops-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}

.ops-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.ops-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ops-badge .signal-dot {
  width: 5px;
  height: 5px;
}

.ops-heading h2 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.ops-heading p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.ops-update {
  color: var(--text-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.ops-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-kpis .kpi-card {
  min-height: 138px;
}

.ops-kpis .kpi-value {
  font-size: 32px;
}

.ops-placeholder {
  grid-column: 1 / -1;
  padding: 26px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: stretch;
}

.ops-network-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-network-stage {
  position: relative;
  flex: 1;
  min-height: 380px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    radial-gradient(70% 76% at 55% 45%, var(--accent-soft), transparent 68%),
    var(--map-bg);
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.ops-network-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ops-network-list {
  display: none;
}

.ops-network-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.ops-network-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ops-network-item-name {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
}

.ops-network-item-meta {
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.ops-network-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}

.ops-network-item-rate {
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.legend-dot-good {
  background: var(--good);
}

.legend-dot-warning {
  background: var(--warning);
}

.legend-dot-critical {
  background: var(--critical);
}

.ops-link {
  fill: none;
  stroke-linecap: round;
  opacity: 0.34;
}

.ops-node-halo {
  opacity: 0.14;
}

.ops-node-core {
  stroke: var(--surface);
  stroke-width: 2;
}

.ops-center-halo {
  fill: var(--accent);
  opacity: 0.12;
}

.ops-center-core {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.ops-center-label {
  fill: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  font-family: var(--font-sans);
}

.ops-center-sub {
  fill: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.ops-center-note {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: var(--font-sans);
}

.ops-node-name {
  fill: var(--text-primary);
  font-size: 11px;
  font-weight: 620;
  font-family: var(--font-sans);
}

.ops-node-meta {
  fill: var(--text-muted);
  font-size: 9.5px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.ops-node-status {
  fill: var(--text-secondary);
  font-size: 9px;
  font-family: var(--font-sans);
}

.ops-alerts-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-alert-list {
  flex: 1;
  min-height: 180px;
  max-height: 440px;
  padding: 0 10px 6px;
}

.ops-alert-list .alert-empty {
  min-height: 210px;
}

.alert-breakdown {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.45;
  white-space: normal;
}

.ops-alert-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-detail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10px;
}

.ops-detail-title strong {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
}

.ops-detail-empty {
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.ops-breakdown-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.ops-breakdown-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 9.5px;
}

.ops-breakdown-table th {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}

.ops-breakdown-table td {
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ops-breakdown-table tr:first-child td {
  border-top: 0;
}

.ops-breakdown-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ops-breakdown-table .is-total td {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
}

.ops-breakdown-table .ops-line-name {
  color: var(--text-primary);
  font-weight: 600;
}

#opsAlertDialog .dialog-body {
  max-height: min(58vh, 540px);
  overflow-y: auto;
}

.ops-kpi-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 9.5px;
  cursor: pointer;
}

.ops-kpi-link:hover {
  text-decoration: underline;
}

.ops-kpi-link .icon {
  width: 10px;
  height: 10px;
}

.merchant-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: 88vh;
}

.merchant-dialog .dialog-body {
  max-height: min(64vh, 620px);
  overflow-y: auto;
}

.merchant-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.merchant-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 9.5px;
  white-space: nowrap;
}

.merchant-stat-chip strong {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.merchant-stat-chip.is-alert {
  border-color: rgba(250, 178, 25, 0.28);
  background: var(--sev-warning-soft);
}

.merchant-stat-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--text-muted);
}

.merchant-stat-chip.is-alert .merchant-stat-dot {
  background: var(--warning);
}

.merchant-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 9.5px;
}

.merchant-table-scroll {
  max-height: 42vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.merchant-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 9.5px;
}

.merchant-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}

.merchant-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.merchant-table tbody tr:first-child td {
  border-top: 0;
}

.merchant-table tbody tr:hover {
  background: var(--surface);
}

.merchant-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.merchant-table .merchant-id {
  color: var(--text-primary);
  font-weight: 600;
}

.merchant-table .is-issue {
  color: var(--text-primary);
  font-weight: 600;
}

.merchant-table th:first-child,
.merchant-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface-raised);
  box-shadow: 1px 0 0 var(--border);
}

.merchant-table th:first-child {
  background: var(--surface);
}

.merchant-table tbody tr:hover td:first-child {
  background: var(--surface);
}

.merchant-dialog .dialog-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}

.merchant-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 9.5px;
}

.merchant-pagination .button {
  height: 28px;
  font-size: 10px;
}

.merchant-pagination .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.merchant-notice {
  margin: 0;
}

@media (max-width: 700px) {
  .merchant-dialog {
    width: calc(100vw - 16px);
  }

  .merchant-dialog .dialog-body {
    max-height: 68vh;
  }

  .merchant-table-scroll {
    max-height: 38vh;
  }

  .merchant-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* 运单详情 */
.order-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: 88vh;
}

.order-dialog .dialog-body {
  max-height: min(68vh, 660px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-section h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 600;
}

.order-section h3 span {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 400;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.order-field {
  display: flex;
  gap: 8px;
  min-width: 0;
  font-size: 10px;
  line-height: 1.5;
}

.order-field .k {
  flex: none;
  width: 88px;
  color: var(--text-muted);
}

.order-field .v {
  color: var(--text-primary);
  word-break: break-all;
}

.order-field .v.is-alert {
  color: var(--warning);
  font-weight: 600;
}

.order-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.order-timeline-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
  font-size: 10px;
}

.order-timeline-item:first-child {
  border-top: 0;
}

.order-timeline-time {
  flex: none;
  width: 82px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.order-timeline-title {
  flex: none;
  width: 72px;
  color: var(--text-primary);
  font-weight: 600;
}

.order-timeline-note {
  color: var(--text-secondary);
  word-break: break-all;
}

.order-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-link:hover {
  color: var(--accent-hover);
}

.order-placeholder {
  padding: 24px;
  color: var(--text-muted);
  font-size: 10.5px;
  text-align: center;
}

.order-dialog .dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .order-grid {
    grid-template-columns: 1fr;
  }
}

/* 运力线占比与出勤 */
.ops-line-share {
  margin-top: 12px;
}

.ops-share-bar {
  display: flex;
  height: 12px;
  margin: 2px 0 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.ops-share-seg {
  height: 100%;
  min-width: 2px;
}

.ops-share-seg + .ops-share-seg {
  box-shadow: 0 0 0 1px var(--surface-raised);
}

.ops-share-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 16px;
}

.ops-share-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 9.5px;
  white-space: nowrap;
}

.ops-share-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
}

.ops-share-item strong {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ops-share-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 尾部明细 */
.tails-view {
  margin-top: 18px;
}

.tails-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.tails-card .card-header {
  align-items: flex-start;
}

.tails-scroll {
  max-height: 360px;
}

.tails-table {
  min-width: 560px;
}

.tails-table td .tail-name {
  color: var(--text-primary);
  font-weight: 600;
}

.tails-table td .tail-sub {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 8.5px;
}

.tails-table td.is-warning {
  color: var(--warning);
  font-weight: 600;
}

.tails-empty {
  padding: 22px;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 1100px) {
  .tails-grid {
    grid-template-columns: 1fr;
  }
}

.ops-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ops-chart-card {
  overflow: hidden;
}

.ops-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 14px 14px;
}

.ops-bar-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 64px 56px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.ops-bar-row:hover {
  background: var(--surface);
}

.ops-bar-label {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ops-bar-track {
  position: relative;
  height: 9px;
  border-radius: 4px;
  background: var(--surface);
}

.ops-bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--series-1);
  transition: width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ops-bar-fill.is-warning {
  background: var(--warning);
}

.ops-bar-fill.is-critical {
  background: var(--critical);
}

.ops-bar-threshold {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 96%;
  width: 1px;
  background: var(--warning);
  opacity: 0.8;
  pointer-events: none;
}

.ops-bar-value {
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ops-bar-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.ops-bar-status i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
}

.ops-table-card {
  overflow: hidden;
}

.ops-table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.ops-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 10.5px;
}

.ops-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}

.ops-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ops-table tbody tr:last-child td {
  border-bottom: 0;
}

.ops-table tbody tr:hover {
  background: var(--surface);
}

.ops-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ops-table .ops-line-name {
  color: var(--text-primary);
  font-weight: 600;
}

.ops-table tr.is-aggregate td {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 1120px) {
  .ops-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .ops-charts {
    grid-template-columns: 1fr;
  }

  .ops-network-card .map-header-legend {
    display: flex;
  }
}

@media (max-width: 700px) {
  .ops-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ops-kpis {
    gap: 10px;
  }

  .ops-network-stage {
    min-height: 320px;
  }

  .ops-network-card .map-header-legend {
    display: none;
  }

  .ops-network-card #opsNetworkSvg,
  .ops-network-card .map-hud,
  .ops-network-card .map-zoom-note {
    display: none;
  }

  .ops-network-list {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    overflow-y: auto;
  }

  .ops-alert-list {
    max-height: 340px;
  }

  .ops-bar-row {
    grid-template-columns: 64px minmax(0, 1fr) 56px 46px;
    gap: 6px;
  }

  .ops-table th,
  .ops-table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .ops-table th:first-child,
  .ops-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface-raised);
    box-shadow: 1px 0 0 var(--border);
  }

  .ops-table th:first-child {
    background: var(--surface);
  }

  .ops-table tbody tr:hover td:first-child {
    background: var(--surface);
  }

  .ops-table tr.is-aggregate td:first-child {
    background: var(--surface);
  }
}

@media (max-width: 460px) {
  .ops-kpis {
    grid-template-columns: 1fr;
  }

  .ops-heading h2 {
    font-size: 16px;
  }

  .ops-network-stage {
    min-height: 300px;
  }
}

