/* ─────────────────────────────────────────────────────────────
   CPL Infrastructure Dashboard — CyberDefend Ops Theme
   Engineer + Manager perspective: clarity, depth, signal
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:       #04080f;
  --bg2:      #070d1a;
  --panel:    rgba(7,13,28,0.88);
  --panel-bd: rgba(55,120,200,0.16);
  --blue:     #3b7ef8;
  --blue-l:   #6fa3fb;
  --cyan:     #22d3ee;
  --green:    #22c55e;
  --amber:    #f59e0b;
  --orange:   #f97316;
  --red:      #ef4444;
  --purple:   #a78bfa;
  --text:     #e2e8f0;
  --text-2:   #8699b5;
  --text-3:   #4a6187;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'Inter', sans-serif;
  --nav-h:    48px;
  --wave-h:   64px;
  --lp-w:     256px;
  --dp-w:     368px;
}

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

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   CANVAS LAYERS
   ═══════════════════════════════════════════════════════════ */
canvas { position: fixed; inset: 0; pointer-events: none; }
#bg-canvas   { z-index: 0; }
#conn-canvas { z-index: 1; }
#wave-canvas {
  z-index: 2; top: auto; bottom: 0;
  height: var(--wave-h);
  background: rgba(4,8,15,0.78);
  border-top: 1px solid rgba(55,120,200,0.12);
}

/* ═══════════════════════════════════════════════════════════
   SERVICE NODES (topology)
   ═══════════════════════════════════════════════════════════ */
#nodes-layer { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

