/* ─────────────────────────────────────────────────────────────────────
   Portal Hadeon ERP — hoja única.

   Paleta: la Material 3 de la landing original (tailwind.config) y, en
   oscuro, la del CSS propio del sitio. El modo oscuro lo marca la clase
   `dark` en <html>, como en el original; `tema.js` la pone antes de pintar.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --primary: #00327d;
  --primary-hover: rgba(0, 50, 125, 0.9);
  --primary-container: #0047ab;
  --on-primary: #ffffff;
  --accent-text: #00327d;
  --surface: #faf8ff;
  --surface-low: #f3f3fc;
  --surface-container: #ededf6;
  --surface-high: #e7e7f0;
  --surface-highest: #e2e2eb;
  --surface-card: rgba(255, 255, 255, 0.7);
  --on-surface: #191b22;
  --on-surface-variant: #434653;
  --muted: #737784;
  --placeholder: #8d909e;
  --outline: #c3c6d5;
  --outline-soft: rgba(195, 198, 213, 0.5);
  --secondary-container: #cde1fc;
  --on-secondary-container: #51647b;
  --primary-fixed: #dae2ff;
  --inverse-primary: #b1c5ff;
  --focus: #00327d;
  --error: #ba1a1a;
  --error-bg: #ffdad6;
  --error-text: #93000a;
  --ok: #1a7f4b;
  --ok-bg: #d6f5e3;
  --warn: #8a5a00;
  --warn-bg: #ffefc7;
  --header-bg: rgba(250, 248, 255, 0.8);
  --shadow-card: 0 8px 32px rgba(0, 50, 125, 0.04);
  --shadow-btn: 0 4px 12px rgba(0, 50, 125, 0.2);
  --shadow-btn-hover: 0 6px 16px rgba(0, 50, 125, 0.3);
  --radius: 8px;
  --radius-card: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Hanken Grotesk", "Inter", system-ui, sans-serif;
}

html.dark {
  --primary: #0047ab;
  --primary-hover: #2559bd;
  --primary-container: #2559bd;
  --accent-text: #b1c5ff;
  --surface: #131318;
  --surface-low: #1b1b20;
  --surface-container: #1f1f25;
  --surface-high: #2a292f;
  --surface-highest: #35343a;
  --surface-card: rgba(31, 31, 37, 0.7);
  --on-surface: #e4e1e9;
  --on-surface-variant: #c3c6d5;
  --muted: #8d909e;
  --placeholder: #8d909e;
  --outline: rgba(67, 70, 83, 0.6);
  --outline-soft: rgba(255, 255, 255, 0.1);
  --secondary-container: #35485e;
  --on-secondary-container: #d0e4ff;
  --primary-fixed: #1f2b4a;
  --focus: #2559bd;
  --error: #ffb4ab;
  --error-bg: #3a1513;
  --error-text: #ffdad6;
  --ok: #7ddba3;
  --ok-bg: #12301f;
  --warn: #ffd27a;
  --warn-bg: #33270b;
  --header-bg: rgba(31, 31, 37, 0.9);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-btn-hover: 0 6px 16px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

/* `hidden` tiene que ganar siempre. Sin esto, una regla como
   `.form { display: grid }` lo anula y lo "oculto" se sigue viendo: pasó en
   el panel, donde el formulario no desaparecía tras crear la instancia y el
   segundo clic chocaba con la propia instancia recién creada. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-surface);
  background: var(--surface);
}

img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Iconos: Material Symbols Outlined, como el original. */
.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; user-select: none;
}

