/* ============================================================
   ULTRON // HOMELAB GRID — estética cyberpunk / synthwave
   ============================================================ */

:root {
  --bg0: #0b0b0d;
  --bg1: #141417;
  --panel: rgba(26, 26, 30, 0.28);
  --panel-solid: #17171b;
  --line: rgba(200, 208, 216, 0.14);
  --cyan: #ff5a1f;       /* acento naranja-rojo (Ultron) */
  --magenta: #c8d0d8;    /* plata */
  --violet: #9aa3ad;     /* gris */
  --green: #2ee6a8;
  --amber: #ffb020;
  --red: #ff3b30;
  --text: #e8eaed;
  --muted: #8a9099;
  --glow-cyan: 0 0 18px rgba(255, 90, 31, 0.35);
  --glow-magenta: 0 0 18px rgba(200, 208, 216, 0.3);
  --radius: 14px;
  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg0);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.02em;
}

/* ---------- Fondos animados ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(200, 208, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 208, 216, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: grid-pan 30s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 40%, transparent 100%);
}
@keyframes grid-pan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 44px, 44px 0; }
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(255, 105, 45, 0.18), transparent 55%),
    radial-gradient(1000px 700px at 100% 0%, rgba(220, 50, 25, 0.13), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(140, 25, 15, 0.16), transparent 60%),
    linear-gradient(rgba(11, 11, 13, 0) 60%, rgba(11, 11, 13, 0.92) 100%);
}

#bg-jarvis {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  opacity: 0.28;
  mix-blend-mode: overlay;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

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

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

.logo {
  font-size: 30px;
  line-height: 1;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  animation: spin-slow 14s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.18em;
  margin-right: -0.18em;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 90, 31, 0.6);
}
.subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.7;
}
.glitch::before { color: var(--cyan); animation: glitch-a 3s infinite steps(1); }
.glitch::after { color: var(--magenta); animation: glitch-b 3s infinite steps(1); }
@keyframes glitch-a {
  0%, 92%, 100% { transform: none; opacity: 0; }
  93% { transform: translate(-2px, 1px); opacity: 0.7; }
  95% { transform: translate(2px, -1px); opacity: 0.7; }
}
@keyframes glitch-b {
  0%, 92%, 100% { transform: none; opacity: 0; }
  94% { transform: translate(2px, 1px); opacity: 0.7; }
  96% { transform: translate(-2px, -1px); opacity: 0.7; }
}

.clock {
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.clock-time {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: var(--glow-cyan);
  font-variant-numeric: tabular-nums;
}
.clock-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.top-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--green);
}
.logout-btn {
  margin-left: 8px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 59, 92, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.3);
}
.theme-btn {
  margin-left: 8px;
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.theme-btn:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.dot-pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.55); opacity: 0.5; }
}

/* ---------- Layout (Gridstack) ---------- */
.grid-stack {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 24px 8px;
}

.grid-stack.hidden-cards .grid-stack-item {
  display: none !important;
}

/* Reveal cibernético de las tarjetas */
.grid-stack-item {
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}
#noise {
  position: fixed;
  inset: 0;
  z-index: 1002;
  pointer-events: none;
}

.grid-stack-item.cyber-in {
  animation: cyberIn 0.6s ease-out;
}
@keyframes cyberIn {
  0% { opacity: 0; clip-path: inset(0 0 100% 0); filter: brightness(2.4) saturate(0.6); }
  35% { opacity: 1; clip-path: inset(0 0 55% 0); filter: brightness(1.5); }
  55% { opacity: 0.5; clip-path: inset(0 0 30% 0); }
  75% { opacity: 1; clip-path: inset(0 0 8% 0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); filter: brightness(1); }
}
.grid-stack-item.cyber-out {
  animation: cyberOut 0.45s ease-in forwards;
}
@keyframes cyberOut {
  0% { opacity: 1; clip-path: inset(0 0 0 0); filter: brightness(1); }
  100% { opacity: 0; clip-path: inset(100% 0 0 0); filter: brightness(2.4); }
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(3px);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,90,31,0.35), transparent 35%, transparent 70%, rgba(255,47,179,0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}
.card:hover::before { opacity: 0.9; }

/* Gridstack: tarjetas rellenan la celda y listas con scroll */
.grid-stack-item-content.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.grid-stack-item-content.card .card-head {
  flex-shrink: 0;
}
.grid-stack-item-content.card .stat-body,
.grid-stack-item-content.card .core-bars {
  flex-shrink: 0;
}
.containers-grid,
.services-list,
.tailscale-peers,
.attacks-list,
.disk-list,
.info-list,
.iface-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
/* Tirador de resize (siempre visible) y placeholder */
.grid-stack-item > .ui-resizable-se {
  display: block !important;
  opacity: 0.7;
}
.grid-stack-item:hover > .ui-resizable-se {
  opacity: 1;
}
.grid-stack-item.ui-draggable-dragging,
.grid-stack-item.ui-resizable-resizing {
  opacity: 0.85;
}
.grid-stack-placeholder > .placeholder-content {
  border: 2px dashed var(--cyan);
  background: rgba(255, 90, 31, 0.08);
  border-radius: var(--radius);
}
body.light .grid-stack-placeholder > .placeholder-content {
  background: rgba(10, 77, 255, 0.15);
}

