@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.260c81a4759b.woff2") format("woff2");
}

:root {
  --marca: oklch(0.37 0.055 220);
  --marca-fuerte: oklch(0.30 0.05 220);
  --marca-sutil: oklch(0.955 0.014 220);
  --marca-borde: oklch(0.88 0.03 220);

  --fondo: oklch(0.975 0.004 190);
  --superficie: oklch(0.995 0.0015 190);
  --superficie-2: oklch(0.982 0.004 200);
  --borde: oklch(0.905 0.006 200);
  --borde-fuerte: oklch(0.84 0.008 200);

  --texto: oklch(0.26 0.014 200);
  --texto-suave: oklch(0.50 0.014 200);
  --texto-tenue: oklch(0.62 0.012 200);

  --ok: oklch(0.49 0.11 150);
  --ok-fondo: oklch(0.955 0.032 150);
  --alerta: oklch(0.55 0.10 75);
  --alerta-fondo: oklch(0.955 0.045 80);
  --error: oklch(0.52 0.17 25);
  --error-fondo: oklch(0.948 0.03 25);

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-cuerpo: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.375rem;
  --t-xl: 1.75rem;

  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2rem;
  --e7: 3rem;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  --sombra-1: 0 1px 2px oklch(0.26 0.014 200 / 0.05), 0 1px 3px oklch(0.26 0.014 200 / 0.05);
  --sombra-2: 0 1px 2px oklch(0.26 0.014 200 / 0.04), 0 6px 16px -4px oklch(0.26 0.02 200 / 0.10);
  --anillo: 0 0 0 3px oklch(0.37 0.055 220 / 0.28);
  --transicion: 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter var", system-ui, "Segoe UI", sans-serif;
  font-size: var(--t-cuerpo);
  line-height: 1.55;
  background: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.011em;
  margin: 0;
}
h1 { font-size: var(--t-lg); font-weight: 700; }
h2 { font-size: var(--t-md); font-weight: 650; }
h3 { font-size: var(--t-cuerpo); font-weight: 600; }

a { color: var(--marca); }

.num { font-variant-numeric: tabular-nums; }

/* Encabezado */
.cabecera {
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--e4);
}
.marca {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}
.marca .isotipo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--marca);
  color: oklch(0.99 0.005 190);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--sombra-1);
}
.marca .isotipo svg { width: 19px; height: 19px; display: block; }
.marca .textos { display: flex; flex-direction: column; line-height: 1.15; }
.marca .producto { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.marca .cliente { font-size: var(--t-xs); color: var(--texto-suave); }

nav.principal { display: flex; gap: 0.35rem; align-items: center; }
.menu-movil { display: none; }
nav.principal a {
  color: var(--texto-suave);
  text-decoration: none;
  font-size: var(--t-sm);
  font-weight: 500;
  padding: 0.42rem 0.7rem;
  border-radius: var(--r-sm);
  transition: background var(--transicion), color var(--transicion);
}
nav.principal a:hover { color: var(--texto); background: var(--superficie-2); }
nav.principal a.activo { color: var(--marca); background: var(--marca-sutil); font-weight: 600; }
.salir-form { margin: 0; }
button.salir {
  width: auto;
  margin: 0;
  padding: 0.42rem 0.7rem;
  background: none;
  border: none;
  color: var(--texto-tenue);
  font-size: var(--t-sm);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--r-sm);
}
button.salir:hover { color: var(--error); background: var(--error-fondo); }

.nav-toggle { display: none; list-style: none; }
.nav-toggle::marker { content: ""; }
.nav-toggle::-webkit-details-marker { display: none; }

/* Contenido */
main {
  flex: 1;
  width: 100%;
  max-width: 460px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}
main.ancho { max-width: 920px; }

.intro {
  color: var(--texto-suave);
  font-size: var(--t-cuerpo);
  margin: 0.4rem 0 var(--e6);
  max-width: 70ch;
}

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
  padding: 1.75rem;
}

