/* ==========================================================================
   VIGIL · 运行态势平台 - Design System & Layout
   Calm dark industrial observability theme (1920x1080 primary + responsive)
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-canvas: #1A1F2C;
  --bg-surface: #202634;
  --bg-card: #252D3B;
  --bg-card-elevated: #303A4A;
  --bg-hover: #333E4E;
  --bg-input: #1F2633;
  --bg-terminal: #1D2430;

  --border-hairline: rgba(148, 163, 184, 0.14);
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-active: rgba(139, 190, 232, 0.45);

  --text-primary: #D9E1EA;
  --text-secondary: #BBC6D4;
  --text-muted: #A7B4C5;

  /* Strict Phase 1 spec status semantics */
  --critical: #E6A099;
  --critical-soft: rgba(244, 63, 94, 0.13);
  --critical-border: rgba(244, 63, 94, 0.34);

  --warning: #DBBC87;
  --warning-soft: rgba(245, 158, 11, 0.13);
  --warning-border: rgba(245, 158, 11, 0.34);

  --healthy: #97C6AE;
  --healthy-soft: rgba(16, 185, 129, 0.13);
  --healthy-border: rgba(16, 185, 129, 0.34);

  --offline: #AAB6C5;
  --offline-soft: rgba(148, 163, 184, 0.13);
  --offline-border: rgba(148, 163, 184, 0.3);

  --deploy: #9BC4EA;
  --deploy-soft: rgba(139, 190, 232, 0.13);
  --deploy-border: rgba(139, 190, 232, 0.40);

  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shell-pad-x: clamp(16px, 1.5vw, 28px);
  --content-max-width: 1980px;
  --section-gap: 16px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-popover: 0 18px 42px rgba(2, 6, 23, 0.72), 0 0 0 1px rgba(148, 163, 184, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.36);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--deploy);
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 60px;
  padding: 0 max(var(--shell-pad-x), calc((100% - var(--content-max-width)) / 2 + var(--shell-pad-x)));
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--deploy-soft);
  border: 1px solid var(--deploy-border);
  border-radius: 8px;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.nav-tab.active {
  background: var(--bg-card-elevated);
  border-color: var(--border-active);
  color: var(--deploy);
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid var(--critical-border);
}

.nav-badge.zero {
  background: var(--healthy-soft);
  color: var(--healthy);
  border-color: var(--healthy-border);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.scope-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-pill,
.input-control {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  transition: border-color 0.15s ease;
}

.select-pill:hover,
.input-control:hover {
  border-color: var(--border-subtle);
}

.select-pill:focus,
.input-control:focus {
  border-color: var(--deploy);
}

select.select-pill,
select.input-control,
select option,
select optgroup {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 12px;
}

.clock-pill .demo-tag {
  color: var(--text-muted);
  font-size: 11px;
  padding-right: 6px;
  border-right: 1px solid var(--border-hairline);
}

.clock-pill .demo-tag:empty {
  display: none;
}

.clock-pill .demo-tag.is-go-engine {
  color: var(--deploy);
  font-weight: 600;
}

.clock-pill .clock-time {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: rgba(148, 163, 184, 0.36);
}

.btn-primary {
  background: var(--deploy-soft);
  border-color: var(--deploy-border);
  color: var(--deploy);
}

.btn-primary:hover {
  background: var(--bg-hover);
  border-color: var(--deploy);
}

.btn-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #FCD34D;
}

.btn-danger {
  background: var(--critical-soft);
  border-color: var(--critical-border);
  color: #FDA4AF;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.65);
  color: #FFE4E6;
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(244, 63, 94, 0.32);
  color: #FDA4AF;
}

.btn-danger-ghost:hover {
  background: var(--critical-soft);
  border-color: var(--critical-border);
  color: #FFE4E6;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.btn-sm {
  padding: 4px 9px;
  font-size: 12px;
}

.btn-active-sim {
  border-color: var(--warning-border);
  background: rgba(245, 158, 11, 0.14);
  color: #FCD34D;
}

/* Global Banner (e.g., Jenkins disconnect lag notice) */
.global-banner {
  padding: 8px var(--shell-pad-x);
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid var(--warning-border);
  color: #FDE68A;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.global-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main Content Area - fluid full-width aligned with topbar, flex-filling viewport height */
.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px var(--shell-pad-x) 28px;
  max-width: var(--content-max-width);
  width: 100%;
  margin-inline: auto;
}

.main-content > .wallboard-layout,
.main-content > .view-stack {
  flex: 1;
  min-height: 0;
}

.app-shell:has(.wallboard-layout) .topbar {
  padding-inline: var(--shell-pad-x);
}

.main-content:has(> .wallboard-layout) {
  max-width: none;
}

/* NOC / Fullscreen Mode */
.noc-mode .topbar {
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  background: var(--bg-surface);
  position: relative;
}

.noc-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

.noc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.noc-scope-pill {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: 99px;
  padding: 2px 10px;
  white-space: nowrap;
}

.live-beacon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}

.live-beacon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--healthy);
  animation: liveBeaconPulse 2.2s ease-out infinite;
}

.noc-sweep-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.72) 50%, rgba(16, 185, 129, 0.7) 100%);
  transform-origin: left center;
  animation: sweepProgress 5s linear infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

.noc-mode .main-content {
  max-width: none;
  width: 100%;
  padding: 12px 20px 14px;
}

@media (min-width: 1121px) and (min-height: 700px) {
  .app-shell.noc-mode {
    height: 100dvh;
  }
  .noc-mode .wallboard-head {
    display: none;
  }
  .noc-mode .wallboard-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }
  .noc-mode .card-body {
    min-height: 0;
    overflow-y: auto;
  }
}

.wallboard-bottom.noc-split-3 {
  grid-template-columns: 1fr 1fr 1.05fr;
}

@media (min-width: 1121px) and (min-height: 740px) {
  .hosts-split {
    flex: 1;
    align-items: stretch;
  }
  .settings-layout {
    flex: 1;
    align-items: stretch;
  }
}

