@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);
  --sobre-marca: oklch(0.99 0.005 190);

  --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;

  --sidebar-w: 244px;

  --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;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

::selection { background: var(--marca-sutil); color: var(--marca-fuerte); }

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; }

/* Barra lateral */
.barra-lateral {
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.15rem 0.75rem;
  background: var(--superficie);
  border-right: 1px solid var(--borde);
  overflow-y: auto;
}
.marca {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.55rem 0.9rem;
  text-decoration: none;
  color: inherit;
}
.marca .isotipo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--marca);
  color: var(--sobre-marca);
  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.2; min-width: 0; }
.marca .producto { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.marca .cliente {
  font-size: var(--t-xs);
  color: var(--texto-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-lateral { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; }
.nav-lateral a, .pie-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.52rem 0.65rem;
  border-radius: var(--r-sm);
  color: var(--texto-suave);
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transicion), color var(--transicion);
}
.nav-lateral a .ico, .pie-item .ico {
  width: 18px; height: 18px; flex: none;
  display: grid; place-items: center;
  color: var(--texto-tenue);
  transition: color var(--transicion);
}
.nav-lateral a .ico svg, .pie-item .ico svg { width: 18px; height: 18px; display: block; }
.nav-lateral a:hover, .pie-item:hover { background: var(--superficie-2); color: var(--texto); }
.nav-lateral a:hover .ico, .pie-item:hover .ico { color: var(--texto-suave); }
.nav-lateral a.activo, .pie-item.activo { background: var(--marca-sutil); color: var(--marca); font-weight: 600; }
.nav-lateral a.activo .ico, .pie-item.activo .ico { color: var(--marca); }

.pastilla {
  margin-left: auto;
  background: var(--marca);
  color: var(--sobre-marca);
  font-size: var(--t-xs);
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-pie {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--borde);
}
.pie-item {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.pie-item.salir:hover { color: var(--error); background: var(--error-fondo); }
.pie-item.salir:hover .ico { color: var(--error); }
.salir-form { margin: 0; }

/* Lienzo y topbar movil (drawer sin JS via <details>) */
.lienzo { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 100vh; }
.nav-movil { display: none; }
.nav-movil > summary { list-style: none; cursor: pointer; }
.nav-movil > summary::-webkit-details-marker { display: none; }
.topbar-movil { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; background: var(--superficie); border-bottom: 1px solid var(--borde); }
.marca-movil { display: flex; align-items: center; gap: 0.55rem; color: inherit; font-weight: 700; font-size: 0.95rem; }
.marca-movil .isotipo { width: 30px; height: 30px; border-radius: 8px; background: var(--marca); color: var(--sobre-marca); display: grid; place-items: center; flex: none; }
.marca-movil .isotipo svg { width: 17px; height: 17px; }
.menu-abrir {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--borde-fuerte); border-radius: var(--r-sm);
  color: var(--texto-suave);
}
.menu-fondo { display: none; }

/* Contenido */
main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2.75rem 2.5rem 3rem;
  animation: surgir 0.14s ease-out;
}
main.ancho { max-width: 1060px; }
main.explorador { max-width: 1320px; display: block; }
main.auth {
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

@keyframes surgir {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-caja { width: 100%; max-width: 400px; }
.auth-marca { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-bottom: 1.35rem; }
.auth-marca .auth-isotipo { width: 40px; height: 40px; border-radius: 10px; background: var(--marca); color: var(--sobre-marca); display: grid; place-items: center; box-shadow: var(--sombra-1); flex: none; }
.auth-marca .auth-isotipo svg { width: 22px; height: 22px; }
.auth-marca .auth-nombre { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.auth-caja .tarjeta h1 { font-size: var(--t-md); }
.auth-caja .intro { margin: 0.35rem 0 1.4rem; font-size: var(--t-sm); }

.pie { padding: 1.15rem 2.5rem; border-top: 1px solid var(--borde); text-align: right; }
.pie a { color: var(--texto-tenue); font-size: var(--t-xs); text-decoration: none; }
.pie a:hover { color: var(--texto-suave); text-decoration: underline; }

.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; }
.pie-version { font-size: var(--t-xs); color: var(--texto-tenue); margin-top: 1.5rem; text-align: center; }
.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: var(--sobre-marca);
  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 1rem; }
.preview-doc { margin: 0 0 1.15rem; }
.preview-doc-toggle { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: var(--t-sm); font-weight: 600; color: var(--marca); width: fit-content; list-style: none; }
.preview-doc-toggle::-webkit-details-marker { display: none; }
.preview-doc-toggle::before { content: "▸"; font-size: 0.8em; transition: transform 0.15s; }
.preview-doc[open] .preview-doc-toggle::before { transform: rotate(90deg); }
.preview-doc-frame { width: 100%; height: 70vh; margin-top: 0.7rem; border: 1px solid var(--borde); border-radius: var(--r-sm); background: var(--superficie-2); }
.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; }