/* Formularios */
form p { margin: 0 0 1.1rem; }
label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 550;
  margin-bottom: 0.35rem;
  color: var(--texto);
}
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--r-sm);
  font-size: var(--t-cuerpo);
  font-family: inherit;
  color: var(--texto);
  background: var(--superficie);
  transition: border-color var(--transicion), box-shadow var(--transicion);
}
input::placeholder, textarea::placeholder { color: var(--texto-tenue); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--marca);
  box-shadow: var(--anillo);
}
input:disabled, select:disabled { background: var(--superficie-2); color: var(--texto-tenue); cursor: not-allowed; }
.ayuda { font-size: var(--t-xs); color: var(--texto-suave); margin-top: 0.3rem; }
.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
  color: var(--error);
  font-size: var(--t-xs);
  font-weight: 500;
}

:where(input, select, textarea, button, a, summary):focus-visible {
  outline: none;
  box-shadow: var(--anillo);
  border-radius: var(--r-sm);
}

/* Botones */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--marca);
  color: oklch(0.99 0.005 190);
  font-size: var(--t-cuerpo);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transicion), border-color var(--transicion), transform var(--transicion);
}
button:hover, .btn:hover { background: var(--marca-fuerte); }
button:active, .btn:active { transform: translateY(0.5px); }
button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-auto { width: auto; }
.btn-sm { padding: 0.5rem 0.85rem; font-size: var(--t-sm); }

.btn-secundario {
  background: var(--superficie);
  color: var(--texto);
  border-color: var(--borde-fuerte);
}
.btn-secundario:hover { background: var(--superficie-2); border-color: var(--texto-tenue); }

.btn-fantasma {
  background: transparent;
  color: var(--texto-suave);
  border-color: var(--borde);
  border-style: dashed;
}
.btn-fantasma:hover { background: var(--superficie-2); color: var(--texto); }

.btn-peligro {
  width: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--error);
  font-size: var(--t-sm);
  font-weight: 500;
}
.btn-peligro:hover { background: none; text-decoration: underline; }

.btn-enlace {
  width: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--marca);
  font-weight: 500;
  font-size: var(--t-sm);
}
.btn-enlace:hover { background: none; text-decoration: underline; }

/* Mensajes */
.mensajes { list-style: none; padding: 0; margin: 0 0 var(--e5); display: flex; flex-direction: column; gap: 0.5rem; }
.mensajes li {
  padding: 0.7rem 1rem;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 500;
  border: 1px solid var(--borde);
  background: var(--superficie);
}
.mensajes li.success { background: var(--ok-fondo); border-color: transparent; color: var(--ok); }
.mensajes li.error { background: var(--error-fondo); border-color: transparent; color: var(--error); }
.mensajes li.warning { background: var(--alerta-fondo); border-color: transparent; color: var(--alerta); }

/* Barra de titulo con accion */
.barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--e4);
  margin-bottom: var(--e5);
  flex-wrap: wrap;
}
.barra h1 { margin: 0; }

/* Insignias de estado */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem 0.22rem 0.55rem;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-incompleta { background: var(--error-fondo); color: var(--error); }
.badge-completa { background: var(--alerta-fondo); color: var(--alerta); }
.badge-archivada { background: var(--ok-fondo); color: var(--ok); }

/* Tablas */
.tabla {
  width: 100%;
  border-collapse: collapse;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sombra-1);
}
.tabla th, .tabla td {
  padding: 0.8rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--borde);
  font-size: var(--t-sm);
  vertical-align: top;
}
.tabla thead th {
  color: var(--texto-suave);
  font-weight: 600;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--superficie-2);
}
.tabla tbody tr { transition: background var(--transicion); }
.tabla tbody tr:hover { background: var(--superficie-2); }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla-scroll { overflow-x: auto; border-radius: var(--r-lg); }
.enlace-tabla { color: var(--marca); text-decoration: none; font-weight: 600; }
.enlace-tabla:hover { text-decoration: underline; }
.tenue { color: var(--texto-tenue); }

/* Estado vacio */
.vacio {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--texto-suave);
}
.vacio .icono {
  width: 44px; height: 44px;
  margin: 0 auto 0.9rem;
  color: var(--texto-tenue);
  display: grid; place-items: center;
  background: var(--superficie-2);
  border-radius: var(--r-lg);
}
.vacio .icono svg { width: 22px; height: 22px; }
.vacio p { margin: 0; font-size: var(--t-cuerpo); }
.vacio .sub { font-size: var(--t-sm); color: var(--texto-tenue); margin-top: 0.3rem; }