@media (min-width: 2100px) {
  :root {
    --shell-pad-x: clamp(20px, 1.8vw, 36px);
  }
  .kpi-grid {
    gap: 18px;
  }
  .kpi-card {
    padding: 16px 22px;
  }
  .kpi-value {
    font-size: 34px;
  }
  .kpi-value .kpi-denom {
    font-size: 24px;
  }
  .card-title {
    font-size: 15px;
  }
  .data-table th {
    padding: 10px 14px;
    font-size: 12px;
  }
  .data-table td,
  .timeline-msg,
  .anomaly-title {
    font-size: 13.5px;
  }
  .data-table td {
    padding: 12px 14px;
  }
  .micro-bar {
    width: 72px;
    height: 5px;
  }
  .hosts-split {
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 18px;
  }
  .settings-layout {
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 18px;
  }
  .noc-mode .kpi-value {
    font-size: 38px;
  }
  .noc-mode .kpi-value .kpi-denom {
    font-size: 27px;
  }
}

/* Functional Motion & Telemetry Micro-animations */
.micro-bar-fill {
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}

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

.anomaly-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(16, 185, 129, 0.75));
  transform-origin: left center;
  animation: anomalyProgress 8s linear 1;
  will-change: transform;
}

.noc-anomaly-card:hover .anomaly-progress-bar {
  animation-play-state: paused;
}

.evidence-animate {
  animation: evidenceFadeIn 0.24s ease-out;
}

.svg-live-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: svgHaloPulse 2.4s ease-out infinite;
}

.noc-animations-off *,
.noc-animations-off .noc-sweep-bar,
.noc-animations-off .live-beacon-dot,
.noc-animations-off .anomaly-progress-bar,
.noc-animations-off .svg-live-halo {
  animation: none !important;
  transition: none !important;
}

.noc-animations-off .noc-sweep-bar {
  display: none;
}

@keyframes liveBeaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes sweepProgress {
  0% {
    transform: scaleX(0);
    opacity: 0.75;
  }
  92% {
    transform: scaleX(1);
    opacity: 0.85;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes anomalyProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes evidenceFadeIn {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

@keyframes svgHaloPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.85;
  }
  75% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Settings Page Styles */
.settings-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-sidebar {
  padding: 8px;
  gap: 4px;
}

.settings-nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.settings-nav-item:hover {
  background: var(--bg-hover);
}

.settings-nav-item.active {
  background: var(--bg-card-elevated);
  border-color: var(--border-active);
}

.settings-nav-title {
  font-size: 13px;
  font-weight: 600;
}

.settings-nav-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

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

.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.toggle-switch {
  appearance: none;
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.25);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease;
  padding: 0;
}

.toggle-switch.on {
  background: rgba(56, 189, 248, 0.35);
  border-color: var(--deploy);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F1F5F9;
  transition: transform 0.16s ease;
}

.toggle-switch.on .toggle-knob {
  transform: translateX(18px);
}

.settings-inline-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.4fr 0.9fr auto;
  gap: 8px;
  align-items: center;
}

.settings-inline-add-6 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr) minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.92fr) auto;
}

.grade-checkbox-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.grade-check-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.grade-check-chip:hover {
  border-color: var(--border-active);
}

.btn-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.toggle-switch.disabled-lock {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1320px) {
  .settings-inline-add-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.asset-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

@media (max-width: 1120px) {
  .settings-layout,
  .settings-grid-2,
  .settings-inline-add,
  .settings-inline-add-6,
  .grade-checkbox-group,
  .wallboard-bottom.noc-split-3 {
    grid-template-columns: 1fr;
  }
}

/* Card Primitive */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.card-body {
  padding: 16px 18px;
  flex: 1;
  min-width: 0;
}

/* Status Badges (Color + Icon + Text) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tone-critical {
  color: var(--critical);
}
.tone-warning {
  color: var(--warning);
}
.tone-healthy {
  color: var(--healthy);
}
.tone-offline,
.tone-unknown {
  color: var(--offline);
}
.tone-deploy {
  color: var(--deploy);
}

.pill-critical {
  color: var(--critical);
  background: var(--critical-soft);
  border-color: var(--critical-border);
}
.pill-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}
.pill-healthy {
  color: var(--healthy);
  background: var(--healthy-soft);
  border-color: var(--healthy-border);
}
.pill-offline,
.pill-unknown {
  color: #CBD5E1;
  background: var(--offline-soft);
  border-color: var(--offline-border);
}
.pill-deploy {
  color: var(--deploy);
  background: var(--deploy-soft);
  border-color: var(--deploy-border);
}

/* ==========================================================================
   Page 1: Wallboard (运行态势) - tuned for 1920x1080 single-screen fit
   ========================================================================== */
.wallboard-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wallboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.wallboard-scope {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallboard-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.wallboard-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

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

.kpi-card {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
  font: inherit;
  text-align: start;
  min-width: 0;
}

.kpi-alert-high {
  --kpi-alert-color: var(--critical);
  --kpi-alert-bg: #3E3038;
}

.kpi-alert-warning {
  --kpi-alert-color: var(--warning);
  --kpi-alert-bg: #38343A;
}

.kpi-alert-high,
.kpi-alert-warning {
  border-inline-start: 2px solid var(--kpi-alert-color);
  background: linear-gradient(105deg, var(--kpi-alert-bg), var(--bg-card) 84%);
}

.kpi-alert-high:hover,
.kpi-alert-warning:hover {
  border-inline-start-color: var(--kpi-alert-color);
}

.kpi-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-elevated);
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-action-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-value {
  display: block;
  font-family: var(--font-sans);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-value .kpi-denom {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 22px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Middle Split: Hosts Left / Anomalies + Evidence Right */
.wallboard-mid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
  align-items: stretch;
}

.wallboard-mid.wallboard-calm {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.wallboard-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 7px 12px;
  flex-wrap: wrap;
  gap: 8px 16px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.wallboard-health.health-healthy {
  background: color-mix(in srgb, var(--bg-card) 88%, var(--healthy));
  border-inline-start: 2px solid var(--healthy);
}

.wallboard-health.health-warning {
  border-inline-start: 2px solid var(--warning);
}

.wallboard-health-facts,
.wallboard-health-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.wallboard-health-facts > span {
  color: var(--text-secondary);
  font-size: 13px;
}

.wallboard-health-facts > span::before {
  content: "·";
  margin-inline-end: 7px;
  color: var(--text-muted);
}

.wallboard-calm td:nth-last-child(-n+4) {
  white-space: nowrap;
}

.probe-picker-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 48dvh;
  overflow-y: auto;
}

.probe-picker-list .btn {
  justify-content: space-between;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

/* Bottom Split: Trend Chart Left / Event Timeline Right */
.wallboard-bottom {
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  gap: 14px;
  align-items: stretch;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 13px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.clickable-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.data-table tbody tr.clickable-row:hover {
  background: var(--bg-hover);
}

.data-table tbody tr.selected-row {
  background: var(--deploy-soft);
}

/* Inline Resource Micro-bar */
.metric-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.metric-val {
  min-width: 34px;
  text-align: right;
}

.micro-bar {
  width: 48px;
  height: 5px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  flex-shrink: 0;
}

.micro-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--meter-color) 52%, var(--bg-card)), var(--meter-color));
  --meter-color: var(--offline);
}