/* ---------- Cabecera de tarjeta ---------- */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  cursor: grab;
  user-select: none;
}
.card-head:active { cursor: grabbing; }
.card-head h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 90, 31, 0.4);
}
.card-tag {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mono { font-family: var(--font-mono); }

/* ---------- Stat body / gauges ---------- */
.stat-body { display: flex; align-items: center; gap: 16px; }

.gauge-wrap { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.gauge { width: 120px; height: 120px; transform: rotate(-90deg); }
.gauge circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.gauge-bg { stroke: rgba(255, 255, 255, 0.07); }
.gauge-fg { transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.gauge-cyan { stroke: var(--cyan); filter: drop-shadow(0 0 6px rgba(255, 90, 31, 0.7)); }
.gauge-violet { stroke: var(--violet); filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7)); }

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 40px;
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
}
.gauge-center span { font-size: 30px; font-variant-numeric: tabular-nums; }
.gauge-center small { font-size: 13px; color: var(--muted); margin-left: 1px; }

.side-metrics { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.metric { display: flex; flex-direction: column; }
.metric .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.metric .value { font-size: 15px; color: var(--text); }

/* ---------- Barras de núcleos ---------- */
.core-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.core-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.core-bar .track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.core-bar .fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 8px rgba(255, 90, 31, 0.5);
  transition: width 0.6s ease;
}
.core-bar .num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
}

/* ---------- Discos ---------- */
.disk-list { display: flex; flex-direction: column; gap: 16px; }
.disk-item { display: flex; flex-direction: column; gap: 5px; }
.disk-item .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 11px;
}
.disk-item .mount { color: var(--text); letter-spacing: 0.06em; }
.disk-item .size { color: var(--muted); }
.disk-bar {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.disk-bar .fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 8px rgba(0, 255, 157, 0.5);
  transition: width 0.6s ease;
}
.disk-bar .fill.warn { background: linear-gradient(90deg, var(--amber), var(--red)); box-shadow: 0 0 8px rgba(255, 59, 92, 0.5); }
.disk-item .pct { font-family: var(--font-mono); font-size: 11px; color: var(--green); }