/* ── Cabecera ───────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-soft);
}
.header__inner {
  max-width: 1200px; margin: 0 auto; min-height: 72px;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent-text); font-weight: 600; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand span { white-space: nowrap; }
.header__actions { display: flex; align-items: center; gap: 12px; }

/* Conmutador Claro / Oscuro */
.theme-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface-container); border: 1px solid var(--outline-soft);
}
.theme-switch button {
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 13px var(--font); color: var(--on-surface-variant);
  background: transparent; border: 0; border-radius: 999px; padding: 6px 10px; cursor: pointer;
}
.theme-switch .ms { font-size: 16px; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
html.dark .theme-switch button[aria-pressed="true"] { background: var(--surface-highest); }

/* ── Botones ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--font); border-radius: 999px; padding: 11px 24px;
  border: 1px solid transparent; cursor: pointer; transition: all .3s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-btn-hover); transform: scale(.98); }
.btn-outline { background: transparent; color: var(--accent-text); border-color: var(--on-surface-variant); }
.btn-outline:hover { background: var(--surface-container); }
.btn-block { width: 100%; border-radius: var(--radius); padding: 14px 24px; font-size: 16px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; transform: none; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }

/* ── Páginas de acceso: formulario a la izquierda, ilustración a la derecha */
.auth { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 73px); }
@media (min-width: 1024px) { .auth { grid-template-columns: 1fr 1fr; } }

.auth__form {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px 64px; background: var(--surface);
}
.auth__inner { width: 100%; max-width: 448px; position: relative; }
.auth__inner--wide { max-width: 560px; }
.auth__title { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.auth__lead { color: var(--on-surface-variant); margin-bottom: 32px; }
.auth__foot { margin-top: 32px; text-align: center; color: var(--on-surface-variant); }
.auth__foot a { font-size: 14px; font-weight: 500; }

.glass-card {
  position: relative; isolation: isolate;
  background: var(--surface-card);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--outline-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 32px;
}
.glass-card::before {
  content: ""; position: absolute; top: -80px; left: -80px; width: 256px; height: 256px;
  background: rgba(177, 197, 255, 0.2); border-radius: 50%; filter: blur(60px);
  z-index: -1; pointer-events: none;
}
@media (max-width: 480px) { .glass-card { padding: 24px 18px; } }

/* ── Formularios ────────────────────────────────────────────────────── */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row--2 { grid-template-columns: 1fr 1fr; } }
.form-section { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.field { display: grid; gap: 8px; }
.field__label { font-size: 14px; font-weight: 500; color: var(--on-surface-variant); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field__label a { font-size: 14px; font-weight: 500; }
.field__control { position: relative; }
.field__control > .ms {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--placeholder); pointer-events: none;
}
.input, .select {
  width: 100%; font: 400 15px var(--font); color: var(--on-surface);
  background: var(--surface-low); border: 1px solid var(--outline-soft);
  border-radius: var(--radius); padding: 12px 16px 12px 46px; min-height: 47px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:focus, .select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--error); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238d909e'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: calc(100% - 12px) center; background-size: 18px;
}
.input:-webkit-autofill { -webkit-box-shadow: 0 0 0 50px var(--surface-low) inset; -webkit-text-fill-color: var(--on-surface); }

/* Subdominio: el sufijo del dominio pegado al campo. */
.input-suffix { display: flex; align-items: stretch; }
.input-suffix .field__control { flex: 1; }
.input-suffix .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix__tail {
  display: flex; align-items: center; padding: 0 12px; font-size: 14px; color: var(--muted);
  background: var(--surface-container); border: 1px solid var(--outline-soft); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; white-space: nowrap;
}

/* Ojo para mostrar u ocultar la contraseña (NIST: ofrecerlo). */
.field__control > .field__toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--placeholder);
}
.field__control > .field__toggle:hover { color: var(--on-surface); }
.field__control > .field__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input--con-ojo { padding-right: 48px; }

/* Barra de aprobación de la contraseña. `<progress>` y no un div: el lector de
   pantalla la anuncia sola, y el ancho se pone con la propiedad `value`, no con
   un estilo en línea (la CSP no los admite). */