.micro-bar-fill.normal {
  --meter-color: #91AEC8;
}
.micro-bar-fill.warning {
  --meter-color: var(--warning);
}
.micro-bar-fill.critical {
  --meter-color: var(--critical);
}

/* Anomaly List & Evidence Box */
.anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.anomaly-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  border-inline-start: 2px solid var(--anomaly-edge, var(--offline-border));
  background: var(--bg-input);
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
  text-align: start;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.anomaly-item:hover {
  background: var(--bg-hover);
}

.anomaly-item.active {
  background: var(--deploy-soft);
  border-color: var(--border-active);
  border-inline-start-color: var(--anomaly-edge, var(--offline-border));
}

.anomaly-item[data-grade="P0"],
.anomaly-item[data-grade="P1"] {
  --anomaly-edge: color-mix(in srgb, var(--critical) 65%, transparent);
}

.anomaly-item[data-grade="P2"] {
  --anomaly-edge: color-mix(in srgb, var(--warning) 65%, transparent);
}

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

.anomaly-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anomaly-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.evidence-box {
  margin-top: 0;
  padding: 12px 14px;
  min-height: 128px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.anomaly-list + .evidence-box {
  margin-top: 12px;
}

@media (min-width: 1121px) and (min-height: 740px) {
  .noc-anomaly-card .anomaly-list + .evidence-box {
    margin-top: auto;
  }
  .noc-anomaly-card .anomaly-list {
    margin-bottom: 12px;
  }
}

.wb-card-foot-summary {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
}

.evidence-primary {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.evidence-clue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--deploy);
  font-size: 12.5px;
  cursor: pointer;
  width: fit-content;
}

.evidence-clue:hover {
  text-decoration: underline;
}

.evidence-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.evidence-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.evidence-actions .btn-primary {
  background: linear-gradient(100deg, #344D64, #2B3A4E);
  color: var(--text-primary);
}

.evidence-actions .btn-ghost {
  border-color: transparent;
}

.timeline-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Events Timeline */
.timeline-card-body {
  padding: 8px 10px !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden !important;
}

.timeline-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 2px;
}

.timeline-viewport.is-paged {
  flex: 0 1 auto;
  max-height: calc(var(--event-rows, 6) * 40px);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 48px 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}

button.timeline-row {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.timeline-row:hover {
  background: var(--bg-hover);
}

.timeline-viewport:focus-visible,
button.timeline-row:focus-visible {
  outline-offset: -2px;
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.timeline-msg {
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-target {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Charts & Probe Strip
   ========================================================================== */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.legend-marker-dot {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
}

.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
  user-select: none;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  background: rgba(8, 12, 20, 0.96);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  min-width: 155px;
}

.probe-strip {
  display: flex;
  align-items: center;
  gap: 3px;
}

.probe-cell {
  width: 10px;
  height: 22px;
  border-radius: 2px;
  cursor: default;
  transition: transform 0.1s ease;
}

.probe-cell:hover {
  transform: scaleY(1.16);
}

.probe-ok {
  background: rgba(16, 185, 129, 0.85);
}

.probe-fail {
  background: rgba(244, 63, 94, 0.9);
}

.probe-unknown {
  background: rgba(148, 163, 184, 0.45);
}

/* ==========================================================================
   Console Views (Hosts, Service, Alerts, Jenkins)
   ========================================================================== */
.view-stack {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
}

.card-body > .data-table,
.service-table-wrap > .data-table {
  font-variant-numeric: tabular-nums;
}

/* Hosts & Containers Master-Detail */
.hosts-split {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.service-search {
  padding: 12px 16px;
}

.service-search .input-control {
  width: 100%;
}

.service-catalog {
  max-height: max(240px, calc(100dvh - 220px));
  overflow: auto;
}

.service-host-group {
  border-top: 1px solid var(--border-hairline);
}

.service-host-group > summary {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: color-mix(in srgb, var(--bg-card-elevated) 86%, var(--deploy) 14%);
  border-left: 3px solid var(--deploy);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}

.service-host-group > summary::-webkit-details-marker {
  display: none;
}

.service-host-group > summary:hover {
  background: color-mix(in srgb, var(--bg-card-elevated) 78%, var(--deploy) 22%);
}

.service-host-group > summary::before {
  content: "▸";
  color: var(--deploy);
  font-size: 12px;
  flex: 0 0 auto;
}

.service-host-group[open] > summary::before {
  content: "▾";
}

.host-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-muted);
}

.host-group-dot.is-online {
  background: var(--healthy);
}

.host-group-dot.is-warning {
  background: var(--warning);
}

.host-group-dot.is-critical,
.host-group-dot.is-offline {
  background: var(--critical);
}

.host-group-main {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.host-group-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.host-group-main > .card-subtitle {
  display: block;
  font-weight: 400;
  margin-top: 2px;
}

.host-group-tag {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--deploy);
  background: color-mix(in srgb, var(--deploy) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--deploy) 34%, transparent);
  flex: 0 0 auto;
}

.host-group-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-surface) 80%, transparent);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.service-host-items {
  background: color-mix(in srgb, var(--bg-canvas) 55%, transparent);
  padding: 6px 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px dashed color-mix(in srgb, var(--border-subtle) 90%, transparent);
  margin-left: 11px;
}

