:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel-bg: #0c101d;
  --panel-border: #1a2236;
  --text: #e8ecf6;
  --muted: #8591a8;
  --line: #1c2438;
  --accent: #00f0ff;
  --accent-glow: rgba(0, 240, 255, 0.35);
  --purple: #a855f7;
  --cyan: #00ff88;
  --cyan-glow: rgba(0, 255, 136, 0.3);
  --warning: #ffb703;
  --warning-glow: rgba(255, 183, 3, 0.3);
  --down: #ff3366;
  --down-glow: rgba(255, 51, 102, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 46, 70, 0.85) transparent;
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(35, 46, 70, 0.85);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

body {
  background: var(--bg);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 240, 255, 0.08), transparent 70%),
    linear-gradient(rgba(28, 36, 56, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 36, 56, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  height: 100dvh;
  min-height: 720px;
  display: flex;
  flex-direction: column;
  padding: 0 44px;
  scrollbar-gutter: stable both-edges;
  overflow: hidden;
}

/* ================= HEADER & BRAND ================= */
header {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 94px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 50;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(168, 85, 247, 0.05));
  box-shadow: 0 0 16px var(--accent-glow), inset 0 0 10px var(--accent-glow);
  text-shadow: 0 0 12px var(--accent);
}

.brand h1 {
  font-size: 20px;
  letter-spacing: 4px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.brand h1 span {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-left: 12px;
  font-weight: 400;
}

.brand p {
  font: 9px/1.6 monospace;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 3px;
}

/* ================= BUSCADOR TÁCTICO ================= */
.search-command-wrap {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 16, 29, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 10px rgba(0, 240, 255, 0.1);
  background: rgba(15, 21, 38, 0.95);
}

.search-glyph {
  font-size: 16px;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

#universe-search {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font: 11px/1.4 monospace;
  letter-spacing: 1px;
}

#universe-search::placeholder {
  color: #5d6a85;
  font-size: 10px;
}