.meter {
  display: block; width: 100%; height: 6px; margin-top: 2px; border: 0; border-radius: 999px;
  overflow: hidden; appearance: none; -webkit-appearance: none; background: var(--surface-highest);
  --meter-color: var(--placeholder);
}
.meter::-webkit-progress-bar { background: var(--surface-highest); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--meter-color); border-radius: 999px; transition: width .25s ease, background-color .25s ease; }
.meter::-moz-progress-bar { background: var(--meter-color); border-radius: 999px; }
.meter[data-estado="corta"], .meter[data-estado="mal"] { --meter-color: var(--error); }
.meter[data-estado="revisando"] { --meter-color: var(--primary-container); }
.meter[data-estado="ok"] { --meter-color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .meter::-webkit-progress-value { transition: none; } }

/* Botón con aspecto de enlace, para acciones que no cambian de página. */
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--primary);
  text-decoration: underline; cursor: pointer;
}
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.field__hint { font-size: 13px; color: var(--muted); }
.field__hint--ok { color: var(--ok); }
.field__hint--error { color: var(--error); }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-surface-variant); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Logo: cuadrado con vista previa, como en el registro original. */
.logo-picker {
  position: relative; width: 120px; height: 120px; margin: 0 auto 8px;
  border: 2px dashed var(--outline); border-radius: var(--radius-card);
  background: var(--surface-low) center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--placeholder); cursor: pointer; overflow: hidden;
}
.logo-picker .ms { font-size: 32px; }
.logo-picker span:last-child { font-size: 13px; font-weight: 500; margin-top: 4px; }
.logo-picker.has-image .ms, .logo-picker.has-image span:last-child { opacity: 0; }
.logo-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-picker:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Avisos ─────────────────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.alert .ms { font-size: 20px; flex: none; margin-top: 1px; }
.alert--error { background: var(--error-bg); color: var(--error-text); }
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--info { background: var(--primary-fixed); color: var(--accent-text); }

.done { text-align: center; display: grid; gap: 14px; justify-items: center; }
.done__icon {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(to bottom right, var(--primary), var(--primary-container)); color: #fff;
}
.done__icon .ms { font-size: 32px; }
.done p { color: var(--on-surface-variant); }

/* ── Ilustración (lado derecho de las páginas de acceso) ────────────── */
.illustration {
  display: none; position: relative; overflow: hidden;
  background: var(--surface-low); border-left: 1px solid var(--outline-soft);
  align-items: center; justify-content: center;
}
/* Fija junto al formulario: con un formulario largo (registro), centrada en
   una columna tan alta quedaba fuera de la vista. */
@media (min-width: 1024px) {
  .illustration { display: flex; position: sticky; top: 73px; height: calc(100vh - 73px); align-self: start; }
}
.illustration__grid {
  position: absolute; inset: 0; opacity: .4; mix-blend-mode: multiply;
  background-image: radial-gradient(#b1c5ff 1px, transparent 1px); background-size: 32px 32px;
}
html.dark .illustration__grid { opacity: .2; mix-blend-mode: screen; }
.blob { position: absolute; border-radius: 50%; }
.blob--bottom { bottom: -10rem; right: -10rem; width: 600px; height: 600px; background: rgba(177,197,255,.3); filter: blur(100px); }
.blob--top { top: 5rem; left: 5rem; width: 300px; height: 300px; background: rgba(208,228,255,.4); filter: blur(80px); }
html.dark .blob--bottom { background: rgba(0,71,171,.3); }
html.dark .blob--top { background: rgba(62,73,93,.4); }

.showcase {
  position: relative; z-index: 2; width: 75%; height: 75%; max-width: 672px;
  background: rgba(250, 248, 255, 0.4); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255,255,255,.5); border-radius: 24px; box-shadow: 0 20px 60px rgba(0,50,125,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; overflow: hidden; text-align: center;
}
html.dark .showcase { background: rgba(19,19,24,.3); border-color: rgba(67,70,83,.3); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.showcase__logo {
  width: 96px; height: 96px; border-radius: 16px; margin-bottom: 24px;
  background: linear-gradient(to bottom right, #00327d, #0047ab);
  display: grid; place-items: center; box-shadow: 0 10px 15px -3px rgba(0,50,125,.2);
}
.showcase__logo img { width: 84px; height: 84px; object-fit: contain; }
.showcase__title { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--accent-text); margin-bottom: 12px; }
.showcase__text { max-width: 380px; color: var(--on-surface-variant); }
.badge-online {
  position: absolute; top: 24px; right: 24px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--outline-soft); color: var(--on-surface);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulso 2s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.mock {
  position: absolute; width: 180px; padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--outline-soft); box-shadow: 0 8px 24px rgba(0,50,125,.06);
}
html.dark .mock { background: var(--surface-high); }
.mock--tl { top: 40px; left: 40px; transform: rotate(-4deg); }
.mock--br { bottom: 40px; right: 40px; transform: rotate(3deg); }
.mock__line { height: 8px; border-radius: 4px; background: var(--surface-highest); }
.mock__box { height: 48px; border-radius: 8px; margin: 10px 0; background: rgba(0,71,171,.12); }
.mock__row { display: flex; align-items: center; gap: 8px; }
.mock__circle { width: 20px; height: 20px; border-radius: 50%; background: var(--secondary-container); flex: none; }
.mock__bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; margin-top: 10px; }
.mock__bars span { flex: 1; border-radius: 4px 4px 0 0; }
.w-half { width: 50%; } .w-third { width: 33%; } .w-full { width: 100%; }