.acciones-descarte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--borde);
}
.acciones-descarte form { margin: 0; }
.form-descartar { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 260px; }
.form-descartar input[type="text"] { flex: 1; min-width: 180px; }

/* 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); }
.guia { margin-top: 1.25rem; border: 1px solid var(--borde); border-radius: var(--r); background: var(--marca-sutil); }
.guia > summary { cursor: pointer; padding: 0.85rem 1.1rem; font-size: var(--t-sm); font-weight: 600; color: var(--marca); list-style: none; }
.guia > summary::after { content: "+"; float: right; font-weight: 400; }
.guia[open] > summary::after { content: "\2013"; }
.guia > summary::-webkit-details-marker { display: none; }
.guia .sub { padding: 0 1.1rem; margin: 0.2rem 0 0.9rem; color: var(--texto-suave); font-size: var(--t-sm); }
.guia .ayuda { padding: 0 1.1rem 1rem; }
.guia ol { margin: 0; padding: 0 1.1rem 0.4rem 2.6rem; }
.guia ol li { font-size: var(--t-sm); line-height: 1.55; margin-bottom: 0.6rem; }

/* 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; }

/* Archivo (explorador de dos paneles) */
.explorador { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: var(--e5); align-items: start; }

.arbol-panel { display: flex; flex-direction: column; gap: var(--e2); position: sticky; top: var(--e5); }

.arbol-todo { display: flex; flex-direction: column; gap: var(--e2); }
.arbol-todo > summary { display: none; }
.arbol-todo-cuerpo { display: flex; flex-direction: column; gap: var(--e2); }

.arbol-filtro { padding: 0 0.1rem; }
.arbol-filtro-input { font-size: var(--t-sm); padding: 0.55rem 0.75rem; }
.arbol-sin-coincidencias { color: var(--texto-suave); font-size: var(--t-sm); padding: 0.4rem 0.1rem; margin: 0; }
.arbol-sin-coincidencias[hidden] { display: none; }

.arbol-anio-grupo[hidden] { display: none; }
.arbol-lista li[hidden] { display: none; }

.arbol-anio-grupo {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
}
.arbol-anio-grupo > summary {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
  font-size: var(--t-sm);
  font-weight: 650;
  color: var(--texto-suave);
  border-radius: var(--r-lg);
}
.arbol-anio-grupo > summary::-webkit-details-marker { display: none; }
.arbol-anio-grupo > summary:hover { background: var(--superficie-2); }
.arbol-anio-grupo[open] > summary { border-bottom: 1px solid var(--borde); border-radius: var(--r-lg) var(--r-lg) 0 0; }

