/* Calendario del asesor · estilos propios, sin librerías ni fuentes de fuera (T-0008) */
:root {
  --fondo: #f5f4f0;
  --superficie: #ffffff;
  --hundido: #faf9f6;
  --linea: #e8e5de;
  --linea-fuerte: #d8d3c8;
  --texto: #1f2328;
  --suave: #6a6e75;
  --tenue: #9a9da3;
  --tinta: #0f5f6e;
  --tinta-fuerte: #0b4a56;
  --tinta-suave: #e4f0f1;
  --rojo: #b93a2e;
  --rojo-suave: #fbeae7;
  --ambar: #a86a12;
  --ambar-suave: #fcf2de;
  --verde: #2d7a4c;
  --verde-suave: #e5f2e9;
  --amarillo-suave: #fff6bf;
  --amarillo-borde: #e6c800;
  --amarillo-texto: #7a6200;
  --evento: #6a4fb3;
  --evento-suave: #f0ecfa;
  --error: var(--rojo);
  --radio: 10px;
  --sombra: 0 1px 2px rgba(31, 35, 40, 0.05);
  --sombra-alta: 0 8px 24px rgba(31, 35, 40, 0.10), 0 1px 3px rgba(31, 35, 40, 0.06);
  --lateral: 240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--fondo);
  color: var(--texto);
}
a { color: var(--tinta); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 650; margin: 0 0 0.25rem; }
h2 { font-size: 1rem; font-weight: 650; margin: 1.75rem 0 0.75rem; letter-spacing: -0.005em; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; border-radius: 4px; }
.icono { flex: none; vertical-align: -4px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ armazón */

body.con-sesion { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100vh; }
/* Ocupa el ancho de la pantalla (T-0009): el tope solo frena en monitores muy anchos */
.contenido { padding: 2rem 2.5rem 3rem; max-width: 120rem; width: 100%; min-width: 0; }
body.sin-sesion .contenido { max-width: none; padding: 0; }

.lateral {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem 0.9rem;
  background: var(--superficie);
  border-right: 1px solid var(--linea);
}
.marca-app { display: flex; align-items: center; gap: 0.65rem; padding: 0 0.4rem; color: var(--texto); }
.marca-app:hover { text-decoration: none; }
.marca-app strong { display: block; font-size: 1.05rem; letter-spacing: -0.01em; }
.marca-app small { display: block; color: var(--suave); font-size: 0.78rem; margin-top: -2px; }
.marca-texto { min-width: 0; }
.marca-texto strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral .marca-app { padding: 0.5rem; margin: 0 -0.1rem; border-radius: 10px; background: var(--hundido); border: 1px solid var(--linea); }
.lateral .marca-app:hover { border-color: var(--linea-fuerte); }
.logo {
  position: relative; width: 34px; height: 34px; border-radius: 9px;
  background: var(--tinta); display: inline-block; flex: none; overflow: hidden;
}
.logo::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: var(--tinta-fuerte); }
.logo span { position: absolute; width: 9px; height: 9px; border-radius: 2px; background: #fff; right: 7px; bottom: 7px; }
.logo span::before { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); right: 12px; top: 0; }

.anadir { position: relative; }
.anadir summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 0.8rem; border-radius: 8px;
  background: var(--tinta); color: #fff; font-weight: 600;
}
.anadir summary::-webkit-details-marker { display: none; }
.anadir summary:hover { background: var(--tinta-fuerte); }
.anadir[open] summary { background: var(--tinta-fuerte); }
.anadir-menu {
  position: absolute; z-index: 20; left: 0; right: -60px; top: calc(100% + 6px);
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  box-shadow: var(--sombra-alta); padding: 0.35rem;
}
.anadir-menu a { display: block; padding: 0.5rem 0.65rem; border-radius: 7px; color: var(--texto); }
.anadir-menu a:hover { background: var(--hundido); text-decoration: none; }
.anadir-menu strong { display: block; font-weight: 600; font-size: 0.92rem; }
.anadir-menu small { color: var(--suave); font-size: 0.78rem; }

.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.65rem; border-radius: 7px;
  color: #3c4046; font-weight: 500;
}
.menu a .icono { color: var(--tenue); }
.menu a:hover { background: var(--hundido); text-decoration: none; color: var(--texto); }
.menu a[aria-current="page"] { background: var(--tinta-suave); color: var(--tinta-fuerte); font-weight: 600; }
.menu a[aria-current="page"] .icono { color: var(--tinta); }
.menu-separador { height: 1px; background: var(--linea); margin: 0.6rem 0.4rem; }

