@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Quicksand-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/Quicksand-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/Quicksand-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/Quicksand-Bold.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --bg-app: #181b26;
  --bg-panel: #212636;
  --bg-panel-2: #2a3046;
  --bg-elev: #333a54;
  --bg-input: #232842;
  --border: #2f3650;
  --border-strong: #414a72;
  --text: #eef0f7;
  --text-dim: #d4d9e8;
  --muted: #8d96b3;
  --accent: #14b8a6;
  --accent-bright: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, .16);
  --accent2: #a5b4fc;
  --accent2-soft: rgba(165, 180, 252, .16);
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #7dd3fc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 32px rgba(8, 10, 20, .34);
  --font-sans: "Quicksand", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
[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;
}
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--bg-app); font-size: 15px; }
button, select, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 28px; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 20px; }
h3 { font-size: 17px; }

.app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column;
  height: 100vh; background: var(--bg-panel); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.auth-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  color: #06231f; background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  font-size: 20px; font-weight: 900; box-shadow: 0 7px 22px rgba(20, 184, 166, .25);
}
.brand-icon { display: block; width: 36px; height: 36px; flex: 0 0 auto; }
.brand-name { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.brand-name strong, .auth-brand strong { color: var(--accent-bright); }
.brand-subtitle { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
.site-picker { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.site-picker label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.site-picker select { width: 100%; }
.sidebar-nav { flex: 1; padding: 14px 8px; overflow-y: auto; }
.sidebar-nav > p { margin: 10px 12px 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; width: 100%; min-height: 42px; gap: 10px;
  padding: 8px 12px; border: 0; border-radius: 10px; color: var(--text-dim);
  background: transparent; text-align: left; text-decoration: none; transition: background .12s ease, color .12s ease;
}
.nav-item:hover { color: var(--text); background: var(--bg-panel-2); }
.nav-item.active { color: var(--accent-bright); background: var(--accent-soft); }
.nav-item small { margin-left: auto; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.nav-item.disabled { cursor: default; opacity: .55; }
.nav-icon { display: grid; place-items: center; width: 22px; color: currentColor; font-weight: 800; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-top: 1px solid var(--border); }
.user-profile-link { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.user-profile-link:hover .user-copy strong { color: var(--accent-bright); }
.user-profile-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 999px; color: #06231f; background: var(--accent-bright); font-weight: 900; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 13px; }
.user-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.user-chip form { margin: 0; }
.sign-out { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.sign-out:hover { color: var(--bad); background: rgba(251, 113, 133, .12); }

.main { min-width: 0; }
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 96px; padding: 19px clamp(20px, 4vw, 48px);
  background: rgba(24, 27, 38, .86); border-bottom: 1px solid var(--border);
}
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.page-subtitle { margin-bottom: 0; color: var(--muted); }
.page-body { display: grid; gap: 18px; padding: 24px clamp(16px, 4vw, 48px) 56px; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

select, input {
  min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; color: var(--text); background: var(--bg-input); outline: none;
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 191, .12); }
.refresh-button, .auth-form button {
  min-height: 40px; padding: 8px 15px; border: 1px solid var(--accent);
  border-radius: var(--radius-sm); color: #06231f; background: var(--accent-bright); font-weight: 800;
}
.status-strip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-strip .dot { display: inline-block; margin-right: 2px; vertical-align: middle; }

.read-model-view { display: grid; gap: 18px; }
.connection-panel, .data-panel, .summary-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.connection-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; }
.agent-cards { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.agent-card { min-width: 250px; padding: 13px 15px; border-radius: 11px; background: var(--bg-panel-2); border: 1px solid var(--border-strong); }
.agent-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); }
.dot.online { background: var(--good); box-shadow: 0 0 0 4px rgba(74, 222, 128, .12); }
.dot.stale { background: var(--warn); }
.dot.offline { background: var(--bad); }
.agent-meta { display: grid; grid-template-columns: auto auto; gap: 4px 16px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.agent-meta strong { color: var(--text); text-align: right; }

.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); gap: 11px; }
.summary-grid.alarm-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.summary-grid.topology-summary { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
.summary-grid.account-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.summary-grid.report-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.summary-card { padding: 15px; }
.summary-card span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.summary-card strong { display: block; margin-top: 5px; font-size: 27px; letter-spacing: -.04em; }
.overview-metrics { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 11px; }
.overview-metric {
  position: relative; overflow: hidden; min-height: 128px; padding: 18px 19px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--bg-panel);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.overview-metric:hover { transform: translateY(-2px); }
.overview-metric::before {
  position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--border-strong);
}
.overview-metric.metric-accent::before { background: var(--accent); }
.overview-metric.metric-good::before { background: var(--good); }
.overview-metric.metric-warn::before { background: var(--warn); }
.overview-metric.metric-bad::before { background: var(--bad); }
.metric-label {
  display: block; color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
}
.metric-value {
  display: block; margin-top: 9px; font-size: 31px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.045em; line-height: 1;
}
.metric-sub { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.panel-link {
  padding: 4px 0; border: 0; color: var(--accent-bright); background: transparent;
  font-size: 12px; font-weight: 700;
}
.panel-link:hover { color: var(--text); }
.alert-feed, .timeline { margin: 0; padding: 0; list-style: none; }
.overview-alarm {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 15px;
  border-top: 1px solid var(--border);
}
.overview-alarm:first-child, .timeline-item:first-child { border-top: 0; }
.overview-alarm-main { min-width: 0; flex: 1; }
.overview-alarm-title { color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.35; }
.overview-alarm-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.overview-alarm-age { color: var(--text-dim); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
.class-chip {
  flex: 0 0 auto; padding: 3px 7px; border-radius: var(--radius-sm);
  font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.class-chip.class-0 { color: var(--info); background: rgba(125, 211, 252, .14); }
.class-chip.class-1, .class-chip.class-4 { color: var(--warn); background: rgba(251, 191, 36, .14); }
.class-chip.class-2 { color: #fb923c; background: rgba(251, 146, 60, .14); }
.class-chip.class-3 { color: var(--bad); background: rgba(251, 113, 133, .14); }
.timeline-item {
  display: grid; grid-template-columns: 122px 92px minmax(0, 1fr); gap: 12px;
  align-items: center; padding: 11px 15px; border-top: 1px solid var(--border); font-size: 12px;
}
.timeline-time { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.timeline-actor { color: var(--text-dim); font-weight: 700; }
.timeline-action { display: flex; align-items: center; gap: 8px; min-width: 0; }
.timeline-target { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.data-panel { overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 20px 20px 13px; }
.filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-message { min-height: 20px; margin: 0; padding: 0 20px 12px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 13px; color: var(--muted); background: var(--bg-panel-2); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 12px 13px; border-top: 1px solid var(--border); white-space: nowrap; }
td:nth-child(3) { max-width: 420px; white-space: normal; }
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: var(--accent-soft); }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: var(--bg-elev); }
.pill.delivered, .pill.online, .pill.resolved { color: var(--good); background: rgba(74, 222, 128, .14); }
.pill.faulty, .pill.offline, .pill.active, .pill.class-3 { color: var(--bad); background: rgba(251, 113, 133, .14); }
.pill.class-2 { color: #fb923c; background: rgba(251, 146, 60, .14); }
.pill.class-1, .pill.class-4, .pill.purged, .pill.stale, .pill.in_flight { color: var(--warn); background: rgba(251, 191, 36, .14); }
.pill.owner { color: var(--accent-bright); background: var(--accent-soft); }
.pill.admin { color: var(--accent2); background: var(--accent2-soft); }
.pill.operator { color: var(--info); background: rgba(125, 211, 252, .14); }
.pill.viewer, .pill.you { color: var(--text-dim); }
.pill.disabled { color: var(--bad); background: rgba(251, 113, 133, .14); }

dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 40px); border: 1px solid var(--border-strong); border-radius: 18px; padding: 24px; color: var(--text); background: var(--bg-panel); box-shadow: 0 25px 80px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(8, 10, 20, .72); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.icon-button { min-width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--bg-panel-2); font-size: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; padding: 18px 0; }
.detail-grid div { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
dd { margin: 4px 0 0; font-weight: 700; }
.hop-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; padding-left: 28px; }
.hop-list li { padding: 8px 10px; border-radius: 8px; background: var(--bg-panel-2); }
.topology-tree { max-height: 640px; overflow: auto; padding: 0 20px 24px; }
.topology-tree ul { margin: 0; padding-left: 24px; list-style: none; }
.topology-tree > ul { padding-left: 0; }
.topology-tree li { margin: 5px 0; }
.topology-node { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 9px; border-radius: 8px; background: var(--bg-panel-2); }
.topology-node small { color: var(--muted); }
.health-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 20px; overflow: visible;
}
.health-controls { display: flex; align-items: center; gap: 14px; }
.segmented {
  display: inline-flex; padding: 3px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--bg-input);
}
.segmented button {
  min-width: 54px; min-height: 34px; padding: 5px 10px; border: 0;
  border-radius: 7px; color: var(--muted); background: transparent; font-weight: 700;
}
.segmented button.active { color: #06231f; background: var(--accent-bright); }
.health-summary { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.health-banner {
  padding: 13px 16px; border: 1px solid rgba(251, 191, 36, .42);
  border-radius: 11px; color: var(--warn); background: rgba(251, 191, 36, .09);
}
.health-tree, .health-events { display: grid; gap: 8px; padding: 0 20px 22px; }
.health-group {
  overflow: hidden; border: 1px solid var(--border); border-radius: 11px;
  background: var(--bg-panel-2);
}
.health-group summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; cursor: pointer; list-style-position: inside;
}
.health-group summary:hover { background: var(--accent-soft); }
.health-group-meta { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.health-zone { margin: 0 10px 10px; background: var(--bg-panel); }
.health-zone table { font-size: 12px; }
.health-zone tbody tr { cursor: default; }
.health-device-down { background: rgba(251, 113, 133, .07); }
.health-event-zone {
  display: flex; justify-content: space-between; padding: 10px 16px 4px;
  color: var(--text-dim);
}
.health-event-zone span { color: var(--muted); font-size: 11px; }
.health-event-members {
  display: grid; gap: 5px; margin: 0; padding: 4px 16px 14px 38px;
  color: var(--muted); font-size: 12px;
}
.pill.unknown { color: var(--warn); background: rgba(251, 191, 36, .14); }
.account-identity {
  display: grid; grid-template-columns: 34px minmax(120px, auto) auto;
  align-items: center; gap: 2px 10px;
}
.account-avatar { grid-row: 1 / span 2; width: 34px; height: 34px; }
.account-name { font-weight: 700; }
.account-identity small { color: var(--muted); }
.account-identity .pill { grid-column: 3; grid-row: 1 / span 2; }
.account-disabled { opacity: .64; }
.compact-button { min-height: 32px; padding: 5px 10px; }
.secondary-button {
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); background: var(--bg-panel-2);
  font-weight: 700;
}
.secondary-button:hover { border-color: var(--accent); }
.muted-label { color: var(--muted); font-size: 11px; }
.account-dialog { width: min(760px, calc(100% - 24px)); }
.account-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px; padding: 20px 0 14px;
}
.account-context-grid {
  align-items: stretch; padding-bottom: 0;
}
.account-mode {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 11px;
}
.account-mode legend {
  padding: 0 6px; color: var(--text-dim); font-size: 11px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
}
.account-mode .access-option {
  min-width: 0; margin: 0; padding: 8px; border-radius: 8px;
}
.account-mode .access-option:has(input:checked) { background: var(--accent-soft); }
.account-tenant-name { display: grid; gap: 2px; }
.account-tenant-name small { color: var(--muted); }
.account-shared-note {
  margin: 0 0 14px; padding: 10px 12px; border-left: 3px solid var(--info);
  border-radius: 7px; color: var(--text-dim); background: var(--bg-panel-2); font-size: 12px;
}
.field { display: grid; gap: 6px; }
.field-label {
  color: var(--text-dim); font-size: 11px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
}
.field-hint { color: var(--muted); font-size: 11px; }
.form-error {
  margin: 18px 0 0; padding: 10px 12px; border: 1px solid rgba(251, 113, 133, .4);
  border-radius: 9px; color: var(--bad); background: rgba(251, 113, 133, .1);
}
.account-access {
  margin: 2px 0 20px; padding: 14px; border: 1px solid var(--border);
  border-radius: 11px;
}
.account-access legend {
  padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.access-option { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; }
.access-option input, .site-choice input { min-height: auto; margin-top: 3px; }
.access-option span { display: grid; gap: 2px; }
.access-option small { color: var(--muted); }
.site-choice-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px; margin: 12px 0 0 24px;
}
.site-choice {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; background: var(--bg-panel-2);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.history-import-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px; align-items: center; padding: 20px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: linear-gradient(120deg, var(--bg-panel), var(--bg-panel-2));
}
.history-import-copy { min-width: 0; }
.history-import-title-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px;
}
.history-import-title-row h2 { margin: 0; }
.history-import-title-row h3 { margin: 0; color: #244d3f; font-size: 15px; }
.history-import-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  align-items: end;
}
.history-import-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.history-import-form legend {
  margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.history-window-options {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-panel-2);
}
.history-window-options label { position: relative; min-width: 0; }
.history-window-options input { position: absolute; opacity: 0; pointer-events: none; }
.history-window-options span {
  display: grid; place-items: center; min-height: 44px; padding: 6px 9px;
  border-radius: 7px; color: var(--text-dim); font-size: 12px; font-weight: 750;
  cursor: pointer;
}
.history-window-options input:checked + span {
  color: var(--accent-strong); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.history-window-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.history-window-options input:disabled + span { opacity: .5; cursor: not-allowed; }
.history-import-form .form-error { grid-column: 1 / -1; margin: 0; }
.history-import-panel .status-message { min-height: 2.8em; }
.history-import-results {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0;
}
.history-import-results div { display: grid; gap: 2px; }
.history-import-results dt {
  color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.history-import-results dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 750; }
.pill.ready { color: var(--text-dim); background: var(--bg-panel-2); }
.pill.succeeded { color: var(--good); background: rgba(52, 211, 153, .14); }
.pill.rejected { color: var(--bad); background: rgba(251, 113, 133, .14); }
.report-generator { padding-bottom: 20px; }
.report-form {
  display: grid; grid-template-columns: 2fr 1fr; gap: 18px;
  padding: 0 20px;
}
.report-form fieldset {
  margin: 0; padding: 14px; border: 1px solid var(--border);
  border-radius: 11px;
}
.report-form legend {
  padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.report-choice {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 6px;
  border-radius: 8px;
}
.report-choice:hover { background: var(--accent-soft); }
.report-choice input { min-height: auto; margin-top: 3px; }
.report-choice span { display: grid; gap: 2px; }
.report-choice small { color: var(--muted); }
.report-window-options { display: grid; gap: 8px; }
.report-window-options label {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 8px; background: var(--bg-panel-2);
}
.report-window-options input { min-height: auto; }
.report-name { display: grid; gap: 3px; }
.report-name small { color: var(--muted); font-family: ui-monospace, monospace; }
.pill.queued, .pill.running { color: var(--warn); background: rgba(251, 191, 36, .14); }
.pill.completed { color: var(--good); background: rgba(52, 211, 153, .14); }
.pill.failed, [class*="pill failed"] { color: var(--bad); background: rgba(251, 113, 133, .14); }
.pill.expired { color: var(--muted); background: rgba(148, 163, 184, .12); }
.pill.pending, .pill.processing, .pill.retry { color: var(--warn); background: rgba(251, 191, 36, .14); }
.pill.delivered { color: var(--good); background: rgba(52, 211, 153, .14); }
.table-actions { display: flex; gap: 7px; }
.danger-button { color: var(--bad); }
.danger-button:hover { border-color: var(--bad); }
@media (max-width: 820px) {
  .history-import-panel { grid-template-columns: 1fr; }
  .history-import-form { grid-template-columns: 1fr; }
  .history-import-form .refresh-button { width: 100%; }
}
.delivery-editor { padding-bottom: 18px; }
.delivery-form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; align-items: end; padding: 0 20px 18px;
}
.compact-delivery-form { grid-template-columns: 1fr 160px 2fr auto; }
.delivery-target-field { min-width: 0; }
.form-submit { align-self: end; }
.schedule-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.delivery-options {
  min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 11px;
}
.delivery-options legend {
  padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.delivery-options label {
  display: inline-flex; align-items: center; gap: 6px; margin: 5px 10px 5px 0;
  color: var(--text-dim); font-size: 12px;
}
.delivery-options input, .schedule-enabled input { min-height: auto; }
.weekdays { grid-column: span 2; }
.schedule-recipient-options { grid-column: span 2; }
.schedule-recipient-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
}
.schedule-enabled { align-self: center; margin: 0; }

.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 18px; background: radial-gradient(circle at 80% 0%, rgba(45, 212, 191, .08), transparent 40%), var(--bg-app); }
.auth-card { width: min(390px, 100%); padding: 34px 32px 30px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-panel); box-shadow: 0 28px 80px rgba(8, 10, 20, .55); }
.auth-brand { display: grid; justify-items: center; margin-bottom: 24px; text-align: center; }
.auth-mark { width: 48px; height: 48px; margin-bottom: 13px; font-size: 25px; }
.auth-logo { display: block; width: 52px; height: 52px; margin-bottom: 13px; }
.auth-brand h1 { margin-bottom: 2px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 6px; color: var(--text-dim); font-size: 12px; font-weight: 700; }
.auth-form button { margin-top: 5px; }
.auth-error { padding: 10px 12px; border: 1px solid rgba(251, 113, 133, .4); border-radius: 9px; color: var(--bad); background: rgba(251, 113, 133, .1); font-size: 13px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { display: flex; flex-wrap: wrap; }
  .sidebar-nav > p { width: 100%; }
  .nav-item { width: auto; }
  .user-chip { display: none; }
  .connection-panel { align-items: stretch; flex-direction: column; }
  .agent-cards { justify-content: stretch; }
  .agent-card { flex: 1; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-metrics { grid-template-columns: repeat(2, 1fr); }
  .overview-columns { grid-template-columns: 1fr; }
  .health-toolbar, .health-controls { align-items: stretch; flex-direction: column; }
  .delivery-form, .compact-delivery-form, .schedule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions { align-items: stretch; flex-direction: column; }
  .summary-grid, .summary-grid.alarm-summary, .summary-grid.topology-summary, .health-summary, .summary-grid.account-summary, .summary-grid.report-summary { grid-template-columns: repeat(2, 1fr); }
  .overview-metrics { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
  .detail-grid { grid-template-columns: 1fr; }
  .account-form-grid, .account-mode, .site-choice-grid, .report-form { grid-template-columns: 1fr; }
  .account-dialog input, .account-dialog select { font-size: 16px; }
  .account-dialog .icon-button { min-width: 44px; min-height: 44px; }
  .delivery-form, .compact-delivery-form, .schedule-form, .schedule-recipient-grid { grid-template-columns: 1fr; }
  .weekdays, .schedule-recipient-options { grid-column: auto; }
}

/* Flup-inspired 2026 portal redesign: light operational workspace. */
:root {
  color-scheme: light;
  --bg-app: #f3f6f4;
  --bg-panel: #ffffff;
  --bg-panel-2: #f7f9f8;
  --bg-elev: #edf3f0;
  --bg-input: #fbfcfb;
  --border: #e4e9e6;
  --border-strong: #d3ddd8;
  --text: #12372c;
  --text-dim: #3f6257;
  --muted: #889b94;
  --accent: #0d8a67;
  --accent-bright: #12a77c;
  --accent-soft: #e2f4ed;
  --accent2: #7457db;
  --accent2-soft: #eeeafd;
  --good: #13a976;
  --warn: #e89c35;
  --bad: #e85b68;
  --info: #5087e8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(31, 63, 52, .055);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(18, 167, 124, .07), transparent 25rem),
    var(--bg-app);
  font-size: 14px;
}

h1 { font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -.045em; }
h2 { color: #124532; font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
h3 { color: #164c3a; }

.app-shell { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar {
  z-index: 5;
  padding: 0 12px;
  background: rgba(249, 251, 250, .96);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 32px rgba(36, 69, 57, .025);
  backdrop-filter: blur(18px);
}
.brand {
  min-height: 91px;
  gap: 12px;
  padding: 22px 12px 18px;
  border-bottom: 0;
}
.brand-icon { width: 40px; height: 40px; }
.brand-name { color: #114b38; font-size: 22px; }
.brand-name strong, .auth-brand strong { color: var(--accent); }
.brand-subtitle {
  margin-top: 6px;
  color: #9aa9a3;
  font-size: 8px;
  letter-spacing: .17em;
}
.site-picker {
  margin: 0 0 7px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(31, 63, 52, .035);
}
.site-picker label { margin-bottom: 8px; color: #9aa9a3; font-size: 9px; }
.site-picker select {
  min-height: 38px;
  border-color: #e5ebe8;
  background-color: #f8faf9;
  font-size: 12px;
  font-weight: 700;
}
.sidebar-nav { padding: 10px 0 18px; }
.sidebar-nav > p {
  margin: 20px 13px 8px;
  color: #a1aea9;
  font-size: 9px;
  letter-spacing: .13em;
}
.nav-item {
  min-height: 47px;
  gap: 11px;
  margin: 3px 0;
  padding: 7px 10px;
  border-radius: 12px;
  color: #6f887f;
  font-size: 13px;
  font-weight: 600;
}
.nav-item:hover { color: #18543f; background: #f0f5f2; }
.nav-item.active {
  color: #0c6f53;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(13, 138, 103, .035);
}
.nav-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  color: #82968e;
  background: transparent;
}
.nav-item.active .nav-icon {
  color: #087657;
  background: rgba(255, 255, 255, .65);
}
.nav-icon svg, .refresh-button svg, .connection-icon svg {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.user-chip {
  margin-top: auto;
  padding: 18px 7px 20px;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(145deg, #1ca981, #087858);
  box-shadow: 0 7px 18px rgba(13, 138, 103, .18);
}
.user-copy strong { color: #214f3f; font-size: 12px; }
.user-copy small { color: #9aa9a3; }
.sign-out { color: #8ea098; }
.sign-out:hover { color: var(--bad); background: #fff0f1; }

.main { background: rgba(248, 250, 249, .72); }
.page-header {
  min-height: 118px;
  padding: 25px clamp(24px, 4vw, 54px) 20px;
  background: transparent;
  border-bottom: 0;
}
.page-heading { min-width: 0; }
.page-heading-meta { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.page-heading-meta .eyebrow { margin: 0; }
.header-site {
  max-width: 260px;
  overflow: hidden;
  padding: 4px 9px;
  border: 1px solid #dce7e2;
  border-radius: 999px;
  color: #4b7465;
  background: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-subtitle { color: #8a9b95; font-size: 12px; }
.page-actions { gap: 13px; }
.status-strip {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: #6e857c;
  background: rgba(255, 255, 255, .76);
  font-size: 11px;
}
.refresh-button, .auth-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #087858;
  border-radius: 11px;
  color: #fff;
  background: #087858;
  box-shadow: 0 7px 18px rgba(13, 138, 103, .16);
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.refresh-button:hover, .auth-form button:hover {
  background: #066a4d;
  box-shadow: 0 10px 24px rgba(13, 138, 103, .22);
  transform: translateY(-1px);
}
.refresh-button:disabled { opacity: .55; transform: none; }
.refresh-button svg { width: 16px; height: 16px; }
.eyebrow { color: #9aaaa4; font-size: 9px; letter-spacing: .13em; }
.page-body {
  width: min(100%, 1660px);
  gap: 20px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 54px) 58px;
}

select, input {
  min-height: 42px;
  border-color: var(--border-strong);
  color: #244e40;
  background: var(--bg-input);
  font-size: 12px;
}
select:focus, input:focus {
  border-color: #29a886;
  box-shadow: 0 0 0 4px rgba(18, 167, 124, .09);
}
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid rgba(18, 167, 124, .24);
  outline-offset: 2px;
}

.connection-panel, .data-panel, .summary-card {
  border-color: var(--border);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.connection-panel {
  min-height: 98px;
  padding: 17px 19px;
  border-radius: 17px;
}
.connection-heading { display: flex; align-items: center; gap: 13px; }
.connection-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  color: #087858;
  background: var(--accent-soft);
}
.connection-icon svg { width: 21px; height: 21px; }
.agent-cards { gap: 9px; }
.agent-card {
  position: relative;
  min-width: 245px;
  overflow: hidden;
  padding: 12px 14px 12px 17px;
  border-color: #e5ebe8;
  border-radius: 12px;
  background: #fbfcfb;
}
.agent-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--muted);
}
.agent-card[data-state="online"]::before { background: var(--good); }
.agent-card[data-state="stale"]::before { background: var(--warn); }
.agent-card[data-state="offline"]::before { background: var(--bad); }
.agent-title { color: #245441; font-size: 12px; }
.agent-meta { color: #93a19c; font-size: 10px; }
.agent-meta strong { color: #4f6e63; }
.dot { width: 7px; height: 7px; }
.dot.online { box-shadow: 0 0 0 3px rgba(19, 169, 118, .12); }

.read-model-view { gap: 20px; }
.overview-metrics { grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.overview-metric {
  min-height: 132px;
  padding: 18px 18px 16px;
  border-color: var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}
.overview-metric:hover {
  border-color: #d7e3de;
  box-shadow: 0 14px 34px rgba(31, 63, 52, .075);
}
.overview-metric::before { display: none; }
.metric-decoration {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 15px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 800;
}
.overview-metric[data-metric="active-alarms"] .metric-decoration::before { content: "!"; }
.overview-metric[data-metric="in-flight"] .metric-decoration::before { content: "↗"; }
.overview-metric[data-metric="delivered"] .metric-decoration::before { content: "✓"; }
.overview-metric[data-metric="devices"] .metric-decoration::before { content: "▦"; font-size: 17px; }
.overview-metric[data-metric="connection"] .metric-decoration::before { content: "●"; font-size: 11px; }
.overview-metric.metric-good .metric-decoration { color: #09875f; background: #e1f5ec; }
.overview-metric.metric-warn .metric-decoration { color: #c97d18; background: #fff3df; }
.overview-metric.metric-bad .metric-decoration { color: #d64555; background: #ffeaed; }
.metric-label { color: #91a19b; font-size: 9px; letter-spacing: .07em; }
.metric-value {
  margin-top: 7px;
  color: #104b36;
  font-size: 28px;
  font-weight: 700;
  text-transform: capitalize;
}
.metric-sub { margin-top: 8px; color: #91a19b; font-size: 10px; }

.summary-grid { gap: 13px; }
.summary-card {
  position: relative;
  min-height: 101px;
  overflow: hidden;
  padding: 18px;
  border-radius: 15px;
}
.summary-card::after {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  content: "";
  background: rgba(18, 167, 124, .055);
}
.summary-card span { color: #91a19b; font-size: 9px; letter-spacing: .07em; }
.summary-card strong { margin-top: 9px; color: #104b36; font-size: 26px; }

.overview-columns { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 20px; }
.data-panel { border-radius: 17px; }
.panel-heading { align-items: center; padding: 21px 22px 15px; }
.panel-heading h2 { font-size: 18px; }
.panel-link {
  padding: 7px 10px;
  border-radius: 8px;
  color: #0b795a;
  background: #eef7f3;
  font-size: 10px;
}
.panel-link:hover { color: #fff; background: #0b795a; }
.status-message { padding: 0 22px 13px; color: #99a7a2; font-size: 10px; }
.overview-alarm, .timeline-item { border-color: #edf0ee; }
.overview-alarm { padding: 13px 22px; }
.overview-alarm:hover, .timeline-item:hover { background: #f7faf8; }
.overview-alarm-title { color: #234e40; font-size: 12px; }
.overview-alarm-meta { color: #92a29c; font-size: 10px; }
.overview-alarm-age, .timeline-time { color: #9aa8a3; }
.timeline-item { padding: 13px 22px; }
.timeline-actor { color: #345f50; }

.table-wrap { margin: 0 9px 9px; border: 1px solid #edf0ee; border-radius: 12px; }
table { font-size: 12px; }
th {
  padding: 12px 13px;
  color: #91a19b;
  background: #fafbfa;
  font-size: 8px;
  letter-spacing: .09em;
}
th:first-child { border-radius: 11px 0 0 0; }
th:last-child { border-radius: 0 11px 0 0; }
td { padding: 13px; border-color: #edf0ee; color: #45675b; }
tbody tr:hover { background: #f3f8f5; }
.pill {
  padding: 5px 9px;
  border-radius: 7px;
  color: #617b72;
  background: #eef2f0;
  font-size: 9px;
  text-transform: capitalize;
}
.pill.delivered, .pill.online, .pill.resolved, .pill.completed {
  color: #087c58;
  background: #e2f5ec;
}
.pill.success {
  color: #087c58;
  background: #e2f5ec;
}
.pill.faulty, .pill.offline, .pill.active, .pill.class-3, .pill.failed {
  color: #cc3f50;
  background: #ffeaed;
}
.pill.failure, .pill.denied {
  color: #cc3f50;
  background: #ffeaed;
}
.pill.class-2 { color: #c9682f; background: #fff0e7; }
.pill.class-1, .pill.class-4, .pill.canceled, .pill.purged, .pill.stale,
.pill.in_flight, .pill.queued, .pill.running, .pill.pending,
.pill.processing, .pill.retry {
  color: #bc7416;
  background: #fff2df;
}
.pill.owner { color: #6042c8; background: #eeeafd; }
.pill.admin { color: #8d4dc4; background: #f5eafa; }
.pill.operator { color: #326dcf; background: #e9f0fd; }
.pill.viewer, .pill.you { color: #647b73; background: #eef2f0; }

.audit-actor { display: grid; gap: 2px; min-width: 140px; }
.audit-actor strong { color: #315a4b; }
.audit-actor small { color: #98a6a1; font-size: 9px; }
.audit-details {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: #6f857d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-button {
  border-color: #dce4e0;
  color: #42685a;
  background: #fff;
  box-shadow: 0 3px 10px rgba(31, 63, 52, .035);
}
.secondary-button:hover { border-color: #8bb9a8; color: #0b795a; }
.segmented { border-color: #dce4e0; background: #f5f8f6; }
.segmented button { color: #879a93; }
.segmented button.active { color: #fff; background: #087858; }
.health-banner {
  border-color: #f3d39e;
  color: #a96610;
  background: #fff7e9;
}
.health-group, .topology-node, .site-choice, .report-window-options label {
  border-color: #e9eeeb;
  background: #f8faf9;
}
.health-zone { background: #fff; }
.health-device-down { background: #fff3f4; }
.form-error, .auth-error { border-color: #f5c8cd; color: #c84151; background: #fff0f2; }

dialog {
  border-color: #dce4e0;
  color: var(--text);
  background: #fff;
  box-shadow: 0 28px 90px rgba(25, 57, 46, .22);
}
dialog::backdrop { background: rgba(23, 48, 39, .32); backdrop-filter: blur(5px); }
.icon-button { border-color: #e0e7e3; color: #5f786f; background: #f7f9f8; }
.detail-grid div { border-color: #e9eeeb; }
dt { color: #96a59f; }
dd { color: #315a4b; }
.hop-list li { color: #45675b; background: #f7f9f8; }
.field-label, .account-access legend, .report-form legend, .delivery-options legend {
  color: #82968e;
}
.field-hint, .report-choice small, .access-option small { color: #98a6a1; }
.account-access, .report-form fieldset, .delivery-options { border-color: #e3e9e6; }

.auth-body {
  background:
    radial-gradient(circle at 20% 15%, rgba(18, 167, 124, .17), transparent 27rem),
    radial-gradient(circle at 88% 80%, rgba(116, 87, 219, .1), transparent 25rem),
    #f3f6f4;
}
.auth-card {
  width: min(420px, 100%);
  padding: 40px 38px 35px;
  border-color: #dfe7e3;
  color: var(--text);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 30px 90px rgba(31, 63, 52, .13);
  backdrop-filter: blur(16px);
}
.auth-logo { width: 58px; height: 58px; }
.auth-brand h1 { color: #174b39; font-size: 30px; }
.auth-brand p { color: #93a39d; }
.auth-form label { color: #557368; }

@media (max-width: 1180px) {
  .overview-metrics { grid-template-columns: repeat(3, 1fr); }
  .overview-columns { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 0 16px; }
  .brand { min-height: 76px; }
  .site-picker { margin-bottom: 0; }
  .sidebar-nav { gap: 4px; padding: 9px 0 14px; }
  .sidebar-nav > p { display: none; }
  .nav-item { min-height: 42px; padding: 5px 8px; }
  .nav-icon { width: 28px; height: 28px; flex-basis: 28px; }
  .page-header { min-height: 105px; }
  .overview-metrics { grid-template-columns: repeat(2, 1fr); }
  .connection-panel { align-items: stretch; }
}

@media (max-width: 560px) {
  .page-header { padding: 22px 18px 18px; }
  .page-body { padding: 0 14px 40px; }
  .page-actions { align-items: stretch; }
  .status-strip { justify-content: center; }
  .overview-metrics { grid-template-columns: 1fr; }
  .summary-grid, .summary-grid.alarm-summary, .summary-grid.topology-summary,
  .health-summary, .summary-grid.account-summary, .summary-grid.report-summary {
    grid-template-columns: 1fr 1fr;
  }
  .table-wrap { margin-inline: 5px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* Login cascade guard: keep legacy portal auth rules from overriding the new page. */
body.auth-body { overflow-x: hidden; }
body.auth-body .auth-shell { max-width: 100%; }
body.auth-body .auth-context .auth-brand {
  display: block;
  justify-items: start;
  margin: 0;
  text-align: left;
}
body.auth-body .auth-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
body.auth-body .auth-card {
  width: min(410px, 100%);
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body.auth-body .auth-form,
body.auth-body .auth-field,
body.auth-body .auth-password-control { min-width: 0; max-width: 100%; }

@media (max-width: 520px) {
  body.auth-body .auth-card { width: 100%; }
}

/* Login experience */
.auth-body {
  display: grid;
  min-height: 100dvh;
  padding: clamp(16px, 3vw, 40px);
  color: #18332c;
  background:
    radial-gradient(circle at 0 0, rgba(24, 146, 111, .13), transparent 31rem),
    radial-gradient(circle at 100% 100%, rgba(51, 91, 150, .09), transparent 34rem),
    #edf2f0;
}

.auth-skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #123f36;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .18s ease-out;
}
.auth-skip-link:focus { transform: translateY(0); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(390px, 1.04fr);
  width: min(1080px, 100%);
  min-height: min(700px, calc(100dvh - clamp(32px, 6vw, 80px)));
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(37, 74, 64, .12);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(26, 55, 47, .14);
}

.auth-context {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(34px, 5vw, 68px);
  overflow: hidden;
  color: #f3fbf8;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .055), transparent 42%),
    #123f36;
}
.auth-context::before,
.auth-context::after {
  position: absolute;
  border: 1px solid rgba(153, 224, 202, .13);
  border-radius: 999px;
  content: "";
  pointer-events: none;
}
.auth-context::before {
  width: 360px;
  height: 360px;
  right: -190px;
  top: -150px;
  box-shadow: 0 0 0 52px rgba(153, 224, 202, .035), 0 0 0 104px rgba(153, 224, 202, .025);
}
.auth-context::after {
  width: 260px;
  height: 260px;
  bottom: -190px;
  left: -120px;
  box-shadow: 0 0 0 48px rgba(153, 224, 202, .025);
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0;
  text-align: left;
}
.auth-wordmark {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1;
}
.auth-brand .auth-wordmark strong { color: #63d0ae; }
.auth-brand-subtitle {
  margin: 7px 0 0;
  color: #9fc5b9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.auth-context-copy {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: auto 0;
  padding: 44px 0;
}
.auth-eyebrow {
  margin: 0 0 12px;
  color: #188563;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-context .auth-eyebrow { color: #76d7b7; }
.auth-context h1 {
  max-width: 430px;
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(36px, 3.6vw, 48px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.auth-context-intro {
  max-width: 390px;
  margin: 18px 0 0;
  color: #bed6cf;
  font-size: 14px;
  line-height: 1.6;
}

.auth-panel {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
  background: #fbfcfc;
}
.auth-card {
  width: min(410px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #18332c;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.auth-card-header { margin-bottom: 30px; }
.auth-card-header h2 {
  margin: 0;
  color: #172e28;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.1;
}
.auth-card-header > p:last-child {
  margin: 11px 0 0;
  color: #63766f;
  font-size: 13.5px;
  line-height: 1.55;
}

.auth-error {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin: -5px 0 22px;
  padding: 12px 13px;
  border: 1px solid #e2b9c0;
  border-radius: 10px;
  color: #772b37;
  background: #fff5f6;
  font-size: 11.5px;
  line-height: 1.5;
}
.auth-error svg {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  stroke: #b43e50;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.auth-error strong { display: block; font-size: 12px; }

.auth-form { display: grid; gap: 20px; }
.auth-field { display: grid; gap: 8px; }
.auth-field > small { color: #667871; font-size: 12px; line-height: 1.5; }
.auth-field > label {
  color: #284b41;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}
.auth-field > input,
.auth-password-control {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cfdad6;
  border-radius: 10px;
  color: #18332c;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 57, 47, .035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.auth-field > input {
  padding: 12px 14px;
  font-size: 16px;
}
.auth-field input::placeholder { color: #65776f; }
.auth-field > input:hover,
.auth-password-control:hover { border-color: #aebfba; }
.auth-field > input:focus {
  border-color: #178664;
  box-shadow: 0 0 0 4px rgba(23, 134, 100, .11);
  outline: none;
}
.auth-password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
}
.auth-password-control:focus-within {
  border-color: #178664;
  box-shadow: 0 0 0 4px rgba(23, 134, 100, .11);
}
.auth-password-control input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 4px 12px 14px;
  border: 0;
  border-radius: 10px 0 0 10px;
  color: #18332c;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 16px;
}
.auth-password-control input[type="password"] {
  color: var(--j-ink-strong, #172e28);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .1em;
}
.auth-password-toggle {
  min-width: 62px;
  min-height: 44px;
  margin: 3px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: #356659;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  transition: color .16s ease, background .16s ease;
}
.auth-password-toggle:hover { color: #126e54; background: #eef7f3; }
.auth-password-toggle:focus-visible {
  outline: 2px solid #178664;
  outline-offset: -2px;
}

.auth-form .auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 12px 17px;
  border: 1px solid #0e7054;
  border-radius: 10px;
  color: #fff;
  background: #10795b;
  box-shadow: 0 10px 24px rgba(16, 121, 91, .18);
  font-size: 13px;
  font-weight: 800;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
  touch-action: manipulation;
}
.auth-form .auth-submit:hover {
  border-color: #0c634a;
  background: #0c6c50;
  box-shadow: 0 12px 28px rgba(16, 121, 91, .24);
}
.auth-form .auth-submit:active { background: #0a6047; box-shadow: 0 5px 14px rgba(16, 121, 91, .18); }
.auth-form .auth-submit:disabled {
  cursor: wait;
  border-color: #5d9584;
  background: #5d9584;
  box-shadow: none;
}
.auth-form .auth-submit:focus-visible {
  outline: 3px solid rgba(23, 134, 100, .28);
  outline-offset: 3px;
}

.auth-access-note {
  margin: 24px 0 0;
  color: #667871;
  font-size: 10.5px;
  line-height: 1.45;
  text-align: center;
}
.auth-start-over {
  justify-self: center;
  color: #45665c;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}
.auth-start-over:hover { color: #284b41; }

@media (max-width: 880px) {
  .auth-body { padding: 16px; }
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(580px, 100%);
    min-height: auto;
    border-radius: 22px;
  }
  .auth-context { padding: 30px 32px; }
  .auth-context-copy { margin: 52px 0 0; padding: 0; }
  .auth-context h1 { max-width: 430px; font-size: clamp(34px, 8vw, 48px); }
  .auth-context-intro { margin-top: 16px; }
  .auth-panel { padding: 40px 32px 46px; }
}

@media (max-width: 520px) {
  .auth-body { padding: 0; background: #fbfcfc; }
  .auth-shell {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-context { padding: 25px 24px 30px; }
  .auth-context::before { right: -260px; top: -220px; }
  .auth-wordmark { font-size: 25px; }
  .auth-context-copy { margin-top: 37px; }
  .auth-context h1 { max-width: 330px; font-size: 33px; }
  .auth-context-intro { display: none; }
  .auth-panel { place-items: start stretch; padding: 34px 24px 40px; }
  .auth-card { width: 100%; }
  .auth-card-header { margin-bottom: 26px; }
  .auth-card-header h2 { font-size: 31px; }
  .auth-card-header > p:last-child { font-size: 13px; }
  .auth-access-note { align-items: flex-start; text-align: left; }
}

@media (max-height: 680px) and (min-width: 881px) {
  .auth-shell { min-height: 620px; }
  .auth-context, .auth-panel { padding-top: 34px; padding-bottom: 34px; }
  .auth-context-copy { padding: 28px 0; }
  .auth-capabilities { gap: 14px; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-skip-link,
  .auth-field > input,
  .auth-password-control,
  .auth-password-toggle,
  .auth-form .auth-submit { transition: none; }
}

/* UX refinement: denser operational hierarchy and a true mobile layout. */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Quicksand", var(--font-ui);
  --text: #173e32;
  --text-dim: #45675c;
  --muted: #718a81;
  --border: #dfe7e3;
  --shadow: 0 8px 24px rgba(25, 61, 49, .06);
}

html { overflow-x: hidden; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand-name, .auth-brand h1 { font-family: var(--font-display); }
h1 { font-size: clamp(30px, 3vw, 38px); }
h2 { font-size: 20px; }
button, select, input { font-family: var(--font-ui); }

.app-shell { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding-inline: 13px; }
.brand { min-height: 84px; padding: 18px 10px 14px; }
.brand-icon { width: 38px; height: 38px; }
.brand-name { font-size: 21px; }
.brand-subtitle { color: #82978f; font-size: 8px; }
.site-picker { padding: 12px; }
.site-picker label { color: #758d84; font-size: 9px; }
.site-picker select { color: #244f40; font-size: 12px; }
.sidebar-nav { padding-top: 8px; }
.sidebar-nav > p { color: #879b94; font-size: 9px; }
.nav-item {
  min-height: 44px;
  color: #58776c;
  font-size: 13px;
  font-weight: 600;
}
.nav-item:hover { color: #0d674e; }
.nav-item.active {
  color: #08694f;
  background: #dff2ea;
}
.nav-icon { color: #708b81; }
.nav-item.active .nav-icon { color: #08795a; }
.user-copy strong { font-size: 12px; }
.user-copy small { font-size: 9px; }

.page-header {
  min-height: 105px;
  padding-top: 23px;
  padding-bottom: 16px;
}
.page-heading-meta { margin-bottom: 6px; }
.page-subtitle { color: #71887f; font-size: 13px; }
.header-site { color: #315f4f; font-size: 10px; }
.status-strip {
  min-height: 39px;
  color: #526f64;
  font-size: 11px;
}
.refresh-button, .auth-form button {
  min-height: 42px;
  padding-inline: 17px;
}
.page-body { gap: 16px; padding-top: 0; }

.connection-panel {
  display: grid;
  grid-template-columns: minmax(185px, .55fr) minmax(420px, 1.45fr);
  min-height: 84px;
  gap: 18px;
  padding: 13px 15px;
}
.connection-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}
.connection-heading h2 { font-size: 18px; }
.agent-cards { width: 100%; flex-wrap: nowrap; }
.agent-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 11px 15px 12px 18px;
}
.agent-title { font-size: 12px; }
.agent-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.agent-stat { display: grid; min-width: 0; gap: 2px; }
.agent-stat span {
  overflow: hidden;
  color: #82968e;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-stat strong {
  overflow: hidden;
  color: #315d4e;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-metrics { gap: 12px; }
.overview-metric {
  min-height: 124px;
  padding: 19px 18px 16px;
}
.overview-metric::after {
  position: absolute;
  inset: 0 18px auto;
  height: 3px;
  border-radius: 0 0 4px 4px;
  content: "";
  background: #b9d9ce;
  opacity: .9;
}
.overview-metric.metric-good::after { background: #3abc91; }
.overview-metric.metric-warn::after { background: #e8a747; }
.overview-metric.metric-bad::after { background: #e86673; }
.metric-decoration {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  margin: 0;
  font-size: 15px;
}
.metric-label {
  max-width: calc(100% - 42px);
  color: #6f887e;
  font-size: 10px;
  font-weight: 700;
}
.metric-value {
  margin-top: 18px;
  color: #0f4b37;
  font-size: 31px;
  line-height: .95;
}
.metric-sub { margin-top: 10px; color: #738a82; font-size: 11px; }

.summary-card { min-height: 98px; padding: 17px; }
.summary-card span { color: #70877f; font-size: 10px; font-weight: 700; }
.summary-card strong { color: #124b38; font-size: 27px; }
.overview-columns { gap: 16px; }
.data-panel { box-shadow: 0 7px 22px rgba(25, 61, 49, .055); }
.panel-heading { padding: 19px 20px 13px; }
.panel-heading h2 { font-size: 19px; }
.panel-link { font-size: 11px; font-weight: 700; }
.status-message { padding: 0 20px 12px; color: #748b83; font-size: 11px; }
.overview-alarm { min-height: 58px; padding: 12px 20px; }
.overview-alarm-title { color: #214f40; font-size: 13px; }
.overview-alarm-meta { color: #6f867e; font-size: 10px; }
.overview-alarm-age { color: #6f867e; font-size: 10px; }
.timeline-item {
  grid-template-columns: 80px 88px minmax(0, 1fr);
  min-height: 51px;
  padding: 11px 20px;
}
.timeline-time { color: #6f867e; font-size: 10px; white-space: nowrap; }
.timeline-actor { color: #285846; font-size: 11px; }
.timeline-target { color: #647d74; font-size: 11px; }

.table-wrap { border-color: #e5ebe8; }
table { font-size: 13px; }
th {
  padding: 12px 13px;
  color: #6f867e;
  font-size: 9px;
  font-weight: 700;
}
td { color: #3f6256; font-size: 12px; }
.pill { font-size: 10px; font-weight: 700; }
.eyebrow { color: #718a81; font-size: 9px; font-weight: 800; }

.auth-body {
  background:
    linear-gradient(135deg, rgba(11, 126, 94, .10), transparent 42%),
    #f3f6f4;
}
.auth-card {
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(20, 57, 44, .15);
}
.auth-brand p { color: #718a81; }
.auth-form label { color: #365f50; font-size: 12px; }

@media (max-width: 1180px) {
  .connection-panel { grid-template-columns: 1fr; }
  .agent-meta { grid-template-columns: repeat(5, minmax(100px, 1fr)); }
  .agent-card { overflow-x: auto; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(145px, .8fr) minmax(185px, 1.2fr);
    gap: 8px 12px;
    height: auto;
    padding: 10px 14px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(25, 61, 49, .04);
  }
  .brand {
    min-width: 0;
    min-height: 58px;
    padding: 4px;
  }
  .brand-icon { width: 34px; height: 34px; }
  .brand-name { font-size: 19px; }
  .site-picker {
    align-self: center;
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
  }
  .site-picker label { margin-bottom: 4px; }
  .site-picker select { min-height: 34px; padding-block: 5px; }
  .sidebar-nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 0 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: inline proximity;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav > p { display: none; }
  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 40px;
    flex: 0 0 auto;
    gap: 6px;
    margin: 0;
    padding: 5px 10px 5px 7px;
    border-radius: 10px;
    font-size: 11px;
    scroll-snap-align: start;
  }
  .nav-icon {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }
  .nav-icon svg { width: 16px; height: 16px; }
  .page-header { min-height: auto; padding: 20px 20px 14px; }
  .page-body { padding-inline: 20px; }
  .connection-panel { grid-template-columns: 1fr; }
  .agent-card { overflow: visible; }
  .agent-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-metrics { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
}

@media (max-width: 560px) {
  .sidebar {
    grid-template-columns: minmax(110px, .75fr) minmax(0, 1.25fr);
    gap: 6px 9px;
    padding: 9px 12px 7px;
  }
  .brand { gap: 8px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-name { font-size: 18px; }
  .brand-subtitle { display: none; }
  .site-picker { padding: 6px 8px; }
  .site-picker label { font-size: 8px; }
  .site-picker select { min-height: 32px; font-size: 10px; }
  .sidebar-nav { margin-inline: -2px; }
  .nav-item { min-height: 38px; font-size: 10px; }
  .page-header {
    gap: 14px;
    padding: 18px 15px 12px;
  }
  .page-heading-meta { margin-bottom: 5px; }
  .page-header h1 { font-size: 30px; }
  .page-subtitle { font-size: 12px; }
  .page-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .status-strip {
    min-width: 0;
    padding-inline: 10px;
    overflow: hidden;
    justify-content: flex-start;
    font-size: 10px;
    white-space: nowrap;
  }
  .refresh-button { min-height: 40px; padding-inline: 13px; }
  .page-body { gap: 13px; padding: 0 12px 36px; }
  .connection-panel {
    gap: 13px;
    padding: 14px;
    border-radius: 15px;
  }
  .connection-heading { gap: 10px; }
  .connection-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .agent-cards { display: block; }
  .agent-card { width: 100%; padding: 12px 13px 13px 16px; }
  .agent-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
  .agent-stat:last-child { grid-column: 1 / -1; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .overview-metric {
    min-height: 112px;
    padding: 16px 14px 13px;
    border-radius: 14px;
  }
  .metric-decoration { top: 14px; right: 14px; width: 30px; height: 30px; }
  .metric-label { font-size: 9px; }
  .metric-value { margin-top: 16px; font-size: 26px; }
  .metric-sub { margin-top: 8px; font-size: 9px; }
  .summary-grid, .summary-grid.alarm-summary, .summary-grid.topology-summary,
  .health-summary, .summary-grid.account-summary, .summary-grid.report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-heading {
    align-items: center;
    flex-direction: row;
    padding: 17px 17px 12px;
  }
  .panel-heading h2 { font-size: 18px; }
  .panel-heading .filter { margin-left: auto; }
  .panel-link { flex: 0 0 auto; }
  .status-message { padding-inline: 17px; }
  .overview-alarm { padding-inline: 17px; }
  .timeline-item {
    grid-template-columns: 62px 76px minmax(0, 1fr);
    gap: 7px;
    padding-inline: 17px;
  }
  .table-wrap { max-width: 100%; margin-inline: 5px; }
  dialog { padding: 19px; }
  .auth-card { padding: 32px 24px 28px; }
}

@media (max-width: 380px) {
  .page-actions { grid-template-columns: 1fr; }
  .overview-metrics { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
}

/* Global multi-site workspace filter. */
.brand-text-only {
  justify-content: center;
  min-height: 96px;
  padding: 24px 13px 19px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.brand-text-only > div { min-width: 0; width: 100%; }
.brand-text-only .brand-name { font-size: 25px; }
.brand-text-only .brand-subtitle {
  margin-top: 7px;
  color: #718a81;
  font-size: 8px;
}
.sidebar-nav { padding-top: 13px; }

.main,
.page-body,
.read-model-view,
.connection-panel,
.agent-cards,
.agent-card,
.overview-metrics,
.overview-metric,
.overview-columns,
.data-panel {
  min-width: 0;
  max-width: 100%;
}

.page-header {
  position: relative;
  align-items: flex-start;
  overflow: visible;
}
.page-actions {
  position: relative;
  min-width: min(360px, 42vw);
}

.scope-selector {
  position: relative;
  width: 100%;
  color: var(--text);
}
.scope-selector > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 50px;
  gap: 8px;
  padding: 8px 11px 8px 14px;
  border: 1px solid #d9e5df;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(25, 61, 49, .07);
  cursor: pointer;
  list-style: none;
}
.scope-selector > summary::-webkit-details-marker { display: none; }
.scope-selector > summary:hover { border-color: #b9d5ca; }
.scope-selector > summary:focus-visible {
  outline: 3px solid rgba(18, 167, 124, .24);
  outline-offset: 2px;
}
.scope-selector-label {
  color: #748c83;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.scope-selector > summary strong {
  overflow: hidden;
  color: #174b39;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-selector-count {
  min-width: 38px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #087657;
  background: #e2f4ed;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.scope-selector > summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #6f887f;
  stroke-width: 2;
  transition: transform .16s ease;
}
.scope-selector[open] > summary svg { transform: rotate(180deg); }

.scope-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid #dce7e2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(25, 61, 49, .18);
}
.scope-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 3px 11px;
  border-bottom: 1px solid #e8eeeb;
}
.scope-menu-heading strong,
.scope-menu-heading small { display: block; }
.scope-menu-heading strong { color: #174b39; font-size: 13px; }
.scope-menu-heading small { margin-top: 2px; color: #7b9189; font-size: 10px; }
.scope-menu-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}
.scope-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 8px 2px;
}
.scope-selection-toolbar > span {
  margin-left: auto;
  color: #718a81;
  font-size: 10px;
  font-weight: 750;
}
.scope-add-button,
.scope-all-button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #d8e5df;
  border-radius: 10px;
  color: #456b5d;
  background: #f7faf8;
  font-size: 11px;
  font-weight: 700;
}
.scope-add-button {
  border-color: #087858;
  color: #fff;
  background: #087858;
}
.scope-add-button:hover { background: #066a4d; }
.scope-all-button:hover,
.scope-all-button.active {
  border-color: #9fd0bf;
  color: #087657;
  background: #e5f5ee;
}
.scope-add-button:focus-visible,
.scope-all-button:focus-visible,
.scope-connect-button:focus-visible {
  outline: 3px solid rgba(18, 167, 124, .24);
  outline-offset: 2px;
}
.scope-options {
  display: grid;
  max-height: min(360px, 52vh);
  gap: 4px;
  padding: 8px 0;
  overflow-y: auto;
}
.scope-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}
.scope-option-row.can-manage { grid-template-columns: minmax(0, 1fr) auto; }
.scope-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  cursor: pointer;
}
.scope-option:hover { background: #f2f7f4; }
.scope-option:has(input:checked) {
  color: #174b39;
  background: #eaf5f0;
  box-shadow: inset 0 0 0 1px #b9d5ca;
}
.scope-option input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: #087858;
}
.scope-option input:focus-visible {
  outline: 3px solid rgba(18, 167, 124, .24);
  outline-offset: 2px;
}
.scope-option span,
.scope-option strong,
.scope-option small { display: block; min-width: 0; }
.scope-option strong {
  overflow: hidden;
  color: #285746;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-option small { margin-top: 2px; color: #82968e; font-size: 10px; }
.scope-option.archived { opacity: .76; }
.scope-option.archived strong { color: #5f716b; }
.scope-site-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.scope-site-settings {
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #71847d;
  background: transparent;
  text-decoration: none;
}
.scope-site-settings:hover {
  border-color: #cbd8d3;
  color: #244d3f;
  background: #f2f7f4;
}
.scope-site-settings:focus-visible {
  outline: 3px solid rgba(18, 167, 124, .24);
  outline-offset: 1px;
}
.scope-site-settings svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.scope-site-remote {
  color: #55746a;
}
.archived-sites-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  padding: 8px 9px;
  border-top: 1px solid #e8eeeb;
  color: #526b62;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.archived-sites-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #087858;
}
.archived-sites-toggle small { color: #82968e; font-size: 9.5px; }
.scope-selection-status {
  min-height: 17px;
  flex: 1 1 auto;
  margin: 0;
  color: #718a81;
  font-size: 10px;
}
.scope-menu-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 45px;
  gap: 12px;
  padding: 7px 3px 1px;
  border-top: 1px solid #e8eeeb;
}
.scope-menu-footer .scope-selection-status { grid-column: 1; }
.scope-apply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.scope-apply-actions button { min-height: 38px; }
.scope-apply-actions button:disabled,
.scope-selection-toolbar button:disabled { cursor: not-allowed; opacity: .48; }
.scope-connect-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #b9d5ca;
  border-radius: 9px;
  color: #087657;
  background: #edf7f3;
  font-size: 10px;
  font-weight: 800;
}
.scope-connect-button:hover { border-color: #8fc5b2; background: #e3f3ec; }

.agent-site {
  margin-left: auto;
  overflow: hidden;
  color: #738a82;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-cell,
.site-inline {
  color: #28715a;
  font-size: 10px;
  font-weight: 800;
}
.site-inline {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7f4ef;
}

.scope-notice {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid #d7e5df;
  border-radius: 14px;
  color: #537267;
  background: #f4f8f6;
}
.scope-notice strong { color: #174b39; font-size: 13px; }
.scope-notice span { font-size: 11px; }

.topology-site-group {
  border-top: 1px solid #e5ece8;
}
.topology-site-group:first-child { border-top: 0; }
.topology-site-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 16px;
  padding: 10px 20px;
  color: #285746;
  cursor: pointer;
}
.topology-site-group > summary span { color: #718a81; font-size: 10px; }
.topology-site-group > ul { padding: 4px 20px 18px 42px; }

.site-dialog { width: min(690px, calc(100% - 24px)); }
.site-form-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 15px;
  margin-top: 22px;
}
.site-id-field { grid-column: 1 / -1; }
.claim-code-field { margin-top: 17px; }
.claim-code-field input {
  max-width: 230px;
  color: #174b39;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-target {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  padding: 15px 17px;
  border: 1px solid #dce7e2;
  border-radius: 13px;
  background: #f6f9f7;
}
.site-target-label {
  color: #7b9189;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.site-target strong { color: #174b39; font-size: 15px; }
.site-target small { color: #718a81; font-size: 10px; }
.site-security-note {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 13px 15px;
  border-left: 3px solid #66b89d;
  border-radius: 0 11px 11px 0;
  color: #607b71;
  background: #f0f7f4;
  font-size: 10px;
}
.site-security-note strong { color: #285746; font-size: 11px; }
.form-success {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #bfe2d5;
  border-radius: 11px;
  color: #087657;
  background: #eaf7f2;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 8px 14px 7px;
  }
  .brand-text-only {
    min-height: 74px;
    padding: 12px 5px 13px;
  }
  .sidebar-nav {
    grid-column: auto;
    padding: 3px 0;
  }
  .page-header {
    align-items: center;
    padding-top: 18px;
  }
  .page-actions { min-width: min(340px, 48vw); }
}

@media (max-width: 560px) {
  .page-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .page-actions {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .scope-selector > summary { min-height: 48px; }
  .scope-menu {
    right: auto;
    left: 0;
    width: min(390px, calc(100vw - 30px));
  }
  .scope-menu-heading { align-items: flex-start; }
  .scope-menu-heading small { max-width: 190px; }
  .scope-menu-actions { flex-direction: column; }
  .scope-add-button,
  .scope-all-button { min-height: 38px; }
  .scope-menu-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
  .scope-connect-button { width: 100%; }
  .site-form-grid { grid-template-columns: 1fr; }
  .site-id-field { grid-column: auto; }
  .site-dialog input,
  .site-dialog select { font-size: 16px; }
  .claim-code-field input { max-width: none; width: 100%; }
  .overview-metrics { grid-template-columns: 1fr; }
  .agent-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topology-site-group > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-inline: 17px;
  }
}

/* Operations visual system: sober typography, industrial color, useful hierarchy. */
:root {
  color-scheme: light;
  --bg-app: #f3f5f7;
  --bg-panel: #ffffff;
  --bg-panel-2: #f6f8f9;
  --bg-elev: #edf1f3;
  --bg-input: #ffffff;
  --border: #d8e0e5;
  --border-strong: #c4cfd6;
  --text: #14232d;
  --text-dim: #3d515e;
  --muted: #687984;
  --accent: #14745d;
  --accent-bright: #14745d;
  --accent-soft: #e7f2ee;
  --accent2: #395f78;
  --accent2-soft: #e9f0f4;
  --good: #167a5a;
  --warn: #a86116;
  --bad: #b23849;
  --info: #2f688e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(21, 35, 45, .045);
  --font-ui: "Aptos", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-ui);
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, #f8fafb 0, var(--bg-app) 260px);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 700;
}

h1 {
  font-size: clamp(29px, 2.5vw, 36px);
  letter-spacing: -.035em;
}

h2 {
  font-size: 19px;
  letter-spacing: -.02em;
}

.brand-name,
.auth-brand h1 {
  font-family: "Quicksand", var(--font-ui);
}

.brand-name { color: #183128; }
.brand-name strong,
.auth-brand strong { color: var(--accent); }

.eyebrow {
  color: #71808a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}

.page-subtitle {
  color: #60727d;
  font-size: 13.5px;
}

.sidebar {
  background: rgba(248, 250, 251, .97);
  border-color: #dce3e7;
  box-shadow: 10px 0 30px rgba(21, 35, 45, .025);
}

.sidebar-nav > p {
  color: #7a8992;
  font-size: 10px;
  letter-spacing: .12em;
}

.nav-item {
  color: #4d626e;
  font-size: 13.5px;
  font-weight: 600;
}

.nav-item:hover {
  color: #183b30;
  background: #eef3f1;
}

.nav-item.active {
  color: #0e654f;
  background: #e2efea;
}

.nav-icon { color: #6d7f89; }
.nav-item.active .nav-icon { color: #126f58; }

.page-header {
  border-color: #e0e6ea;
  background: rgba(248, 250, 251, .9);
}

.page-actions {
  border-color: #d9e2e6;
  color: #526872;
  background: #f6f9f8;
}

.scope-notice strong { color: #173c31; }

.data-panel,
.summary-card,
.overview-metric {
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.data-panel { overflow: hidden; }

.panel-heading {
  border-bottom: 1px solid #edf1f3;
}

.panel-heading h2 {
  color: #1b2e39;
  font-family: var(--font-ui);
  font-size: 18px;
}

.panel-link {
  color: #176b56;
  font-size: 12px;
}

.status-message {
  color: #667985;
  font-size: 12px;
}

.overview-posture {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  align-items: center;
  min-height: 124px;
  gap: 22px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 3px solid #79909c;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color .22s ease, box-shadow .22s ease;
}

.overview-posture[data-tone="good"] { border-left-color: var(--good); }
.overview-posture[data-tone="warn"] { border-left-color: var(--warn); }
.overview-posture[data-tone="bad"] { border-left-color: var(--bad); }

.overview-posture-copy { min-width: 0; }
.overview-posture-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.overview-posture-copy .eyebrow { margin: 0; }
.overview-posture-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid #dce4e7;
  border-radius: 999px;
  color: #5c707b;
  background: #f5f7f8;
  font-size: 10px;
  font-weight: 800;
  transition: border-color .22s ease, color .22s ease, background .22s ease;
}
.overview-posture[data-tone="good"] .overview-posture-badge { border-color: #c9e2d8; color: #126a4f; background: #edf7f3; }
.overview-posture[data-tone="warn"] .overview-posture-badge { border-color: #ead6bc; color: #895012; background: #fbf5ed; }
.overview-posture[data-tone="bad"] .overview-posture-badge { border-color: #e9cbd0; color: #9d3040; background: #fbf0f2; }
.overview-posture-copy h2 {
  margin: 0;
  color: #152731;
  font-size: clamp(20px, 1.8vw, 24px);
  letter-spacing: -.03em;
}

#overviewPostureSummary {
  max-width: 720px;
  margin: 6px 0 0;
  color: #526671;
  font-size: 12.5px;
  line-height: 1.45;
}

.overview-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  border: 1px solid #e0e6e9;
  border-radius: 9px;
  background: #f7f9fa;
}

.overview-context > div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 10px 11px;
  border-left: 1px solid #e0e6e9;
}

.overview-context > div:first-child { border-left: 0; }
.overview-context dt {
  color: #74838c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.overview-context dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: #203540;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
}

#overviewSiteCount,
#overviewSourceCount,
#overviewHealthCoverage {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

#overviewLatestActivity {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.overview-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.overview-metric {
  position: relative;
  display: grid;
  min-height: 160px;
  grid-template-rows: auto auto 1fr auto auto;
  align-content: start;
  padding: 18px 19px 17px;
  overflow: hidden;
  border-top: 3px solid #81929c;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.overview-metric-action {
  width: 100%;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  color: inherit;
  background: var(--bg-panel);
  text-align: left;
  cursor: pointer;
}

.overview-metric:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(21, 35, 45, .065);
}
.overview-metric-action:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(20, 116, 93, .28);
  outline-offset: 2px;
}

.overview-metric::before,
.overview-metric::after { display: none; }
.overview-metric.metric-good { border-top-color: var(--good); }
.overview-metric.metric-warn { border-top-color: var(--warn); }
.overview-metric.metric-bad { border-top-color: var(--bad); }
.overview-metric.metric-neutral { border-top-color: #6d8490; }

.metric-status {
  justify-self: start;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid #dbe3e7;
  border-radius: 5px;
  color: #5d707b;
  background: #f5f7f8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.metric-good .metric-status {
  border-color: #c9e2d8;
  color: #126a4f;
  background: #edf7f3;
}

.metric-warn .metric-status {
  border-color: #ead6bc;
  color: #895012;
  background: #fbf5ed;
}

.metric-bad .metric-status {
  border-color: #e9cbd0;
  color: #9d3040;
  background: #fbf0f2;
}

.metric-label {
  max-width: none;
  margin-top: 15px;
  color: #657681;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .015em;
  text-transform: none;
}

.metric-value {
  align-self: end;
  margin-top: 8px;
  color: #172b36;
  font-family: var(--font-ui);
  font-size: clamp(29px, 2.4vw, 36px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
  text-transform: none;
}

.metric-sub {
  margin-top: 12px;
  color: #667985;
  font-size: 12px;
  line-height: 1.4;
}
.metric-action-label {
  align-self: end;
  margin-top: 13px;
  color: #176b56;
  font-size: 11px;
  font-weight: 800;
}
.metric-action-label::after { margin-left: 6px; content: "→"; }

.metric-value-updated {
  animation: metric-value-change .36s cubic-bezier(.2, .75, .25, 1) both;
}
.activity-row-changed {
  animation: activity-row-change .26s ease-out both;
  animation-delay: calc(var(--activity-index, 0) * 28ms);
}
.activity-row-new {
  animation-name: activity-row-new;
  animation-duration: .32s;
}
@keyframes metric-value-change {
  0% { opacity: .58; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes activity-row-change {
  0% { opacity: .72; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes activity-row-new {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.overview-columns {
  grid-template-columns: minmax(0, 1.03fr) minmax(0, .97fr);
  gap: 16px;
}

.overview-alarm,
.timeline-item {
  display: block;
  padding: 0;
  border-color: #e8edef;
}

.overview-alarm-row,
.timeline-row {
  width: 100%;
  min-width: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.overview-alarm-row {
  display: flex;
  align-items: flex-start;
  min-height: 58px;
  gap: 10px;
  padding: 12px 20px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 80px 88px minmax(0, 1fr);
  align-items: center;
  min-height: 51px;
  gap: 12px;
  padding: 11px 20px;
}

.overview-alarm-row:hover,
.timeline-row:hover { background: #f7f9fa; }
.overview-alarm-title {
  color: #253b46;
  font-size: 13px;
  font-weight: 600;
}

.overview-alarm-meta,
.overview-alarm-age,
.timeline-time,
.timeline-target { color: #667a85; }
.timeline-actor { color: #2c4652; }

.overview-alarm-row:focus-visible,
.timeline-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(20, 116, 93, .28);
  outline-offset: -3px;
  background: #f1f6f4;
}

.dispatch-flow-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #edf1f3;
  border-bottom: 1px solid #e5ebee;
  background: #fafcfc;
}

.alarm-flow-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #edf1f3;
  border-bottom: 1px solid #e5ebee;
  background: #fafcfc;
}
.alarm-flow-summary > div {
  position: relative;
  min-width: 0;
  padding: 11px 18px 12px;
  border-left: 1px solid #e5ebee;
}
.alarm-flow-summary > div:first-child { border-left: 0; }
.alarm-flow-summary > div::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 2px;
  border-radius: 99px;
  background: #a9b6bc;
  content: "";
}
.alarm-flow-summary > div[data-tone="good"]::before { background: var(--good); }
.alarm-flow-summary > div[data-tone="warn"]::before { background: var(--warn); }
.alarm-flow-summary > div[data-tone="bad"]::before { background: var(--bad); }
.alarm-flow-summary dt {
  color: #6f8089;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.alarm-flow-summary dd {
  margin: 4px 0 0;
  color: #1e3742;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dispatch-flow-summary > div {
  position: relative;
  min-width: 0;
  padding: 11px 18px 12px;
  border-left: 1px solid #e5ebee;
}

.dispatch-flow-summary > div:first-child { border-left: 0; }
.dispatch-flow-summary > div::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 2px;
  border-radius: 99px;
  background: #a9b6bc;
  content: "";
}
.dispatch-flow-summary > div[data-tone="good"]::before { background: var(--good); }
.dispatch-flow-summary > div[data-tone="warn"]::before { background: var(--warn); }
.dispatch-flow-summary > div[data-tone="bad"]::before { background: var(--bad); }
.dispatch-flow-summary dt {
  color: #6f8089;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.dispatch-flow-summary dd {
  margin: 4px 0 0;
  color: #1e3742;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dispatch-activity {
  display: block;
  padding: 0;
  border-top: 1px solid #e8edef;
  border-left: 3px solid transparent;
}
.dispatch-activity:first-child { border-top: 0; }
.dispatch-activity[data-tone="good"] { border-left-color: var(--good); }
.dispatch-activity[data-tone="warn"] { border-left-color: var(--warn); }
.dispatch-activity[data-tone="bad"] { border-left-color: var(--bad); }
.dispatch-activity[data-tone="neutral"] { border-left-color: #9aabb3; }

.dispatch-activity-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  gap: 10px;
  padding: 13px 18px 14px 17px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background .16s ease;
}
.dispatch-activity-row:hover { background: #f7f9fa; }
.dispatch-activity-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(20, 116, 93, .28);
  outline-offset: -3px;
  background: #f1f6f4;
}

.dispatch-activity-top,
.dispatch-activity-heading,
.dispatch-activity-status,
.dispatch-activity-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}
.dispatch-activity-top { justify-content: space-between; gap: 14px; }
.dispatch-activity-heading { flex-wrap: wrap; gap: 7px; }
.dispatch-reference {
  color: #203b46;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.dispatch-site {
  overflow: hidden;
  max-width: 170px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #1e6d57;
  background: #e7f3ef;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-activity-status {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
}
.dispatch-activity-time {
  color: #6b7f89;
  font-family: var(--font-mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.dispatch-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 9px;
}
.dispatch-route-node {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #e3ece8;
  border-radius: 7px;
  background: #fafcfb;
}
.dispatch-route-node small {
  color: #7a8991;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.dispatch-route-node strong {
  overflow: hidden;
  color: #294651;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-route-arrow {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #d5e4de;
  border-radius: 50%;
  color: #337260;
  background: #eff7f3;
  font-size: 12px;
  font-weight: 800;
}

.dispatch-activity-meta {
  flex-wrap: wrap;
  gap: 4px 12px;
  color: #6c7f88;
  font-size: 9.5px;
  line-height: 1.35;
}
.dispatch-activity-meta > span:not(:first-child)::before {
  margin-right: 12px;
  color: #b1bdc2;
  content: "·";
}
.dispatch-flag {
  color: #47636e;
  font-weight: 700;
}
.dispatch-flag-warn { color: #995d17; }
.dispatch-activity-empty {
  min-height: 110px;
  padding: 30px 20px;
  color: #647983;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.overview-alarm { border-left: 3px solid transparent; }
.overview-alarm[data-tone="good"] { border-left-color: var(--good); }
.overview-alarm[data-tone="warn"] { border-left-color: var(--warn); }
.overview-alarm[data-tone="bad"] { border-left-color: var(--bad); }
.overview-alarm[data-tone="neutral"] { border-left-color: #9aabb3; }
.overview-alarm-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  gap: 10px;
  padding: 13px 18px 14px 17px;
}
.alarm-activity-top,
.alarm-activity-heading,
.alarm-activity-status,
.alarm-activity-target,
.alarm-activity-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}
.alarm-activity-top { justify-content: space-between; gap: 14px; }
.alarm-activity-heading { flex-wrap: wrap; gap: 7px; }
.alarm-reference { color: #203b46; font-size: 13px; font-weight: 700; line-height: 1.25; }
.alarm-site {
  overflow: hidden;
  max-width: 170px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #1e6d57;
  background: #e7f3ef;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alarm-activity-status { flex: 0 0 auto; justify-content: flex-end; gap: 8px; }
.alarm-activity-age { color: #6b7f89; font-family: var(--font-mono); font-size: 9.5px; white-space: nowrap; }
.alarm-activity-target {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e3ece8;
  border-radius: 7px;
  background: #fafcfb;
}
.alarm-activity-target small { color: #7a8991; font-size: 8.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.alarm-activity-target strong { overflow: hidden; color: #294651; font-size: 11.5px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.alarm-activity-meta { flex-wrap: wrap; gap: 4px 12px; color: #6c7f88; font-size: 9.5px; line-height: 1.35; }
.alarm-activity-meta > span:not(:first-child)::before { margin-right: 12px; color: #b1bdc2; content: "·"; }
.alarm-activity-flag { color: #47636e; font-weight: 700; }
.alarm-activity-flag-warn { color: #995d17; }

.overview-metric-loading {
  color: #72838d;
  box-shadow: none;
}

.pill,
.class-chip {
  border-radius: 5px;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.summary-card span {
  color: #687a85;
  font-size: 11px;
}

.summary-card strong {
  color: #1a303b;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  .overview-posture {
    grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr);
    gap: 22px;
  }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .overview-posture {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .overview-context { max-width: 620px; }
}

@media (max-width: 560px) {
  .overview-posture {
    min-height: 0;
    gap: 14px;
    padding: 16px;
  }
  .overview-posture-copy h2 { font-size: 20px; }
  #overviewPostureSummary { font-size: 12px; }
  .overview-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-context > div:nth-child(3) {
    grid-column: auto;
    border-top: 1px solid #e0e6e9;
    border-left: 0;
  }
  .overview-context > div:nth-child(4) { border-top: 1px solid #e0e6e9; }
  .overview-metrics { grid-template-columns: 1fr; }
  .overview-metric { min-height: 148px; }
  .timeline-row {
    grid-template-columns: 62px 76px minmax(0, 1fr);
    gap: 7px;
    padding-inline: 17px;
  }
  .overview-alarm-row { padding-inline: 17px; }
  .alarm-flow-summary > div { padding-inline: 12px; }
  .alarm-flow-summary > div::before { right: 12px; left: 12px; }
  .alarm-flow-summary dt { font-size: 8.5px; }
  .alarm-flow-summary dd { font-size: 17px; }
  .dispatch-flow-summary > div { padding-inline: 12px; }
  .dispatch-flow-summary > div::before { right: 12px; left: 12px; }
  .dispatch-flow-summary dt { font-size: 8.5px; }
  .dispatch-flow-summary dd { font-size: 17px; }
  .dispatch-activity-row {
    min-height: 0;
    gap: 11px;
    padding: 14px 16px 15px 14px;
  }
  .dispatch-activity-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .alarm-activity-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .alarm-activity-status {
    width: 100%;
    justify-content: space-between;
  }
  .alarm-activity-target { grid-template-columns: 78px minmax(0, 1fr); }
  .alarm-activity-target .class-chip { grid-column: 2; justify-self: start; }
  .alarm-activity-target strong { overflow: visible; text-overflow: clip; white-space: normal; }
  .alarm-activity-meta { gap: 5px 9px; }
  .alarm-activity-meta > span:not(:first-child)::before { margin-right: 9px; }
  .dispatch-activity-status {
    width: 100%;
    justify-content: space-between;
  }
  .dispatch-route {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .dispatch-route-node {
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    padding: 9px 10px;
  }
  .dispatch-route-node strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .dispatch-route-arrow { display: none; }
  .dispatch-activity-meta { gap: 5px 9px; }
  .dispatch-activity-meta > span:not(:first-child)::before { margin-right: 9px; }
}

@media (max-width: 380px) {
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .dispatch-flow-summary > div { padding-inline: 9px; }
  .dispatch-flow-summary > div::before { right: 9px; left: 9px; }
  .dispatch-flow-summary dt { letter-spacing: .035em; }
  .alarm-flow-summary > div { padding-inline: 9px; }
  .alarm-flow-summary > div::before { right: 9px; left: 9px; }
  .alarm-flow-summary dt { letter-spacing: .035em; }
  .dispatch-site { max-width: 150px; }
}

/* Site lifecycle: aligned setup, progressive agent connection, safe deletion. */
.scope-footer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.scope-manage-button,
.scope-connect-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #cbd8d3;
  border-radius: 8px;
  color: #31594c;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.scope-connect-button {
  border-color: #b9d5ca;
  color: #087657;
  background: #edf7f3;
}

.scope-manage-button:hover,
.scope-manage-button:focus-visible,
.scope-connect-button:hover,
.scope-connect-button:focus-visible {
  border-color: #6fae98;
  outline: 3px solid rgba(20, 116, 93, .16);
  outline-offset: 1px;
}

.site-dialog,
.site-management-dialog {
  width: min(780px, calc(100% - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #ccd7dc;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 35, 45, .24);
}

.site-management-dialog { width: min(700px, calc(100% - 32px)); }

.site-dialog::backdrop,
.site-management-dialog::backdrop {
  background: rgba(23, 38, 34, .46);
  backdrop-filter: blur(4px);
}

.site-dialog-shell {
  display: grid;
  max-height: min(880px, calc(100dvh - 32px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 0;
}

.site-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 28px 21px;
  border-bottom: 1px solid #e7ecef;
  background: #fff;
}

.site-dialog-header > div { min-width: 0; }
.site-dialog-header .eyebrow { margin-bottom: 6px; }
.site-dialog-header h2 {
  margin: 0;
  color: #172b36;
  font-size: 24px;
  letter-spacing: -.03em;
}
.site-dialog-header .page-subtitle {
  max-width: 560px;
  margin-top: 6px;
  color: #60737e;
  font-size: 13px;
}

.dialog-close-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #d8e1e5;
  border-radius: 9px;
  color: #526872;
  background: #f7f9fa;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.dialog-close-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.dialog-close-button:hover {
  border-color: #b9c8cf;
  color: #203640;
  background: #eef2f4;
}

.dialog-close-button:focus-visible {
  outline: 3px solid rgba(20, 116, 93, .22);
  outline-offset: 2px;
}

.site-dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 28px;
  overscroll-behavior: contain;
}

.site-setup-content { display: grid; gap: 28px; }
.site-form-section { display: grid; gap: 16px; }
.site-form-section + .site-form-section {
  padding-top: 25px;
  border-top: 1px solid #e9edef;
}

.site-section-heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

.site-section-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c9dcd4;
  border-radius: 7px;
  color: #126b53;
  background: #edf6f2;
  font-size: 12px;
  font-weight: 800;
}

.site-section-heading h3,
.site-management-actions h3,
.site-danger-heading h3 {
  margin: 0;
  color: #20343f;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
}

.site-section-heading p,
.site-management-actions p,
.site-danger-heading p {
  margin: 3px 0 0;
  color: #6a7c86;
  font-size: 12px;
  line-height: 1.5;
}

.tenant-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.tenant-mode-option,
.connect-now-option,
.delete-tenant-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #dbe3e7;
  border-radius: 10px;
  color: #344c58;
  background: #fafbfb;
  cursor: pointer;
}

.tenant-mode-option:has(input:checked),
.connect-now-option:has(input:checked),
.delete-tenant-option:has(input:checked) {
  border-color: #7db7a3;
  background: #eff7f4;
  box-shadow: 0 0 0 2px rgba(20, 116, 93, .08);
}

.tenant-mode-option input,
.connect-now-option input,
.delete-tenant-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 2px 0 0;
  accent-color: #14745d;
}

.tenant-mode-option span,
.connect-now-option span,
.delete-tenant-option span { display: grid; min-width: 0; gap: 2px; }
.tenant-mode-option strong,
.connect-now-option strong,
.delete-tenant-option strong {
  color: #263e49;
  font-size: 12.5px;
}
.tenant-mode-option small,
.connect-now-option small,
.delete-tenant-option small {
  color: #71828b;
  font-size: 11px;
  line-height: 1.4;
}

.site-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.site-fields-single { max-width: 100%; }

.site-dialog .field,
.site-management-dialog .field { gap: 7px; }
.site-dialog .field-label,
.site-management-dialog .field-label {
  color: #50646f;
  font-size: 11px;
  letter-spacing: .055em;
}

.site-dialog input[type="text"],
.site-dialog select,
.site-management-dialog input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #c8d3da;
  border-radius: 9px;
  color: #1c3440;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(20, 35, 45, .02);
}

.site-dialog select { padding-right: 38px; }
.site-dialog input::placeholder,
.site-management-dialog input::placeholder { color: #9aa7ae; }
.site-dialog input:focus,
.site-dialog select:focus,
.site-management-dialog input:focus {
  border-color: #25856b;
  outline: 3px solid rgba(20, 116, 93, .14);
  box-shadow: none;
}
.site-dialog [aria-invalid="true"],
.site-management-dialog [aria-invalid="true"],
.site-dialog input:user-invalid,
.site-dialog select:user-invalid,
.site-management-dialog input:user-invalid {
  border-color: #b23849 !important;
  outline-color: rgba(178, 56, 73, .14) !important;
}

.site-dialog .field-hint,
.site-management-dialog .field-hint {
  min-height: 17px;
  color: #71828b;
  font-size: 11px;
  line-height: 1.45;
}

.site-agent-section { padding-bottom: 2px; }
.connect-now-option { max-width: 430px; }
.site-agent-fields {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr);
  align-items: center;
  gap: 20px;
  margin-top: 23px;
  padding: 18px;
  border: 1px solid #dbe6e1;
  border-radius: 11px;
  background: #f6f9f8;
}

.site-install-command {
  grid-column: 1 / -1;
  padding: 15px 16px;
  border: 1px solid #d7e4df;
  border-radius: 10px;
  background: #fbfdfc;
}
.site-install-command-heading { display: flex; gap: 10px; align-items: flex-start; }
.site-install-step {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #168062;
  font-size: 11px;
  font-weight: 800;
}
.site-install-command h4 {
  margin: 1px 0 3px;
  color: #28473d;
  font-size: 12px;
}
.site-install-command p {
  margin: 0;
  color: #657b72;
  font-size: 11px;
  line-height: 1.45;
}
.site-install-command-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.site-install-command code {
  display: block;
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #d4e0dc;
  border-radius: 8px;
  color: #174b39;
  background: #f1f6f3;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}
.copy-command-button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid #b9d6ca;
  border-radius: 8px;
  color: #1b604a;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}
.copy-command-button:hover { border-color: #168062; color: #0d6f51; background: #eef8f4; }
.copy-command-button:focus-visible { outline: 3px solid rgba(22, 128, 98, .24); outline-offset: 2px; }
.site-install-copy-status { min-height: 16px; margin-top: 7px !important; color: #276a52 !important; }

.claim-code-field { margin: 0; }
.claim-code-field input {
  max-width: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace !important;
  font-size: 18px !important;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.site-security-note {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 3px solid #72b49e;
  border-radius: 0;
  color: #60756e;
  background: transparent;
  font-size: 11px;
  line-height: 1.45;
}
.site-security-note strong { color: #2a5547; font-size: 12px; }

.site-target {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 18px;
  margin: 0;
  padding: 17px 18px;
  border-color: #d8e2e6;
  border-radius: 11px;
  background: #f7f9fa;
}
.site-target .site-target-label,
.site-target strong { grid-column: 1; }
.site-target small {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #5f737d;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
}
.site-target strong { color: #1f3944; font-size: 16px; }

.site-dialog .form-error,
.site-management-dialog .form-error {
  margin: 0 0 20px;
  padding: 11px 13px;
  border-color: #e3bbc2;
  color: #972d3c;
  background: #fcf1f3;
  font-size: 12px;
  line-height: 1.45;
}

.site-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 20px;
  padding: 16px 28px;
  border-top: 1px solid #e4eaed;
  background: #fafbfb;
}
.site-dialog-actions > p {
  max-width: 360px;
  margin: 0;
  color: #71828b;
  font-size: 11px;
  line-height: 1.45;
}
.site-dialog-actions > div { display: flex; gap: 9px; }
.site-dialog-actions button { min-height: 44px; padding-inline: 18px; }

.site-dialog button[aria-busy="true"]::after,
.site-management-dialog button[aria-busy="true"]::after {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  content: "";
  vertical-align: -2px;
  animation: site-button-spin .8s linear infinite;
}

@keyframes site-button-spin { to { transform: rotate(360deg); } }

.site-management-body { display: grid; gap: 18px; }
.site-management-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(86px, .55fr));
  border: 1px solid #dce4e8;
  border-radius: 11px;
  background: #f8fafb;
}
.site-management-summary > div { min-width: 0; padding: 15px 16px; }
.site-management-summary > div + div { border-left: 1px solid #e1e7ea; }
.site-management-summary span {
  display: block;
  color: #71828b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-management-summary strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #233b46;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-management-summary .site-summary-identity strong { font-size: 16px; }
.site-management-summary small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #687b85;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-management-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 17px;
  border: 1px solid #dce5e2;
  border-radius: 11px;
}

.site-lifecycle-action { background: #f9fbfa; }
.site-management-dialog .site-lifecycle-error {
  margin: -8px 0 0;
}

.site-disconnect-confirmation {
  display: grid;
  gap: 13px;
  margin: -8px 0 0;
  padding: 15px 17px;
  border: 1px solid #e4c5ca;
  border-radius: 11px;
  background: #fffafa;
}
.site-disconnect-confirmation > p {
  margin: 0;
  color: #6d4a51;
  font-size: 12px;
  line-height: 1.5;
}
.site-disconnect-confirmation > div {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.site-disconnect-confirmation .form-error { margin: 0; }

.site-danger-zone {
  overflow: hidden;
  border: 1px solid #e4c5ca;
  border-radius: 11px;
  background: #fffafa;
}
.site-danger-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px;
}
.site-danger-heading .eyebrow { color: #9b4350; }
.site-danger-heading h3 { color: #6e2933; }
.site-danger-heading p { max-width: 470px; color: #80636a; }

.danger-outline-button,
.danger-button-solid {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.danger-outline-button {
  border: 1px solid #d79ba4;
  color: #9b3040;
  background: #fff;
}
.danger-outline-button:hover { background: #fceff1; }
.danger-button-solid {
  border: 1px solid #a92f40;
  color: #fff;
  background: #a92f40;
}
.danger-button-solid:hover { background: #8e2635; }
.danger-button-solid:disabled { cursor: not-allowed; opacity: .48; }

.site-delete-confirmation {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 17px;
  border-top: 1px solid #ead1d5;
  background: #fff;
}
.site-delete-confirmation > p {
  margin: 0;
  color: #6d4a51;
  font-size: 12px;
  line-height: 1.5;
}
.delete-tenant-option { border-color: #ead1d5; background: #fff9fa; }
.site-delete-actions { display: flex; justify-content: flex-end; gap: 9px; }
.site-delete-actions button { min-height: 42px; }

.portal-notice {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid #a8cfc1;
  border-radius: 10px;
  color: #174c3b;
  background: #eff8f4;
  box-shadow: 0 18px 45px rgba(20, 35, 45, .16);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.portal-notice[data-tone="error"] {
  border-color: #dfb2ba;
  color: #842c39;
  background: #fcf1f3;
}

/* Topology: dense, keyboard-native hierarchy for operational investigation. */
.summary-grid.topology-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.topology-panel { overflow: hidden; }
.topology-header-meta {
  padding: 7px 10px;
  border: 1px solid #dce7e2;
  border-radius: 999px;
  color: #5b7469;
  background: #f6faf8;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.topology-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid #e5ece8;
  border-bottom: 1px solid #e5ece8;
  background: #fbfcfb;
}
.topology-search {
  display: flex;
  align-items: center;
  min-width: min(100%, 360px);
  flex: 1;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #d4e1dc;
  border-radius: 9px;
  color: #648076;
  background: #fff;
}
.topology-search:focus-within {
  border-color: #168062;
  box-shadow: 0 0 0 3px rgba(22, 128, 98, .13);
}
.topology-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.topology-search input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  color: #1d3e33;
  background: transparent;
  font-size: 13px;
}
.topology-search input::placeholder { color: #94a59e; }
.topology-toolbar-actions { display: flex; gap: 8px; }
.topology-tool-button {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d4e1dc;
  border-radius: 8px;
  color: #386657;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.topology-tool-button:hover { border-color: #a8cbbd; color: #0e6f50; background: #f0f8f4; }
.topology-tool-button:focus-visible { outline: 3px solid rgba(22, 128, 98, .24); outline-offset: 2px; }
.topology-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 20px;
  color: #71867d;
  background: #f7faf8;
  font-size: 10px;
}
.topology-legend span { display: inline-flex; align-items: center; gap: 6px; }
.topology-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #168062;
  box-shadow: 0 0 0 3px #dff2e9;
}
.topology-legend-dot-muted { background: #9ba9a3; box-shadow: 0 0 0 3px #edf0ee; }
.topology-tree {
  max-height: min(68vh, 760px);
  padding: 12px 20px 22px;
  overflow: auto;
  background: linear-gradient(180deg, #fff 0%, #fbfcfb 100%);
}
.topology-site-group {
  margin: 8px 0;
  overflow: hidden;
  border: 1px solid #dce7e2;
  border-radius: 11px;
  background: #fff;
}
.topology-site-group:first-child { border-top: 1px solid #dce7e2; }
.topology-site-group > summary,
.topology-branch > summary { list-style: none; }
.topology-site-group > summary::-webkit-details-marker,
.topology-branch > summary::-webkit-details-marker { display: none; }
.topology-site-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 14px;
  padding: 10px 15px 10px 18px;
  color: #204b3d;
  cursor: pointer;
  background: #f8fbf9;
}
.topology-site-group > summary::before {
  width: 7px;
  height: 7px;
  margin-right: 1px;
  border: 2px solid #6c9585;
  border-top: 0;
  border-left: 0;
  content: "";
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
.topology-site-group[open] > summary::before { transform: rotate(45deg); }
.topology-site-summary-copy { min-width: 0; flex: 1; }
.topology-site-summary-copy strong,
.topology-site-summary-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topology-site-summary-copy strong { font-size: 13px; }
.topology-site-summary-copy small { margin-top: 3px; color: #72877e; font-size: 10px; }
.topology-site-version {
  padding: 4px 7px;
  border: 1px solid #dce8e3;
  border-radius: 5px;
  color: #71877d;
  background: #fff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
}
.topology-level {
  position: relative;
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 9px 12px 12px 35px;
  list-style: none;
}
.topology-level::before {
  position: absolute;
  top: 0;
  bottom: 20px;
  left: 24px;
  width: 1px;
  background: #dce8e3;
  content: "";
}
.topology-level > li { position: relative; margin: 0; }
.topology-level > li::before {
  position: absolute;
  top: 22px;
  left: -11px;
  width: 10px;
  height: 1px;
  background: #dce8e3;
  content: "";
}
.topology-branch > .topology-level { padding-top: 5px; padding-bottom: 2px; }
.topology-node {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 45px;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #e0eae5;
  border-radius: 8px;
  color: #274d40;
  background: #fff;
}
.topology-branch > .topology-node { cursor: pointer; }
.topology-branch > .topology-node:hover { border-color: #b8d5c8; background: #f4faf7; }
.topology-branch > .topology-node:focus-visible { outline: 3px solid rgba(22, 128, 98, .22); outline-offset: 2px; }
.topology-node-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #168062;
  box-shadow: 0 0 0 3px #e2f3eb;
}
.topology-node-copy { min-width: 0; }
.topology-node-copy strong,
.topology-node-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topology-node-copy strong { color: #254b3e; font-size: 12px; font-weight: 800; }
.topology-node-copy small { margin-top: 3px; color: #798d84; font-size: 10px; }
.topology-node-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.topology-kind,
.topology-children,
.topology-deleted {
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.topology-kind { color: #326a57; background: #e8f4ee; }
.topology-children { color: #71847b; background: #f0f3f1; }
.topology-deleted { color: #8b6a44; background: #f8eee2; }
.topology-node.is-deleted { border-color: #e2e6e4; color: #809089; background: #fafbfa; }
.topology-node.is-deleted .topology-node-marker { background: #aab4b0; box-shadow: 0 0 0 3px #edf0ee; }
.topology-node.is-deleted .topology-node-copy strong { color: #7d8d86; text-decoration: line-through; }

/* Shared activity range for Overview, Dispatches, and Alerts. */
.time-range-filter { position: relative; flex: 0 0 auto; }
.time-range-presets {
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid #d9e5df;
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(25, 61, 49, .055);
}
.time-range-presets button {
  min-width: 48px;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  color: #667d75;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.time-range-presets button:hover { color: #126b52; background: #edf5f1; }
.time-range-presets button.active { color: #fff; background: #14785c; box-shadow: 0 4px 12px rgba(20, 120, 92, .2); }
.time-range-presets button:focus-visible { outline: 3px solid rgba(18, 167, 124, .22); outline-offset: 1px; }
.time-range-presets button:disabled { cursor: progress; }
.time-range-filter[aria-busy="true"] .time-range-presets { opacity: .68; }

.custom-time-range {
  position: absolute;
  z-index: 35;
  top: calc(100% + 9px);
  left: 0;
  width: min(430px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #dce7e2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(25, 61, 49, .18);
}
.custom-time-range-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.custom-time-range-heading strong,
.custom-time-range-heading small { display: block; }
.custom-time-range-heading strong { color: #234d3f; font-size: 13px; }
.custom-time-range-heading small { margin-top: 3px; color: #82958e; font-size: 10px; }
.custom-time-range-heading button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #e0e8e4;
  border-radius: 9px;
  color: #667d75;
  background: #f7faf8;
  font-size: 20px;
  cursor: pointer;
}
.custom-time-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 15px; }
.custom-time-range-fields label { color: #6f857d; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.custom-time-range-fields input { width: 100%; margin-top: 6px; color: #31584a; background: #fbfcfb; font-size: 11px; }
.time-range-error { margin: 10px 0 0; color: #bd3e4a; font-size: 10px; }
.custom-time-range-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.custom-time-range-actions span { overflow: hidden; color: #7b8f88; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.custom-time-range-actions button {
  min-height: 40px;
  padding: 8px 13px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #14785c;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 900px) {
  .time-range-filter,
  .time-range-presets { width: 100%; }
  .time-range-presets button { flex: 1; }
}

@media (max-width: 520px) {
  .time-range-presets button { min-width: 0; padding-inline: 7px; }
  .custom-time-range { right: 0; left: auto; }
  .custom-time-range-fields { grid-template-columns: 1fr; }
  .custom-time-range-actions { align-items: stretch; flex-direction: column; }
  .custom-time-range-actions button { width: 100%; }
  .time-range-filter + .scope-selector { margin-top: 8px; }
}

/* Dispatch detail: operational summary first, raw PTS fields second. */
.dispatch-detail-dialog {
  width: min(880px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
}
.dispatch-detail-shell {
  max-height: calc(100dvh - 32px);
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dispatch-detail-heading { align-items: flex-start; }
.dispatch-detail-heading h2 { margin: 4px 0 0; color: #183f32; font-size: 26px; letter-spacing: -.025em; }
.dispatch-detail-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.dispatch-detail-badges .pill { padding: 5px 9px; }
.dispatch-route-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #edca8d;
  border-radius: 999px;
  color: #925e0c;
  background: #fff6e7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.dispatch-route-status-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.dispatch-route-status[data-tone="neutral"] {
  border-color: #d7e2de;
  color: #526f65;
  background: #f4f8f6;
}
.dispatch-detail-close {
  flex: 0 0 auto;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}
.dispatch-detail-close:hover { border-color: #afc9bf; color: #0b7658; background: #eef7f3; transform: translateY(-1px); }
.dispatch-detail-close:focus-visible { outline: 3px solid rgba(16, 155, 115, .2); outline-offset: 2px; }

.dispatch-route-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #dfe9e5;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbfa, #f2f8f5);
}
.dispatch-route-endpoint { min-width: 0; }
.dispatch-route-endpoint > span,
.dispatch-routing-context span {
  display: block;
  margin-bottom: 7px;
  color: #738a82;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.dispatch-route-endpoint strong {
  display: block;
  overflow: hidden;
  color: #244d3f;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Carrier inventory is activity-based and intentionally excluded from uptime. */
.carrier-fleet-panel { overflow: hidden; }
.carrier-fleet-heading { align-items: center; }
.carrier-fleet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  min-width: min(100%, 390px);
  margin: 0;
  overflow: hidden;
  border: 1px solid #e1e9e5;
  border-radius: 11px;
  background: #f7faf8;
}
.carrier-fleet-summary div { min-width: 0; padding: 9px 11px; border-left: 1px solid #e1e9e5; }
.carrier-fleet-summary div:first-child { border-left: 0; }
.carrier-fleet-summary dt { color: #81938c; font-size: 8px; font-weight: 800; letter-spacing: .07em; }
.carrier-fleet-summary dd { margin-top: 3px; color: #234d3f; font-size: 16px; font-variant-numeric: tabular-nums; }
.carrier-fleet { min-height: 96px; padding: 0 20px 22px; }
.carrier-fleet-loading {
  display: grid;
  gap: 9px;
  padding: 4px 0;
}
.carrier-fleet-loading span {
  display: block;
  height: 20px;
  border-radius: 7px;
  background: #f0f4f2;
}
.carrier-fleet-loading span:nth-child(2) { width: 91%; }
.carrier-fleet-loading span:nth-child(3) { width: 76%; }
.carrier-fleet-table { margin: 0; }
.carrier-fleet-table table { min-width: 760px; font-size: 11px; }
.carrier-fleet-table tbody tr { cursor: default; }
.carrier-fleet-table time { color: #60776e; white-space: nowrap; }
.carrier-status { white-space: nowrap; }
.carrier-in_transit { color: #236993; background: #edf6fb; }
.carrier-active { color: #087858; background: #eaf7f1; }
.carrier-no_activity { color: #6f8079; background: #f0f3f2; }
.carrier-source_unavailable { color: #9a6113; background: #fff4df; }
.carrier-fleet-empty { margin: 0; padding: 14px; border-radius: 10px; background: #f7faf8; }

.site-agent-update {
  margin: 2px 0 18px;
  padding: 18px;
  border: 1px solid #dfe8e4;
  border-radius: 12px;
  background: #f8faf9;
}
.site-history-import {
  margin: 2px 0 18px;
  border: 1px solid #dfe8e4;
  border-radius: 12px;
}
.site-history-import .page-subtitle { margin: 4px 0 0; color: #687d75; font-size: 11px; line-height: 1.45; }
.site-history-import .status-message { padding: 0; }
.site-history-import .history-import-form { grid-template-columns: 1fr; }
.site-history-import .history-import-form .refresh-button { width: 100%; }
.site-agent-update-heading,
.site-agent-update-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-agent-update-heading h3 { margin: 0; color: #244d3f; font-size: 15px; }
.site-agent-update-heading p,
.site-agent-update-action p { margin: 4px 0 0; color: #687d75; font-size: 11px; line-height: 1.45; }
.site-agent-update-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 15px 0; }
.site-agent-update-facts div { padding: 10px 12px; border: 1px solid #e0e8e4; background: #fff; }
.site-agent-update-facts div:first-child { border-radius: 9px 0 0 9px; }
.site-agent-update-facts div:last-child { border-left: 0; border-radius: 0 9px 9px 0; }
.site-agent-update-facts dt { color: #84958e; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.site-agent-update-facts dd { margin: 4px 0 0; color: #2d5648; font-weight: 700; }
.site-agent-update-policy { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; border: 0; }
.site-agent-update-policy legend { margin-bottom: 8px; color: #60766e; font-size: 10px; font-weight: 800; }
.site-agent-update-policy label { display: inline-flex; width: auto; min-height: 32px; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.site-agent-update-policy input { margin: 0; accent-color: #0d8060; }
.site-agent-update-policy strong,
.site-agent-update-policy small { display: block; }
.site-agent-update-policy strong { color: #2a5144; font-size: 12px; }
.site-agent-update-policy small { display: none; }
.site-agent-update-policy-help { margin: -5px 0 0; color: #7a8d86; font-size: 10px; line-height: 1.4; }
.site-agent-update-action { padding-top: 14px; border-top: 1px solid #e1e8e5; }
.site-agent-update-action p { max-width: 540px; }

@media (max-width: 620px) {
  .site-agent-update-policy label { min-height: 44px; }
  .site-agent-update-action { align-items: stretch; flex-direction: column; }
  .site-agent-update-action button { width: 100%; }
}

/* Site scope and management use explicit, staged actions and one operational hierarchy. */
.site-management-dialog { width: min(780px, calc(100% - 32px)); }
.site-management-body { gap: 12px; }
.site-management-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dfe8e4;
  border-radius: 10px;
  background: #f8faf9;
}
.site-management-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.site-management-section-heading > div { min-width: 0; }
.site-management-section-heading .eyebrow { margin: 0 0 5px; }
.site-management-section-heading h3,
.site-agent-update-heading h4 {
  margin: 0;
  color: #244d3f;
  font-size: 16px;
  letter-spacing: -.01em;
}
.site-management-section-heading p,
.site-agent-update-heading p {
  margin: 4px 0 0;
  color: #687d75;
  font-size: 11px;
  line-height: 1.5;
}
.site-agent-connection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-block: 1px solid #e1e8e5;
}
.site-agent-connection-copy { display: flex; align-items: center; min-width: 0; gap: 11px; }
.site-agent-connection-copy strong { display: block; color: #244d3f; font-size: 13px; }
.site-agent-connection-copy p { margin: 3px 0 0; color: #6d817a; font-size: 11px; }
.site-agent-status-mark {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #879790;
  box-shadow: 0 0 0 5px rgba(135, 151, 144, .13);
}
.site-agent-panel[data-connection="online"] .site-agent-status-mark {
  background: #15825f;
  box-shadow: 0 0 0 5px rgba(21, 130, 95, .13);
}
.site-agent-panel[data-connection="offline"] .site-agent-status-mark {
  background: #d18b2f;
  box-shadow: 0 0 0 5px rgba(209, 139, 47, .13);
}
.site-agent-update {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.site-agent-update-heading h4 { font-size: 13px; }
.site-agent-update-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.site-agent-update-facts div { min-width: 0; }
.site-agent-update-facts div:first-child { border-radius: 9px 0 0 9px; }
.site-agent-update-facts div:nth-child(2) { border-left: 0; }
.site-agent-update-facts div:last-child { border-left: 0; border-radius: 0 9px 9px 0; }
.site-agent-update-facts dd {
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-agent-update-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 4px 2px;
}
.site-agent-update-progress[hidden] { display: none; }
.site-agent-update-progress span {
  position: relative;
  padding-top: 18px;
  color: #87968f;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}
.site-agent-update-progress span::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border: 2px solid #aab6b1;
  border-radius: 50%;
  background: #f8faf9;
  content: "";
}
.site-agent-update-progress span:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 50%;
  width: 100%;
  height: 1px;
  background: #cfd8d4;
  content: "";
}
.site-agent-update-progress[data-state="checking"] span:nth-child(-n+1),
.site-agent-update-progress[data-state="queued"] span:nth-child(-n+1),
.site-agent-update-progress[data-state="downloading"] span:nth-child(-n+2),
.site-agent-update-progress[data-state="installing"] span:nth-child(-n+3),
.site-agent-update-progress[data-state="restarting"] span:nth-child(-n+4),
.site-agent-update-progress[data-state="completed"] span:nth-child(-n+4) { color: #426250; }
.site-agent-update-progress[data-state="checking"] span:nth-child(-n+1)::before,
.site-agent-update-progress[data-state="queued"] span:nth-child(-n+1)::before,
.site-agent-update-progress[data-state="downloading"] span:nth-child(-n+2)::before,
.site-agent-update-progress[data-state="installing"] span:nth-child(-n+3)::before,
.site-agent-update-progress[data-state="restarting"] span:nth-child(-n+4)::before,
.site-agent-update-progress[data-state="completed"] span:nth-child(-n+4)::before {
  border-color: #78883f;
  background: #9aa45b;
}
.site-agent-update-action > div { display: flex; flex: 0 0 auto; gap: 8px; }
.site-agent-update-action .refresh-button,
.site-agent-update-action .secondary-button { min-height: 40px; white-space: nowrap; }

.site-history-import { grid-template-columns: 1fr; align-items: stretch; margin: 0; }
.history-import-heading { align-items: center; }
.history-import-title-row { margin: 0; }
.history-import-readiness { display: flex; flex-wrap: wrap; gap: 7px; }
.history-import-readiness span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #dce5e1;
  border-radius: 999px;
  color: #6c7e77;
  background: #fff;
  font-size: 9.5px;
  font-weight: 700;
}
.history-import-readiness span::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a1ada8;
  content: "";
}
.history-import-readiness span.ready::before { background: #15825f; }
.history-import-readiness span.unavailable { color: #946019; background: #fff8eb; }
.history-import-readiness span.unavailable::before { background: #d18b2f; }
.site-history-import .history-import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.site-history-import .history-import-form .refresh-button { width: auto; min-width: 130px; }
.site-history-import .history-window-options { max-width: 286px; }
.history-import-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid #e1e8e5;
  border-radius: 10px;
  background: #fff;
}
.history-import-status-card .status-message { min-height: 0; margin: 0; }
.history-import-results { min-width: 285px; }
.history-import-results:not(.has-results) { opacity: .55; }

@media (max-width: 760px) {
  .site-management-section-heading,
  .site-agent-connection-row,
  .site-agent-update-action { align-items: stretch; flex-direction: column; }
  .site-agent-update-action > div { width: 100%; }
  .site-agent-update-action button { flex: 1; }
  .site-agent-update-facts { grid-template-columns: 1fr; }
  .site-agent-update-facts div,
  .site-agent-update-facts div:first-child,
  .site-agent-update-facts div:nth-child(2),
  .site-agent-update-facts div:last-child { border: 1px solid #e0e8e4; border-radius: 8px; }
  .site-agent-update-facts div + div { margin-top: -1px; }
  .site-history-import .history-import-form,
  .history-import-status-card { grid-template-columns: 1fr; }
  .site-history-import .history-import-form .refresh-button { width: 100%; }
  .history-import-results { min-width: 0; }
}

@media (max-width: 820px) {
  .carrier-fleet-heading { align-items: stretch; flex-direction: column; }
  .carrier-fleet-summary { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .carrier-fleet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carrier-fleet-summary div:nth-child(3) { border-top: 1px solid #e1e9e5; border-left: 0; }
  .carrier-fleet-summary div:nth-child(4) { border-top: 1px solid #e1e9e5; }
}
.dispatch-route-endpoint small { display: block; margin-top: 5px; color: #91a19b; font-size: 10px; line-height: 1.35; }
.dispatch-route-endpoint.is-receiver { text-align: right; }
.dispatch-route-direction { position: relative; height: 22px; }
.dispatch-route-direction::before {
  position: absolute;
  top: 10px;
  right: 7px;
  left: 7px;
  height: 2px;
  border-radius: 999px;
  background: #90b9aa;
  content: "";
}
.dispatch-route-direction::after {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #669b87;
  border-right: 2px solid #669b87;
  transform: rotate(45deg);
  content: "";
}
.dispatch-route-direction span {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 3px solid #f5f9f7;
  border-radius: 50%;
  background: #168062;
}

.dispatch-routing-context {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding: 15px 18px;
  border-left: 3px solid #5eab90;
  border-radius: 8px 13px 13px 8px;
  background: #eef7f3;
}
.dispatch-routing-context strong { color: #245544; font-size: 13px; }
.dispatch-routing-context p { margin: 0; color: #5d786e; font-size: 11px; line-height: 1.55; }
.dispatch-routing-context.is-clearing { border-left-color: #d59b42; background: #fff7e9; }
.dispatch-routing-context.is-clearing strong { color: #8b5b13; }
.dispatch-routing-context.is-clearing p { color: #7d6744; }
.dispatch-routing-context.is-diverted:not(.is-clearing) { border-left-color: #c88a32; background: #fff9ef; }

.dispatch-detail-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.dispatch-detail-section {
  padding: 18px;
  border: 1px solid #e4ebe8;
  border-radius: 14px;
  background: #fff;
}
.dispatch-detail-section h3,
.dispatch-section-heading h3 { margin: 0; color: #284f41; font-size: 13px; }
.dispatch-fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; margin: 15px 0 0; }
.dispatch-fact-grid div { min-width: 0; }
.dispatch-fact-grid dt { color: #8a9b95; font-size: 9px; font-weight: 700; letter-spacing: .07em; }
.dispatch-fact-grid dd { overflow-wrap: anywhere; color: #31594b; font-size: 12px; line-height: 1.4; }

.dispatch-route-history { margin-top: 18px; padding: 18px; border: 1px solid #e4ebe8; border-radius: 14px; }
.dispatch-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dispatch-section-heading .eyebrow { margin-bottom: 4px; }
.dispatch-hop-count { padding: 5px 8px; border-radius: 999px; color: #527568; background: #edf5f1; font-size: 10px; font-weight: 800; }
.dispatch-hop-list { display: grid; gap: 0; margin: 17px 0 0; padding: 0; list-style: none; }
.dispatch-hop-list li {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: #34594c;
}
.dispatch-hop-list li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 28px;
  bottom: -14px;
  left: 12px;
  width: 1px;
  background: #cdded7;
  content: "";
}
.dispatch-hop-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #bcd2c9;
  border-radius: 50%;
  color: #18775a;
  background: #fff;
  font-size: 9px;
  font-weight: 900;
}
.dispatch-hop-list strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-hop-list time { color: #81938c; font-size: 10px; white-space: nowrap; }
.dispatch-hop-list .dispatch-hop-empty {
  display: block;
  min-height: 0;
  padding: 13px 14px;
  border-radius: 9px;
  color: #71877f;
  background: #f6f9f7;
  font-size: 11px;
}

.dispatch-technical { margin-top: 12px; border: 1px solid #e4ebe8; border-radius: 12px; background: #fafcfb; }
.dispatch-technical summary {
  padding: 14px 16px;
  color: #527166;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.dispatch-technical[open] summary { border-bottom: 1px solid #e4ebe8; }
.dispatch-technical .dispatch-fact-grid { margin: 0; padding: 16px; }

@media (max-width: 700px) {
  .dispatch-detail-dialog { width: min(100% - 16px, 880px); max-height: calc(100dvh - 16px); border-radius: 15px; }
  .dispatch-detail-shell { max-height: calc(100dvh - 16px); padding: 20px 17px; }
  .dispatch-route-overview { grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr); gap: 8px; padding: 16px; }
  .dispatch-route-endpoint strong { font-size: 12px; white-space: normal; }
  .dispatch-route-endpoint small { display: none; }
  .dispatch-routing-context { grid-template-columns: 1fr; gap: 7px; }
  .dispatch-detail-sections { grid-template-columns: 1fr; }
  .dispatch-hop-list li { grid-template-columns: 26px minmax(0, 1fr); }
  .dispatch-hop-list time { grid-column: 2; margin-top: -7px; padding-bottom: 7px; }
}

@media (max-width: 430px) {
  .dispatch-route-overview { grid-template-columns: 1fr; gap: 12px; }
  .dispatch-route-endpoint.is-receiver { text-align: left; }
  .dispatch-route-direction { width: 24px; height: 30px; transform: rotate(90deg); }
  .dispatch-fact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .summary-grid.topology-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topology-toolbar { align-items: stretch; flex-direction: column; padding-inline: 16px; }
  .topology-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topology-tool-button { width: 100%; }
  .topology-legend { padding-inline: 16px; }
  .topology-tree { padding-inline: 12px; }
  .topology-site-group > summary { padding-inline: 14px; }
  .topology-site-version { display: none; }
  .topology-level { padding-left: 27px; }
  .topology-level::before { left: 17px; }
  .topology-node { grid-template-columns: 8px minmax(0, 1fr); gap: 8px; }
  .topology-node-meta { grid-column: 2; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .dispatch-detail-close { transition: none; }
  .dialog-close-button { transition: none; }
  .site-dialog button[aria-busy="true"]::after,
  .site-management-dialog button[aria-busy="true"]::after { animation: none; }
  .overview-posture,
  .overview-posture-badge { transition: none; }
  .metric-value-updated,
  .activity-row-changed,
  .activity-row-new { animation: none; }
}

@media (max-width: 700px) {
  .site-dialog,
  .site-management-dialog {
    width: min(100% - 16px, 780px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .site-dialog-shell { max-height: calc(100dvh - 16px); }
  .site-dialog-header { padding: 20px 18px 17px; }
  .site-dialog-header h2 { font-size: 22px; }
  .site-dialog-body { padding: 20px 18px 24px; }
  .tenant-mode-options,
  .site-fields-grid,
  .site-agent-fields { grid-template-columns: 1fr; }
  .site-agent-fields { gap: 15px; }
  .site-install-command-row { flex-direction: column; }
  .copy-command-button { width: 100%; }
  .site-dialog-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px 18px 16px;
  }
  .site-dialog-actions > p { max-width: none; }
  .site-dialog-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .site-dialog-actions button { width: 100%; }
  .site-management-summary { grid-template-columns: repeat(3, 1fr); }
  .site-management-summary .site-summary-identity { grid-column: 1 / -1; }
  .site-management-summary > div + div { border-left: 1px solid #e1e7ea; }
  .site-management-summary .site-summary-identity + div {
    border-top: 1px solid #e1e7ea;
    border-left: 0;
  }
  .site-management-summary > div:nth-child(3),
  .site-management-summary > div:nth-child(4) { border-top: 1px solid #e1e7ea; }
  .site-management-actions,
  .site-danger-heading { align-items: stretch; flex-direction: column; }
  .site-management-actions button,
  .site-danger-heading button { width: 100%; }
  .site-disconnect-confirmation > div {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .scope-menu-footer { gap: 10px; }
  .scope-footer-actions { width: 100%; }
  .scope-footer-actions button { flex: 1; }
  .scope-apply-actions { width: 100%; }
  .scope-apply-actions button { flex: 1; }
  .tenant-mode-option { padding: 12px; }
  .site-form-section + .site-form-section { padding-top: 21px; }
  .site-target { grid-template-columns: 1fr; }
  .site-target small {
    grid-column: 1;
    grid-row: auto;
    margin-top: 4px;
  }
  .site-dialog input[type="text"],
  .site-dialog select,
  .site-management-dialog input[type="text"] { font-size: 16px; }
  .site-delete-actions { display: grid; grid-template-columns: 1fr; }
  .site-delete-actions button { width: 100%; }
  .portal-notice {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}