.arbol-lista { list-style: none; margin: 0; padding: 0.4rem; display: flex; flex-direction: column; gap: 0.15rem; }
.arbol-lista li { display: flex; align-items: stretch; gap: 0.1rem; }
.arbol-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
  color: var(--texto);
  text-decoration: none;
}
.arbol-drive {
  flex: none;
  width: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--texto-tenue);
  text-decoration: none;
}
.arbol-drive:hover { background: var(--superficie-2); color: var(--marca); }
.arbol-drive svg { width: 16px; height: 16px; display: block; }
.arbol-item:hover { background: var(--superficie-2); }
.arbol-item.activo { background: var(--marca-sutil); color: var(--marca-fuerte); }
.arbol-item-textos { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.arbol-item .badge { margin-left: auto; }

.arbol-icono { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.arbol-icono svg { width: 18px; height: 18px; display: block; }
.arbol-icono.carpeta { color: var(--marca); }
.arbol-icono.documento { color: var(--texto-tenue); }
.arbol-nombre { font-weight: 650; font-size: var(--t-sm); }
.arbol-meta { color: var(--texto-suave); font-size: var(--t-xs); }

.panel-central { min-width: 0; }
.panel-operacion {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  box-shadow: var(--sombra-1);
  padding: var(--e5);
}
.panel-operacion[hidden] { display: none; }
.panel-cab { margin-bottom: var(--e4); padding-bottom: var(--e4); border-bottom: 1px solid var(--borde); }
.panel-cab h2 { margin: 0 0 0.3rem; }
.panel-meta { color: var(--texto-suave); font-size: var(--t-sm); margin: 0 0 0.8rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.panel-acciones { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.panel-acciones .doc-drive { margin-top: 0; }

.panel-docs { display: flex; flex-direction: column; gap: var(--e2); }
.panel-doc { padding: var(--e3) 0; border-bottom: 1px solid var(--borde); }
.panel-doc:last-child { border-bottom: none; }
.panel-doc-cab { display: flex; align-items: center; gap: 0.6rem; font-size: var(--t-sm); }
.arbol-doc-nombre { color: var(--texto); text-decoration: none; font-weight: 500; }
a.arbol-doc-nombre { color: var(--marca); }
a.arbol-doc-nombre:hover { text-decoration: underline; }
.panel-doc-cab .doc-tipo { margin-left: auto; white-space: nowrap; }
.panel-doc .tenue, .panel-doc .motivo { margin: 0.4rem 0 0 2.6rem; }
.doc-preview-btn { display: block; background: none; border: none; padding: 0; margin: 0.4rem 0 0 2.6rem; color: var(--marca); font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.doc-preview-btn:hover { text-decoration: underline; }

.doc-preview { margin-top: var(--e4); border: 1px solid var(--borde); border-radius: var(--r-sm); overflow: hidden; }
.doc-preview[hidden] { display: none; }
.doc-preview-cab { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.6rem var(--e3); background: var(--superficie-2); border-bottom: 1px solid var(--borde); }
.doc-preview-nombre { font-size: var(--t-sm); font-weight: 600; }
.doc-preview-cab-acciones { display: flex; align-items: center; gap: 1rem; }
.doc-preview-cab-acciones .doc-drive { margin-top: 0; }
.doc-preview-cerrar { background: none; border: none; padding: 0; color: var(--texto-suave); font-size: var(--t-sm); cursor: pointer; }
.doc-preview-cerrar:hover { color: var(--texto); text-decoration: underline; }
.doc-preview-frame { display: block; width: 100%; height: 75vh; min-height: 460px; border: none; background: var(--superficie); }

/* Planilla */
.planilla td, .planilla th { white-space: nowrap; }
.celda-valor { color: inherit; text-decoration: none; }
a.celda-valor { color: var(--marca); font-weight: 550; }
a.celda-valor:hover { text-decoration: underline; }
.calculado { border-bottom: 1px dashed var(--texto-tenue); cursor: help; }
.subtotal td { background: var(--superficie-2); font-weight: 650; font-size: var(--t-sm); border-bottom: none; }

.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; }

/* Responsive: barra lateral colapsable */
@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .nav-movil { display: block; position: sticky; top: 0; z-index: 40; }
  .barra-lateral {
    position: fixed;
    top: 0; left: 0;
    width: 274px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--transicion);
    box-shadow: var(--sombra-2);
  }
  .nav-movil[open] ~ .barra-lateral { transform: none; }
  .menu-fondo {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: oklch(0 0 0 / 0.45);
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity var(--transicion);
  }
  .nav-movil[open] .menu-fondo { opacity: 1; pointer-events: auto; }
  main { padding: 1.75rem 1.15rem 2.25rem; }
  .pie { padding: 1rem 1.15rem; }
}

/* Responsive: rejillas de contenido */
@media (max-width: 760px) {
  .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; }

  .explorador { grid-template-columns: 1fr; }
  .arbol-panel { position: static; }
  .doc-preview-frame { height: 60vh; min-height: 320px; }

  .arbol-todo {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--r-lg);
    box-shadow: var(--sombra-1);
  }
  .arbol-todo > summary {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: var(--t-sm);
    font-weight: 650;
    color: var(--texto);
    border-radius: var(--r-lg);
  }
  .arbol-todo > summary::-webkit-details-marker { display: none; }
  .arbol-todo[open] > summary { border-bottom: 1px solid var(--borde); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .arbol-todo-cuerpo { padding: var(--e3); }
}

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

.boton-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--r-sm);
  background: var(--superficie);
  color: var(--texto);
  font-weight: 600;
  text-decoration: none;
}
.boton-sec:hover { background: var(--superficie-2); }

.pastilla.ok { background: var(--ok-fondo); color: var(--ok); }

