/* ============ DTGP Guardian — dark glassmorphism (estética "tera") ============ */

:root {
  --bg: #0B0F0C;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --lime: #D6F252;
  --blue: #8FC7E8;
  --amber: #E8C468;
  --red: #E86868;
  --text: #F2F5F0;
  --muted: rgba(255, 255, 255, 0.55);
  --muted2: rgba(255, 255, 255, 0.35);
  --radius: 22px;
  --font-display: "Bricolage Grotesque", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

/* El atributo hidden debe ganar siempre, incluso sobre display:grid/flex de las clases */
[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 92% 108%, rgba(214, 242, 82, 0.10), transparent 60%),
    radial-gradient(900px 650px at -8% 112%, rgba(120, 180, 90, 0.10), transparent 55%),
    radial-gradient(1000px 600px at 50% -20%, rgba(40, 70, 50, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 56px) 60px;
  -webkit-font-smoothing: antialiased;
}

.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }

/* ============ Topbar ============ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(30px, 5vh, 60px);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: auto;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 11px 22px;
  cursor: pointer;
  transition: color .25s, background .25s;
}

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

.tab.active {
  background: #DDE9EE;
  color: #0B0F0C;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.bell {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(20px);
  transition: background .25s;
}
.bell:hover { background: var(--card-strong); }
.bell svg { width: 19px; height: 19px; }

.bell-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  display: grid; place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
}

.avatar {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #2a3a2e, #16201a);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--lime);
}

/* ============ Cards base ============ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform .3s ease, background .3s ease, border-color .3s ease;
}

.card:hover { background: rgba(255, 255, 255, 0.055); border-color: rgba(255, 255, 255, 0.12); }

.card-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============ Hero ============ */

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.1fr) minmax(360px, 1.15fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-bottom: clamp(50px, 8vh, 90px);
}

.hero-left { display: flex; flex-direction: column; min-height: 560px; }

.hero-left h1 {
  font-size: clamp(38px, 4vw, 56px);
  line-height: 1.04;
  margin-bottom: 18px;
}

.subtitle {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.power-card { margin-top: auto; padding: 20px; max-width: 360px; }

.power-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 16px;
  cursor: pointer;
  color: var(--text);
  transition: background .3s;
}

.toggle-text { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }

.toggle-knob {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--lime);
  color: #0B0F0C;
  box-shadow: 0 0 18px rgba(214, 242, 82, 0.55);
  transition: background .3s, box-shadow .3s;
}
.toggle-knob svg { width: 15px; height: 15px; }

.toggle.off .toggle-knob { background: rgba(255,255,255,0.25); color: var(--text); box-shadow: none; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
}

.seg {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .25s, color .25s;
}

.seg.active {
  background: var(--lime);
  color: #0B0F0C;
  box-shadow: 0 0 24px rgba(214, 242, 82, 0.25);
}

/* --- Gauge central --- */

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.big-number {
  font-size: clamp(56px, 6vw, 84px);
  font-weight: 800;
  margin-bottom: 14px;
}
.big-number .pct { font-size: 0.55em; vertical-align: 0.45em; }

.gauge-area {
  display: flex;
  align-items: stretch;
  gap: 26px;
  height: clamp(380px, 52vh, 480px);
}

.gauge-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0;
}

.scale-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted2);
  font-size: 12.5px;
  font-weight: 500;
}
.scale-mark span { min-width: 42px; text-align: right; }
.scale-mark i { width: 18px; height: 1px; background: rgba(255, 255, 255, 0.18); }