/* Pulse animations */
@keyframes pulse-warn {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.55); }
  60%      { box-shadow: 0 0 0 10px rgba(245,158,11,0); }
}
@keyframes pulse-issue {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  60%      { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}
@keyframes pulse-ok {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.25); }
  60%      { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

.svc-node {
  position: absolute; pointer-events: auto; cursor: pointer;
  width: 60px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(7,13,28,0.82);
  border: 1.5px solid rgba(55,120,200,0.22);
  backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  user-select: none;
}
.svc-node:hover {
  border-color: var(--svc-color, var(--blue));
  box-shadow: 0 0 18px -3px var(--svc-color, var(--blue)), 0 0 50px -12px var(--svc-color, var(--blue));
  transform: scale(1.10); z-index: 10;
}
.svc-node.selected {
  border-color: var(--svc-color, var(--blue));
  box-shadow: 0 0 24px -3px var(--svc-color, var(--blue)), 0 0 70px -12px var(--svc-color, var(--blue));
  transform: scale(1.14); z-index: 11;
}
.svc-node.healthy  { border-color: rgba(34,197,94,0.32); animation: pulse-ok 4s ease-out infinite; }
.svc-node.degraded { border-color: rgba(245,158,11,0.45); animation: pulse-warn 2s ease-out infinite; }
.svc-node.unknown  { border-color: rgba(74,97,135,0.30); }
.svc-node.has-issue { border-color: rgba(245,158,11,0.55); animation: pulse-warn 1.6s ease-out infinite; }
.svc-node.has-issue.selected { animation: none; }
.svc-node.selected { animation: none; }

.sn-glow {
  position: absolute; inset: -5px; border-radius: 14px;
  background: radial-gradient(circle, var(--svc-color,var(--blue)) 0%, transparent 70%);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.svc-node:hover .sn-glow, .svc-node.selected .sn-glow { opacity: 0.10; }

.sn-body { display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 1; }
.sn-icon  { font-size: 17px; line-height: 1; color: var(--svc-color, var(--blue)); }
.sn-label {
  /* Always visible — labels shown by default */
  display: block;
  font-size: 7px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-2); text-align: center;
  max-width: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0.70; transition: opacity .2s, font-size .2s;
}
.svc-node:hover .sn-label  { opacity: 1; font-size: 7.5px; }
.svc-node.selected .sn-label { opacity: 1; font-size: 7.5px; color: var(--text); }

.sn-tools {
  position: absolute; top: -7px; right: -7px;
  background: var(--bg2); border: 1px solid rgba(55,120,200,0.28);
  border-radius: 10px; padding: 1px 5px;
  font: 600 8px var(--mono); color: var(--text-2); line-height: 1.4;
  pointer-events: none;
}

/* Issue ring indicator */
.sn-issue-ring { display: none; }
.svc-node.has-issue .sn-issue-ring {
  display: block; position: absolute; bottom: -4px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

/* Tooltip */
.node-tip {
  position: fixed; z-index: 50; pointer-events: none;
  background: rgba(7,13,28,0.94); border: 1px solid rgba(55,120,200,0.30);
  backdrop-filter: blur(14px);
  padding: 7px 12px; border-radius: 7px;
  font-size: 12px; white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
.node-tip.show { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(4,8,15,0.92); border-bottom: 1px solid rgba(55,120,200,0.13);
  backdrop-filter: blur(16px); gap: 16px;
}
.nav-l, .nav-r { display: flex; align-items: center; gap: 12px; }

.brand {
  font-size: 13px; font-weight: 700; letter-spacing: .12em; color: #fff;
  user-select: none; display: flex; align-items: center; gap: 6px;
}
.brand-hex { color: var(--blue); font-size: 16px; }
.brand-sub { color: var(--text-2); font-weight: 500; font-size: 10.5px; letter-spacing: .15em; }

.nav-tabs { display: flex; gap: 2px; }
.tab {
  position: relative; background: none; border: none; color: var(--text-2);
  font: 500 11px var(--sans); letter-spacing: .08em;
  padding: 4px 12px; border-radius: 4px; cursor: pointer;
  transition: color .15s, background .15s;
}
.tab:hover  { color: var(--text); background: rgba(55,120,200,0.1); }
.tab.active { color: var(--cyan); border-bottom: 2px solid var(--cyan); }

.alerts-badge {
  position: absolute; top: 1px; right: 3px;
  background: var(--red); color: #fff;
  font: 700 8px var(--sans); border-radius: 8px;
  padding: 0 4px; min-width: 14px; text-align: center; line-height: 14px;
}

.status-pills { display: flex; gap: 5px; align-items: center; }
.pill {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 20px;
  border: 1px solid rgba(55,120,200,0.18);
  background: rgba(7,13,28,0.7); color: var(--text-2);
}
.pill.online  { color: var(--green); border-color: rgba(34,197,94,0.28); }
.pill.offline { color: var(--red);   border-color: rgba(239,68,68,0.28); }
.pill-dot  { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-tc   { opacity: .55; font-size: 10px; }

.clock { font: 500 12px var(--mono); color: var(--text-2); letter-spacing: .08em; }

.ring-wrap { width: 22px; height: 22px; cursor: default; opacity: .7; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rt { fill: none; stroke: rgba(55,120,200,0.15); stroke-width: 2; }
.rf { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }

.icon-btn {
  background: none; border: none; color: var(--text-2); font-size: 14px;
  cursor: pointer; padding: 4px 6px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: rgba(55,120,200,0.12); }

/* ═══════════════════════════════════════════════════════════
   LEFT PANEL
   ═══════════════════════════════════════════════════════════ */
.left-panel {
  position: fixed; top: var(--nav-h); bottom: var(--wave-h); left: 0;
  width: var(--lp-w); z-index: 10;
  background: var(--panel); border-right: 1px solid var(--panel-bd);
  backdrop-filter: blur(18px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tab-pane {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
}
.tab-pane::-webkit-scrollbar { width: 3px; }
.tab-pane::-webkit-scrollbar-thumb { background: rgba(55,120,200,0.2); border-radius: 4px; }
.tab-pane.hidden { display: none; }

.lp-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--text-3); padding: 10px 14px 6px; flex-shrink: 0;
}

/* ── KPI strip ── */
.kpi-strip {
  display: flex; align-items: stretch;
  background: rgba(4,8,24,0.65);
  border-bottom: 1px solid rgba(55,120,200,0.14);
  flex-shrink: 0;
}
.kpi-box {
  flex: 1; text-align: center; padding: 10px 4px 8px;
  display: flex; flex-direction: column; gap: 1px;
}
.kpi-val   { font: 700 18px var(--mono); letter-spacing: .02em; line-height: 1; }
.kpi-label { font-size: 8.5px; font-weight: 700; letter-spacing: .16em; color: var(--text-3); }
.kpi-sub   { font-size: 9px; color: var(--text-3); }
.kpi-divider { width: 1px; background: rgba(55,120,200,0.12); margin: 8px 0; }

/* ── Service cards ── */
.service-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 8px; }

.svc-card {
  padding: 7px 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
  background: rgba(55,120,200,0.04);
  transition: background .15s, border-color .15s;
}
.svc-card:hover   { background: rgba(55,120,200,0.10); border-color: rgba(55,120,200,0.2); }
.svc-card.active  { background: rgba(55,120,200,0.14); border-color: rgba(55,120,200,0.32); }
.svc-card.has-issue { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.04); }
.svc-card.has-issue:hover { border-color: rgba(245,158,11,0.45); }

.sc-head  { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.sc-icon  { font-size: 13px; flex-shrink: 0; }
.sc-name  { font-size: 11.5px; font-weight: 500; flex: 1; color: var(--text); }
.sc-dot   { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sc-issue-badge {
  background: rgba(245,158,11,0.2); color: var(--amber);
  border: 1px solid rgba(245,158,11,0.4);
  font: 700 9px var(--mono); border-radius: 8px;
  padding: 1px 5px; flex-shrink: 0;
}
.sc-bar-track { height: 2px; border-radius: 2px; background: rgba(55,120,200,0.10); margin-bottom: 4px; overflow: hidden; }
.sc-bar-fill  { height: 100%; border-radius: 2px; transition: width .4s ease; }
.sc-meta { font-size: 10px; color: var(--text-3); }
.sc-ts   { opacity: .7; }

/* ── Issues list ── */
.issues-list { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 8px; }

.issue-empty {
  font-size: 11.5px; color: var(--text-2);
  padding: 20px 8px; text-align: center; line-height: 1.6;
}

.issue-item {
  display: flex; gap: 8px; padding: 8px 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.issue-item:hover { background: rgba(55,120,200,0.08); border-color: rgba(55,120,200,0.2); }

.sev-critical { border-left: 3px solid var(--red)   !important; background: rgba(239,68,68,0.05); }
.sev-warning  { border-left: 3px solid var(--amber)  !important; background: rgba(245,158,11,0.05); }
.sev-info     { border-left: 3px solid var(--blue)   !important; background: rgba(59,126,248,0.04); }

.issue-sev-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px;
  color: var(--amber);
  .sev-critical & { color: var(--red); }
  .sev-info & { color: var(--blue); }
}
.sev-critical .issue-sev-icon { color: var(--red); }
.sev-info     .issue-sev-icon { color: var(--blue-l); }

.issue-body   { flex: 1; min-width: 0; }
.issue-title  { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; font-size: 11.5px; }
.issue-sev-tag {
  font: 700 8px var(--mono); letter-spacing: .1em;
  padding: 1px 5px; border-radius: 4px; flex-shrink: 0;
}
.sev-critical .issue-sev-tag { color: var(--red);   background: rgba(239,68,68,0.15); }
.sev-warning  .issue-sev-tag { color: var(--amber); background: rgba(245,158,11,0.15); }
.sev-info     .issue-sev-tag { color: var(--blue-l); background: rgba(59,126,248,0.12); }
.issue-msg    { font-size: 10.5px; color: var(--text-2); margin-bottom: 2px; }
.issue-ts     { font: 9.5px var(--mono); color: var(--text-3); }

/* ── Global search ── */
.global-search {
  display: block; width: calc(100% - 16px); margin: 0 8px 0;
  background: rgba(55,120,200,0.08); border: 1px solid rgba(55,120,200,0.22);
  border-radius: 6px; color: var(--text); font-size: 12px;
  padding: 7px 10px; outline: none;
  transition: border-color .15s;
}
.global-search:focus { border-color: rgba(55,120,200,0.50); }
.global-search::placeholder { color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════
   RIGHT DETAIL PANEL
   ═══════════════════════════════════════════════════════════ */
.detail-panel {
  position: fixed; top: var(--nav-h); bottom: var(--wave-h); right: 0;
  width: var(--dp-w); z-index: 10;
  background: var(--panel); border-left: 1px solid var(--panel-bd);
  backdrop-filter: blur(18px);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.detail-panel::-webkit-scrollbar { width: 3px; }
.detail-panel::-webkit-scrollbar-thumb { background: rgba(55,120,200,0.2); border-radius: 4px; }
.detail-panel.hidden { transform: translateX(100%); pointer-events: none; }

.dp-header     { padding: 14px 14px 10px; border-bottom: 1px solid rgba(55,120,200,0.12); }
.dp-title-row  { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.dp-icon       { font-size: 26px; flex-shrink: 0; line-height: 1.1; }
.dp-titles     { flex: 1; min-width: 0; }
.dp-name       { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.2; }
.dp-connector  { font-size: 10px; color: var(--text-3); }
.dp-close      { margin-left: auto; flex-shrink: 0; }
.dp-desc       { font-size: 11.5px; color: var(--text-2); margin-bottom: 8px; }
.dp-health     { font-size: 11.5px; }

/* Health check result */
.dp-healthcheck { padding: 8px 14px 10px; border-bottom: 1px solid rgba(55,120,200,0.1); }
.dp-hc-result   {
  font: 11px var(--mono); color: var(--text); white-space: pre-wrap; word-break: break-all;
  max-height: 160px; overflow-y: auto; margin-top: 5px;
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
}

/* Recommendations */
.dp-recommendations { padding: 8px 14px 10px; border-bottom: 1px solid rgba(55,120,200,0.1); }
.dp-rec-list        { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; }

.rec-item {
  display: flex; gap: 8px; padding: 8px 9px; border-radius: 6px;
  background: rgba(55,120,200,0.05); border: 1px solid rgba(55,120,200,0.12);
}
.rec-critical { background: rgba(239,68,68,0.07);   border-color: rgba(239,68,68,0.22); }
.rec-warning  { background: rgba(245,158,11,0.07);  border-color: rgba(245,158,11,0.22); }
.rec-ok       { background: rgba(34,197,94,0.06);   border-color: rgba(34,197,94,0.18); }
.rec-info     { background: rgba(59,126,248,0.06);  border-color: rgba(59,126,248,0.18); }

.rec-icon   { font-size: 14px; flex-shrink: 0; }
.rec-text   { font-size: 11.5px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.rec-action { font-size: 10.5px; color: var(--text-2); font-style: italic; }

/* Section label row */
.dp-section-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em; color: var(--text-3);
  padding: 10px 14px 4px; display: flex; align-items: center; gap: 8px;
}
.dp-tools-header { border-top: 1px solid rgba(55,120,200,0.08); }

/* Tool search */
.dp-search {
  flex: 1; background: rgba(55,120,200,0.08); border: 1px solid rgba(55,120,200,0.18);
  border-radius: 4px; color: var(--text); font-size: 11px; padding: 3px 7px; outline: none;
  transition: border-color .15s;
}
.dp-search:focus   { border-color: rgba(55,120,200,0.45); }
.dp-search::placeholder { color: var(--text-3); }

.dp-tools { padding: 0 8px 6px; display: flex; flex-direction: column; gap: 1px; }
.tl-section { font-size: 9.5px; letter-spacing: .12em; color: var(--text-3); padding: 6px 6px 2px; }
.tl-empty   { font-size: 11px; color: var(--text-3); padding: 10px 8px; }

.tool-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 7px 8px; border-radius: 5px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.tool-item:hover  { background: rgba(55,120,200,0.10); border-color: rgba(55,120,200,0.22); }
.tool-item.active { background: rgba(59,126,248,0.16); border-color: rgba(59,126,248,0.38); }
.tool-item.hidden { display: none; }

.ti-pin        { color: var(--amber); flex-shrink: 0; font-size: 11px; margin-top: 1px; }
.ti-pin-spacer { width: 11px; flex-shrink: 0; }
.ti-svc-dot    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.ti-name       { font: 500 11.5px var(--mono); color: var(--text); }
.ti-desc       { font-size: 10.5px; color: var(--text-2); margin-top: 1px; }

/* ── Tool runner ── */
.dp-runner { padding: 8px 14px; border-top: 1px solid rgba(55,120,200,0.12); }
.dr-label  { padding: 6px 0 4px; }

.dr-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dr-field label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--text-2);
  display: block; margin-bottom: 3px;
}
.dr-field input, .dr-field select, .dr-field textarea {
  width: 100%; background: rgba(55,120,200,0.07);
  border: 1px solid rgba(55,120,200,0.22); border-radius: 5px;
  color: var(--text); font: 11.5px var(--mono); padding: 5px 8px; outline: none;
  transition: border-color .15s;
}
.dr-field input:focus, .dr-field select:focus, .dr-field textarea:focus {
  border-color: rgba(59,126,248,0.55);
  box-shadow: 0 0 0 2px rgba(59,126,248,0.10);
}
.dr-field textarea { min-height: 60px; resize: vertical; }
.dr-field select   { appearance: none; cursor: pointer; }
.req-mark    { color: var(--amber); }
.field-hint  { font-size: 10px; color: var(--text-3); margin-bottom: 3px; }
.no-params   { font-size: 11.5px; color: var(--text-2); padding: 4px 0; }

.dr-btn {
  width: 100%; padding: 9px; border-radius: 6px; border: none; cursor: pointer;
  background: linear-gradient(135deg, rgba(59,126,248,0.22), rgba(34,211,238,0.14));
  color: var(--blue-l); font: 600 12px var(--sans); letter-spacing: .08em;
  border: 1px solid rgba(59,126,248,0.32);
  transition: background .15s, color .15s, box-shadow .15s;
}
.dr-btn:hover    { background: linear-gradient(135deg, rgba(59,126,248,0.35), rgba(34,211,238,0.22)); color: #fff; box-shadow: 0 0 16px rgba(59,126,248,0.3); }
.dr-btn:disabled { opacity: .45; cursor: not-allowed; }

.dr-output    { margin-top: 10px; }
.dr-out-bar   {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px; letter-spacing: .14em; color: var(--text-3); margin-bottom: 4px;
}
.txt-btn {
  background: none; border: 1px solid rgba(55,120,200,0.18); color: var(--text-3);
  font-size: 9.5px; letter-spacing: .1em; cursor: pointer; padding: 2px 7px; border-radius: 3px;
  transition: color .12s, border-color .12s;
}
.txt-btn:hover { color: var(--text); border-color: rgba(55,120,200,0.40); }

#dr-pre {
  font: 11.5px var(--mono); white-space: pre-wrap; word-break: break-all;
  color: var(--text); max-height: 300px; overflow-y: auto;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(55,120,200,0.14);
  border-radius: 6px; padding: 9px;
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
}
.out-error   { color: var(--red)   !important; }
.out-loading { color: var(--amber) !important; animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ═══════════════════════════════════════════════════════════
   BOTTOM BAR
   ═══════════════════════════════════════════════════════════ */
.bottom-bar {
  position: fixed; bottom: 0; left: var(--lp-w); right: 0;
  height: var(--wave-h); z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; pointer-events: none;
}
.bb-stats {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-2);
  background: rgba(4,8,15,0.6); border-radius: 4px; padding: 3px 12px;
  pointer-events: auto; border: 1px solid rgba(55,120,200,0.10);
}
.bb-val  { color: var(--text); font-weight: 600; }
.bb-sep  { color: var(--text-3); }
.bb-wave-label { font-size: 9.5px; letter-spacing: .16em; color: var(--text-3); pointer-events: none; }

/* ═══════════════════════════════════════════════════════════
   INFRA TAB — Connector metrics + Pod cards
   ═══════════════════════════════════════════════════════════ */

/* ── Connector request metric cards ── */
.connector-metrics { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 4px; }

.metric-card {
  padding: 8px 10px; border-radius: 6px; cursor: default;
  background: rgba(55,120,200,0.05); border: 1px solid rgba(55,120,200,0.12);
}
.mc-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.mc-icon { font-size: 14px; flex-shrink: 0; }
.mc-name { flex: 1; font-size: 11px; font-weight: 500; color: var(--text); }
.mc-err-dot { color: var(--red); font-size: 8px; }
.mc-stats   { display: flex; gap: 4px; margin-bottom: 4px; }
.mc-stat    { flex: 1; text-align: center; }
.mc-val     { font: 700 13px var(--mono); line-height: 1; margin-bottom: 1px; }
.mc-lbl     { font-size: 8px; letter-spacing: .14em; color: var(--text-3); }
.mc-last    { font-size: 10px; color: var(--text-3); }
.mc-err-msg { font: 10px var(--mono); color: var(--red); margin-top: 3px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Pod cards ── */
.pod-grid   { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 8px; }

.pod-card {
  padding: 8px 10px; border-radius: 6px;
  background: rgba(55,120,200,0.04); border: 1px solid rgba(55,120,200,0.12);
  transition: border-color .15s;
}
.pod-card:hover  { border-color: rgba(55,120,200,0.28); }
.pod-ready       { border-left: 2px solid var(--green); }
.pod-running     { border-left: 2px solid var(--amber); }
.pod-bad         { border-left: 2px solid var(--red); }

.pod-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.pod-status-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pod-name        { font: 600 10.5px var(--mono); flex: 1; color: var(--text);
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-actions     { display: flex; gap: 3px; flex-shrink: 0; }
.pod-btn         {
  background: none; border: 1px solid rgba(55,120,200,0.18); color: var(--text-3);
  font-size: 11px; cursor: pointer; padding: 1px 5px; border-radius: 3px;
  transition: color .12s, border-color .12s;
}
.pod-btn:hover   { color: var(--text); border-color: rgba(55,120,200,0.40); }

.pod-meta        { font-size: 10px; color: var(--text-3); margin-bottom: 5px; }

.pod-gauges      { display: flex; flex-direction: column; gap: 3px; }
.gauge-row       { display: flex; align-items: center; gap: 5px; }
.gauge-lbl       { font: 600 8.5px var(--mono); color: var(--text-3); width: 26px; flex-shrink: 0; }
.gauge-track     { flex: 1; height: 4px; border-radius: 3px; background: rgba(55,120,200,0.10); overflow: hidden; }
.gauge-fill      { height: 100%; border-radius: 3px; transition: width .5s ease; }
.gauge-val       { font: 500 9.5px var(--mono); width: 44px; text-align: right; flex-shrink: 0; }
.gauge-na        { font-size: 10px; color: var(--text-3); padding: 4px 0; }

.pod-limits      { font-size: 9.5px; color: var(--text-3); margin-top: 4px;
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pod-notice      {
  padding: 16px 10px; text-align: center; font-size: 11.5px; color: var(--text-2); line-height: 1.7;
  border: 1px dashed rgba(55,120,200,0.18); border-radius: 6px; margin: 4px 8px;
}

/* ═══════════════════════════════════════════════════════════
   LOG VIEWER MODAL
   ═══════════════════════════════════════════════════════════ */
.log-modal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(4,8,15,0.82); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.log-modal-inner {
  width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  background: var(--bg2); border: 1px solid rgba(55,120,200,0.28);
  border-radius: 10px; display: flex; flex-direction: column;
  overflow: hidden;
}
.log-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(55,120,200,0.14);
  flex-shrink: 0; gap: 10px;
}
.log-modal-title {
  display: flex; align-items: center; gap: 7px;
  font: 600 13px var(--mono); color: var(--text);
}
.log-modal-icon { font-size: 15px; color: var(--blue-l); }

.log-modal-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; flex-wrap: wrap; }
.lm-check  { font-size: 10.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.lm-select {
  background: rgba(55,120,200,0.08); border: 1px solid rgba(55,120,200,0.22);
  color: var(--text); font-size: 11px; padding: 3px 6px; border-radius: 4px; outline: none;
}
.lm-btn {
  background: none; border: 1px solid rgba(55,120,200,0.22); color: var(--text-2);
  font-size: 11px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.lm-btn:hover   { color: var(--text); border-color: rgba(55,120,200,0.50); }
.lm-close       { border-color: rgba(239,68,68,0.28); color: var(--red); }
.lm-close:hover { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.55); }

.log-modal-body {
  flex: 1; overflow-y: auto; padding: 10px 14px;
  font: 11px var(--mono); color: var(--text-2);
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
}
.log-modal-body::-webkit-scrollbar { width: 4px; }
.log-modal-body::-webkit-scrollbar-thumb { background: rgba(55,120,200,0.2); border-radius: 4px; }

.log-lines   { display: flex; flex-direction: column; }
.log-line    { line-height: 1.55; padding: 0 2px; white-space: pre-wrap; word-break: break-all; }
.log-line:hover { background: rgba(55,120,200,0.06); }
.ll-error    { color: #f87171; }
.ll-warn     { color: var(--amber); }
.ll-info     { color: var(--text-2); }
.ll-default  { color: var(--text-3); }
.ll-ts       { color: rgba(55,120,200,0.55); font-size: 10px; }

.log-loading { font-size: 11.5px; color: var(--text-3); padding: 16px; animation: blink 1s step-end infinite; }
.log-err     { font-size: 11.5px; color: var(--red); padding: 16px; }

/* ── Application log pane ── */
.app-logs-pane {
  max-height: 220px; overflow-y: auto; margin: 0 8px 8px;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(55,120,200,0.12);
  border-radius: 5px; padding: 6px 8px;
  font: 10.5px var(--mono);
  scrollbar-width: thin; scrollbar-color: rgba(55,120,200,0.2) transparent;
}
.app-logs-pane::-webkit-scrollbar { width: 3px; }
.app-logs-pane::-webkit-scrollbar-thumb { background: rgba(55,120,200,0.2); border-radius: 4px; }

.al-line   { display: flex; gap: 6px; line-height: 1.55; padding: 0 1px; white-space: pre-wrap; word-break: break-all; }
.al-ts     { color: rgba(55,120,200,0.45); flex-shrink: 0; width: 52px; }