.token-nuevo { border-color: var(--marca); background: var(--marca-sutil); margin-bottom: var(--e4); }
.token-nuevo h2 { color: var(--marca-fuerte); }
.token-valor {
  width: 100%;
  margin-top: var(--e3);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--t-sm);
  letter-spacing: 0.02em;
}
.tabla .pastilla { margin-left: 0; }

.guia-intro p { margin: 0 0 var(--e3); line-height: 1.6; }
.guia-intro p:last-child { margin-bottom: 0; }
.guia-intro .paso-flujo {
  background: var(--marca-sutil);
  border-left: 3px solid var(--marca);
  border-radius: var(--r-sm);
  padding: var(--e3) var(--e4);
  color: var(--texto);
}
.guia-titulo { margin: var(--e6) 0 var(--e4); font-size: var(--t-lg); }
.guia {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  margin-bottom: var(--e3);
}
.guia > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--e4);
  font-weight: 600;
  font-size: var(--t-md);
  display: flex;
  align-items: center;
  gap: var(--e2);
}
.guia > summary::-webkit-details-marker { display: none; }
.guia > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--texto-suave);
  border-bottom: 2px solid var(--texto-suave);
  transform: rotate(-45deg);
  transition: transform var(--transicion);
  flex: none;
}
.guia[open] > summary::before { transform: rotate(45deg); }
.guia[open] > summary { border-bottom: 1px solid var(--borde); }
.guia-cuerpo { padding: var(--e4); }
.guia-cuerpo p { margin: 0 0 var(--e3); line-height: 1.6; }
.guia-cuerpo p:last-child { margin-bottom: 0; }
.guia-cuerpo ul, .guia-cuerpo ol { margin: 0 0 var(--e3) var(--e4); line-height: 1.6; }
.guia-cuerpo li { margin-bottom: var(--e2); }

/* Ilustraciones de la guia: wireframes con datos ficticios, sin capturas reales */
.ilustra { margin: var(--e4) 0 var(--e2); }
.ilustra-etq { font-size: var(--t-xs); color: var(--texto-tenue); margin: var(--e2) 0 0; display: flex; align-items: center; gap: 0.4rem; }
.ilustra-etq::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--borde-fuerte); flex: none; }
.mock {
  border: 1px solid var(--borde);
  border-radius: var(--r-lg);
  background: var(--fondo);
  overflow: hidden;
  box-shadow: var(--sombra-1);
}
.mock-app { display: grid; grid-template-columns: 128px 1fr; min-height: 176px; }
.mock-side { background: var(--superficie); border-right: 1px solid var(--borde); padding: 0.6rem 0.55rem; display: flex; flex-direction: column; gap: 0.28rem; }
.mock-brand { display: flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; font-weight: 700; color: var(--texto); margin-bottom: 0.35rem; }
.mock-brand span { width: 16px; height: 16px; border-radius: 5px; background: var(--marca); flex: none; }
.mock-nav { font-size: 0.68rem; color: var(--texto-suave); padding: 0.26rem 0.4rem; border-radius: var(--r-sm); }
.mock-nav.on { background: var(--marca-sutil); color: var(--marca); font-weight: 600; }
.mock-main { padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.55rem; background: var(--fondo); }
.mock-titulo { height: 11px; width: 42%; border-radius: 4px; background: var(--borde-fuerte); }
.mock-card { border: 1px solid var(--borde); border-radius: var(--r-sm); background: var(--superficie); height: 30px; }
.mock-bandeja { padding: 1.1rem 1.25rem; background: var(--superficie); }
.mock-doc { font-weight: 650; font-size: var(--t-sm); }
.mock-motivo { color: var(--texto-suave); font-size: var(--t-xs); margin: 0.25rem 0 0.8rem; }
.mock-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mock-chip { border: 1px solid var(--borde-fuerte); border-radius: var(--r-sm); padding: 0.4rem 0.6rem; background: var(--superficie); }
.mock-chip.si { border-color: var(--marca); background: var(--marca-sutil); }
.mock-chip .p { font-weight: 650; font-size: var(--t-xs); color: var(--texto); }
.mock-chip .d { font-size: 0.66rem; color: var(--texto-suave); }
.mock-planilla { width: 100%; border-collapse: collapse; background: var(--superficie); font-size: var(--t-xs); }
.mock-planilla th, .mock-planilla td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.mock-planilla thead th { color: var(--texto-suave); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.62rem; background: var(--superficie-2); }
.mock-planilla td .lnk { color: var(--marca); font-weight: 550; }
.mock-planilla tbody tr:last-child td { border-bottom: none; }