.usuario { margin: 0; padding: 0.6rem 0 0; border-top: 1px solid var(--linea); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ece9e2; color: #4a4e55; font-weight: 650; font-size: 0.85rem;
}
.avatar.grande { width: 38px; height: 38px; font-size: 1rem; background: var(--tinta); color: #fff; }
.boton-salir {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem;
  background: none; border: 0; padding: 0.45rem 0.65rem; color: var(--suave); font-weight: 500; border-radius: 7px;
}
.boton-salir .nota { flex-basis: 100%; padding-left: 1.75rem; font-size: 0.74rem; text-align: left; white-space: normal; }
.boton-salir:hover { background: var(--rojo-suave); border: 0; color: var(--rojo); }

/* ------------------------------------------------------------ piezas comunes */

.cabeza { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.cabeza .sub { margin: 0; color: var(--suave); }
.cabeza-acciones, .botones { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.botones form, form.en-linea { display: inline; margin: 0; }

button, .boton {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.95rem; border-radius: 8px; border: 1px solid var(--tinta);
  background: var(--tinta); color: #fff;
  font: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .boton:hover { background: var(--tinta-fuerte); border-color: var(--tinta-fuerte); text-decoration: none; }
button:disabled { opacity: 0.55; cursor: progress; }
button.secundario, .boton.secundario { background: var(--superficie); color: var(--texto); border-color: var(--linea-fuerte); }
button.secundario:hover, .boton.secundario:hover { background: var(--hundido); border-color: var(--tenue); }
/* T-0014: borrar de verdad, en rojo */
button.peligro { background: var(--rojo); border-color: var(--rojo); color: #fff; }
button.peligro:hover { background: #9a2f25; border-color: #9a2f25; }

/* T-0014: Modificar, Archivar y Eliminar al lado de cada cliente y cada documento */
.acciones-fila { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; vertical-align: middle; }
.acciones-fila form { display: inline; margin: 0; }
.boton-icono, button.boton-icono {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.55rem; border: 1px solid var(--linea-fuerte);
  border-radius: 7px; background: var(--superficie); color: var(--texto); font-size: 0.78rem; font-weight: 550;
  line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.boton-icono .icono { width: 15px; height: 15px; }
.boton-icono:hover, button.boton-icono:hover { background: var(--tinta-suave); border-color: var(--tinta); color: var(--tinta-fuerte); text-decoration: none; }
.boton-icono.peligro, button.boton-icono.peligro { color: var(--rojo); border-color: #e9c3bd; }
.boton-icono.peligro:hover, button.boton-icono.peligro:hover { background: var(--rojo-suave); border-color: var(--rojo); color: var(--rojo); }
.acciones-grandes .boton-icono { padding: 0.45rem 0.85rem; font-size: 0.88rem; }
.acciones-grandes .boton-icono .icono { width: 17px; height: 17px; }
.archivo-texto .acciones-fila { margin-top: 0.35rem; }
.confirmar-borrado { max-width: 42rem; }
.peligro-texto { display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.75rem 0.9rem; border-radius: var(--radio); background: var(--rojo-suave); color: var(--rojo); }
.peligro-texto .icono { flex: none; margin-top: 1px; }

.tarjeta {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.1rem 1.25rem; box-shadow: var(--sombra); margin-bottom: 1rem;
}
.tarjeta-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.tarjeta-cabeza h2 { margin: 0; }

.error { color: var(--error); }
.nota { color: var(--suave); font-size: 0.86rem; }
a.nota:hover { color: var(--tinta); }
.aviso {
  display: flex; gap: 0.5rem; align-items: flex-start;
  background: var(--ambar-suave); color: #6e4a0f; padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.88rem;
}
.aviso .icono { color: var(--ambar); margin-top: 1px; }

.mensajes { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 0.4rem; }
.mensajes li, .mensajes p {
  margin: 0; padding: 0.65rem 0.9rem; border-radius: 8px;
  background: var(--superficie); border: 1px solid var(--linea); border-left: 4px solid var(--tinta);
}
.mensajes .error { border-left-color: var(--rojo); color: var(--texto); background: var(--rojo-suave); border-color: #f1cfc9; }
.mensajes .success { border-left-color: var(--verde); background: var(--verde-suave); border-color: #cfe6d7; }

.punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; vertical-align: 1px; }
.punto.rojo { background: var(--rojo); }
.punto.ambar { background: var(--ambar); }
.punto.verde { background: var(--verde); }

.vencido {
  display: inline-block; padding: 0 6px; border-radius: 4px;
  background: var(--rojo); color: #fff; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.ejemplo, .suelto {
  display: inline-block; padding: 0 6px; border: 1px dashed var(--linea-fuerte); border-radius: 4px;
  font-size: 0.72rem; color: var(--suave); background: var(--hundido);
}
.fuente { font-size: 0.8rem; }

.estado { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.estado.falta { background: var(--ambar-suave); color: var(--ambar); }
.estado.recibida { background: var(--tinta-suave); color: var(--tinta); }
.estado.presentado { background: var(--verde-suave); color: var(--verde); }

/* ------------------------------------------------------------ inicio */

.cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-bottom: 1.25rem; }
.cifra-tarjeta {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1rem 1.1rem; color: var(--texto); box-shadow: var(--sombra);
  transition: border-color 0.15s, transform 0.15s;
}
.cifra-tarjeta:hover { text-decoration: none; border-color: var(--linea-fuerte); transform: translateY(-1px); }
.cifra-titulo { color: var(--suave); font-size: 0.85rem; font-weight: 500; }
.cifra { font-size: 2.3rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cifra-pie { color: var(--suave); font-size: 0.82rem; display: flex; align-items: center; gap: 0.2rem; }
.cifra-pie .icono { width: 15px; height: 15px; }
.cifra-tarjeta.alerta { border-color: #efc4bd; box-shadow: inset 0 3px 0 var(--rojo), var(--sombra); }
.cifra-tarjeta.alerta .cifra { color: var(--rojo); }
.cifra-tarjeta { position: relative; }
.cifra-icono {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cifra-tarjeta.rojo .cifra-icono { background: var(--rojo-suave); color: var(--rojo); }
.cifra-tarjeta.tinta .cifra-icono { background: var(--tinta-suave); color: var(--tinta); }
.cifra-tarjeta.ambar .cifra-icono { background: var(--ambar-suave); color: var(--ambar); }
.cifra-tarjeta.verde .cifra-icono { background: var(--verde-suave); color: var(--verde); }

/* Inicio: agenda grande a la izquierda y dos columnas de tarjetas; en pantallas medianas, una */
.rejilla-inicio { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rejilla-inicio .tarjeta-agenda { grid-row: span 2; }
@media (min-width: 1440px) {
  .rejilla-inicio { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr); }
  .rejilla-inicio .tarjeta-agenda { grid-row: auto; }
}

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-top: 1px solid var(--linea); }
.ranking li:first-child { border-top: 0; }
.ranking a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texto); font-weight: 550; }
.ranking .iniciales { margin: 0; width: 28px; height: 28px; }
.ranking-n {
  min-width: 28px; padding: 0.1rem 0.5rem; border-radius: 999px; text-align: center;
  background: var(--ambar-suave); color: var(--ambar); font-weight: 700; font-size: 0.82rem; font-variant-numeric: tabular-nums;
}

/* Pestañas de las listas de plazos */
.pestanas { display: flex; flex-wrap: wrap; gap: 0.3rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: 10px; padding: 0.25rem; }
.pestanas a { padding: 0.4rem 0.8rem; border-radius: 7px; color: var(--suave); font-weight: 550; font-size: 0.88rem; }
.pestanas a:hover { background: var(--hundido); text-decoration: none; color: var(--texto); }
.pestanas a[aria-current="page"] { background: var(--tinta-suave); color: var(--tinta-fuerte); }

/* Ficha del cliente: plazos y archivos a la izquierda; plazo suelto y subida a la derecha */
.rejilla-ficha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 0.5rem; }
@media (min-width: 1280px) { .rejilla-ficha { grid-template-columns: minmax(0, 1fr) 18rem; } }
.ficha-principal .tabla-caja table.lista { min-width: 40rem; }
.cifra-tarjeta .cifra-titulo { padding-right: 2.75rem; }
.chip strong { font-weight: 700; }
.ficha-principal > .tarjeta-cabeza { margin-top: 1.25rem; }
.ficha-principal > .tarjeta-cabeza:first-child { margin-top: 0; }
.ficha-lateral { position: sticky; top: 1rem; }
.ficha-lateral h2 { margin: 0 0 0.75rem; }
.formulario-plano p { margin: 0 0 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; }
.formulario-plano p > label { font-weight: 550; font-size: 0.9rem; }
.formulario-plano .helptext { color: var(--suave); font-size: 0.8rem; }
.formulario-plano input[type="text"], .formulario-plano input[type="date"], .formulario-plano select { width: 100%; }
.formulario-plano ul.errorlist { list-style: none; margin: 0; padding: 0; color: var(--rojo); font-size: 0.85rem; }
.formulario-plano .aviso { flex-direction: row; }
.plegable { margin: 0 0 1rem; }
.plegable summary { padding: 0.4rem 0; font-weight: 550; }

/* Formularios con su ayuda al lado */
.rejilla-form { display: grid; grid-template-columns: minmax(0, 46rem) minmax(16rem, 26rem); gap: 1.25rem; align-items: start; }
.rejilla-form .formulario { max-width: none; }
.ayuda { background: var(--hundido); box-shadow: none; }
.ayuda h2 { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.6rem; font-size: 0.92rem; }
.ayuda h2 .icono { color: var(--tinta); }
.ayuda p, .ayuda ul { margin: 0; color: #4a4e55; font-size: 0.9rem; }
.ayuda ul { padding-left: 1.1rem; display: grid; gap: 0.45rem; }

/* Cargar: los dos pasos a la izquierda y lo subido a la derecha */
.rejilla-cargar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); gap: 1rem; align-items: start; }
.sin-js { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda-fila {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: center;
  padding: 0.7rem 0.25rem 0.7rem 0.75rem; border-top: 1px solid var(--linea);
  border-left: 3px solid transparent; margin-left: -0.25rem;
}
.agenda-fila:first-child { border-top: 0; }
.agenda-fila.rojo { border-left-color: var(--rojo); }
.agenda-fila.ambar { border-left-color: var(--ambar); }
.agenda-fila.verde { border-left-color: var(--verde); }
.agenda-fila.hecho { opacity: 0.6; }
.agenda-fila.hecho .agenda-titulo { text-decoration: line-through; text-decoration-color: var(--tenue); }
.agenda-fecha {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 8px; background: var(--hundido); border: 1px solid var(--linea); color: var(--texto);
}
.agenda-fecha:hover { text-decoration: none; border-color: var(--tinta); }
.agenda-num { font-weight: 650; font-size: 1.05rem; line-height: 1; font-variant-numeric: tabular-nums; }
.agenda-mes { font-size: 0.68rem; color: var(--suave); text-transform: uppercase; letter-spacing: 0.05em; }
.agenda-texto { min-width: 0; display: flex; flex-direction: column; }
.agenda-titulo { font-weight: 550; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grupo { font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--suave); margin: 0.9rem 0 0.2rem; }
.grupo:first-of-type { margin-top: 0; }
.grupo.rojo { color: var(--rojo); }
.mas-abajo { margin: 0.2rem 0 0.4rem; padding: 0.5rem 0.75rem; font-size: 0.85rem; color: var(--suave); background: var(--hundido); border-radius: 7px; }
.agenda-cliente { color: var(--suave); font-size: 0.84rem; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.agenda-cliente + .agenda-cliente { margin-top: 0.2rem; }
.agenda-cliente:empty { display: none; }
.agenda-cliente a { color: var(--suave); }
.agenda-cliente a:hover { color: var(--tinta); }
.cuenta-archivos { display: inline-flex; align-items: center; gap: 1px; color: var(--suave); }
.cuenta-archivos .icono { width: 14px; height: 14px; }
.agenda-fila form { margin: 0; }
.boton-paso {
  padding: 0.3rem 0.6rem; font-size: 0.78rem; font-weight: 600;
  background: var(--superficie); color: var(--tinta); border-color: var(--linea-fuerte);
}
.boton-paso .icono { width: 14px; height: 14px; }
.boton-paso:hover { background: var(--tinta-suave); border-color: var(--tinta); color: var(--tinta-fuerte); }
.hecho-marca { color: var(--verde); display: inline-flex; padding: 0 0.6rem; }

.vacio { text-align: center; padding: 2rem 1rem; color: var(--suave); }
.vacio p { margin: 0 0 0.4rem; }
.vacio strong { color: var(--texto); }

.tira { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tira-dia {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 0.35rem 0 0.4rem; border-radius: 7px; color: var(--texto); min-height: 62px;
}
.tira-dia:hover { background: var(--hundido); text-decoration: none; }
.tira-dia.pasado { color: var(--tenue); }
.tira-dia.hoy { background: var(--tinta); color: #fff; }
.tira-dia.hoy .tira-letra { color: rgba(255, 255, 255, 0.75); }
.tira-letra { font-size: 0.68rem; color: var(--tenue); font-weight: 600; }
.tira-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.tira-puntos { display: flex; align-items: center; gap: 2px; min-height: 8px; }
.tira-puntos .punto { width: 6px; height: 6px; margin: 0; }
.tira-dia.hoy .punto { box-shadow: 0 0 0 1.5px #fff; }
.tira-puntos small { font-size: 0.62rem; color: var(--suave); }

.barra-avance { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--hundido); border: 1px solid var(--linea); }
.tramo { display: block; height: 100%; min-width: 4px; }
.tramo.falta, .cuadro.falta { background: var(--ambar); }
.tramo.recibida, .cuadro.recibida { background: var(--tinta); }
.tramo.presentado, .cuadro.presentado { background: var(--verde); }
.leyenda { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.86rem; color: var(--suave); }
.leyenda li { display: flex; align-items: center; gap: 0.45rem; }
.leyenda strong { margin-left: auto; color: var(--texto); font-variant-numeric: tabular-nums; }
.cuadro { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.archivos { list-style: none; margin: 0; padding: 0; }
.archivos li { display: flex; gap: 0.7rem; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--linea); }
.archivos li:first-child { border-top: 0; }
.archivo-texto { min-width: 0; display: flex; flex-direction: column; }
.archivo-texto > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; color: var(--texto); }
.archivo-texto small { color: var(--suave); font-size: 0.8rem; }
.archivo-texto small a { color: var(--suave); }
.tipo-archivo {
  flex: none; width: 40px; padding: 0.3rem 0; text-align: center; border-radius: 6px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  background: #eeece6; color: #5b5f66;
}
.tipo-archivo.pdf { background: #f8e4e1; color: #a03427; }
.tipo-archivo.jpg, .tipo-archivo.png, .tipo-archivo.webp, .tipo-archivo.heic { background: #e6eef7; color: #335b8a; }
.tipo-archivo.docx { background: #e3eaf8; color: #2d4f9a; }
.tipo-archivo.xlsx, .tipo-archivo.csv { background: #e2f1e7; color: #276642; }
.tipo-archivo.zip { background: #f1ebde; color: #7a5a1e; }

/* ------------------------------------------------------------ cargar */

.cargar { margin-bottom: 1rem; }
.paso { display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.paso h2 { margin: 0.1rem 0 0.75rem; }
.paso-num {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tinta-suave); color: var(--tinta-fuerte); font-weight: 700; font-size: 0.9rem;
}
.paso-cuerpo { min-width: 0; }
.campos-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.campos-fila label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 550; font-size: 0.9rem; }

.zona {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center;
  padding: 2.2rem 1rem; border: 2px dashed var(--linea-fuerte); border-radius: 12px; background: var(--hundido);
  cursor: pointer; transition: border-color 0.15s, background 0.15s; margin-bottom: 0.8rem;
}
.zona:hover, .zona.encima { border-color: var(--tinta); background: var(--tinta-suave); }
.zona input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.zona-icono {
  width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--superficie); border: 1px solid var(--linea); color: var(--tinta);
}
.zona-icono .icono { width: 26px; height: 26px; }
.zona-texto { font-size: 1rem; color: var(--suave); }
.zona-texto strong { color: var(--texto); }
.zona-tipos { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 30rem; }
.zona-tipos span {
  font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: var(--superficie); border: 1px solid var(--linea); color: var(--suave);
}

/* T-0013: con cientos de archivos, la lista se desplaza por dentro y el resumen queda a la vista */
.cola {
  list-style: none; margin: 0.6rem 0 0; padding: 0; border: 1px solid var(--linea); border-radius: var(--radio);
  max-height: 30rem; overflow-y: auto;
}
.cola-fila {
  position: relative; display: grid; grid-template-columns: 1fr auto minmax(8rem, auto); gap: 0.8rem; align-items: center;
  padding: 0.6rem 0.85rem; border-top: 1px solid var(--linea); font-size: 0.9rem;
}
.cola-fila:first-child { border-top: 0; }
.cola-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cola-peso { color: var(--suave); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.cola-estado { font-size: 0.82rem; color: var(--suave); text-align: right; }
.cola-barra { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; }
.cola-barra span { display: block; height: 100%; background: var(--tinta); width: 0; transition: width 0.2s; }
.cola-fila[data-estado="bien"] { background: var(--verde-suave); }
.cola-fila[data-estado="bien"] .cola-estado { color: var(--verde); font-weight: 600; }
.cola-fila[data-estado="mal"] { background: var(--rojo-suave); }
.cola-fila[data-estado="mal"] .cola-estado { color: var(--rojo); font-weight: 500; }
/* T-0011: «Por asignar» en ámbar; el texto de lo que ha decidido la app va en su propia línea */
.cola-fila[data-estado="aviso"] { background: var(--ambar-suave); }
.cola-fila[data-estado="aviso"] .cola-estado { color: #6e4a0f; font-weight: 500; }
.cola-fila[data-estado="bien"] .cola-estado, .cola-fila[data-estado="mal"] .cola-estado, .cola-fila[data-estado="aviso"] .cola-estado {
  grid-column: 1 / -1; text-align: left; margin-top: -0.4rem;
}
.cola-fila[data-estado="bien"] .cola-barra, .cola-fila[data-estado="mal"] .cola-barra, .cola-fila[data-estado="aviso"] .cola-barra { display: none; }
.cola.solo-mirar .cola-fila[data-estado="bien"] { display: none; }
/* T-0013: lo de dentro de un ZIP, plegado debajo de su fila */
.cola-dentro { grid-column: 1 / -1; font-size: 0.82rem; }
.cola-dentro summary { cursor: pointer; color: var(--tinta); }
.cola-dentro ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.cola-dentro li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0.6rem; padding: 0.25rem 0; border-top: 1px dashed var(--linea-fuerte); }
.cola-dentro li strong { font-weight: 550; overflow-wrap: anywhere; }
.cola-dentro li[data-estado="bien"] span { color: var(--verde); }
.cola-dentro li[data-estado="aviso"] span { color: #6e4a0f; }
.cola-dentro li[data-estado="mal"] span { color: var(--rojo); }
/* T-0013: resumen de la cola, arriba de la lista */
.resumen-cola { margin-top: 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--hundido); }
.resumen-cola[data-estado="pausa"] { border-color: var(--ambar); background: var(--ambar-suave); }
.resumen-linea { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.resumen-cifras { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.resumen-cifras span { padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.resumen-cifras span:empty { display: none; }
.cifra-bien { background: var(--verde-suave); color: var(--verde); }
.cifra-aviso { background: var(--ambar-suave); color: #6e4a0f; }
.cifra-mal { background: var(--rojo-suave); color: var(--rojo); }
.resumen-barra { display: block; height: 4px; margin: 0.6rem 0; border-radius: 2px; background: var(--linea); overflow: hidden; }
.resumen-barra span { display: block; height: 100%; width: 0; background: var(--tinta); transition: width 0.3s; }
.resumen-cola[data-estado="listo"] .resumen-barra span { background: var(--verde); }
.resumen-nota { margin: 0 0 0.5rem; font-size: 0.85rem; color: #6e4a0f; }
.resumen-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.resumen-acciones .casilla { margin-right: auto; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--suave); cursor: pointer; }
.zona-otra { margin: -0.4rem 0 0.8rem; text-align: center; font-size: 0.85rem; }
button.enlace { background: none; border: 0; padding: 0; color: var(--tinta); text-decoration: underline; cursor: pointer; font: inherit; }
/* T-0013: en las demás pantallas, mientras quede algo por subir */
.cola-flotante {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; gap: 0.6rem; align-items: center;
  padding: 0.55rem 0.95rem; border-radius: 999px; background: var(--superficie); border: 1px solid var(--linea);
  box-shadow: var(--sombra-alta); font-size: 0.88rem; font-weight: 550;
}
.cola-flotante[data-estado="pausa"] { background: var(--ambar-suave); border-color: var(--ambar); }
.cola-flotante[data-estado="listo"] { background: var(--verde-suave); border-color: var(--verde); }
.acciones { display: flex; gap: 0.5rem; margin-top: 1rem; }
.cargar .elegir { margin: 0 0 1rem; }
.contador {
  display: inline-block; min-width: 1.5rem; padding: 0 0.4rem; border-radius: 999px; text-align: center;
  background: var(--ambar-suave); color: var(--ambar); font-size: 0.82rem; font-variant-numeric: tabular-nums;
}
.detectado { padding: 0 0.35rem; border-radius: 4px; background: var(--tinta-suave); color: var(--tinta); font-size: 0.75rem; }
.por-asignar { color: var(--ambar); font-weight: 600; }
.archivo-texto small.motivo { color: #6e4a0f; }
form.asignar { display: flex; gap: 0.4rem; margin: 0.35rem 0 0.2rem; }
form.asignar input { flex: 1; min-width: 0; }
details.cambiar summary { font-size: 0.8rem; color: var(--suave); cursor: pointer; }
button.pequeno, .boton.pequeno { padding: 0.25rem 0.6rem; font-size: 0.82rem; }

/* Anchos de 5 en 5 (la CSP no deja estilos en línea) */
.p0 { width: 0; } .p5 { width: 5%; } .p10 { width: 10%; } .p15 { width: 15%; } .p20 { width: 20%; }
.p25 { width: 25%; } .p30 { width: 30%; } .p35 { width: 35%; } .p40 { width: 40%; } .p45 { width: 45%; }
.p50 { width: 50%; } .p55 { width: 55%; } .p60 { width: 60%; } .p65 { width: 65%; } .p70 { width: 70%; }
.p75 { width: 75%; } .p80 { width: 80%; } .p85 { width: 85%; } .p90 { width: 90%; } .p95 { width: 95%; } .p100 { width: 100%; }

/* ------------------------------------------------------------ calendario */

.resumen {
  display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem;
  font-weight: 600; background: var(--superficie); padding: 0.55rem 0.9rem;
  border: 1px solid var(--linea); border-left: 4px solid var(--rojo); border-radius: 8px;
}
.barra-mes { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.barra-mes h1 { margin: 0 auto 0 0; }
.barra-mes .boton { background: var(--superficie); color: var(--texto); border-color: var(--linea-fuerte); }
.barra-mes .boton:hover { background: var(--hundido); }
.barra-mes .boton.principal { background: var(--tinta); color: #fff; border-color: var(--tinta); }

table.mes {
  width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed;
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra);
}
table.mes th {
  padding: 0.55rem 0.4rem; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--suave); background: var(--hundido); border-bottom: 1px solid var(--linea); text-align: left;
}
table.mes td {
  vertical-align: top; height: 7rem; padding: 0.35rem; overflow: hidden;
  border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea);
}
table.mes td:last-child { border-right: 0; }
table.mes tr:last-child td { border-bottom: 0; }
table.mes td.fuera { background: var(--hundido); }
table.mes td.fuera .num-dia { color: var(--tenue); }
table.mes td.hoy { background: #f3f8f8; }
table.mes td.hoy .num-dia { background: var(--tinta); color: #fff; }
.num-dia {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 4px; border-radius: 50%;
  font-weight: 600; font-size: 0.85rem; color: var(--texto); margin-bottom: 2px; font-variant-numeric: tabular-nums;
}
.num-dia:hover { background: var(--tinta-suave); text-decoration: none; }
.chip, .agrupado {
  display: block; margin-top: 3px; padding: 2px 6px; border-radius: 5px;
  font-size: 0.74rem; font-weight: 550; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid;
}
.chip:hover, .agrupado:hover { text-decoration: none; filter: brightness(0.97); }
.agrupado { font-weight: 650; font-size: 0.82rem; padding: 4px 6px; }
.chip-ejemplo { display: block; font-size: 0.64rem; font-weight: 400; font-style: italic; opacity: 0.85; }
.chip.rojo, .agrupado.rojo { background: var(--rojo-suave); color: var(--rojo); border-color: var(--rojo); }
.chip.ambar, .agrupado.ambar { background: var(--ambar-suave); color: var(--ambar); border-color: var(--ambar); }
.chip.verde, .agrupado.verde { background: var(--verde-suave); color: var(--verde); border-color: var(--verde); }

/* Eventos del calendario (T-0012): morado, para no confundirlos con los colores de los plazos */
.chip.evento, .agrupado.evento { background: var(--evento-suave); color: var(--evento); border-color: var(--evento); }
.chip.evento.hecho { text-decoration: line-through; opacity: 0.6; }
.punto.evento { background: var(--evento); }
.casilla-cabeza { display: flex; align-items: center; justify-content: space-between; }
.mas-dia {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 1rem; font-weight: 700; line-height: 1; color: var(--evento); opacity: 0.55; transition: opacity 0.15s, background 0.15s;
}
table.mes td:hover .mas-dia, .mas-dia:focus-visible { opacity: 1; }
.mas-dia:hover { background: var(--evento-suave); text-decoration: none; }
@media (hover: none) { .mas-dia { opacity: 0.8; } }
.barra-mes .nuevo-evento { margin-left: auto; }
.dialogo {
  border: 0; border-radius: var(--radio); box-shadow: var(--sombra-alta); padding: 1.25rem 1.4rem;
  width: min(30rem, calc(100vw - 2rem)); color: var(--texto); background: var(--superficie);
}
.dialogo::backdrop { background: rgba(31, 35, 40, 0.35); }
.dialogo-cabeza { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.dialogo-cabeza h2 { margin: 0; }
.dialogo .cerrar { background: none; border: 0; color: var(--suave); font-size: 1.5rem; line-height: 1; padding: 0 0.25rem; cursor: pointer; }
.dialogo .campos-fila p { margin: 0 0 0.85rem; }
.eventos-dia { margin-top: 1rem; }
.lista-eventos { list-style: none; margin: 0 0 1rem; padding: 0; }
.evento-fila { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.55rem 0; border-top: 1px solid var(--linea); }
.lista-eventos.tarjeta .evento-fila { padding: 0.55rem 0.75rem; }
.evento-fila:first-child { border-top: 0; }
.evento-hora { font-weight: 650; color: var(--evento); font-variant-numeric: tabular-nums; }
.evento-texto small { display: block; color: var(--suave); font-size: 0.8rem; }
.evento-fila.hecho .evento-texto { text-decoration: line-through; color: var(--suave); }
.evento-fila.archivado { opacity: 0.7; }
.evento-botones { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.leyenda-colores { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.9rem; font-size: 0.84rem; color: var(--suave); }
.leyenda-colores span { display: inline-flex; align-items: center; }

/* ------------------------------------------------------------ tablas y listas */

.tabla-caja {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  overflow-x: auto; box-shadow: var(--sombra); margin-bottom: 1rem;
}
table.lista { width: 100%; border-collapse: collapse; background: var(--superficie); }
.tabla-caja table.lista { margin: 0; }
table.lista th, table.lista td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--linea); text-align: left; vertical-align: middle; }
table.lista th {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--suave); background: var(--hundido);
}
table.lista tbody tr:last-child td { border-bottom: 0; }
table.lista tbody tr:hover td { background: #fcfbf9; }
.tabla-caja table.lista { min-width: 56rem; }
table.lista .botones { flex-wrap: wrap; }
table.lista button { padding: 0.32rem 0.65rem; font-size: 0.8rem; }
/* Listas de clientes, un pelín más pequeñas para que quepa también el contacto (T-0033) */
.tabla-caja table.lista.compacta { min-width: 0; font-size: 0.86rem; }
table.lista.compacta th, table.lista.compacta td { padding: 0.5rem 0.6rem; }
table.lista.compacta th { font-size: 0.7rem; letter-spacing: 0.04em; }
table.lista.compacta .celda-nombre { min-width: 11rem; }
table.lista.compacta .iniciales { width: 26px; height: 26px; margin-right: 0.5rem; }
table.lista.compacta .contacto { white-space: nowrap; line-height: 1.35; }
table.lista.compacta .boton-icono, table.lista.compacta .boton-icono span { font-size: 0.78rem; }

.marca {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.55rem 0.1rem 0.45rem;
  border-radius: 999px; font-size: 0.76rem; font-weight: 600;
}
.marca::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.marca.rojo { background: var(--rojo-suave); color: var(--rojo); }
.marca.ambar { background: var(--ambar-suave); color: var(--ambar); }
.marca.verde { background: var(--verde-suave); color: var(--verde); }
.marca.gris { background: var(--hundido); color: var(--suave); font-weight: 500; }
/* Clientes con cuenta de usuario: una franja verde a la izquierda de la fila (T-0029) */
table.lista tbody tr.con-cuenta td:first-child { box-shadow: inset 3px 0 0 var(--verde); }

.buscador { position: relative; flex: 1; max-width: 22rem; }
.buscador .icono { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); color: var(--tenue); }
.buscador input[type="search"] { width: 100%; padding-left: 2.2rem; }
.celda-nombre { display: flex; align-items: center; min-width: 14rem; }
.iniciales {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px; margin-right: 0.6rem; vertical-align: middle;
  background: var(--tinta-suave); color: var(--tinta-fuerte); font-weight: 700; font-size: 0.78rem;
}
.iniciales.grande { width: 52px; height: 52px; border-radius: 12px; font-size: 1.15rem; margin: 0; }
.obligacion-chip {
  display: inline-block; padding: 0 6px; margin: 1px 2px 1px 0; border-radius: 4px;
  background: var(--hundido); border: 1px solid var(--linea); font-size: 0.74rem; font-weight: 600; color: #4a4e55;
}

.ficha-cliente { display: flex; gap: 1rem; align-items: center; }
.ficha-cliente h1 { margin: 0; }
.ficha-datos { color: var(--suave); margin: 0.15rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.volver { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--suave); font-size: 0.88rem; margin-bottom: 0.75rem; }
.volver .icono { transform: scaleX(-1); width: 16px; height: 16px; }
.subida-rapida { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.subida-rapida .aviso { flex-basis: 100%; margin: 0; }
details summary { cursor: pointer; color: var(--suave); }

/* ------------------------------------------------------------ formularios */

input[type="text"], input[type="password"], input[type="date"], input[type="url"], input[type="number"], input[type="search"], input[type="email"], input[type="time"], select, textarea {
  font: inherit; font-size: 0.92rem; color: var(--texto);
  padding: 0.5rem 0.7rem; border: 1px solid var(--linea-fuerte); border-radius: 8px; background: var(--superficie);
  min-height: 38px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 3px var(--tinta-suave); }
select:disabled { background: var(--hundido); color: var(--tenue); }
input[type="file"] { font: inherit; font-size: 0.88rem; }
input[type="checkbox"] { accent-color: var(--tinta); width: 16px; height: 16px; vertical-align: -3px; }

.formulario {
  background: var(--superficie); padding: 1.25rem 1.4rem; border: 1px solid var(--linea); border-radius: var(--radio);
  box-shadow: var(--sombra); margin-bottom: 1rem; max-width: 46rem;
}
.formulario p { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.formulario p > label { font-weight: 550; font-size: 0.9rem; }
.formulario p:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 0.5rem; }
.formulario .helptext { display: block; color: var(--suave); font-size: 0.82rem; }
.formulario ul { list-style: none; padding-left: 0; margin: 0; columns: 3; }
.formulario ul li { margin-bottom: 0.3rem; }
.formulario ul.errorlist { columns: 1; color: var(--rojo); font-size: 0.85rem; }
.formulario .pie-form { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.obligacion { margin-bottom: 1.25rem; }
.obligacion h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.obligacion h2 .enlaces { margin-left: auto; font-size: 0.85rem; font-weight: 500; }


/* ------------------------------------------------------------ pantallas estrechas */

@media (max-width: 1100px) {
  .rejilla-inicio, .rejilla-form, .rejilla-cargar { grid-template-columns: 1fr; }
  .rejilla-inicio .tarjeta-agenda { grid-row: auto; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  body.con-sesion { display: block; padding-bottom: 64px; }
  /* Encima de la barra de abajo (T-0013) */
  .cola-flotante { bottom: calc(64px + 0.75rem); right: 0.75rem; }
  .lateral {
    position: fixed; z-index: 30; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; align-items: center; gap: 0; padding: 0.3rem 0.4rem;
    border-right: 0; border-top: 1px solid var(--linea);
  }
  .marca-app, .usuario, .menu-separador { display: none; }
  .menu { flex-direction: row; justify-content: space-around; overflow-x: auto; }
  .menu a { flex-direction: column; gap: 2px; padding: 0.35rem 0.5rem; font-size: 0.68rem; }
  .menu a:nth-child(n+5) { display: none; }
  .anadir summary { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 0; gap: 0; }
  .anadir-menu { top: auto; bottom: calc(100% + 10px); left: 0; right: auto; width: 16rem; }
  .contenido { padding: 1.25rem 1rem 2rem; }
  .campos-fila { grid-template-columns: 1fr; }
  table.mes td { height: 4.5rem; padding: 0.2rem; }
  .chip { font-size: 0.62rem; padding: 1px 3px; }
  /* Solo la cifra, que se lea entera (T-0016) */
  .agrupado { padding: 2px 3px; text-overflow: clip; text-align: center; }
  .agrupado-texto { display: none; }
  .formulario ul { columns: 2; }
}
@media (max-width: 520px) {
  .cifras { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .cifra { font-size: 1.9rem; }
  .agenda-fila { grid-template-columns: auto 1fr; row-gap: 0.4rem; }
  .agenda-fila form, .agenda-fila .hecho-marca { grid-column: 2; }

  .paso { grid-template-columns: 1fr; }
}

/* Clientes con filtros (T-0015) */
/* minmax(0, 1fr): que el desplegable más largo no estire la caja en el móvil */
.filtros { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; margin: 0 0 1rem; padding: 0.8rem 0.9rem; }
.filtros-fila { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: flex-end; }
.filtros-fila label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--suave); }
.filtros-fila label.buscador { flex: 1 1 18rem; max-width: 100%; min-width: 0; }
.filtros-fila label { min-width: 0; max-width: 100%; }
.filtros-fila select { min-width: 9rem; max-width: 100%; }
.resumen-estados { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0.8rem; }
.resumen-estados a.estado { font-size: 0.85rem; text-decoration: none; }
.resumen-estados a.estado.elegido { outline: 2px solid currentColor; outline-offset: 1px; }
.datos-cliente { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; font-size: 0.9rem; }
.datos-cliente dt { color: var(--suave); }
.datos-cliente dd { margin: 0; overflow-wrap: anywhere; }
/* T-0016: el alta de cliente por bloques y el ancho de la obligación en las tablas de plazos */
.formulario fieldset.bloque { border: 1px solid var(--linea); border-radius: var(--radio); padding: 0.6rem 1rem 0.2rem; margin: 0 0 1rem; min-width: 0; }
.formulario fieldset.bloque legend { padding: 0 0.4rem; font-weight: 650; font-size: 0.85rem; color: var(--suave); text-transform: uppercase; letter-spacing: 0.05em; }
.bloque-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 0 1rem; }
.bloque-campos.ancho { grid-template-columns: minmax(0, 1fr); }
.bloque-campos > div { margin: 0 0 0.8rem; }
.celda-obligacion { min-width: 11rem; }
/* Para que a 1440 px la tabla de plazos de la ficha quepa entera, con los botones (T-0016) */
.ficha-principal table.lista th, .ficha-principal table.lista td { padding-left: 0.6rem; padding-right: 0.6rem; }
/* El espacio del cliente (T-0018): el año, sus 12 meses con color y cifra, y las facturas */
.espacio { margin-bottom: 1.25rem; }
.espacio-anio { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.75rem; }
.espacio-anio h2 { margin: 0; font-size: 1.4rem; }
.meses { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; }
/* Las casillas, solo dentro de .meses: los calendarios son <table class="mes"> y un «.mes» suelto los desmontaba */
.meses .mes {
  display: flex; flex-direction: column; gap: 0.15rem; min-height: 4.6rem; padding: 0.5rem 0.6rem;
  border-radius: var(--radio); border: 1px solid var(--linea); background: var(--superficie); color: var(--texto);
}
.meses .mes:hover { text-decoration: none; border-color: var(--linea-fuerte); }
.meses .mes[aria-current="true"] { outline: 2px solid var(--tinta); outline-offset: 1px; }
.meses .mes.gris { color: var(--tenue); background: var(--hundido); }
.meses .mes.ambar { background: var(--ambar-suave); border-color: #edd6a8; }
.meses .mes.verde { background: var(--verde-suave); border-color: #bfdcc8; }
.meses .mes.amarillo { background: var(--amarillo-suave); border-color: var(--amarillo-borde); }
.mes-nombre { font-weight: 600; font-size: 0.88rem; }
.mes-cifra { font-size: 1.35rem; font-weight: 700; line-height: 1; color: var(--ambar); }
.meses .mes.verde .mes-cifra { color: var(--verde); }
.meses .mes.amarillo .mes-cifra { color: var(--amarillo-texto); }
.meses .mes.amarillo .mes-tratado { color: var(--verde); }
.mes-nuevos { font-size: 0.68rem; font-weight: 700; line-height: 1.2; color: var(--amarillo-texto); }
.mes-tratado { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: var(--verde); }
.mes-aviso { color: var(--ambar); font-size: 0.9rem; }
.facturas { list-style: none; margin: 0 0 1rem; padding: 0.3rem 1rem; }
.facturas li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0; border-top: 1px solid var(--linea); }
.facturas li:first-child { border-top: 0; }
.poner-mes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.4rem; margin: 0.4rem 0 0; }
.poner-mes label { display: flex; flex-direction: column; gap: 0.1rem; }
.poner-mes input[type="date"] { max-width: 11rem; cursor: pointer; }
.zona-boton {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem; border-radius: 10px;
  background: var(--tinta); color: #fff; font-weight: 650; font-size: 1.05rem;
}
@media (max-width: 820px) {
  .meses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* En el móvil, lo primero, subir; y el botón grande, que se pulse sin hacer zoom (C-47) */
  .espacio-cliente .ficha-lateral { order: -1; }
  .subir-factura .zona { padding: 1rem; }
  .subir-factura .zona-boton { width: 100%; justify-content: center; min-height: 3.25rem; font-size: 1.15rem; }
}

/* Los avisos en el calendario (T-0018, pieza 26): azul tinta; los que el cliente aún no ha abierto, resaltados */
.chip.aviso { background: var(--tinta-suave); color: var(--tinta-fuerte); border-left: 3px solid var(--tinta); }
.chip.aviso .icono { width: 12px; height: 12px; vertical-align: -2px; }
.chip.aviso.sin-ver { background: var(--ambar-suave); color: #6e4a0f; border-left-color: var(--ambar); font-weight: 650; }

/* Calendario de 3 meses y de año entero, y el selector de año y de vista (T-0028, bloque 4) */
.selector-periodo { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; margin: 0 0 1rem; }
.selector-periodo nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.selector-periodo .boton { background: var(--superficie); color: var(--texto); border-color: var(--linea-fuerte); }
.selector-periodo .boton.principal, .barra-mes .boton.principal { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.selector-periodo .vistas { margin-left: auto; }
.boton.apagado { opacity: 0.4; cursor: default; background: var(--superficie); color: var(--texto); border: 1px solid var(--linea-fuerte); }
.meses-peques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.meses-peques.doce { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mes-peque { padding: 0.8rem 0.9rem; }
.mes-peque h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 0.5rem; font-size: 1rem; }
.mes-peque h2 .contador { margin-left: 0.4rem; }
table.mini { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
table.mini th { font-size: 0.65rem; font-weight: 600; color: var(--tenue); text-align: center; padding: 0 0 2px; }
table.mini td { text-align: center; padding: 0; border-radius: 6px; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
table.mini td a { position: relative; display: block; padding: 0.3rem 0; color: var(--texto); border-radius: 6px; }
table.mini td a:hover { text-decoration: none; background: var(--tinta-suave); }
table.mini td.rojo { background: var(--rojo-suave); color: var(--rojo); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--rojo); }
table.mini td.ambar { background: var(--ambar-suave); color: var(--ambar); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ambar); }
table.mini td.verde { background: var(--verde-suave); color: var(--verde); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--verde); }
table.mini td.rojo a, table.mini td.ambar a, table.mini td.verde a { color: inherit; }
table.mini td.hoy a { outline: 2px solid var(--tinta); outline-offset: -2px; }
table.mini .marca { position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--evento); }
.plazos-mes { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.78rem; display: grid; gap: 0.15rem; }
.plazos-mes li { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plazos-mes .dia-corto { min-width: 1.4rem; color: var(--suave); font-variant-numeric: tabular-nums; }
.chip-ejemplo-en-linea { font-style: italic; color: var(--suave); font-size: 0.7rem; }
@media (max-width: 1100px) { .meses-peques.doce { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .meses-peques, .meses-peques.doce { grid-template-columns: 1fr 1fr; } .selector-periodo .vistas { margin-left: 0; } }
@media (max-width: 480px) { .meses-peques, .meses-peques.doce { grid-template-columns: 1fr; } }

/* El aviso para el usuario cliente: casilla grande en su espacio y una página más vistosa (T-0028, bloque 5) */
.aviso-grande {
  display: grid; justify-items: center; align-content: center; gap: 0.35rem; text-align: center;
  min-height: 11rem; padding: 1.4rem 1.2rem; border-radius: var(--radio); border: 2px solid var(--ambar);
  background: var(--ambar-suave); color: #6e4a0f; box-shadow: var(--sombra);
}
.aviso-grande-icono .icono { width: 40px; height: 40px; color: var(--ambar); }
.aviso-grande strong { font-size: 1.7rem; line-height: 1.1; }
.aviso-grande-fecha { font-size: 0.95rem; opacity: 0.85; }
.aviso-grande form { margin-top: 0.5rem; }
button.grande { padding: 0.8rem 2rem; font-size: 1.15rem; font-weight: 650; border-radius: 10px; }
.aviso-nuevo:has(.aviso-grande) { display: block; padding: 0; border: 0; background: transparent; }
.aviso-pagina { max-width: 46rem; margin: 0 auto 1.5rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra-alta, var(--sombra)); overflow: hidden; }
.aviso-banda { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 1.6rem; background: var(--tinta); color: #fff; }
.aviso-pagina.cerrado .aviso-banda { background: var(--ambar); }
.aviso-banda h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; color: inherit; }
.aviso-banda p { margin: 0.2rem 0 0; opacity: 0.9; }
.aviso-banda-icono { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.aviso-banda-icono .icono { width: 30px; height: 30px; color: #fff; }
.aviso-cuerpo { padding: 1.5rem 1.6rem; display: grid; gap: 1.1rem; }
.aviso-invitacion { margin: 0; font-size: 1.1rem; }
.aviso-texto { margin: 0; font-size: 1.1rem; line-height: 1.65; }
.aviso-adjunto { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem; border-radius: 10px; border: 1px solid var(--linea-fuerte); background: var(--hundido); color: var(--texto); }
.aviso-adjunto:hover { text-decoration: none; border-color: var(--tinta); background: var(--tinta-suave); }
.aviso-adjunto-texto { display: grid; flex: 1; min-width: 0; }
.aviso-adjunto-texto small { color: var(--suave); }
.aviso-visto { margin: 0; display: flex; align-items: center; gap: 0.4rem; color: var(--suave); font-size: 0.9rem; border-top: 1px solid var(--linea); padding-top: 0.9rem; }
.aviso-visto .icono { width: 16px; height: 16px; color: var(--verde); }
/* Los plazos del usuario cliente */
.mis-plazos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.mis-plazos li { display: flex; gap: 0.7rem; align-items: center; padding: 0.5rem 0.6rem; border-radius: 8px; border-left: 4px solid var(--verde); background: var(--verde-suave); }
.mis-plazos li.ambar { border-color: var(--ambar); background: var(--ambar-suave); }
.mis-plazos li.rojo { border-color: var(--rojo); background: var(--rojo-suave); }
.plazo-fecha { display: grid; justify-items: center; min-width: 2.6rem; line-height: 1.05; }
.plazo-fecha strong { font-size: 1.35rem; }
.plazo-fecha small { font-size: 0.65rem; letter-spacing: 0.06em; color: var(--suave); }
.plazo-texto { display: grid; min-width: 0; }
.plazo-texto small { color: var(--suave); }


/* ------------------------------------------------------------ pantallas de acceso (T-0044)
   Entrar, verificar, activar la app, recuperar, restablecer, crear cuenta y los errores: un mismo marco.
   Todo propio y sin recursos de fuera (la política de seguridad es default-src 'self'): degradados, formas y SVG. */

body.sin-sesion { display: block; min-height: 100vh; background: var(--fondo); }
.olvido { margin: 1.25rem 0 0; text-align: center; font-size: 0.9rem; }
.usuario-cuenta { font-size: 1.2rem; }

.pt { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---- el lado de la marca */
.pt-marca {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 3rem 2.5rem;
  background: linear-gradient(140deg, #052d36 0%, #0b4a56 36%, #0f6a78 70%, #1b9a9b 100%);
}
.pt-aurora { position: absolute; z-index: -1; border-radius: 50%; filter: blur(64px); animation: pt-deriva 20s ease-in-out infinite alternate; }
/* Las auroras son más oscuras y suaves donde cae el texto: el titular amarillo y el lema blanco tienen que leerse (Revisor, T-0044) */
.pt-aurora.a1 { width: 30rem; height: 30rem; left: -9rem; top: -9rem; background: #168f8a; opacity: 0.35; }
.pt-aurora.a2 { width: 24rem; height: 24rem; right: -7rem; bottom: -5rem; background: #f4c542; opacity: 0.25; animation-delay: -7s; }
.pt-aurora.a3 { width: 19rem; height: 19rem; left: 34%; top: 46%; background: #3a86d8; opacity: 0.22; animation-delay: -12s; }
.pt-marca :focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 6px; }
@keyframes pt-deriva { to { translate: 3.5rem 2.5rem; scale: 1.18; } }
.pt-rejilla {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 42%, #000 15%, transparent 72%);
}
.pt-marca-dentro { position: relative; width: min(34rem, 100%); display: grid; gap: 1.75rem; }
.pt-logo { display: inline-flex; align-items: center; gap: 0.8rem; color: #fff; justify-self: start; }
.pt-logo:hover { text-decoration: none; }
.pt-logo svg { width: 2.9rem; height: 2.9rem; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.pt-nombre { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.16em; }
.pt-lema .pt-titular { margin: 0 0 0.8rem; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; font-weight: 780; letter-spacing: -0.025em; }
.pt-resalte { background: linear-gradient(90deg, #ffe9a6, #f4c542); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pt-lema p { margin: 0; max-width: 30rem; font-size: 1.1rem; line-height: 1.55; }
.pt-lema p.pt-titular { max-width: none; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; }
.pt-roles { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.pt-roles span {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24); backdrop-filter: blur(6px);
}
.pt-roles svg { width: 1rem; height: 1rem; }

/* ---- la escena: tres tarjetas que flotan (solo adorno) */
.pt-escena { position: relative; height: 16.5rem; margin-top: 0.25rem; }
.pt-tarjeta {
  position: absolute; display: grid; gap: 0.55rem; padding: 0.95rem 1.05rem; color: var(--texto); background: rgba(255, 255, 255, 0.96);
  border-radius: 18px; box-shadow: 0 22px 44px -10px rgba(0, 20, 28, 0.45); animation: pt-flota 8s ease-in-out infinite;
}
.pt-tarjeta.t1 { left: 0; top: 0; width: 13rem; }
.pt-tarjeta.t2 { left: calc(50% - 6.4rem); bottom: 0; width: 13rem; animation-delay: -3s; }
.pt-tarjeta.t3 { right: 0; top: 1.4rem; width: 13.4rem; animation-delay: -5.5s; }
@keyframes pt-flota { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
.pt-tarjeta-cabeza { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--tinta-fuerte); }
.pt-tarjeta-cabeza svg { width: 1.15rem; height: 1.15rem; flex: none; }
.pt-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.28rem; }
.pt-dias i { display: block; aspect-ratio: 1; border-radius: 6px; background: #e9eef0; }
.pt-dias i.ok { background: #3fae6a; }
.pt-dias i.av { background: #f4c542; }
.pt-dias i.hoy { background: #0f5f6e; }
.pt-linea { display: block; height: 0.5rem; border-radius: 99px; background: #dde6e8; }
.pt-linea.c { width: 70%; }
.pt-linea.m { width: 85%; }
.pt-pildora { justify-self: start; padding: 0.18rem 0.65rem; border-radius: 99px; font-size: 0.74rem; font-weight: 700; }
.pt-pildora.verde { background: var(--verde-suave); color: var(--verde); }
.pt-pildora.ambar { background: var(--ambar-suave); color: var(--ambar); }

/* ---- el lado del formulario */
.pt-panel {
  display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at 100% 0%, var(--tinta-suave) 0, transparent 42%), radial-gradient(circle at 0% 100%, var(--ambar-suave) 0, transparent 40%), var(--fondo);
}
.pt-caja {
  position: relative; width: min(26rem, 100%); padding: 2.4rem 2.1rem 2.1rem; background: var(--superficie);
  border: 1px solid var(--linea); border-radius: 24px; box-shadow: 0 34px 64px -26px rgba(11, 74, 86, 0.42), 0 2px 6px rgba(31, 35, 40, 0.06);
  animation: pt-entra 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.pt-caja.ancha { width: min(31rem, 100%); }
.pt-caja { overflow-wrap: anywhere; }
@keyframes pt-entra { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.pt-caja::before { content: ""; position: absolute; left: 2.1rem; right: 2.1rem; top: -1px; height: 4px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg, #0f5f6e, #1b9a9b, #f4c542); }
.pt-sello {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; margin: 0 0 1.1rem; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #0f5f6e, #1b9a9b); box-shadow: 0 12px 22px -10px rgba(15, 95, 110, 0.7);
}
.pt-sello svg { width: 1.7rem; height: 1.7rem; }
.pt-sello.ok { background: linear-gradient(135deg, #2d7a4c, #3fae6a); box-shadow: 0 12px 22px -10px rgba(45, 122, 76, 0.7); }
.pt-sello.aviso { background: linear-gradient(135deg, #c98a1a, #f4c542); color: #4a3a05; box-shadow: 0 12px 22px -10px rgba(168, 106, 18, 0.65); }
.pt-caja h1 { margin: 0 0 0.4rem; font-size: 1.7rem; font-weight: 760; letter-spacing: -0.02em; line-height: 1.15; }
.pt-caja .sub { margin: 0 0 1.4rem; color: var(--suave); font-size: 0.97rem; line-height: 1.5; }
.pt-caja .nota { color: var(--suave); font-size: 0.85rem; line-height: 1.45; margin: 0.8rem 0 0; }
.pt-caja label { display: block; margin-top: 1rem; font-weight: 600; font-size: 0.9rem; }
.pt-caja input[type="text"], .pt-caja input[type="password"], .pt-caja input[type="email"] {
  width: 100%; margin-top: 0.35rem; padding: 0.8rem 0.95rem; min-height: 3rem; border-radius: 12px; font-size: 1rem;
  background: #fcfcfa; border: 1.5px solid var(--linea-fuerte); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.pt-caja input:hover { border-color: var(--tenue); }
.pt-caja input:focus { background: #fff; border-color: var(--tinta); box-shadow: 0 0 0 4px var(--tinta-suave); }
.pt-caja input[readonly] { background: var(--hundido); color: var(--suave); }
.pt-caja input.codigo { text-align: center; font-size: 1.55rem; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; padding-left: 1.3rem; }
.pt-caja button[type="submit"], .pt-caja .boton {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; min-height: 3.1rem; margin-top: 1.5rem; padding: 0.8rem 1rem;
  border: 0; border-radius: 12px; font-size: 1.02rem; font-weight: 700; color: #fff; white-space: normal; text-align: center;
  background: linear-gradient(135deg, #0f5f6e 0%, #14828b 100%); box-shadow: 0 14px 24px -12px rgba(15, 95, 110, 0.85);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.pt-caja button[type="submit"]:hover, .pt-caja .boton:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 18px 28px -12px rgba(15, 95, 110, 0.9); text-decoration: none; }
.pt-caja button[type="submit"]:active, .pt-caja .boton:active { transform: translateY(0); }
.pt-caja button.secundario {
  margin-top: 0.75rem; min-height: 2.8rem; background: var(--superficie); color: var(--tinta-fuerte); box-shadow: none;
  border: 1.5px solid var(--linea-fuerte); font-weight: 650;
}
.pt-caja button.secundario:hover { background: var(--tinta-suave); border-color: var(--tinta); box-shadow: none; }
.pt-caja .error { margin: 0 0 1rem; padding: 0.65rem 0.85rem; border-radius: 12px; border-left: 4px solid var(--rojo); background: var(--rojo-suave); color: var(--texto); font-size: 0.92rem; }
.pt-caja .mensajes { margin: 0 0 1.1rem; }
.pt-caja form + form { margin-top: 0; }
.pt-caja a { font-weight: 600; }
.pt-caja input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; }

/* la app de códigos: pasos, QR y clave a mano; y los códigos de recuperación */
.pt-caja .pasos { list-style: none; counter-reset: paso; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.85rem; line-height: 1.45; }
.pt-caja .pasos li { position: relative; margin: 0; padding-left: 2.4rem; counter-increment: paso; font-size: 0.95rem; }
.pt-caja .pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: var(--tinta-suave); color: var(--tinta-fuerte); font-weight: 800; font-size: 0.85rem;
}
.pt-caja .pasos p { margin: 0.35rem 0 0; }
.qr { display: block; width: max-content; max-width: 100%; margin: 0.65rem 0 0.25rem; padding: 0.65rem; background: #fff; border: 1px solid var(--linea-fuerte); border-radius: 16px; line-height: 0; box-shadow: var(--sombra); }
.qr svg { width: 11.5rem; height: 11.5rem; max-width: 100%; }
.clave-a-mano { display: block; padding: 0.55rem 0.7rem; border-radius: 10px; background: var(--hundido); border: 1px dashed var(--linea-fuerte); font-size: 1.02rem; letter-spacing: 0.08em; word-break: break-word; }
.codigos-recuperacion { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; counter-reset: cod; }
.codigos-recuperacion li { margin: 0; padding: 0.55rem 0.4rem; border-radius: 12px; text-align: center; background: var(--hundido); border: 1px solid var(--linea); }
.codigos-recuperacion code { font-size: 1.02rem; font-weight: 700; letter-spacing: 0.06em; color: var(--tinta-fuerte); }

/* ---- móvil y pantallas bajas */
@media (max-width: 900px) {
  .pt { grid-template-columns: 1fr; min-height: 0; }
  .pt-marca { justify-content: flex-start; padding: 1.5rem 1.25rem 4.75rem; }
  .pt-marca-dentro { gap: 1rem; }
  .pt-lema p.pt-titular { margin: 0; font-size: clamp(1.55rem, 7vw, 2rem); }
  .pt-lema p:not(.pt-titular), .pt-roles, .pt-escena { display: none; }
  /* Detrás del titular, solo el degradado oscuro: el amarillo nunca sobre algo más claro que #0f6a78 */
  .pt-marca { background: linear-gradient(140deg, #052d36 0%, #0b4a56 65%, #0f6a78 100%); }
  .pt-aurora.a2, .pt-aurora.a3 { display: none; }
  .pt-aurora.a1 { opacity: 0.22; }
  .pt-logo svg { width: 2.5rem; height: 2.5rem; }
  .pt-panel { position: relative; align-items: flex-start; margin-top: -3.4rem; padding: 0 1rem 2rem; background: none; }
  .pt-caja, .pt-caja.ancha { width: 100%; padding: 1.7rem 1.3rem 1.5rem; border-radius: 22px; }
  .pt-caja::before { left: 1.3rem; right: 1.3rem; }
  .pt-caja h1 { font-size: 1.5rem; }
}
@media (min-width: 901px) and (max-width: 1100px) { .pt-escena { display: none; } }
@media (min-width: 901px) and (max-height: 700px) {
  .pt-marca { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  .pt-escena { display: none; }
}
@media (max-width: 380px) {
  .pt-caja input.codigo { letter-spacing: 0.18em; font-size: 1.35rem; }
  .codigos-recuperacion code { font-size: 0.92rem; letter-spacing: 0.03em; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-aurora, .pt-tarjeta, .pt-caja { animation: none; }
  .pt-caja button[type="submit"], .pt-caja .boton, .pt-caja input { transition: none; }
}