.search-key {
  font: 10px monospace;
  background: #172033;
  color: var(--accent);
  border: 1px solid #2a3754;
  border-radius: 3px;
  padding: 2px 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(10, 14, 26, 0.96);
  border: 1px solid var(--accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 24px var(--accent-glow);
  border-radius: 6px;
  max-height: 380px;
  overflow-y: auto;
  backdrop-filter: blur(16px);
  z-index: 100;
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(28, 36, 56, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.search-item:hover, .search-item.active {
  background: rgba(0, 240, 255, 0.12);
}

.search-item-info strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.search-item-info span {
  font: 10px monospace;
  color: var(--muted);
}

.search-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px monospace;
}

.search-item-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.search-item-badge.healthy { background: rgba(0, 255, 136, 0.15); color: var(--cyan); border: 1px solid var(--cyan); }
.search-item-badge.warning { background: rgba(255, 183, 3, 0.15); color: var(--warning); border: 1px solid var(--warning); }
.search-item-badge.down { background: rgba(255, 51, 102, 0.15); color: var(--down); border: 1px solid var(--down); }
.search-item-badge.sin_datos { background: rgba(133, 145, 168, 0.15); color: var(--muted); border: 1px solid var(--muted); }

.search-empty {
  padding: 18px;
  text-align: center;
  font: 11px monospace;
  color: var(--muted);
}

/* ================= LIVE INDICATOR & CLOCK ================= */
.live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.live i {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
}

body.inventory-ok .live i {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 4px #fff;
  animation: live-pulse 2s infinite ease-in-out;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

#clock {
  padding-left: 20px;
  margin-left: 10px;
  border-left: 1px solid var(--line);
  font: 22px monospace;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ================= METRICS BAR ================= */
.metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.15fr);
  align-items: center;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.metrics > div {
  padding: 0 clamp(6px, 0.75vw, 14px);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px clamp(4px, 0.5vw, 8px);
  min-width: 0;
}

.metrics > div:first-child {
  border-left: none;
  padding-left: 0;
}

.metric-label {
  grid-column: 1 / -1;
  font: 9px/1 monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metrics strong {
  font-family: monospace;
  font-size: clamp(18px, 1.8vw, 30px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -1px;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.metrics small {
  max-width: 105px;
  align-self: end;
  font: 8px/1.2 monospace;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding-bottom: 1px;
  white-space: normal;
}

#k-servers { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }
#k-suburbs { color: var(--purple); text-shadow: 0 0 16px rgba(168, 85, 247, 0.4); }
#k-incidents { color: var(--warning); text-shadow: 0 0 16px var(--warning-glow); }
#k-infra { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }
#k-aws { color: #ff9900; text-shadow: 0 0 14px rgba(255, 153, 0, 0.4); }
#k-do { color: #0080ff; text-shadow: 0 0 14px rgba(0, 128, 255, 0.4); }
#k-ssl { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }
#k-nodata { color: #8fa0bd; }

.metric-sync strong {
  font-size: clamp(12px, 0.95vw, 15px);
  letter-spacing: -0.5px;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
  white-space: nowrap;
}

.metric-sync small {
  max-width: none;
  grid-column: 1 / -1;
}

/* ================= MAIN & PANELS ================= */
main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding-top: 20px;
}

.fabric {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.eyebrow {
  font: 10px/1.5 monospace;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.fabric-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
}

.fabric-title h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 500;
  margin-top: 6px;
}

.fabric-title em {
  color: var(--muted);
  font-style: normal;
}

#universe-count {
  font: 10px monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-align: right;
}

/* ================= CANVAS VIEWPORT ================= */
.canvas-wrap {
  flex: 1;
  min-height: 340px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 65% 55% at 50% 45%, #11172a 0%, #060913 75%, #03050a 100%);
  border: 1px solid #1a233b;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.05);
  border-radius: 4px;
}

#fabric {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 1px;
  pointer-events: none;
}

.map-empty[hidden] { display: none; }

/* Navigation Controls in Canvas */
.map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.map-btn {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #94a3b8;
  font: 12px/1 monospace;
  font-weight: 600;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.map-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.map-btn-reset {
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 0 8px;
}

/* Floating HUD Tooltip */
.canvas-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  background: rgba(10, 15, 26, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 14px rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(10px);
  max-width: 280px;
  transform: translate(14px, 14px);
  transition: opacity 0.1s ease;
}

.canvas-tooltip[hidden] {
  display: none;
}

.tooltip-colony {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tooltip-badge {
  font: 9px monospace;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

.tooltip-badge.healthy { background: rgba(0, 255, 136, 0.2); color: var(--cyan); border: 1px solid var(--cyan); }
.tooltip-badge.warning { background: rgba(255, 183, 3, 0.2); color: var(--warning); border: 1px solid var(--warning); }
.tooltip-badge.down { background: rgba(255, 51, 102, 0.2); color: var(--down); border: 1px solid var(--down); }
.tooltip-badge.sin_datos { background: rgba(133, 145, 168, 0.2); color: var(--muted); border: 1px solid var(--muted); }

.tooltip-warning {
  margin: 4px 0;
  padding: 3px 6px;
  background: rgba(255, 183, 3, 0.15);
  border: 1px solid var(--warning);
  border-radius: 2px;
  color: var(--warning);
  font: bold 9px monospace;
  letter-spacing: 0.5px;
}

.tooltip-meta {
  font: 10px/1.4 monospace;
  color: var(--muted);
}

.tooltip-meta strong {
  color: #cbd5e1;
}

.tooltip-ping {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font: 9px monospace;
  color: var(--accent);
}

/* Tactical Corner Brackets */
.map-edge {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.top-left { left: 8px; top: 8px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.bottom-right { right: 8px; bottom: 8px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.top-right { right: 8px; top: 8px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.bottom-left { left: 8px; bottom: 8px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }

.map-stamp {
  position: absolute;
  bottom: 16px;
  left: 18px;
  font: 8px/1.7 monospace;
  letter-spacing: 3px;
  color: #5d6982;
  pointer-events: none;
}

.map-stamp span { color: var(--accent); }

.map-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font: 9px monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.legend { display: flex; gap: 20px; }
.unknown { color: #8fa0bd; }
.healthy { color: var(--cyan); text-shadow: 0 0 8px var(--cyan-glow); }
.warning { color: var(--warning); text-shadow: 0 0 8px var(--warning-glow); }
.down { color: var(--down); text-shadow: 0 0 8px var(--down-glow); }

/* ================= ASIDE / FOCUS INSPECTOR ================= */
aside {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  padding-right: 20px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

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

.auto {
  font: 9px monospace;
  color: var(--accent);
  background: rgba(0, 240, 255, 0.1);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.picker-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
}

#server-picker, #resume-auto {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background: #0f1526;
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

#server-picker { cursor: pointer; }
#resume-auto {
  margin-top: 8px;
  color: var(--accent);
  border-color: rgba(0, 240, 255, 0.4);
  cursor: pointer;
  background: rgba(0, 240, 255, 0.08);
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

#resume-auto:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 12px var(--accent-glow);
}

#resume-auto[hidden], #node-details[hidden] { display: none; }

#focus-city {
  display: block;
  width: 100%;
  height: 144px;
  background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.08), transparent 70%);
  border: 1px solid #161e33;
  border-radius: 4px;
  margin-top: 10px;
}

.focus-identity {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font: 10px monospace;
  color: var(--muted);
}

.focus-identity span:first-child { color: var(--accent); }

#focus-name {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
  color: #fff;
}

.focus-description {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 8px;
}

/* Detail & Telemetry Lists */
.detail-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-top: 18px;
  text-transform: uppercase;
}

.telemetry-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 6px;
}

.node-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 14px 0;
  font-size: 11px;
  line-height: 1.5;
}

.node-data dt { color: var(--muted); font-family: monospace; }
.node-data dd { text-align: right; overflow-wrap: anywhere; color: #fff; }

/* ================= BARRA LATERAL: TELEMETRÍA TÁCTICA ================= */
.telemetry-interactive-card {
  margin: 14px 0 10px 0;
  padding: 12px 14px;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  position: relative;
  overflow: hidden;
}

.telemetry-interactive-card:hover {
  background: rgba(13, 22, 38, 0.95);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.28), inset 0 0 12px rgba(0, 240, 255, 0.08);
  transform: translateY(-1px);
}

.telemetry-interactive-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.telemetry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.telemetry-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-expand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 2px 7px;
  border-radius: 2px;
  transition: all 0.18s ease;
}

.telemetry-interactive-card:hover .telemetry-expand-badge {
  background: var(--cyan);
  color: #030712;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.telemetry-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 6px #00ff88;
  animation: pulse-live-dot 1.5s infinite;
}

@keyframes pulse-live-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Fila de métricas principales con gráficas amplias */
.telem-sidebar-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px 0;
}

.telem-sidebar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  background: rgba(6, 10, 18, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.14);
  border-radius: 3px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.telem-sidebar-row:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(8, 14, 24, 0.9);
}