/* Inicio: salud del sistema */
.salud { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--e4); margin-bottom: var(--e6); }
.salud-item {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r);
  box-shadow: var(--sombra-1);
  padding: 1.1rem 1.2rem;
}
.salud-item .rotulo { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: var(--t-sm); }
.salud-item .valor { color: var(--texto-suave); font-size: var(--t-sm); margin-top: 0.35rem; }
.punto { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.punto.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-fondo); }
.punto.no { background: var(--texto-tenue); box-shadow: 0 0 0 3px var(--superficie-2); }

/* Inicio: metricas (sobrio, sin hero-metric) */
.metricas {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  background: var(--superficie);
  box-shadow: var(--sombra-1);
  margin-bottom: var(--e5);
  overflow: hidden;
}
.metrica { flex: 1; min-width: 140px; padding: 1.1rem 1.35rem; border-right: 1px solid var(--borde); }
.metrica:last-child { border-right: none; }
.metrica .numero { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; }
.metrica .etiqueta { color: var(--texto-suave); font-size: var(--t-sm); margin-top: 0.15rem; }

.listo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ok-fondo);
  color: var(--ok);
  border-radius: var(--r);
  padding: 0.9rem 1.15rem;
  font-size: var(--t-sm);
  font-weight: 500;
}
.listo svg { width: 18px; height: 18px; flex: none; }

/* Inicio: primeros pasos */
.pasos { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.5rem 1.75rem; }
.pasos h2 { margin: 0 0 0.4rem; }
.pasos .sub { color: var(--texto-suave); font-size: var(--t-sm); margin: 0 0 1rem; }
.paso { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--borde); }
.paso:last-child { border-bottom: none; }
.paso .check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.paso .check.ok { background: var(--ok-fondo); color: var(--ok); }
.paso .check.no { background: var(--superficie-2); color: var(--texto-tenue); border: 1px solid var(--borde); }
.paso .check svg { width: 12px; height: 12px; }
.paso .nombre { font-size: var(--t-cuerpo); }
.paso .nombre.hecho { color: var(--texto-suave); }
.paso a { margin-left: auto; font-size: var(--t-sm); font-weight: 600; text-decoration: none; }

/* Bandeja de pendientes */
.explicacion { color: var(--texto-suave); font-size: var(--t-cuerpo); margin: 0.3rem 0 var(--e5); max-width: 72ch; }
.lista-pendientes { display: flex; flex-direction: column; gap: var(--e4); }
.pendiente { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.5rem; }
.pendiente-cab { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e4); margin-bottom: 0.3rem; }
.pendiente-doc { font-weight: 650; font-size: var(--t-md); }
.pendiente-tipo { color: var(--texto-suave); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.pendiente-motivo { color: var(--texto-suave); font-size: var(--t-sm); margin: 0 0 1.15rem; }
.pregunta { font-size: var(--t-sm); font-weight: 600; color: var(--texto); margin: 0 0 0.7rem; }
.candidatos { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.candidatos form { margin: 0; }
.candidato {
  width: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.95rem;
  background: var(--superficie);
  color: var(--texto);
  border: 1px solid var(--borde-fuerte);
  text-align: left;
}
.candidato:hover { background: var(--marca-sutil); border-color: var(--marca); }
.candidato .prov { font-weight: 650; font-size: var(--t-sm); }
.candidato .det { font-size: var(--t-xs); color: var(--texto-suave); font-weight: 400; }

/* Detalle de operacion */
.volver { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--texto-suave); font-size: var(--t-sm); text-decoration: none; margin-bottom: 0.6rem; }
.volver:hover { color: var(--texto); }
.resumen { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.5rem 1.75rem; margin: 0.9rem 0 var(--e6); }
.resumen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem 1.75rem; }
.dato .rotulo { color: var(--texto-suave); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.dato .valor { font-size: var(--t-cuerpo); margin-top: 0.25rem; }
.faltan { color: var(--error); font-size: var(--t-sm); font-weight: 500; margin-top: 1rem; }
.seccion-titulo { font-size: var(--t-md); margin: 0 0 var(--e4); }
.doc { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.25rem 1.5rem; margin-bottom: var(--e4); }
.doc-cab { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e4); }
.doc-nombre { font-weight: 650; }
.doc-tipo { color: var(--texto-suave); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.motivo {
  margin: 0.85rem 0;
  padding: 0.7rem 0.9rem;
  background: var(--marca-sutil);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--texto);
}
.motivo .m-rotulo { font-weight: 600; color: var(--marca); }
.datos-tabla { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
.datos-tabla td { padding: 0.4rem 0; font-size: var(--t-sm); border-bottom: 1px solid var(--borde); }
.datos-tabla td:first-child { color: var(--texto-suave); width: 42%; }
.datos-tabla tr:last-child td { border-bottom: none; }
.doc-drive { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--t-sm); font-weight: 600; color: var(--marca); text-decoration: none; margin-top: 0.85rem; }
.doc-drive:hover { text-decoration: underline; }