.gauge-capsule {
  position: relative;
  width: clamp(170px, 16vw, 230px);
  border-radius: 999px;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(255,255,255,0.06), transparent 55%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.gauge-fill {
  position: absolute;
  left: 7px; right: 7px; bottom: 7px;
  border-radius: 999px;
  background:
    radial-gradient(80% 55% at 50% 30%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(180deg, #BFE3F7 0%, var(--blue) 40%, #5D93B6 100%);
  filter: blur(1px);
  box-shadow:
    0 0 60px rgba(143, 199, 232, 0.55),
    0 0 140px rgba(143, 199, 232, 0.30);
  transition: height 1.2s cubic-bezier(.22, 1, .36, 1);
  animation: gaugePulse 4s ease-in-out infinite;
  min-height: 26px;
}

@keyframes gaugePulse {
  0%, 100% { box-shadow: 0 0 60px rgba(143, 199, 232, 0.55), 0 0 140px rgba(143, 199, 232, 0.30); }
  50% { box-shadow: 0 0 85px rgba(143, 199, 232, 0.75), 0 0 190px rgba(143, 199, 232, 0.42); }
}

/* --- Columna derecha --- */

.hero-right { display: flex; flex-direction: column; gap: 18px; }

.hero-right-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chips { display: flex; flex-direction: column; gap: 14px; }

.chip {
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  backdrop-filter: blur(20px);
}

.chip-label { font-size: 12.5px; color: rgba(255, 255, 255, 0.75); font-weight: 500; }
.chip-value { font-size: 19px; font-weight: 500; color: rgba(255,255,255,.85); }
.chip-value b { font-family: var(--font-display); font-weight: 700; font-size: 22px; }

.chip-lime { background: linear-gradient(100deg, rgba(214, 242, 82, 0.38), rgba(214, 242, 82, 0.05) 75%); }
.chip-amber { background: linear-gradient(100deg, rgba(232, 196, 104, 0.38), rgba(232, 196, 104, 0.05) 75%); }
.chip-blue { background: linear-gradient(100deg, rgba(143, 199, 232, 0.38), rgba(143, 199, 232, 0.05) 75%); }

.storage-card { padding: 20px; display: flex; flex-direction: column; }

.storage-big { font-size: clamp(34px, 3vw, 44px); font-weight: 800; margin: 12px 0 16px; }

.minibars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 62px;
  margin-top: auto;
}

.minibars .bar {
  flex: 1;
  min-height: 8%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}
.minibars .bar.hot { background: var(--lime); box-shadow: 0 0 12px rgba(214, 242, 82, 0.5); }

.sysstatus-card { padding: 20px 22px; }

.status-rows { margin-top: 14px; display: flex; flex-direction: column; }

.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}
.status-row + .status-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.status-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.status-icon svg { width: 17px; height: 17px; }

.status-name { font-size: 14.5px; color: rgba(255, 255, 255, 0.8); }
.status-val { margin-left: auto; font-weight: 700; font-size: 14.5px; }

/* ============ Sección inferior ============ */

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: clamp(24px, 3.5vw, 56px);
  align-items: start;
}

.section-title {
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.05;
  margin-bottom: 26px;
}

/* Timeline */

.timeline { position: relative; padding-left: 4px; }

.tl-item {
  position: relative;
  padding: 0 0 26px 26px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 4px; top: 18px; bottom: -2px;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.12);
}
.tl-item:last-child::before { display: none; }

.tl-dot {
  position: absolute;
  left: 0; top: 6px;
  width: 9px; height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.tl-item.running .tl-dot { background: var(--lime); box-shadow: 0 0 14px rgba(214, 242, 82, 0.8); }
.tl-item.failed .tl-dot { background: var(--red); box-shadow: 0 0 12px rgba(232, 104, 104, 0.6); }

.tl-name { font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.tl-state { font-size: 13.5px; color: var(--muted); }
.tl-item.running .tl-state { color: var(--lime); }
.tl-item.failed .tl-state { color: var(--red); }

/* Stat cards 2x2 */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.stat-card {
  padding: 22px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label { font-size: 14px; color: rgba(255, 255, 255, 0.8); font-weight: 500; }

.stat-value { font-size: clamp(34px, 3.4vw, 48px); font-weight: 800; }
.stat-value.lime { color: var(--lime); text-shadow: 0 0 30px rgba(214, 242, 82, 0.35); }
.stat-value .unit { font-size: 0.45em; font-weight: 600; color: var(--muted); margin-left: 4px; }

/* AI cards */

.ai-cards { display: flex; flex-direction: column; gap: 12px; }

.ai-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  transition: background .3s, transform .3s;
}
.ai-card:hover { background: var(--card-strong); transform: translateX(4px); }

.ai-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}
.ai-icon svg { width: 16px; height: 16px; }
.ai-icon.ok { color: var(--lime); }
.ai-icon.warn { color: var(--amber); }
.ai-icon.error { color: var(--red); }

/* ============ Vistas: tablas ============ */

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 24px;
  margin-bottom: 28px;
}
.view-head h1 { font-size: clamp(34px, 3.6vw, 48px); }
.view-head .subtitle { flex: 1; min-width: 240px; }