.telem-row-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telem-row-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-family: monospace;
}

.telem-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #7b8fa8;
  text-transform: uppercase;
}

.telem-val {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telem-sidebar-row .meter-bar {
  width: 100%;
  height: 5px;
  background: #101626;
  border: 1px solid #1c273e;
  border-radius: 2px;
  overflow: hidden;
  margin: 0;
}

.telem-row-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Indicador de Ping Radar */
.ping-bar-indicator {
  width: 100%;
  height: 5px;
  background: #101626;
  border: 1px solid #1c273e;
  border-radius: 2px;
  overflow: hidden;
}

.ping-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #00ff88);
}

/* Sub-grid táctica para métricas secundarias */
.telem-sub-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 5px 10px;
  margin: 8px 0 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 11px;
  line-height: 1.4;
}

.telem-sub-grid dt {
  color: #64748b;
  font-family: monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.telem-sub-grid dd {
  color: #e2e8f0;
  text-align: right;
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 10px;
}

/* Futuristic Telemetry Meter Bars */
.meter-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.meter-bar {
  width: 54px;
  height: 6px;
  background: #151c2e;
  border: 1px solid #232f4a;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: 0 0 6px var(--accent-glow);
  transition: width 0.4s ease;
}

.meter-fill.warning {
  background: linear-gradient(90deg, var(--warning), #ff6b6b);
  box-shadow: 0 0 6px var(--warning-glow);
}

/* Radar Ping Indicator */
.ping-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.ping-radar {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  position: relative;
}

.ping-radar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  animation: radar-wave 1.6s infinite ease-out;
}

@keyframes radar-wave {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Focus Server Buttons */
button.focus-server {
  display: block;
  width: 100%;
  min-height: 42px;
  background: rgba(15, 21, 38, 0.4);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
}

button.focus-server:hover, button.focus-server[aria-pressed="true"] {
  background: rgba(0, 240, 255, 0.1);
  border-left: 2px solid var(--accent);
}

.focus-server strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.focus-server div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 9px monospace;
  color: var(--muted);
}

.focus-server.down .server-status { color: var(--down); text-shadow: 0 0 6px var(--down-glow); }
.focus-server.warning .server-status { color: var(--warning); text-shadow: 0 0 6px var(--warning-glow); }
.focus-server.healthy .server-status { color: var(--cyan); text-shadow: 0 0 6px var(--cyan-glow); }

/* Incidents Section */
.incidents {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

#incident-count {
  color: var(--accent);
  font: 11px monospace;
  font-weight: bold;
}

.incident-empty {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 10px;
}

.incident-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: rgba(15, 21, 38, 0.2);
  margin-bottom: 4px;
  border-radius: 2px;
}