.service-host-group .service-list-item {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
}

.service-host-group .service-list-item:hover {
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  border-color: var(--border-hairline);
}

.service-host-group .service-list-item.active {
  background: color-mix(in srgb, var(--deploy) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--deploy) 42%, transparent);
  box-shadow: inset 3px 0 0 var(--deploy);
}

.service-run-stat {
  font-weight: 500;
}

.service-run-stat.is-healthy {
  color: var(--healthy);
}

.service-run-stat.is-warning {
  color: var(--warning);
}

.service-run-stat.is-critical {
  color: var(--critical);
}

.service-run-stat.is-muted {
  color: var(--text-muted);
}

.container-name-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--deploy);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.container-name-link:hover {
  text-decoration: underline;
}

.service-container-controls {
  margin: 0 0 10px;
}

.service-container-controls > input {
  width: min(220px, 100%);
}

.service-container-spec {
  overflow-wrap: anywhere;
}

button.service-list-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
}

button.service-list-item:hover,
button.service-list-item.active {
  background: var(--deploy-soft);
}

.service-list-item.active {
  box-shadow: inset 2px 0 var(--deploy);
}

.service-list-name,
.service-list-context {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-list-item .status-pill,
.service-list-item .host-list-meta > :last-child {
  flex-shrink: 0;
}

.service-detail {
  min-width: 0;
}

.service-detail-heading,
.service-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.service-detail-heading {
  justify-content: space-between;
  overflow-wrap: anywhere;
}

.service-detail-heading .card-title {
  font: 650 20px/1.35 var(--font-sans);
}

.service-detail-actions {
  margin-top: 10px;
}

.service-detail-tabs {
  margin: 0 14px 12px;
}

.service-table-wrap {
  overflow-x: auto;
}

[data-external-datasources] > summary {
  display: list-item;
  cursor: pointer;
}

@media (max-width: 960px) {
  .service-catalog {
    max-height: 300px;
  }
}

.host-list-item {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.host-list-item:last-child {
  border-bottom: none;
}

.host-list-item:hover {
  background: var(--bg-hover);
}

.host-list-item.active {
  background: var(--deploy-soft);
  box-shadow: inset 3px 0 0 var(--deploy);
}

.host-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.host-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

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

.stat-tile {
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-tile-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-tile-val {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
}

.mount-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  margin: 6px 0 4px;
}

.mount-bar-fill {
  height: 100%;
  border-radius: 99px;
}

/* Segmented Tabs inside Cards */
.subtabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 3px;
  flex-wrap: wrap;
}

.subtab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subtab:hover {
  color: var(--text-primary);
}

.subtab.active {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Container Log Console */
.log-console {
  background: var(--bg-terminal);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  max-height: 270px;
  overflow-y: auto;
}

.log-line {
  display: grid;
  grid-template-columns: 72px 54px minmax(0, 1fr);
  gap: 10px;
  padding: 2px 4px;
  border-radius: 3px;
}

.log-line:hover {
  background: rgba(148, 163, 184, 0.06);
}

.log-ts {
  color: var(--text-muted);
}

.log-lvl-ERROR {
  color: var(--critical);
  font-weight: 600;
}
.log-lvl-WARN {
  color: var(--warning);
  font-weight: 600;
}
.log-lvl-INFO {
  color: var(--deploy);
}

.log-msg {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.chart-axis-label {
  fill: var(--text-muted);
  font: 12px var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* Service Detail Page */
.service-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.service-pill-btn {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-pill-btn:hover {
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.service-pill-btn.active {
  background: var(--bg-card-elevated);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.service-summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Info Callout */
.callout {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: rgba(56, 189, 248, 0.06);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning-border);
  color: #FDE68A;
}

.callout.critical {
  background: rgba(244, 63, 94, 0.08);
  border-color: var(--critical-border);
  color: #FECDD3;
}

/* Simulation Popover */
.sim-popover {
  position: fixed;
  top: 60px;
  right: 22px;
  width: 390px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: 60;
  overflow: hidden;
}

.sim-popover-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-popover-body {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 75vh;
  overflow-y: auto;
}

.sim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
}

.sim-row-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.sim-row-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 520px;
  max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
}

.modal-card.modal-wide {
  width: 680px;
}

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

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 76vh;
  overflow-y: auto;
}

.modal-section-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.host-alias-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #BAE6FD;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  white-space: nowrap;
}

.host-muted-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  color: #CBD5E1;
  background: var(--offline-soft);
  border: 1px solid var(--offline-border);
  white-space: nowrap;
}

.host-meta-strip {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.host-quick-cfg-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.host-quick-cfg-btn:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.14);
  border-color: var(--border-subtle);
}

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 22px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(19, 27, 43, 0.96);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--deploy);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  font-size: 12.5px;
  max-width: 360px;
  animation: toastIn 0.16s ease-out;
}