.table-card { padding: 8px 20px; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 760px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 15px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .2s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.th-actions { text-align: right !important; }
.td-actions { text-align: right; }

.svc-name { font-weight: 700; font-size: 15px; }
.svc-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: normal; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill-online { color: var(--lime); background: rgba(214, 242, 82, 0.10); border-color: rgba(214, 242, 82, 0.25); }
.pill-degraded { color: var(--amber); background: rgba(232, 196, 104, 0.10); border-color: rgba(232, 196, 104, 0.25); }
.pill-errored, .pill-stopped { color: var(--red); background: rgba(232, 104, 104, 0.10); border-color: rgba(232, 104, 104, 0.25); }
.pill-unknown { color: var(--muted); background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.pill-ok { color: var(--lime); background: rgba(214, 242, 82, 0.10); border-color: rgba(214, 242, 82, 0.25); }
.pill-failed { color: var(--red); background: rgba(232, 104, 104, 0.10); border-color: rgba(232, 104, 104, 0.25); }
.pill-running { color: var(--blue); background: rgba(143, 199, 232, 0.10); border-color: rgba(143, 199, 232, 0.25); }

.upbar {
  position: relative;
  width: 90px; height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.upbar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(214, 242, 82, 0.5);
}

/* ============ Botones ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background .25s, transform .15s, box-shadow .25s;
  backdrop-filter: blur(20px);
}
.btn:hover { background: var(--card-strong); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; }

.btn-lime {
  background: var(--lime);
  color: #0B0F0C;
  border-color: transparent;
  box-shadow: 0 0 24px rgba(214, 242, 82, 0.25);
}
.btn-lime:hover { background: #e2fa6e; box-shadow: 0 0 34px rgba(214, 242, 82, 0.4); }

.btn-ghost { background: transparent; }

.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: rgba(232, 104, 104, 0.12); }

.btn-block { width: 100%; justify-content: center; }

.row-actions { display: inline-flex; gap: 6px; }

/* ============ Alertas ============ */

.alerts-feed { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }

.alert-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(20px);
}

.alert-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.alert-card.warn .alert-dot { background: var(--amber); box-shadow: 0 0 12px rgba(232, 196, 104, 0.7); }
.alert-card.error .alert-dot { background: var(--red); box-shadow: 0 0 12px rgba(232, 104, 104, 0.7); }
.alert-card.resolved { opacity: 0.45; }
.alert-card.resolved .alert-dot { background: var(--muted); box-shadow: none; }

.alert-msg { font-size: 14.5px; font-weight: 500; }
.alert-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.alert-card .btn { margin-left: auto; flex-shrink: 0; }

.empty-note { color: var(--muted); font-size: 14.5px; padding: 30px 0; text-align: center; }

/* ============ Modales ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 6, 0.7);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.modal {
  width: min(420px, 100%);
  padding: 34px;
  text-align: center;
  background: rgba(20, 26, 21, 0.92);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal:hover { transform: none; }

.modal-wide { width: min(860px, 100%); text-align: left; }

.modal-logo { font-size: 28px; }

.modal h3 { font-size: 24px; }

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

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-error { color: var(--red); font-size: 13px; }

.input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.input:focus { border-color: rgba(214, 242, 82, 0.5); box-shadow: 0 0 0 3px rgba(214, 242, 82, 0.12); }

.logs-pre {
  max-height: 55vh;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
}

/* ============ Toast ============ */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 13px 22px;
  border-radius: 14px;
  background: rgba(20, 26, 21, 0.95);
  border: 1px solid rgba(214, 242, 82, 0.35);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(214, 242, 82, 0.12);
  animation: toastIn .3s ease;
}
.toast.error { border-color: rgba(232, 104, 104, 0.45); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ Sitios ============ */

.site-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
  transition: color .2s, border-color .2s;
}
.site-link:hover { color: var(--lime); border-color: rgba(214, 242, 82, 0.6); }