.incident-item.down { border-left-color: var(--down); background: rgba(255, 51, 102, 0.06); }
.incident-item.warning { border-left-color: var(--warning); background: rgba(255, 183, 3, 0.06); }

.incident-item strong { display: block; font-size: 11px; }
.incident-item span { display: block; font-size: 10px; color: var(--muted); font-family: monospace; }

/* Central Monitor Section */
.monitor {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.monitor > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 10px/1.5 monospace;
  color: var(--muted);
  margin-top: 8px;
}

.monitor strong { font-weight: 500; color: #fff; }
.monitor p {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}

/* ================= FOOTER & TACTICAL TICKER ================= */
footer {
  min-height: 46px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font: 9px/1.5 monospace;
  color: var(--muted);
  letter-spacing: 1px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

footer b {
  font-weight: 600;
  color: var(--accent);
  margin-left: 12px;
}

.tactical-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  max-width: 65%;
  background: rgba(12, 16, 29, 0.6);
  padding: 4px 12px;
  border-radius: 3px;
  border: 1px solid #1a2236;
}

.ticker-badge {
  background: rgba(0, 255, 136, 0.15);
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 1px 6px;
  border-radius: 2px;
  font: bold 9px monospace;
  letter-spacing: 1px;
  white-space: nowrap;
}

.ticker-content {
  color: #a8b8d8;
  font: 9px monospace;
  white-space: nowrap;
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= COPILOTO IA / AI ADVISOR CARD ================= */
.ai-advisor-card {
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.85) 0%, rgba(10, 15, 26, 0.95) 100%);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.03);
  position: relative;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-spark-icon {
  color: var(--cyan);
  font-size: 13px;
  animation: pulse-glow 2s infinite ease-in-out;
}