/* ── Landing ────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; scroll-margin-top: 64px; }
.section--tint { background: var(--surface-low); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section__title { font-size: clamp(28px, 4vw, 36px); font-weight: 700; margin-bottom: 12px; }
.section__lead { color: var(--on-surface-variant); font-size: 17px; }

.hero { padding: 72px 0 96px; }
.hero__grid { display: grid; gap: 48px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.05fr 1fr; } }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--secondary-container); color: var(--on-secondary-container); font-size: 13px; font-weight: 600;
}
.pill .ms { font-size: 16px; }
.hero__title { font-size: clamp(36px, 6vw, 56px); font-weight: 700; letter-spacing: -0.02em; margin: 20px 0; }
.hero__title em { font-style: normal; color: var(--primary-container); }
html.dark .hero__title em { color: var(--inverse-primary); }
.hero__lead { font-size: 18px; color: var(--on-surface-variant); max-width: 560px; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__visual { position: relative; min-height: 360px; display: grid; place-items: center; }
.dash {
  position: relative; width: 100%; max-width: 500px; border-radius: 24px; padding: 24px;
  background: var(--surface-card); border: 1px solid var(--outline-soft);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0,50,125,.1);
}
.dash__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dash__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--outline-soft); border-radius: 12px; padding: 12px; }
html.dark .kpi { background: var(--surface-high); }
.kpi__label { font-size: 12px; color: var(--muted); }
.kpi__value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash__bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.dash__bars span { flex: 1; border-radius: 6px 6px 0 0; background: var(--primary-container); opacity: .85; }
.dash__bars span:nth-child(even) { background: var(--inverse-primary); }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--outline-soft); box-shadow: 0 10px 30px rgba(0,50,125,.12); font-size: 14px;
}
html.dark .float-card { background: var(--surface-high); }
.float-card .ms { color: var(--ok); }
.float-card--a { bottom: 6px; left: -8px; }
.float-card strong { display: block; font-variant-numeric: tabular-nums; }

.modules { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .modules { grid-template-columns: repeat(3, 1fr); }
  .module--wide { grid-column: span 2; }
  .module--feature { grid-column: 1 / -1; }
}
.module {
  background: var(--surface); border: 1px solid var(--outline-soft); border-radius: var(--radius-card);
  padding: 28px; box-shadow: var(--shadow-card);
}
html.dark .module { background: var(--surface-container); }
.module__icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--primary-fixed); color: var(--accent-text);
}
.module__title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.module p { color: var(--on-surface-variant); }
.module--feature { background: linear-gradient(135deg, #00327d, #0047ab); color: #fff; border: 0; }
.module--feature p, .module--feature .module__eyebrow { color: rgba(255,255,255,.85); }
.module--feature .module__icon { background: rgba(255,255,255,.15); color: #fff; }
.module__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.module__eyebrow .ms { font-size: 16px; }

.plans { display: grid; gap: 24px; grid-template-columns: 1fr; max-width: 860px; margin: 0 auto; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 20px;
  background: var(--surface); border: 1px solid var(--outline-soft); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-card);
}
html.dark .plan { background: var(--surface-container); }
.plan--featured { border: 2px solid var(--primary-container); box-shadow: 0 20px 50px rgba(0,50,125,.12); }
.plan__flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  padding: 4px 14px; border-radius: 999px;
}
.plan__name { font-size: 22px; font-weight: 700; }
.plan__desc { color: var(--on-surface-variant); }
.plan__price { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan__price small { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: center; }
.plan li .ms { color: var(--primary-container); font-size: 20px; }
html.dark .plan li .ms { color: var(--inverse-primary); }
.plan .btn { margin-top: auto; }
.plans__note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 24px; }

.footer { border-top: 1px solid var(--outline-soft); padding: 48px 0 32px; background: var(--surface); }
.footer__grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer h4 { font-size: 14px; margin: 0 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.footer__copy { margin-top: 32px; font-size: 13px; color: var(--muted); }

/* ── Panel del cliente ──────────────────────────────────────────────── */
.panel { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; display: grid; gap: 24px; }
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.panel__title { font-size: 28px; font-weight: 600; }
.panel__sub { color: var(--on-surface-variant); }
.instances { display: grid; gap: 16px; }
.instance {
  display: grid; gap: 14px; background: var(--surface-card); border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-card);
}
.instance__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.instance__host { font-size: 18px; font-weight: 600; word-break: break-all; }
.instance__meta { font-size: 14px; color: var(--on-surface-variant); }
.instance__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip .ms { font-size: 16px; }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--work { background: var(--primary-fixed); color: var(--accent-text); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--error { background: var(--error-bg); color: var(--error-text); }

.progress { height: 6px; border-radius: 999px; background: var(--surface-highest); overflow: hidden; }
.progress span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--primary-container); animation: avance 1.4s ease-in-out infinite; }
@keyframes avance { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: giro .8s linear infinite; display: inline-block; }
@keyframes giro { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 8px 0; color: var(--on-surface-variant); }

