/* ============================================================
   Status Page — Phantom Server design system
   Tema claro, Inter, navy/azul/cian (inspirado en phantomserver.net)
   ============================================================ */
:root {
  --bg: #f8fafc;
  --bg-soft: #eff6ff;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --navy: #0c2340;
  --navy-light: #1a3a5c;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --cyan: #0891b2;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.08);
  --accent-border: rgba(59, 130, 246, 0.16);
  --glow: rgba(59, 130, 246, 0.18);
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: rgba(37, 99, 235, 0.1);
  --border-strong: rgba(37, 99, 235, 0.18);
  --card-border: #dfe6ec;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 8px 32px rgba(59, 130, 246, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

.container { width: min(100% - 2rem, var(--max-width)); margin-inline: auto; }

/* ─── Logo / brand ─── */
.logo { display: inline-flex; align-items: center; gap: 0.7rem; flex-shrink: 0; color: inherit; }
.logo:hover { text-decoration: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-size: 1.05rem; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.logo-text small {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.logo__full { height: 40px; width: auto; max-width: 220px; object-fit: contain; }
.logo__full--lg { height: 52px; max-width: 280px; }

/* ─── Top bar navy (estilo phantom) ─── */
.topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 1rem; }
.topbar a { color: rgba(255, 255, 255, 0.85); }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar .spread { display: flex; align-items: center; gap: 1.25rem; }

.status-dot { display: inline-flex; align-items: center; gap: 0.4rem; color: #86efac; font-weight: 600; }
.status-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: blink 2.5s ease infinite;
}
.status-dot--red { color: #fca5a5; }
.status-dot--red::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ─── Header main ─── */
.site-header {
  position: sticky; top: 0; z-index: 200; background: #fff;
  border-bottom: 1px solid var(--card-border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 74px; }
.site-header__actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer; transition: all 0.25s; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 4px 20px var(--glow); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 28px var(--glow); text-decoration: none; }
.btn--ghost { background: #fff; color: var(--text-muted); border: 1px solid var(--border-strong); }
.btn--ghost:hover { color: var(--accent); border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.04); text-decoration: none; }
.btn--lg { padding: 0.85rem 1.6rem; font-size: 0.95rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

/* ─── Badges / pills ─── */
.badge {
  display: inline-block; padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid transparent;
}
.badge-up { color: #15803d; background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.2); }
.badge-down { color: #b91c1c; background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.2); }
.badge-warn { color: #b45309; background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.2); }
.badge-error { color: var(--text-dim); background: rgba(100,116,139,.12); border-color: rgba(100,116,139,.2); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-up { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-down { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-error { background: var(--text-dim); }

/* ─── Hero (public status) ─── */
.hero { padding: 3rem 0 2.5rem; position: relative; background: #fff; }
.hero__label {
  display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 1rem;
}
.hero__label::before { content: ''; width: 1.5rem; height: 2px; background: var(--accent); }
.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; line-height: 1.18;
  letter-spacing: -0.02em; color: var(--navy); margin: 0 0 0.9rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { font-size: 1.05rem; color: var(--text-muted); max-width: 560px; margin-bottom: 1.75rem; }

.hero__metrics { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; padding-top: 0.25rem; }
.hero__metric strong { display: block; font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.hero__metric span { font-size: 0.78rem; color: var(--text-dim); }

/* Panel de estado (estilo "Infraestructura operativa") */
.hero-panel {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem; box-shadow: var(--shadow);
}
.hero-panel__title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--card-border);
}
.hero-panel__list { display: flex; flex-direction: column; }
.hero-panel__row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--card-border);
}
.hero-panel__row:last-child { border-bottom: none; padding-bottom: 0; }
.hero-panel__row:first-child { padding-top: 0; }
.hero-panel__icon {
  width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent);
  background: var(--accent-soft); border-radius: 10px; flex-shrink: 0;
}
.hero-panel__label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.hero-panel__meta { font-size: 0.74rem; color: var(--text-dim); display: block; margin-top: 1px; }
.hero-panel__value { font-size: 0.78rem; font-weight: 700; white-space: nowrap; text-align: right; }
.hero-panel__value--ok { color: var(--green); }
.hero-panel__value--down { color: var(--red); }
.hero-panel__value--info { color: var(--accent); }

.hero__layout { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 2.5rem; align-items: center; }
@media (max-width: 900px) { .hero__layout { grid-template-columns: 1fr; } }

/* ─── Stats strip navy ─── */
.stats-strip { background: var(--navy); padding: 1.75rem 0; }
.stats-strip__inner { display: flex; overflow-x: auto; }
.stats-strip__item { flex: 1; min-width: 140px; padding: 0 1.5rem; text-align: center; border-right: 1px solid rgba(255,255,255,.12); }
.stats-strip__item:first-child { padding-left: 0; }
.stats-strip__item:last-child { border-right: none; padding-right: 0; }
.stats-strip__value { font-size: 1.35rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1.3; }
.stats-strip__label { font-size: 0.78rem; color: rgba(255,255,255,.65); margin-top: 0.3rem; }

/* ─── Sections / groups ─── */
.section { padding: 3.5rem 0; }
.section--raised { background: var(--section-bg, #f5f7f9); border-block: 1px solid var(--card-border); }
.section__num { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.5rem; }
.group h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em;
  color: var(--navy); margin: 0 0 1.25rem;
}
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.group-head h2 { margin: 0; }

/* ─── Cards grid ─── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.card {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); transition: border-color .25s, box-shadow .25s, transform .25s;
}
.card:hover { border-color: rgba(59,130,246,.32); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.card-name { font-weight: 600; flex: 1; color: var(--navy); }
.card-desc { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.6rem; }
.card-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; margin-top: 0.5rem; }
.stat-label { display: block; color: var(--text-dim); font-size: 0.66rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-val { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.card-spark { margin-top: 0.7rem; color: var(--blue); }
.card-spark svg { display: block; }
.card-foot { color: var(--text-dim); font-size: 0.72rem; margin-top: 0.6rem; }
.card-foot a { color: var(--accent); font-weight: 600; }

/* ─── Admin / panels ─── */
.admin-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.admin-nav a { color: var(--text-muted); padding: 0.5rem 0.85rem; border-radius: 8px; font-weight: 600; font-size: 0.85rem; }
.admin-nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }

.panel { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.panel h1 { margin: 0 0 0.3rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.panel h3 { color: var(--navy); }
.panel .sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.1rem; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.tbl th, table.tbl td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl th { color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.tbl tr:hover td { background: var(--bg); }
table.tbl code { font-size: 0.78rem; }

input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; background: #fff; color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0.55rem 0.7rem; font-size: 0.875rem; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem 1.1rem; }
.form-item label { display: block; font-size: 0.68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 0.3rem; font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.check-row input { width: auto; }

.msg { padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.85rem; }
.msg-ok { background: rgba(22,163,74,.1); color: #15803d; }
.msg-err { background: rgba(220,38,38,.1); color: #b91c1c; }

pre.code { background: #f8fafc; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0.9rem 1rem; overflow: auto; font-size: 0.78rem; line-height: 1.7; max-height: 420px; }

.login-wrap { max-width: 400px; margin: 10vh auto; }
.login-wrap .panel { padding: 2rem 2.25rem; border-top: 3px solid var(--accent); position: relative; overflow: hidden; }
.login-wrap h1 { text-align: center; margin-bottom: 1.2rem; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.stat-cards .sc { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow); }
.sc-num { font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.sc-label { color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; }

.empty { color: var(--text-dim); }

.foot { border-top: 1px solid var(--card-border); background: #fff; color: var(--text-dim); font-size: 0.8rem; padding: 1.4rem 0; margin-top: 3rem; }
.foot .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ─── Period pills ─── */
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 1.4rem; }
.pill {
  display: inline-block; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); background: #fff; border: 1px solid var(--border-strong); cursor: pointer;
  transition: all .2s;
}
.pill:hover { text-decoration: none; color: var(--accent); border-color: rgba(59,130,246,.35); }
.pill.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 14px var(--glow); }

/* ─── Charts ─── */
.lchart { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius); margin-top: 0.5rem; box-shadow: var(--shadow); }
.leg { display: inline-block; margin: 0.5rem 1rem 0 0; font-size: 0.75rem; color: var(--text-dim); }
.leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart-card { margin-bottom: 1.3rem; }
.chart-card h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin: 0 0 0.3rem; }

/* ─── Pct bars ─── */
.pctbar { height: 9px; border-radius: 999px; background: #eef2f7; overflow: hidden; margin-top: 0.4rem; }
.pctfill { height: 100%; border-radius: 999px; transition: width .4s; background: var(--blue); }

/* ─── Metric tiles ─── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin: 0.9rem 0 1.3rem; }
.metric { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.8rem 1rem; box-shadow: var(--shadow); }
.metric .m-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 700; }
.metric .m-val { font-size: 1.2rem; font-weight: 700; margin-top: 0.15rem; color: var(--navy); }
.metric .m-sub { font-size: 0.72rem; color: var(--text-dim); }

/* ─── Language switch ─── */
.lang-switch { display: flex; gap: 0.2rem; }
.lang-switch a {
  padding: 0.12rem 0.5rem; border-radius: 6px; font-weight: 700; font-size: 0.7rem;
  color: rgba(255,255,255,.7); transition: all .2s;
}
.lang-switch a:hover, .lang-switch a.active { color: #fff; background: rgba(255,255,255,.14); text-decoration: none; }
.lang-switch--light a { color: var(--text-dim); }
.lang-switch--light a:hover, .lang-switch--light a.active { color: var(--accent); background: var(--accent-soft); }

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .admin-nav { gap: 0; }
  .site-header .container { height: auto; padding: 0.75rem 1rem; flex-wrap: wrap; }
}