.ai-title {
  font: bold 10px monospace;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.ai-source-tag {
  font: 8px monospace;
  color: #7e8fa8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

.ai-hint {
  font: 11px/1.4 var(--font-ui, sans-serif);
  color: #94a3b8;
  margin: 0 0 12px 0;
}

.ai-btn-primary {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.15) 0%, rgba(0, 255, 136, 0.15) 100%);
  border: 1px solid var(--cyan);
  border-radius: 3px;
  color: #ffffff;
  font: bold 11px monospace;
  letter-spacing: 1.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.ai-btn-primary:hover {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.28) 0%, rgba(0, 255, 136, 0.28) 100%);
  border-color: #ffffff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}

.ai-btn-primary:active {
  transform: translateY(0);
}

.ai-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-chip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 2px;
  color: #cbd5e1;
  font: 10px monospace;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ai-chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
}

.ai-input-bar {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.ai-input-bar input {
  flex: 1;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 3px;
  color: #f1f5f9;
  font: 11px var(--font-ui, sans-serif);
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-input-bar input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.ai-input-bar input::placeholder {
  color: #5d6d84;
}

.ai-input-bar button {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--cyan);
  border-radius: 3px;
  color: var(--cyan);
  font: bold 10px monospace;
  letter-spacing: 0.8px;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-input-bar button:hover {
  background: var(--cyan);
  color: #050811;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.ai-input-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Response Box */
.ai-response-box {
  margin-top: 14px;
  background: rgba(5, 8, 15, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 3px;
  padding: 12px;
  max-height: 440px;
  overflow-y: auto;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7);
}

.ai-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#ai-response-status {
  font: bold 9px monospace;
  letter-spacing: 1.2px;
  color: var(--cyan);
}

.ai-tool-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 2px;
  color: #94a3b8;
  font: 9px monospace;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-tool-btn:hover {
  color: #f8fafc;
  border-color: #cbd5e1;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  color: var(--cyan);
  font: 11px monospace;
}

.ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px var(--cyan)); }
}

/* Markdown formatting in AI Result */
.ai-result-content {
  color: #e2e8f0;
  font: 12px/1.6 var(--font-ui, sans-serif);
  word-break: break-word;
}

.ai-result-content h1,
.ai-result-content h2,
.ai-result-content h3 {
  font-family: monospace;
  color: #38bdf8;
  margin: 12px 0 6px 0;
  font-size: 12px;
  letter-spacing: 0.8px;
}

.ai-result-content h3 {
  color: #7dd3fc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 2px;
}

.ai-result-content ul,
.ai-result-content ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.ai-result-content li {
  margin-bottom: 4px;
}

.ai-result-content strong {
  color: #ffffff;
}

.ai-result-content code {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 2px;
  font: 11px monospace;
  color: #f6ad55;
}

.ai-result-content pre {
  background: #090d16;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 3px;
  padding: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.ai-result-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #38bdf8;
}

.ai-result-content p {
  margin: 6px 0;
}

.ai-result-error {
  color: #ff7189;
  border-left: 2px solid #ff7189;
  padding-left: 8px;
  font: 11px monospace;
}

/* Incident item with direct AI action */
.incident-item {
  position: relative;
}