.toast.warning {
  border-left-color: var(--warning);
}
.toast.critical {
  border-left-color: var(--critical);
}
.toast.healthy {
  border-left-color: var(--healthy);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Empty States */
.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* AI Copilot Button & Slide-over Drawer + Ops Extensions */
.btn-ai {
  background: var(--deploy-soft);
  border: 1px solid var(--deploy-border);
  color: var(--deploy);
  font-weight: 500;
}

.btn-ai:hover {
  background: var(--bg-hover);
  border-color: var(--deploy);
  color: var(--text-primary);
}

.maint-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #FCD34D;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  white-space: nowrap;
}

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

.spec-grid > div {
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 0;
}

.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.ai-drawer.hidden {
  display: none;
}

.ai-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.64);
  backdrop-filter: blur(3px);
}

.ai-drawer-panel {
  position: relative;
  width: min(620px, 100vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -14px 0 40px rgba(2, 6, 23, 0.72);
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.ai-drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-card);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-spark-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--deploy);
  background: var(--deploy-soft);
  border: 1px solid var(--deploy-border);
  white-space: nowrap;
}

.ai-rca-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--deploy);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.ai-postmortem-box {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.ai-postmortem-pre {
  margin: 0;
  padding: 10px;
  background: var(--bg-terminal);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.ai-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-analysis-result p {
  margin: 8px 0 0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.ai-trace-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-trace-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.ai-trace-tool {
  color: var(--deploy);
  font-size: 11.5px;
  font-weight: 500;
}

.ai-trace-status {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ai-trace-detail {
  color: var(--text-secondary);
  min-width: 0;
  word-break: break-word;
}

.ai-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.ai-step-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ai-step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}

.ai-cmd-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: var(--bg-terminal);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.ai-cmd-box code {
  font-size: 11.5px;
  color: #E2E8F0;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
}

.ai-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.ai-msg {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  font-size: 12.5px;
  line-height: 1.55;
}

.ai-msg-user {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--deploy-border);
  align-self: flex-end;
  max-width: 90%;
}

.ai-msg-bot {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  align-self: flex-start;
  width: 100%;
}

.ai-msg-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ai-msg-body {
  color: var(--text-primary);
  word-break: break-word;
}

/* Alert Grading (P0-P3) & WeCom Concise AI Preview */
.grade-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.grade-p0 {
  color: var(--critical);
  background: #473039;
  border: 1px solid var(--critical-border);
}

.grade-p1 {
  color: var(--critical);
  background: var(--critical-soft);
  border: 1px solid var(--critical-border);
}

.grade-p2 {
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
}

.grade-p3 {
  color: #CBD5E1;
  background: var(--offline-soft);
  border: 1px solid var(--offline-border);
}

.impact-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
}

.impact-critical {
  color: #FECDD3;
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(244, 63, 94, 0.14);
}

.impact-high {
  color: #FDA4AF;
  border-color: var(--critical-border);
  background: rgba(244, 63, 94, 0.09);
}

.impact-moderate {
  color: #FDE68A;
  border-color: var(--warning-border);
  background: rgba(245, 158, 11, 0.09);
}

.impact-low {
  color: var(--text-muted);
}

.grade-rationale-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 10px;
  margin-bottom: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.btn-wecom-ai {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.42);
  color: #A7F3D0;
}

.btn-wecom-ai:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.65);
  color: #ECFDF5;
}

.wecom-notif-ai-note {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.08);
  border-left: 2px solid var(--deploy);
  font-size: 11.5px;
  color: #E0F2FE;
  line-height: 1.5;
}

.wecom-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.wecom-mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.wecom-mode-tab:hover {
  color: var(--text-primary);
}

.wecom-mode-tab.active {
  background: rgba(56, 189, 248, 0.16);
  color: #BAE6FD;
}

.wecom-chat-stage {
  margin-top: 8px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, #E8EEF5 0%, #DFE7F0 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
}

.wecom-chat-sender {
  font-size: 11px;
  color: #64748B;
  margin: 0 auto 7px;
  max-width: 500px;
  font-weight: 500;
}

.wecom-wx-card {
  background: #FFFFFF;
  color: #1F2329;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
}