/* ============ Animaciones de carga ============ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.94) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Splash de arranque --- */

.splash {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: var(--bg);
  animation: splashOut .5s ease 1.05s forwards;
  pointer-events: none;
}
.splash-logo {
  font-size: 46px;
  font-weight: 800;
  animation: splashLogo 1s cubic-bezier(.22, 1, .36, 1) both;
}
.splash-ring {
  position: absolute;
  width: 130px; height: 130px;
  border-radius: 999px;
  border: 1.5px solid rgba(214, 242, 82, 0.4);
  animation: ringGrow 1.3s cubic-bezier(.22, 1, .36, 1) .1s both;
}
@keyframes splashLogo {
  0% { opacity: 0; transform: scale(.9); letter-spacing: .14em; }
  55% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); letter-spacing: -.03em; text-shadow: 0 0 46px rgba(214, 242, 82, 0.35); }
}
@keyframes ringGrow {
  from { opacity: 0; transform: scale(.35); }
  35% { opacity: .9; }
  to { opacity: 0; transform: scale(2.8); }
}
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* --- Entrada de la página (elementos estáticos, una sola vez) --- */

.topbar { animation: fadeDown .6s cubic-bezier(.22, 1, .36, 1) 1.05s both; }
.hero-left h1 { animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) 1.15s both; }
.hero-left > .subtitle { animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) 1.25s both; }
.power-card { animation: popIn .7s cubic-bezier(.22, 1, .36, 1) 1.35s both; }
.big-number { animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) 1.1s both; }
.gauge-capsule { animation: popIn .8s cubic-bezier(.22, 1, .36, 1) 1.15s both; }
.chips .chip:nth-child(1) { animation: fadeUp .6s cubic-bezier(.22, 1, .36, 1) 1.25s both; }
.chips .chip:nth-child(2) { animation: fadeUp .6s cubic-bezier(.22, 1, .36, 1) 1.35s both; }
.chips .chip:nth-child(3) { animation: fadeUp .6s cubic-bezier(.22, 1, .36, 1) 1.45s both; }
.storage-card { animation: popIn .7s cubic-bezier(.22, 1, .36, 1) 1.4s both; }
.sysstatus-card { animation: popIn .7s cubic-bezier(.22, 1, .36, 1) 1.5s both; }
.section-title { animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) 1.55s both; }
.stats-grid .stat-card:nth-child(1) { animation: popIn .6s cubic-bezier(.22, 1, .36, 1) 1.55s both; }
.stats-grid .stat-card:nth-child(2) { animation: popIn .6s cubic-bezier(.22, 1, .36, 1) 1.63s both; }
.stats-grid .stat-card:nth-child(3) { animation: popIn .6s cubic-bezier(.22, 1, .36, 1) 1.71s both; }
.stats-grid .stat-card:nth-child(4) { animation: popIn .6s cubic-bezier(.22, 1, .36, 1) 1.79s both; }