.incident-ai-btn {
  margin-top: 4px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 2px;
  color: var(--cyan);
  font: bold 9px monospace;
  padding: 2px 6px;
  cursor: pointer;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.incident-ai-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* ================= SPARKLINES DE TENDENCIA ================= */
.sparkline-canvas {
  width: 94px;
  height: 22px;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.sparkline-canvas:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}


/* ================= TERMINAL SSH DE REMEDIACIÓN ================= */
.node-ssh-card {
  margin: 12px 0 6px 0;
  padding: 10px 12px;
  background: rgba(8, 12, 22, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ssh-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ssh-card-title {
  font: bold 9px monospace;
  letter-spacing: 1px;
  color: var(--cyan);
}

.ssh-copy-btn {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--cyan);
  border-radius: 2px;
  color: var(--cyan);
  font: bold 9px monospace;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.ssh-copy-btn:hover {
  background: var(--cyan);
  color: #050811;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.ssh-cmd-text {
  font: 10px monospace;
  color: #f6ad55;
  background: rgba(15, 23, 42, 0.8);
  padding: 5px 8px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  white-space: nowrap;
}


/* ================= BOTÓN DE ALERTAS EN HEADER ================= */
.alerts-nav-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 3px;
  color: #ffffff;
  font: bold 10px monospace;
  letter-spacing: 1px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.alerts-nav-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.alerts-btn-pulse {
  color: #ffb703;
  text-shadow: 0 0 6px rgba(255, 183, 3, 0.8);
}

/* ================= SESIÓN DE USUARIO EN HEADER ================= */
.user-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 16, 29, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px 8px 4px 10px;
  font-family: monospace;
  font-size: 11px;
}

.user-glyph {
  font-size: 12px;
  opacity: 0.85;
}

.user-badge {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-nav-btn {
  background: rgba(255, 51, 102, 0.12);
  border: 1px solid rgba(255, 51, 102, 0.35);
  border-radius: 3px;
  color: #ff99b0;
  font: bold 9px monospace;
  letter-spacing: 1px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.logout-nav-btn:hover {
  background: rgba(255, 51, 102, 0.3);
  border-color: var(--down);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
  transform: translateY(-1px);
}

/* ================= MODAL TÁCTICO DE ALERTAS ================= */
.tactical-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.tactical-modal-backdrop[hidden] {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tactical-modal {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: linear-gradient(180deg, rgba(14, 20, 34, 0.98) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(10, 16, 28, 0.8);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h3 {
  margin: 0;
  font: bold 12px monospace;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.modal-spark {
  color: #ffb703;
  font-size: 16px;
  text-shadow: 0 0 8px rgba(255, 183, 3, 0.8);
}

.modal-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  color: #94a3b8;
  font: bold 12px monospace;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: rgba(255, 113, 137, 0.2);
  border-color: var(--down);
  color: var(--down);
}

.alerts-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #cbd5e1;
}

.alerts-section {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alerts-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alerts-section-title {
  font: bold 10px monospace;
  letter-spacing: 1.5px;
  color: var(--cyan);
}

.section-hint {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
}

/* Switch General */
.alerts-toggle-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-label input {
  display: none;
}

.switch-slider {
  width: 38px;
  height: 20px;
  background: #334155;
  border-radius: 12px;
  position: relative;
  transition: all 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.2s;
}

.switch-label input:checked + .switch-slider {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.switch-label input:checked + .switch-slider::before {
  transform: translateX(18px);
  background: #050811;
}

.switch-title {
  font: bold 11px monospace;
  letter-spacing: 1px;
  color: #ffffff;
}

.alerts-status-pill {
  font: bold 9px monospace;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 2px;
}

.alerts-status-pill.pill-active {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid var(--up);
  color: var(--up);
}

.alerts-status-pill.pill-inactive {
  background: rgba(255, 113, 137, 0.15);
  border: 1px solid var(--down);
  color: var(--down);
}

/* Formularios */
.alerts-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.alerts-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alerts-field label {
  font: bold 9px monospace;
  letter-spacing: 1px;
  color: #94a3b8;
}

.alerts-field input,
.threshold-input-box input,
.suburb-filter-box input {
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 2px;
  color: #ffffff;
  font: 11px monospace;
  padding: 8px 10px;
  outline: none;
  transition: all 0.15s;
}

.alerts-field input:focus,
.threshold-input-box input:focus,
.suburb-filter-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

/* Destino y Test Row */
.alerts-destination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.destination-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.destination-label {
  font: bold 9px monospace;
  letter-spacing: 1px;
  color: #94a3b8;
}

.destination-channel {
  font: bold 11px monospace;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 3px 8px;
  border-radius: 2px;
}

.alerts-test-btn {
  background: rgba(255, 183, 3, 0.1);
  border: 1px solid #ffb703;
  border-radius: 2px;
  color: #ffb703;
  font: bold 10px monospace;
  letter-spacing: 1px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.alerts-test-btn:hover {
  background: #ffb703;
  color: #050811;
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.4);
}

.alerts-test-feedback {
  font: 11px monospace;
}


/* Checkbox Tactical */
.alerts-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tactical-chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
}

.tactical-chk input {
  display: none;
}

.chk-custom {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: rgba(8, 12, 22, 0.9);
  border-radius: 2px;
  position: relative;
  transition: all 0.15s;
  flex-shrink: 0;
}

.tactical-chk input:checked + .chk-custom {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.tactical-chk input:checked + .chk-custom::after {
  content: "✓";
  position: absolute;
  top: -1px;
  left: 2px;
  color: #050811;
  font: bold 11px sans-serif;
}

.chk-label {
  color: #e2e8f0;
}

/* Thresholds */
.thresholds-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.threshold-card {
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.threshold-name {
  font: bold 9px monospace;
  letter-spacing: 1px;
  color: #94a3b8;
}

.threshold-input-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.threshold-input-box input {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: bold;
}

.threshold-input-box .unit {
  font: bold 11px monospace;
  color: var(--cyan);
}

/* Cooldown inline */
.alerts-field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.alerts-field-inline input {
  width: 70px;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 2px;
  color: #ffffff;
  font: bold 11px monospace;
  padding: 6px 8px;
}

.alerts-field-inline small {
  color: #94a3b8;
}

/* Suburbs Checklist */
.excluded-counter {
  font: bold 9px monospace;
  letter-spacing: 1px;
  background: rgba(255, 183, 3, 0.15);
  color: #ffb703;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid rgba(255, 183, 3, 0.4);
}

.suburb-filter-box input {
  width: 100%;
  box-sizing: border-box;
}

.suburbs-checklist {
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  padding: 8px 10px;
}

.suburb-chk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 3px 4px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s;
}

.suburb-chk-item:hover {
  background: rgba(0, 240, 255, 0.08);
}

.suburb-chk-item.is-excluded {
  color: #ffb703;
}

.suburb-chk-badge {
  font: 9px monospace;
  color: #64748b;
  margin-left: auto;
}

/* Footer Modal */
.alerts-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(10, 16, 28, 0.8);
}

.save-feedback {
  margin-right: auto;
  font: bold 11px monospace;
}

.alerts-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font: bold 10px monospace;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.alerts-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

.alerts-btn-primary {
  background: var(--cyan);
  border: 1px solid var(--cyan);
  color: #050811;
  font: bold 10px monospace;
  letter-spacing: 1px;
  padding: 8px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.alerts-btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
}

/* ================= INFRASTRUCTURE ISLE STYLES ================= */
.tooltip-infra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  font-family: monospace;
  font-size: 10px;
}

.tooltip-infra-grid span {
  color: var(--muted);
}

.tooltip-infra-grid strong {
  color: var(--text);
  font-weight: 600;
}

.search-item-badge.infra {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: #00f0ff;
}

.search-item-badge.healthy {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid rgba(0, 255, 136, 0.4);
  color: #00ff88;
}

#k-infra {
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

#k-infra.warning {
  color: #ffb703;
  text-shadow: 0 0 12px rgba(255, 183, 3, 0.4);
}

#k-infra.down {
  color: #ff3366;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.5);
}

/* ================= SSL SANCTUARY STYLES ================= */
.tooltip-ssl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 255, 136, 0.25);
  font-family: monospace;
  font-size: 10px;
}

.tooltip-ssl-grid span {
  color: var(--muted);
}

.tooltip-ssl-grid strong {
  color: var(--text);
  font-weight: 600;
}

.search-item-badge.ssl {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid rgba(0, 255, 136, 0.5);
  color: #00ff88;
}

#k-ssl {
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

#k-ssl.warning {
  color: #ffb703;
  text-shadow: 0 0 12px rgba(255, 183, 3, 0.4);
}

#k-ssl.critical, #k-ssl.down {
  color: #ff3366;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.5);
}