/* ---------- Info list ---------- */
.info-list { display: flex; flex-direction: column; gap: 13px; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-row .value { font-size: 14px; text-align: right; }

/* ---------- Gráficas ---------- */
.chart { width: 100%; flex: 1 1 auto; min-height: 120px; display: block; }

.net-legend { display: flex; gap: 10px; }
.legend {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.legend.rx { color: #2ee6a8; }
.legend.tx { color: #ff5a1f; }
.legend:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }
.legend.dimmed { opacity: 0.35; }

.net-now {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.net-now .value.rx { color: #2ee6a8; }
.net-now .value.tx { color: #ff5a1f; }

.iface-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 150px;
  overflow-y: auto;
}
.iface-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.iface-row .name { color: var(--cyan); }
.iface-row .v { color: var(--muted); }

/* ---------- Contenedores ---------- */
.containers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.container {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.container:hover { border-color: rgba(255, 90, 31, 0.35); box-shadow: 0 0 16px rgba(255, 90, 31, 0.12); }
.container .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.container .name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.container .state {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}
.state.up { color: var(--green); background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.3); }
.state.down { color: var(--red); background: rgba(255, 59, 92, 0.1); border: 1px solid rgba(255, 59, 92, 0.3); }
.container .image {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.container .stats { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.container .stats b { color: var(--cyan); font-weight: 400; }
.container .ports { font-family: var(--font-mono); font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container .bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.container .bar .fill { height: 100%; width: 0%; background: var(--cyan); transition: width 0.6s ease; }

/* ---------- Servicios ---------- */
.services-list { display: flex; flex-direction: column; gap: 8px; }
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.service-row .name { font-family: var(--font-body); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; }
.service-row .st {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}
.st.on { color: var(--green); background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.3); }
.st.off { color: var(--red); background: rgba(255, 59, 92, 0.1); border: 1px solid rgba(255, 59, 92, 0.3); }

/* ---------- Tailscale ---------- */
.tailscale-peers { display: flex; flex-direction: column; gap: 8px; }
.peer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.peer-row .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.peer-row .pdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.peer-row .pdot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.peer-row .pdot.off { background: #3a4055; }
.peer-row .host { font-weight: 600; font-size: 14px; letter-spacing: 0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-row .ip { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.peer-row .os { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; }

/* ---------- Clima ---------- */
.weather-body { display: flex; flex-direction: column; gap: 10px; }
.weather-main { display: flex; align-items: center; gap: 14px; }
.weather-icon { font-size: 44px; line-height: 1; }
.weather-temp { font-family: var(--font-head); font-weight: 700; font-size: 40px; color: #fff; text-shadow: var(--glow-magenta); }
.weather-temp small { font-size: 18px; color: var(--muted); }
.weather-desc { font-family: var(--font-body); font-size: 15px; color: var(--text); text-transform: capitalize; }
.weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.weather-muted { color: var(--muted); text-align: center; padding: 20px 0; }

/* ---------- Ataques detectados ---------- */
.attacks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.attack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--red);
  flex-wrap: wrap;
}
.attack-row .a-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.attack-row .a-ip { font-family: var(--font-mono); font-size: 14px; color: var(--red); font-weight: 600; letter-spacing: 0.04em; }
.attack-row .a-type { font-size: 14px; font-weight: 600; color: var(--text); }
.attack-row .a-geo { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.attack-row .a-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.attack-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.attack-badge.ban { color: var(--red); background: rgba(255, 59, 92, 0.1); border: 1px solid rgba(255, 59, 92, 0.3); }
.attack-badge.alert { color: var(--amber); background: rgba(255, 176, 32, 0.1); border: 1px solid rgba(255, 176, 32, 0.3); }

/* Estado de escaneo (sin ataques) */
.attacks-scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 0;
}
.attacks-scan .scan-text {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--muted);
  animation: pulse-text 1.6s ease-in-out infinite;
}
.attacks-scan .scan-track {
  width: 100%;
  max-width: 340px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.attacks-scan .scan-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scan-move 1.8s linear infinite;
}
@keyframes scan-move {
  0% { left: -40%; }
  100% { left: 100%; }
}
@keyframes pulse-text {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px 24px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.dot-sep { color: var(--cyan); }

/* ---------- Utilidades ---------- */
.gauge-center .ok { color: var(--green); }
.gauge-center .warn { color: var(--amber); }
.gauge-center .danger { color: var(--red); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,90,31,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,90,31,0.45); }

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrap { width: 100%; max-width: 400px; padding: 24px; position: relative; z-index: 1; }
.login-card { padding: 32px 30px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo { font-size: 40px; margin-bottom: 10px; }
.login-brand .title { font-size: 26px; }
.login-brand .subtitle { display: block; margin-top: 6px; }

.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(200, 208, 216, 0.2);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12), var(--glow-cyan);
}

.login-error {
  min-height: 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--red);
  text-align: center;
  margin-bottom: 6px;
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: #1a1a1e;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ff5a1f, #ff3b30);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.login-btn:hover {
  box-shadow: var(--glow-cyan);
  filter: brightness(1.08);
}
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Responsive (móvil / tablet) ---------- */
@media (max-width: 1024px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .grid-stack { padding: 14px 14px 8px; }
}
@media (max-width: 640px) {
  .title { font-size: 18px; }
  .logo { font-size: 24px; }
  .clock-time { font-size: 20px; }
  .clock-date { font-size: 9px; }
  .top-status { flex-wrap: wrap; }
  .grid-stack { padding: 10px 10px 6px; }
}

/* ---------- Modo claro ---------- */
body.light {
  --bg0: #eef0f4;
  --bg1: #e6e9ee;
  --panel: rgba(255, 255, 255, 0.4);
  --panel-solid: #ffffff;
  --line: rgba(30, 64, 120, 0.16);
  --text: #191c22;
  --muted: #5b6472;
  --green: #0f9d6b;
  --red: #d42b2b;
  --amber: #c07a0a;
  --cyan: #0a4dff;
  --glow-cyan: 0 0 18px rgba(10, 77, 255, 0.6);
  --glow-magenta: 0 0 14px rgba(150, 160, 175, 0.25);
}
body.light .topbar {
  background: rgba(255, 255, 255, 0.55);
}
body.light .title,
body.light .clock-time,
body.light .gauge-center,
body.light .gauge-center span,
body.light .container .name,
body.light .weather-temp {
  color: #191c22;
}
body.light .gauge-bg {
  stroke: rgba(0, 0, 0, 0.08);
}
body.light .core-bar .track,
body.light .disk-bar,
body.light .container .bar,
body.light .scan-track {
  background: rgba(0, 0, 0, 0.08);
}
body.light .card::before {
  background: linear-gradient(135deg, rgba(10, 77, 255, 0.55), transparent 35%, transparent 70%, rgba(10, 77, 255, 0.35));
}
body.light .login-btn {
  background: linear-gradient(90deg, #0a4dff, #0040d9);
}
body.light .bg-glow {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(20, 90, 255, 0.18), transparent 55%),
    radial-gradient(1000px 700px at 100% 0%, rgba(10, 70, 220, 0.13), transparent 55%),
    linear-gradient(rgba(238, 240, 244, 0) 60%, rgba(238, 240, 244, 0.9) 100%);
}
body.light .bg-grid {
  background-image:
    linear-gradient(rgba(20, 24, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 32, 0.05) 1px, transparent 1px);
}
body.light #bg-jarvis {
  opacity: 0.5;
}
body.light .scanlines {
  opacity: 0.12;
}