/* ── Utilidades ─────────────────────────────────────────────────────
   Sin atributos style="" en el HTML: la CSP del portal (nginx.conf) no
   permite estilos en línea. */
.text-center { text-align: center; }
.mock__bars .b1 { height: 75%; background: #00327d; }
.mock__bars .b2 { height: 100%; background: #0047ab; }
.mock__bars .b3 { height: 50%; background: #b1c5ff; }
.mock__bars .b4 { height: 25%; background: #c3c6d5; }
.dash__bars .h40 { height: 40%; } .dash__bars .h55 { height: 55%; } .dash__bars .h45 { height: 45%; }
.dash__bars .h70 { height: 70%; } .dash__bars .h60 { height: 60%; } .dash__bars .h85 { height: 85%; }
.dash__bars .h100 { height: 100%; }

@media (max-width: 640px) {
  .header__inner { padding: 0 14px; min-height: 64px; }
  .brand { font-size: 17px; }
  .brand img { width: 34px; height: 34px; }
  .theme-switch__txt { display: none; }
  .header .btn { padding: 8px 14px; font-size: 14px; }
  .hide-sm { display: none; }
}

.alert p { margin: 4px 0 0; }
.alert strong { font-weight: 600; }
.instance .alert { align-items: flex-start; }

.acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.acciones .btn { flex: 1 1 160px; }