.meter-fill.ssl-warn {
  background: linear-gradient(90deg, #ffb703, #ff8c00) !important;
  box-shadow: 0 0 8px rgba(255, 183, 3, 0.6) !important;
}

.meter-fill.ssl-crit {
  background: linear-gradient(90deg, #ff3366, #ff0044) !important;
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.7) !important;
}

.search-item-badge.aws {
  background: rgba(255, 153, 0, 0.15);
  color: #ff9900;
  border-color: rgba(255, 153, 0, 0.35);
}

.search-item-badge.do {
  background: rgba(0, 128, 255, 0.15);
  color: #0080ff;
  border-color: rgba(0, 128, 255, 0.35);
}

.tooltip-cloud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font: 10px monospace;
  background: rgba(8, 12, 22, 0.8);
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 6px;
}

.tooltip-cloud-grid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tooltip-cloud-grid span {
  color: var(--muted);
  font-size: 9px;
}

.tooltip-cloud-grid strong {
  color: #fff;
  font-weight: 600;
}

/* ================= MODAL TELEMETRÍA DETALLADA ================= */
.telemetry-modal-box {
  max-width: 980px;
  width: 95%;
  max-height: 92vh;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.3);
}

.telem-modal-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  flex-wrap: wrap;
}

.telem-sub-sep {
  color: #334763;
}