/* Escala del gauge: cascada de abajo hacia arriba, como si se llenara */
.gauge-scale .scale-mark { animation: fadeUp .4s ease both; }
.gauge-scale .scale-mark:nth-child(11) { animation-delay: 1.20s }
.gauge-scale .scale-mark:nth-child(10) { animation-delay: 1.26s }
.gauge-scale .scale-mark:nth-child(9)  { animation-delay: 1.32s }
.gauge-scale .scale-mark:nth-child(8)  { animation-delay: 1.38s }
.gauge-scale .scale-mark:nth-child(7)  { animation-delay: 1.44s }
.gauge-scale .scale-mark:nth-child(6)  { animation-delay: 1.50s }
.gauge-scale .scale-mark:nth-child(5)  { animation-delay: 1.56s }
.gauge-scale .scale-mark:nth-child(4)  { animation-delay: 1.62s }
.gauge-scale .scale-mark:nth-child(3)  { animation-delay: 1.68s }
.gauge-scale .scale-mark:nth-child(2)  { animation-delay: 1.74s }
.gauge-scale .scale-mark:nth-child(1)  { animation-delay: 1.80s }

/* --- Contenido dinámico: solo anima en la primera carga (antes de .booted) --- */

body:not(.booted) .status-row { animation: fadeUp .5s cubic-bezier(.22, 1, .36, 1) both; }
body:not(.booted) .status-row:nth-child(1) { animation-delay: 1.55s }
body:not(.booted) .status-row:nth-child(2) { animation-delay: 1.62s }
body:not(.booted) .status-row:nth-child(3) { animation-delay: 1.69s }
body:not(.booted) .status-row:nth-child(4) { animation-delay: 1.76s }
body:not(.booted) .status-row:nth-child(5) { animation-delay: 1.83s }

body:not(.booted) .tl-item { animation: fadeUp .5s cubic-bezier(.22, 1, .36, 1) both; }
body:not(.booted) .tl-item:nth-child(1) { animation-delay: 1.60s }
body:not(.booted) .tl-item:nth-child(2) { animation-delay: 1.68s }
body:not(.booted) .tl-item:nth-child(3) { animation-delay: 1.76s }
body:not(.booted) .tl-item:nth-child(4) { animation-delay: 1.84s }
body:not(.booted) .tl-item:nth-child(5) { animation-delay: 1.92s }
body:not(.booted) .tl-item:nth-child(6) { animation-delay: 2.00s }

body:not(.booted) .ai-card { animation: fadeUp .5s cubic-bezier(.22, 1, .36, 1) both; }
body:not(.booted) .ai-card:nth-child(1) { animation-delay: 1.65s }
body:not(.booted) .ai-card:nth-child(2) { animation-delay: 1.73s }
body:not(.booted) .ai-card:nth-child(3) { animation-delay: 1.81s }
body:not(.booted) .ai-card:nth-child(4) { animation-delay: 1.89s }
body:not(.booted) .ai-card:nth-child(5) { animation-delay: 1.97s }
body:not(.booted) .ai-card:nth-child(6) { animation-delay: 2.05s }

@keyframes barIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
body:not(.booted) .minibars .bar {
  transform-origin: bottom;
  animation: barIn .5s cubic-bezier(.22, 1, .36, 1) both;
}
body:not(.booted) .minibars .bar:nth-child(2)  { animation-delay: 1.54s }
body:not(.booted) .minibars .bar:nth-child(1)  { animation-delay: 1.50s }
body:not(.booted) .minibars .bar:nth-child(3)  { animation-delay: 1.58s }
body:not(.booted) .minibars .bar:nth-child(4)  { animation-delay: 1.62s }
body:not(.booted) .minibars .bar:nth-child(5)  { animation-delay: 1.66s }
body:not(.booted) .minibars .bar:nth-child(6)  { animation-delay: 1.70s }
body:not(.booted) .minibars .bar:nth-child(7)  { animation-delay: 1.74s }
body:not(.booted) .minibars .bar:nth-child(8)  { animation-delay: 1.78s }
body:not(.booted) .minibars .bar:nth-child(9)  { animation-delay: 1.82s }
body:not(.booted) .minibars .bar:nth-child(10) { animation-delay: 1.86s }
body:not(.booted) .minibars .bar:nth-child(11) { animation-delay: 1.90s }
body:not(.booted) .minibars .bar:nth-child(12) { animation-delay: 1.94s }
body:not(.booted) .minibars .bar:nth-child(13) { animation-delay: 1.98s }
body:not(.booted) .minibars .bar:nth-child(14) { animation-delay: 2.02s }