.wecom-wx-card-inner {
  padding: 11px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wecom-wx-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.wecom-wx-source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.wecom-wx-source.is-red {
  color: #D93025;
}

.wecom-wx-source.is-green {
  color: #07C160;
}

.wecom-wx-source.is-muted {
  color: #6B7280;
}

.wecom-wx-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wecom-wx-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.wecom-wx-desc {
  font-size: 12px;
  color: #6B7280;
}

.wecom-wx-hero {
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #F1F5F9;
}

.wecom-wx-hero.hero-critical {
  background: #FFF5F5;
  border-color: #FEE2E2;
}

.wecom-wx-hero.hero-critical .wecom-wx-hero-val {
  color: #D93025;
}

.wecom-wx-hero.hero-warning {
  background: #FFFBEB;
  border-color: #FEF3C7;
}

.wecom-wx-hero.hero-warning .wecom-wx-hero-val {
  color: #B45309;
}

.wecom-wx-hero.hero-info {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.wecom-wx-hero.hero-info .wecom-wx-hero-val {
  color: #334155;
}

.wecom-wx-hero-val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.wecom-wx-hero-desc {
  margin-top: 3px;
  font-size: 12px;
  color: #4B5563;
}

.wecom-wx-quote {
  background: #F4F6F9;
  border-left: 3px solid #3B82F6;
  border-radius: 4px;
  padding: 8px 10px;
}

.wecom-wx-quote-title {
  font-size: 12px;
  font-weight: 600;
  color: #1D4ED8;
  margin-bottom: 4px;
}

.wecom-wx-quote-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wecom-wx-quote-line {
  font-size: 12px;
  color: #374151;
  line-height: 1.5;
  word-break: break-word;
}

.wecom-wx-quote-line.is-guard {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
}

.wecom-wx-subtitle {
  font-size: 12.5px;
  color: #374151;
  line-height: 1.5;
}

.wecom-wx-kv-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.wecom-wx-kv-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  align-items: baseline;
}

.wecom-wx-kv-k {
  color: #86909C;
}

.wecom-wx-kv-v {
  color: #1F2329;
  word-break: break-word;
}

.wecom-wx-kv-v.is-mention {
  color: #2B59C3;
  font-weight: 500;
}

.wecom-wx-footer {
  border-top: 1px solid #EEF0F4;
  padding: 9px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: #2B59C3;
  background: #FAFBFD;
}

.wecom-wx-arrow {
  font-size: 15px;
  line-height: 1;
}

.wecom-wx-md {
  background: #FFFFFF;
  color: #1F2329;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wecom-mention-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wecom-mention-lbl {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.wecom-wx-md-h {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.wecom-wx-md-sub {
  font-size: 11.5px;
  color: #86909C;
  margin-bottom: 2px;
}

.wecom-wx-md-ai-head {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 4px;
}

.wecom-wx-md .is-warning {
  color: #E6533C;
}

.wecom-wx-md .is-info {
  color: #07C160;
}

.wecom-wx-md .is-muted {
  color: #86909C;
  font-weight: 400;
}

.wecom-wx-md .is-link {
  color: #2B59C3;
}

.wecom-wx-md-mention {
  display: inline-block;
  color: #2B59C3;
  background: #EFF6FF;
  padding: 0 5px;
  border-radius: 3px;
  font-weight: 500;
}

.wecom-wx-md-ping-note {
  margin-top: 5px;
  font-size: 11px;
  color: #1D4ED8;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  border-radius: 4px;
  padding: 4px 8px;
}

.wecom-wx-md-quote {
  border-left: 3px solid #D1D5DB;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wecom-wx-md-quote.is-ai {
  border-left-color: #07C160;
}

.wecom-wx-md-foot {
  font-size: 12px;
  color: #374151;
  margin-top: 2px;
}

.wecom-json-pre {
  margin: 6px 0 0;
  padding: 10px;
  background: var(--bg-terminal);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: #CBD5E1;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
}

/* Global Custom Dark Dropdowns (SelectUI) */
.v-select-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.v-select-wrap.v-select-pill {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}

.v-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.v-select-trigger {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.v-select-trigger-pill {
  min-height: 28px;
  padding: 4px 9px;
  width: auto;
  background: var(--bg-input);
}

.v-select-trigger:hover:not(:disabled) {
  background: var(--bg-card-elevated);
  border-color: rgba(148, 163, 184, 0.42);
}

.v-select-trigger:focus-visible,
.v-select-trigger.open {
  border-color: var(--deploy);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
  background: var(--bg-card-elevated);
}

.v-select-trigger.disabled,
.v-select-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.v-select-caret {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.16s ease, color 0.16s ease;
}

.v-select-trigger.open .v-select-caret {
  transform: rotate(180deg);
  color: var(--deploy);
}

.v-select-portal {
  position: fixed;
  z-index: 120;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.84), 0 0 0 1px rgba(15, 23, 42, 0.9);
  padding: 5px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v-select-portal.hidden {
  display: none !important;
}

.v-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.v-select-option:hover:not(:disabled),
.v-select-option.focused:not(:disabled) {
  background: var(--bg-hover);
  color: #F8FAFC;
}

.v-select-option.selected {
  background: rgba(56, 189, 248, 0.15);
  color: #BAE6FD;
  font-weight: 600;
}

.v-select-option:disabled,
.v-select-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.v-select-opt-text {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

.v-select-opt-check {
  color: var(--deploy);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* User & RBAC Role Badges */
.user-avatar-chip {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #BAE6FD;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(99, 102, 241, 0.24));
  border: 1px solid rgba(56, 189, 248, 0.42);
  flex-shrink: 0;
}

.role-pill-admin {
  color: #BAE6FD;
  background: var(--deploy-soft);
  border-color: var(--deploy-border);
}

.role-pill-sre {
  color: #A7F3D0;
  background: var(--healthy-soft);
  border-color: var(--healthy-border);
}

.role-pill-viewer {
  color: #CBD5E1;
  background: var(--offline-soft);
  border-color: var(--offline-border);
}

/* Responsive adjustments */
@media (max-width: 1360px) {
  .topbar {
    padding: 0 14px;
  }
  .brand-sub,
  .clock-pill .demo-tag:not(.is-go-engine) {
    display: none;
  }
  .main-content {
    padding: 14px;
  }
  .hosts-split {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .service-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1440px) {
  .topbar {
    height: auto;
    padding: 8px 14px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .topbar-left {
    flex: 1 1 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-block: 3px;
  }
  .topbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .topbar { position: relative; }

  .noc-mode .topbar {
    height: auto;
    padding: 8px 14px;
  }

  .wallboard-head,
  .wallboard-meta {
    flex-wrap: wrap;
  }

  .wallboard-bottom.noc-split-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-body:has(> .data-table) {
    overflow-x: auto;
  }

  .data-table th,
  .data-table td {
    padding-inline: 8px;
  }

  .log-line {
    grid-template-columns: 64px 44px minmax(0, 1fr);
    gap: 6px;
  }
}

@media (min-width: 1121px) and (min-height: 700px) {
  .app-shell:not(.noc-mode):has(.wallboard-layout) {
    min-height: 100dvh;
  }

  .app-shell:not(.noc-mode) .main-content:has(.wallboard-layout) {
    padding: clamp(16px, 1.8vh, 24px) var(--shell-pad-x) clamp(18px, 2vh, 26px);
  }

  .app-shell:not(.noc-mode) .wallboard-layout {
    display: grid;
    grid-template-rows: auto auto auto minmax(260px, 1fr);
    gap: clamp(12px, 1.4vh, 18px);
  }

  .app-shell:not(.noc-mode) .wallboard-layout.wallboard-compact {
    grid-template-rows: auto auto auto minmax(260px, 1fr);
  }

  .wallboard-mid,
  .wallboard-bottom {
    min-height: 0;
    gap: clamp(14px, 1.2vw, 20px);
    align-items: stretch;
  }

  .wallboard-layout .kpi-grid {
    gap: clamp(14px, 1.2vw, 18px);
  }

  .wallboard-layout .kpi-card {
    padding: clamp(13px, 1.35vh, 18px) clamp(16px, 1.2vw, 22px);
  }

  .wallboard-layout .card-header {
    padding: 12px 16px;
  }

  .wallboard-mid > .card,
  .wallboard-bottom > .card {
    min-height: 0;
    height: 100%;
  }

  .wallboard-mid .card-body,
  .wallboard-hosts-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding: 10px 16px 12px;
    overflow: auto;
  }

  .wallboard-mid .data-table th {
    padding: 9px 14px;
  }

  .wallboard-mid .data-table td {
    padding: 12px 14px;
  }

  .wallboard-health {
    padding: 10px 16px;
    min-height: 46px;
  }

  .wallboard-layout .chart-card-body,
  .wallboard-layout .chart-host-flex {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .wallboard-layout .chart-card-body {
    padding: 12px 16px 14px;
  }

  .wallboard-layout .chart-host-flex,
  .wallboard-layout .chart-wrap {
    flex: 1;
  }

  .wallboard-layout .chart-wrap {
    min-height: 185px;
    position: relative;
  }

  .wallboard-layout .chart-svg {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .wallboard-layout .timeline-card-body {
    flex: 1;
    min-height: 0;
    padding: 10px 14px 12px !important;
    display: flex;
    flex-direction: column;
  }

  .wallboard-layout .timeline-viewport,
  .wallboard-layout .timeline-viewport.is-paged {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .wallboard-layout .timeline-list {
    gap: 5px;
  }

  .wallboard-layout .timeline-row {
    min-height: 38px;
    padding: 8px 10px;
    line-height: 1.45;
  }

  .wallboard-layout .timeline-msg {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .noc-mode .wallboard-layout.wallboard-compact {
    grid-template-rows: auto auto minmax(260px, 1fr);
  }
}

@media (min-width: 1121px) and (min-height: 700px) and (max-height: 820px) {
  .app-shell:not(.noc-mode) .main-content:has(.wallboard-layout) {
    padding-block: 10px 12px;
  }

  .app-shell:not(.noc-mode) .wallboard-layout {
    gap: 10px;
    grid-template-rows: auto auto auto minmax(215px, 1fr);
  }

  .app-shell:not(.noc-mode) .wallboard-layout.wallboard-compact {
    grid-template-rows: auto auto auto minmax(215px, 1fr);
  }

  .wallboard-layout .kpi-card {
    padding: 10px 14px;
  }

  .wallboard-layout .card-header {
    padding: 9px 14px;
  }

  .wallboard-mid .data-table th,
  .wallboard-mid .data-table td {
    padding: 6px 10px;
  }

  .wallboard-layout .timeline-row {
    min-height: 30px;
    padding: 5px 8px;
  }

  .wallboard-layout .chart-wrap {
    min-height: 150px;
  }
}

/* Per-host operational insight cards inside expanded calm wallboard */
.wb-host-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.wb-host-insight-card {
  appearance: none;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.wb-host-insight-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-elevated);
}

.wb-host-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wb-host-insight-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.wb-host-insight-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.wb-host-insight-mounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px 14px;
}

.wb-mount-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wb-mount-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.wb-mount-mini .mount-bar {
  margin: 0;
  height: 5px;
}

.wb-host-insight-ctrs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.wb-ctr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-ctr-chip.is-stopped {
  color: #FCD34D;
  background: var(--warning-soft);
  border-color: var(--warning-border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1120px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wallboard-mid,
  .wallboard-bottom,
  .hosts-split,
  .two-col-grid,
  .detail-grid-3,
  .spec-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wallboard-layout .chart-wrap {
    min-height: 220px;
  }
  .unified-anomaly-item {
    flex-wrap: wrap;
  }
  .unified-anomaly-main {
    flex-wrap: wrap;
    width: 100%;
  }
  .unified-anomaly-ev {
    flex-basis: 100%;
    white-space: normal;
  }
  .timeline-header-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* Host, service, alert and Jenkins workspaces */
.main-content:has(> .workspace-page) {
  max-width: none;
}

.app-shell:has(.workspace-page) .topbar {
  padding-inline: var(--shell-pad-x);
}

.workspace-page {
  --workspace-gap: clamp(18px, 1.35vw, 28px);
  gap: var(--workspace-gap);
}

.workspace-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding-block: 8px 4px;
}

.workspace-page-head h1 {
  margin: 0;
  font-size: clamp(25px, 1.6vw, 32px);
  line-height: 1.25;
  font-weight: 650;
}

.workspace-page-head p {
  margin: 5px 0 0;
  color: var(--text-secondary);
}

.workspace-page .hosts-split {
  align-items: start;
  gap: var(--workspace-gap);
  grid-template-columns: clamp(270px, 22vw, 380px) minmax(0, 1fr);
}

.workspace-page .hosts-split > .view-stack {
  gap: var(--workspace-gap);
  min-width: 0;
}

.workspace-page .card-header,
.workspace-page .card-body {
  padding: clamp(14px, 1.05vw, 23px) clamp(14px, 1.2vw, 26px);
}

.workspace-page .card-title {
  font-size: 16px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.workspace-page .card-subtitle,
.workspace-page .stat-tile-label,
.workspace-page .host-list-meta {
  font-size: 13px;
}

.workspace-count {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.workspace-sidebar-controls {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.workspace-sidebar-controls .input-control {
  width: 100%;
}

.workspace-host-list,
.workspace-sidebar .service-catalog {
  max-height: min(55dvh, 620px);
  overflow: auto;
}

.services-page .service-split {
  grid-template-columns: clamp(300px, 24vw, 400px) minmax(0, 1fr);
}

.services-page .service-sidebar {
  position: sticky;
  top: 14px;
  max-height: calc(100dvh - 108px);
  display: flex;
  flex-direction: column;
}

.services-page .service-sidebar .service-catalog {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.workspace-sidebar .host-list-item,
.workspace-sidebar .service-host-group > summary {
  padding-block: 11px;
}

.host-list-select {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 600 14px var(--font-sans);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.workspace-identity {
  background: linear-gradient(120deg, var(--bg-card-elevated), var(--bg-card) 65%);
}

.workspace-entity-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 5px;
  font-size: clamp(20px, 1.45vw, 26px);
  line-height: 1.35;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.workspace-actions,
.jenkins-connection,
.host-identity-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.host-identity-controls {
  align-items: flex-start;
  flex-direction: column;
}

.host-heartbeat,
.jenkins-connection {
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.workspace-page .detail-grid-3,
.workspace-page .service-detail-actions {
  gap: 12px;
}

.workspace-page .stat-tile {
  padding: 15px 17px;
}

.workspace-page .data-table th {
  background: var(--bg-input);
  font-size: 12px;
}

.workspace-page .data-table td {
  font-size: 14px;
  padding-block: 12px;
}

.workspace-table,
.workspace-page .card-body:has(> .data-table) {
  overflow-x: auto;
}

.workspace-table:focus-visible {
  outline-offset: -3px;
}

.workspace-page .workspace-empty {
  padding: 30px 12px;
}

.workspace-identity .service-detail-tabs {
  display: flex;
  align-self: flex-start;
  margin: 0 clamp(14px, 1.2vw, 26px) 16px;
}

.service-log-card .log-console {
  max-height: min(42dvh, 430px);
  padding: 14px;
}

.service-log-card .log-line {
  padding-block: 4px;
}

.workspace-tabs,
.alert-filters {
  padding: 12px clamp(14px, 1.2vw, 26px);
}

.workspace-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  align-items: center;
}

.workspace-tabs .subtab {
  flex-shrink: 0;
  padding: 8px 11px;
}

.workspace-tabs .subtab.active {
  color: var(--deploy);
  box-shadow: inset 0 -2px var(--deploy);
}

.alert-filters {
  justify-content: space-between;
  border-top: 1px solid var(--border-hairline);
}

.alert-filters input {
  width: min(280px, 100%);
}

.alert-detail-card[data-grade="P0"],
.alert-detail-card[data-grade="P1"] {
  border-inline-start: 2px solid var(--critical);
}

.alert-detail-card[data-grade="P2"] {
  border-inline-start: 2px solid var(--warning);
}

.jenkins-connection {
  margin-top: 8px;
  gap: 6px 16px;
}

.jenkins-page .jenkins-job {
  min-width: 160px;
  max-width: 360px;
}

@media (max-width: 1100px) {
  .workspace-page .hosts-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .services-page .service-sidebar {
    position: static;
    max-height: none;
  }

  .workspace-host-list,
  .workspace-sidebar .service-catalog,
  .services-page .service-sidebar .service-catalog {
    max-height: 320px;
  }
}

.probe-auto-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--healthy);
  background: color-mix(in srgb, var(--healthy) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--healthy) 28%, transparent);
  border-radius: 6px;
  padding: 5px 9px;
  margin-bottom: 8px;
}

.probe-endpoint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.probe-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.probe-chip:hover {
  border-color: var(--deploy);
  color: var(--text-primary);
}

.probe-chip.active {
  border-color: var(--deploy);
  color: var(--deploy);
  background: color-mix(in srgb, var(--deploy) 12%, transparent);
}

.probe-test-result {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  margin-top: 8px;
}

.probe-test-result.ok {
  border-color: color-mix(in srgb, var(--healthy) 45%, transparent);
  background: color-mix(in srgb, var(--healthy) 10%, transparent);
  color: var(--healthy);
}

.probe-test-result.fail {
  border-color: color-mix(in srgb, var(--critical) 45%, transparent);
  background: color-mix(in srgb, var(--critical) 10%, transparent);
  color: var(--critical);
}

/* Unified Top Anomaly Bar & Timeline Focus */
.unified-anomaly-bar {
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--warning) 42%, transparent);
  border-left: 4px solid var(--warning);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unified-anomaly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.unified-anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unified-anomaly-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 6px 10px;
}

.unified-anomaly-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
}

.unified-anomaly-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.unified-anomaly-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.unified-anomaly-ev {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-anomaly-clock {
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.unified-anomaly-ops {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.timeline-row.is-focused {
  background: color-mix(in srgb, var(--deploy) 14%, var(--bg-surface));
  border-left: 3px solid var(--deploy);
}

/* Anomaly Triage Workbench Slide-Over Drawer */
.triage-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(680px, 95vw);
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.45);
  z-index: 1250;
  display: flex;
  flex-direction: column;
}

.triage-drawer.hidden {
  display: none;
}

.triage-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-card-elevated);
}

.triage-drawer-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.triage-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.triage-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.triage-kpi-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.triage-kpi-item strong {
  font-size: 15px;
  color: var(--text-primary);
}

.triage-mounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.triage-mount-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 4px 8px;
}

.triage-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.triage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.triage-section-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.triage-build-card {
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 8px 10px;
}

.triage-build-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.triage-log-box {
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-terminal);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 8px;
  font-size: 11.5px;
  line-height: 1.45;
}

.triage-log-line {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 2px 4px;
  border-radius: 4px;
}

.triage-log-line.is-error {
  background: var(--critical-soft);
  color: var(--critical);
}

.triage-log-line.is-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.triage-log-ts {
  color: var(--text-muted);
}

.triage-log-lv {
  font-weight: 600;
}

.triage-log-msg {
  overflow-wrap: anywhere;
}

.triage-ai-card {
  background: color-mix(in srgb, var(--deploy) 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--deploy) 38%, transparent);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.triage-ai-card.is-error {
  border-color: var(--critical-border);
  color: var(--critical);
}

.triage-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.triage-ai-block {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-primary);
}

.triage-ai-lbl {
  font-weight: 600;
  color: var(--deploy);
}

.triage-ai-follow {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.triage-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-card-elevated);
}