/* Filtros */
.filtros { display: flex; gap: 0.6rem; margin-bottom: var(--e5); flex-wrap: wrap; align-items: center; }
.filtros input, .filtros select { width: auto; flex: 1; min-width: 170px; }
.filtros button { width: auto; }
.filtros label { display: flex; align-items: center; gap: 0.45rem; font-size: var(--t-sm); font-weight: 500; margin: 0; white-space: nowrap; }
.filtros label input { width: auto; flex: none; min-width: 0; }

/* Configuracion */
.grupo { display: flex; flex-direction: column; gap: var(--e4); }
.seccion { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); padding: 1.5rem 1.75rem; }
.seccion h2 { margin: 0 0 0.3rem; }
.seccion .sub { color: var(--texto-suave); font-size: var(--t-sm); margin: 0 0 1.1rem; }
.estado-servicio { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--t-sm); font-weight: 500; margin: 0 0 1rem; }
.estado-servicio.conectado { color: var(--ok); }
.estado-servicio.sin-conectar { color: var(--texto-suave); }
.acciones { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.4rem; }
.cuenta-imap { display: flex; align-items: center; justify-content: space-between; gap: var(--e4); padding: 0.75rem 0; border-bottom: 1px solid var(--borde); }
.cuenta-imap:last-child { border-bottom: none; }
.cuenta-imap .datos-cuenta { font-size: var(--t-sm); }
.cuenta-imap .datos-cuenta strong { font-weight: 600; }
.cuenta-imap .datos-cuenta span { color: var(--texto-suave); }

/* Proveedores */
.grid-proveedores { display: grid; grid-template-columns: 340px 1fr; gap: var(--e5); align-items: start; }
.acciones-fila { display: flex; gap: 1rem; align-items: center; }
.acciones-fila a { color: var(--marca); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
.acciones-fila a:hover { text-decoration: underline; }
.acciones-fila form { margin: 0; }
.aviso-eliminar { color: var(--alerta); font-size: var(--t-xs); margin: 0 0 0.4rem; }

.bloque { margin-bottom: var(--e6); }
.bloque h2 { margin: 0 0 var(--e4); }
.con-error { color: var(--error); font-weight: 500; }
.sin-error { color: var(--ok); font-weight: 500; }
.detalle-error { color: var(--texto-suave); font-size: var(--t-xs); white-space: pre-line; margin-top: 0.25rem; }

@media (max-width: 760px) {
  .cabecera { flex-wrap: wrap; row-gap: 0.75rem; }
  .menu-movil { display: block; order: 2; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 0.9rem;
    border: 1px solid var(--borde-fuerte);
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--texto-suave);
    font-size: var(--t-sm);
    font-weight: 500;
  }
  nav.principal { display: none; order: 3; flex-direction: column; align-items: stretch; width: 100%; gap: 0.15rem; }
  .menu-movil[open] ~ nav.principal { display: flex; }
  nav.principal a, .salir-form, button.salir { width: 100%; min-height: 44px; }
  nav.principal a { align-items: center; }
  button.salir { justify-content: flex-start; }
  .salud, .resumen-grid { grid-template-columns: 1fr; }
  .grid-proveedores { grid-template-columns: 1fr; }
  .metrica { border-right: none; border-bottom: 1px solid var(--borde); }
  .metrica:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