.telemetry-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* KPI Cards Grid */
.telem-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
}

.telem-kpi-card {
  background: rgba(11, 17, 30, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 3px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.telem-kpi-card:hover {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.telem-kpi-label {
  font-family: monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
}

.telem-kpi-val {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.telem-kpi-val.warning {
  color: #ffb703;
  text-shadow: 0 0 8px rgba(255, 183, 3, 0.5);
}

.telem-kpi-val.critical {
  color: #ff3366;
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
}

.telem-kpi-sub {
  font-family: monospace;
  font-size: 10px;
  color: #8fa0bc;
}

/* 4 Large Charts Grid */
.telem-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 860px) {
  .telem-charts-grid {
    grid-template-columns: 1fr;
  }
}

.telem-chart-panel {
  background: rgba(8, 13, 24, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telem-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.telem-chart-title {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
}

.telem-chart-tag {
  font-family: monospace;
  font-size: 9px;
  color: #64748b;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 2px;
}

.telem-canvas-wrap {
  width: 100%;
  height: 160px;
  background: #060a12;
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.telem-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Footer & Actions */
.telem-modal-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 11px;
  font-family: monospace;
}

.telem-meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.telem-meta-info code {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 5px;
  border-radius: 2px;
}

.telem-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1100px) {
  body { padding: 0 18px; }
  main { grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
  aside { padding-left: 16px; }
  .metrics > div { padding: 0 12px; }
  .metrics strong { font-size: 30px; }
  .search-command-wrap { max-width: 320px; }
  .brand h1 span { display: none; }
  .legend { gap: 10px; }
}

@media (max-width: 760px) {
  body { height: auto; min-height: 100dvh; overflow: auto; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .metric-sync { grid-column: 1 / -1; }
  main { grid-template-columns: 1fr; }
  .canvas-wrap { height: 480px; flex: none; }
  aside { border-left: none; padding: 20px 0; }
  header { flex-wrap: wrap; padding: 12px 0; }
  .search-command-wrap { order: 3; width: 100%; max-width: none; margin-top: 10px; }
  .live { margin-left: auto; }
  footer { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .tactical-ticker { max-width: 100%; }
}