/* --- Cambio de pestaña: filas en cascada --- */

.view.fresh .data-table tbody tr,
.view.fresh .alert-card {
  animation: fadeUp .45s cubic-bezier(.22, 1, .36, 1) both;
}
.view.fresh .data-table tbody tr:nth-child(1),  .view.fresh .alert-card:nth-child(1)  { animation-delay: .03s }
.view.fresh .data-table tbody tr:nth-child(2),  .view.fresh .alert-card:nth-child(2)  { animation-delay: .07s }
.view.fresh .data-table tbody tr:nth-child(3),  .view.fresh .alert-card:nth-child(3)  { animation-delay: .11s }
.view.fresh .data-table tbody tr:nth-child(4),  .view.fresh .alert-card:nth-child(4)  { animation-delay: .15s }
.view.fresh .data-table tbody tr:nth-child(5),  .view.fresh .alert-card:nth-child(5)  { animation-delay: .19s }
.view.fresh .data-table tbody tr:nth-child(6),  .view.fresh .alert-card:nth-child(6)  { animation-delay: .23s }
.view.fresh .data-table tbody tr:nth-child(7),  .view.fresh .alert-card:nth-child(7)  { animation-delay: .27s }
.view.fresh .data-table tbody tr:nth-child(8),  .view.fresh .alert-card:nth-child(8)  { animation-delay: .31s }
.view.fresh .data-table tbody tr:nth-child(9),  .view.fresh .alert-card:nth-child(9)  { animation-delay: .35s }
.view.fresh .data-table tbody tr:nth-child(10), .view.fresh .alert-card:nth-child(10) { animation-delay: .39s }
.view.fresh .data-table tbody tr:nth-child(11), .view.fresh .alert-card:nth-child(11) { animation-delay: .43s }
.view.fresh .data-table tbody tr:nth-child(12), .view.fresh .alert-card:nth-child(12) { animation-delay: .47s }
.view.fresh .data-table tbody tr:nth-child(13), .view.fresh .alert-card:nth-child(13) { animation-delay: .51s }
.view.fresh .data-table tbody tr:nth-child(14), .view.fresh .alert-card:nth-child(14) { animation-delay: .55s }
.view.fresh .view-head { animation: fadeUp .5s cubic-bezier(.22, 1, .36, 1) both; }

/* --- Burbujas dentro del gauge (puro gusto) --- */

.gauge-fill::before,
.gauge-fill::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(6px);
}
.gauge-fill::before {
  width: 24px; height: 24px;
  left: 24%; bottom: 6%;
  animation: bubble 7s ease-in-out 2s infinite;
}
.gauge-fill::after {
  width: 13px; height: 13px;
  left: 64%; bottom: 3%;
  animation: bubble 5.4s ease-in-out 3.4s infinite;
}
@keyframes bubble {
  0% { transform: translateY(0) scale(.9); opacity: 0; }
  12% { opacity: .65; }
  85% { opacity: .25; }
  100% { transform: translateY(-240px) scale(1.3); opacity: 0; }
}

/* Accesibilidad: respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============ Responsive ============ */

@media (max-width: 1200px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-right { grid-column: 1 / -1; }
  .hero-left { min-height: unset; gap: 26px; }
  .bottom-grid { grid-template-columns: 1fr 1fr; }
  .bottom-grid > .bottom-col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  body { padding: 18px 16px 50px; }
  .topbar { flex-wrap: wrap; justify-content: center; }
  .tabs { order: 3; width: 100%; justify-content: center; overflow-x: auto; }
  .tab { padding: 10px 14px; font-size: 11.5px; }
  .hero { grid-template-columns: 1fr; }
  .hero-center { order: -1; }
  .gauge-area { height: 340px; }
  .hero-right-top { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 130px; }
}
