/* Sistema visual basado en "Dashboard - Free UI Kit" (Figma Community), tablero SE·T.
   Medidas y colores tomados del diseño: menú 238 px, panel derecho 470 px, Manrope, azul #369FFF. */

@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fuentes/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --azul: #369fff;
  --azul-oscuro: #006ed3;
  --celeste: #ebf5ff;
  --celeste-2: #d7ecff;
  --texto: #303030;
  --tinta: #1f3864; /* azul marino de la marca: el monograma VM y el nombre de la firma */
  --gris: #bdbdbd;
  --gris-2: #909090;
  --gris-azul: #8ea3b7;
  --fila: #f7f7f7;
  --borde: #f2f2f2;
  --rojo: #eb5757;

  --tarjeta-azul: #2b95f6;
  --tarjeta-naranja: #ff993a;
  --tarjeta-naranja-2: #ff8e26;
  --tarjeta-verde: #7cbc3d;
  --tarjeta-amarilla: #ffd143;
  --tarjeta-amarilla-2: #ffc922;

  --tile-azul: #d0e5f9;
  --tile-naranja: #f9e4d1;
  --tile-verde: #e1edd2;
  --tile-amarillo: #f9efd3;
  --tile-gris: #ececec;
  --icono-azul: #369fff;
  --icono-naranja: #ff993a;
  --icono-verde: #7cbc3d;
  --icono-amarillo: #f4b400;
  --icono-gris: #909090;

  --lateral: 238px;
  --panel: 470px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--texto);
  font: 500 14px/1.45 "Manrope", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.gris { color: var(--gris); }
.gris-2 { color: var(--gris-2); }
.azul { color: var(--azul); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.visual-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

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

.app { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr) var(--panel); min-height: 100vh; }
.app.sin-panel { grid-template-columns: var(--lateral) minmax(0, 1fr); }

.lateral {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 50px 0 38px; border-right: 1px solid var(--borde); background: #fff;
}
/* Logotipo: el monograma queda centrado sobre los íconos del menú y alineado con la tarjeta de WhatsApp. */
.logo { display: flex; align-items: center; gap: 12px; padding-left: 34px; color: var(--tinta); font: 800 15px/1.2 "Manrope"; letter-spacing: -.005em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo-nombre { min-width: 0; }
.logo-nombre span { display: block; white-space: nowrap; }
.logo-nombre i { font-style: normal; color: var(--azul); }
.logo-nombre small { display: none; }
.menu { display: flex; flex-direction: column; gap: 4px; margin-top: 104px; }
.menu a {
  position: relative; display: flex; align-items: center; gap: 22px;
  height: 58px; padding: 0 30px 0 42px; color: var(--gris); font-size: 16px; font-weight: 500;
}
.menu a:hover { color: var(--texto); text-decoration: none; }
.menu a.activo { color: var(--azul); }
@media (max-height: 940px) and (min-width: 761px) {
  .menu { margin-top: 56px; }
  .menu a { height: 52px; }
}
.menu .punto-activo { width: 8px; height: 8px; flex: none; margin-left: -6px; border-radius: 50%; background: var(--azul); }
.menu .cuenta { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--rojo); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.plan { margin: auto 34px 0; padding: 22px 18px 18px; border-radius: 16px; background: var(--celeste); }
.plan h3 { font-size: 15px; font-weight: 600; }
.plan p { margin-top: 4px; font-size: 12.5px; color: var(--gris-azul); }
.plan .pie { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.plan .pie a { font-size: 13px; color: var(--azul); }
.plan .pie a b { font-weight: 800; }
.plan .flecha { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--azul); display: grid; place-items: center; color: var(--azul); }
.plan .flecha svg { width: 16px; height: 16px; }
.prueba-aviso { margin: 14px 34px 0; padding: 10px 14px; border-radius: 12px; background: var(--tile-amarillo); color: #8a6500; font-size: 12px; line-height: 1.4; }
.prueba-aviso a { color: inherit; font-weight: 700; }

.principal { min-width: 0; padding: 50px 48px 64px; container-type: inline-size; }
.panel { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 32px 38px 40px 40px; border-left: 1px solid var(--borde); scrollbar-width: thin; }

/* -------------------------------------------------------------- encabezados */

.saludo { font-size: 19px; font-weight: 500; color: var(--azul); letter-spacing: .01em; }
.saludo b { font-weight: 800; }
.cabecera { display: flex; align-items: center; gap: 28px; margin: 38px 0 24px; }
.cabecera:first-child { margin-top: 6px; }
.cabecera h1, .cabecera h2 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.cabecera h2 { font-size: 26px; }
.cabecera .ver { font-size: 14px; font-weight: 500; }
.cabecera .derecha { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.fecha { display: flex; align-items: center; gap: 12px; color: var(--azul); font-size: 17px; font-weight: 600; }
.fecha svg { color: var(--gris-2); }
.migas { font-size: 13px; color: var(--gris); }
.migas a { color: var(--gris-2); }
.subtitulo { margin-top: 6px; color: var(--gris-2); font-size: 14px; }

.buscar { display: flex; align-items: center; gap: 12px; color: var(--gris); }
.buscar input, .buscar input[type=search] { width: 160px; height: 36px; border: 0; background: transparent; padding: 0; font: 500 14px "Manrope"; color: var(--texto); }
.buscar input::placeholder { color: var(--gris); }
.buscar input:focus { outline: none; background: transparent; }

/* ------------------------------------------------------------- tarjetas de color */

.tarjetas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
/* En pantallas anchas las cuatro tarjetas van en una fila (el kit está pensado a 1440 px). */
@container (min-width: 1000px) {
  .tarjetas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tarjetas .tarjeta-color .ilustracion { width: 72px; height: 82px; right: 14px; bottom: 12px; }
}
.tarjeta-color {
  position: relative; overflow: hidden; height: 150px; padding: 22px 24px; border-radius: 16px; color: #fff;
  background: var(--fondo); box-shadow: 0 10px 22px -10px var(--sombra);
  display: flex; flex-direction: column; justify-content: space-between;
}
a.tarjeta-color:hover { text-decoration: none; transform: translateY(-2px); transition: transform .2s; }
.tarjeta-color::before, .tarjeta-color::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.tarjeta-color::before { width: 220px; height: 220px; right: -70px; bottom: -120px; }
.tarjeta-color::after { width: 140px; height: 140px; right: -20px; bottom: -90px; background: rgba(255, 255, 255, .08); }
.tarjeta-color.azul { --fondo: var(--tarjeta-azul); --sombra: rgba(43, 149, 246, .7); }
.tarjeta-color.naranja { --fondo: linear-gradient(135deg, var(--tarjeta-naranja), var(--tarjeta-naranja-2)); --sombra: rgba(255, 142, 38, .7); }
.tarjeta-color.verde { --fondo: var(--tarjeta-verde); --sombra: rgba(124, 188, 61, .7); }
.tarjeta-color.amarilla { --fondo: linear-gradient(135deg, var(--tarjeta-amarilla), var(--tarjeta-amarilla-2)); --sombra: rgba(255, 201, 34, .75); }
.tarjeta-color > div:first-child { position: relative; z-index: 2; max-width: calc(100% - 84px); }
.tarjeta-color h3 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.tarjeta-color small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; font-weight: 500; opacity: .92; }
.tarjeta-color .ilustracion { position: absolute; right: 18px; bottom: 14px; width: 92px; height: 104px; z-index: 1; }
.anillo { position: relative; z-index: 1; width: 48px; height: 48px; }
.anillo svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 3.5; stroke-linecap: round; }
.anillo .fondo-anillo { stroke: rgba(255, 255, 255, .3); }
.anillo .valor-anillo { stroke: #fff; transition: stroke-dashoffset .8s cubic-bezier(.2, .7, .2, 1); }
.anillo span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- filas (planning) */

.filas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px 30px; }
.filas.una { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.fila {
  position: relative; display: flex; align-items: center; gap: 16px; min-height: 78px;
  padding: 14px 16px 14px 14px; border-radius: 12px; background: var(--fila); color: var(--texto);
}
a.fila:hover, .fila[data-href]:hover { text-decoration: none; background: #f1f3f5; cursor: pointer; }
.tile { width: 48px; height: 48px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--tile-azul); color: var(--icono-azul); }
.tile.naranja { background: var(--tile-naranja); color: var(--icono-naranja); }
.tile.verde { background: var(--tile-verde); color: var(--icono-verde); }
.tile.amarillo { background: var(--tile-amarillo); color: var(--icono-amarillo); }
.tile.gris { background: var(--tile-gris); color: var(--icono-gris); }
.tile svg { width: 24px; height: 24px; }
.fila .cuerpo-fila { min-width: 0; flex: 1; }
.fila .titulo { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .detalle { margin-top: 3px; font-size: 12.5px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .lado { text-align: right; white-space: nowrap; }
.fila .lado b { display: block; font-size: 14px; font-weight: 700; }
.fila .lado span { font-size: 12.5px; color: var(--gris); }
.fila .col.cliente { width: 22%; font-size: 13px; color: var(--gris-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kebab { width: 24px; height: 24px; flex: none; display: grid; place-items: center; color: var(--gris-2); border-radius: 6px; }
.kebab:hover { background: #e9ebee; text-decoration: none; }
.kebab svg { width: 20px; height: 20px; }
.estado-texto { font-size: 12.5px; font-weight: 600; }
.estado-texto.procesado { color: var(--icono-verde); }
.estado-texto.revision { color: #d99a00; }
.estado-texto.error { color: var(--icono-naranja); }
.estado-texto.recibido { color: var(--azul); }
.estado-texto.rechazado, .estado-texto.duplicado, .estado-texto.anulada { color: var(--gris-2); }
.vacio { padding: 36px 20px; border-radius: 12px; background: var(--fila); color: var(--gris-2); text-align: center; }

/* ------------------------------------------------------------- panel derecho */

.cuenta-usuario { display: flex; align-items: center; gap: 26px; }
.campana { position: relative; color: var(--gris-2); display: grid; place-items: center; width: 40px; height: 40px; flex: none; }
.campana:hover { text-decoration: none; color: var(--texto); }
.campana .punto { position: absolute; top: 7px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--rojo); border: 2px solid #fff; }
.chip-usuario { flex: 1; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 18px 0 10px; border-radius: 12px; background: var(--celeste); color: var(--texto); }
.chip-usuario:hover { text-decoration: none; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.chip-usuario .quien b { display: block; font-size: 15px; font-weight: 600; color: var(--texto); }
.chip-usuario .quien small { display: block; font-size: 12px; color: var(--azul); }
.chip-usuario svg { margin-left: auto; width: 20px; height: 20px; color: var(--texto); }

.panel h2 { font-size: 24px; font-weight: 600; margin: 40px 0 22px; }
.estadisticas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.estadistica {
  display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1 / 1; min-height: 150px;
  padding: 26px 22px 24px; border-radius: 20px; background: var(--celeste); color: var(--gris-azul);
}
a.estadistica:hover { text-decoration: none; background: #e2f0ff; }
.estadistica.activa { background: var(--celeste-2); }
.estadistica p { font-size: 16px; line-height: 1.3; }
.estadistica .pie { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.estadistica .pie::before { content: ""; width: 3px; height: 28px; flex: none; border-radius: 2px; background: var(--azul); margin-bottom: 6px; }
.estadistica b { font-size: 40px; line-height: 1; font-weight: 700; color: var(--azul-oscuro); letter-spacing: -.01em; }
.estadistica b.chica { font-size: 21px; white-space: nowrap; }
.estadistica b small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--gris-azul); }

.cabecera-panel { display: flex; align-items: baseline; justify-content: space-between; margin: 48px 0 26px; }
.cabecera-panel h2 { margin: 0; }
.pestanas { display: flex; gap: 18px; font-size: 14px; }
.pestanas a { color: var(--gris); }
.pestanas a.activa { color: var(--azul); }
.pestanas a:hover { text-decoration: none; color: var(--texto); }
.grafico { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; align-items: end; height: 290px; }
.barra-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 14px; }
.barra { width: 28px; min-height: 28px; border-radius: 14px; background: var(--celeste-2); transition: height .6s cubic-bezier(.2, .7, .2, 1); }
.barra.fuerte { background: var(--azul); }
.barra-col span { font-size: 14px; color: var(--texto); white-space: nowrap; }
.cabecera-panel .ver { font-size: 14px; font-weight: 500; }
.salir { margin-top: 36px; text-align: right; }

/* Actividad del inicio: recibidos (pista clara) y procesados (relleno azul) por franja. */
/* Cifras en columna a la izquierda y gráfico a la derecha: el gráfico se queda con todo el alto. */
.actividad { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 40px; }
/* La columna de cifras no pasa de 340 px y se apoya en la base de las barras aunque el gráfico crezca. */
.cifras { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; align-self: end; height: 100%; max-height: 340px; padding-bottom: 32px; }
.cifra { position: relative; padding-left: 15px; }
.cifra::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--azul); }
.cifra > span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gris-azul); }
.cifra b { display: block; margin-top: 4px; font-size: 24px; line-height: 1.1; font-weight: 700; color: var(--azul-oscuro); letter-spacing: -.01em; white-space: nowrap; }
.cifra b small { margin-left: 3px; font-size: 14px; font-weight: 600; color: var(--gris-azul); letter-spacing: 0; }
.cifra b small.antes { margin: 0 5px 0 0; }
.punto-leyenda { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--azul); }
.punto-leyenda.claro { background: var(--celeste-2); }
.grafico.ancho { gap: 8px; height: 260px; }
.grafico.ancho .barra-col { gap: 12px; }
.pista { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.grafico.ancho .barra { position: relative; overflow: hidden; }
.barra i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: inherit; background: var(--azul); transition: height .6s cubic-bezier(.2, .7, .2, 1); }
.actividad[data-modo="dia"] .barra { width: 14px; min-height: 14px; border-radius: 7px; }
.actividad[data-modo="mes"] .barra { width: 12px; min-height: 12px; border-radius: 6px; }
.grafico.ancho .barra-col span { min-height: 20px; font-size: 13px; color: var(--gris-2); }
.grafico.ancho .barra-col.actual span { color: var(--azul); font-weight: 700; }
.grafico.ancho .barra-col.actual .barra { background: #c3e0ff; }
.grafico.ancho { position: relative; }
.grafico-vacio { position: absolute; left: 0; right: 0; top: 38%; text-align: center; color: var(--gris-2); font-size: 14px; pointer-events: none; }

/* Clientes del mes (panel del inicio). */
.clientes-mes { display: flex; flex-direction: column; gap: 10px; }
.clientes-mes .fila { min-height: 64px; padding: 10px 16px 10px 10px; gap: 14px; }
.clientes-mes .fila:hover { text-decoration: none; background: #f1f3f5; }
.clientes-mes .tile { width: 44px; height: 44px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.clientes-mes .monto { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* El inicio se ajusta al alto de la ventana: el gráfico y las estadísticas se reparten el espacio libre. */
.principal.ajustado { display: flex; flex-direction: column; padding-bottom: 32px; }
.principal.ajustado > * { flex-shrink: 0; }
.principal.ajustado .actividad { flex: 1 0 auto; min-height: 250px; }
.principal.ajustado .grafico.ancho { height: auto; max-height: 480px; }
/* Con el centro ancho (tarjetas en una fila) las cifras van en fila encima del gráfico. */
@container (min-width: 1000px) {
  .actividad { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 28px; }
  .cifras { flex-direction: row; justify-content: flex-start; gap: 64px; align-self: start; height: auto; max-height: none; padding-bottom: 0; }
}
.panel.ajustado { display: flex; flex-direction: column; }
.panel.ajustado > * { flex-shrink: 0; }
.panel.ajustado .estadisticas { flex: 1 1 0; min-height: 260px; max-height: 392px; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel.ajustado .estadistica { aspect-ratio: auto; min-height: 0; }
.panel.ajustado .cabecera-panel { margin: 34px 0 18px; }
.panel.ajustado .salir { margin-top: auto; padding-top: 24px; }
/* Ventanas bajas (laptops de 864 px): menos aire entre bloques para que el inicio quepa sin desplazar. */
@media (max-height: 900px) {
  .principal.ajustado { padding-top: 40px; }
  .principal.ajustado .cabecera { margin: 28px 0 18px; }
}

.bloque-panel { margin-top: 34px; }
.bloque-panel > h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.tarjeta-celeste { padding: 20px; border-radius: 16px; background: var(--celeste); }
.formulario-panel { display: flex; flex-direction: column; gap: 16px; }
/* Libros: descarga del paquete de documentos del mes. */
.paquete-mes { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; margin-bottom: 24px; padding: 12px 16px 12px 12px; border-radius: 12px; background: var(--celeste); }
.paquete-mes .cuerpo-fila { flex: 1; min-width: 240px; }
.paquete-mes .titulo { font-size: 14px; font-weight: 600; }
.paquete-mes .detalle { margin-top: 3px; font-size: 12.5px; color: var(--gris-azul); }
.paquete-mes .boton.chico { background: #fff; }
.paquete-mes .boton.chico.primario { background: var(--azul); }
/* Usuarios: solicitudes de acceso por aprobar, y la vista previa de los correos. */
.solicitudes { margin-bottom: 24px; border-color: var(--tile-amarillo); }
/* Si no cabe todo en una línea, los botones bajan a la derecha y el nombre y el correo se leen completos. */
.solicitudes .fila { flex-wrap: wrap; row-gap: 10px; }
.solicitudes .cuerpo-fila { min-width: 240px; }
.solicitudes .detalle { white-space: normal; }
.aprobar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.aprobar select { width: 190px; height: 34px; padding: 0 10px; background: #fff; font-size: 13px; }
.muestras-correo { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 24px; }
.muestras-correo .tarjeta-blanca + .tarjeta-blanca { margin-top: 0; }
.muestra-correo iframe { display: block; width: 100%; height: 720px; border: 0; border-radius: 12px; background: #eef1f6; }
.formulario-panel input[type], .formulario-panel select { background: #fff; }

/* --------------------------------------------------------------- controles */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 10px; border: 0;
  background: var(--celeste); color: var(--azul); font: 600 14px "Manrope"; cursor: pointer; white-space: nowrap;
}
.boton:hover { text-decoration: none; background: #dcedff; }
.boton.primario { background: var(--azul); color: #fff; box-shadow: 0 8px 18px -10px rgba(54, 159, 255, .9); }
.boton.primario:hover { background: #2490f2; }
.boton.peligro { background: #fdecec; color: var(--rojo); }
.boton.peligro:hover { background: #fbdcdc; }
.boton.chico { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.boton.ancho { width: 100%; }
.boton:disabled { opacity: .6; cursor: progress; }
.enlace { border: 0; background: none; padding: 0; color: var(--azul); font: 600 13px "Manrope"; cursor: pointer; }
.enlace.peligro { color: var(--rojo); }
form.en-linea { display: inline; }

.campo > label, label.etq { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--texto); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=month], input[type=search], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid transparent; border-radius: 10px;
  background: var(--fila); color: var(--texto); font: 500 14px "Manrope";
  transition: border-color .15s, background .15s;
}
textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--gris); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); background: #fff; }
input.cifra { text-align: right; }
.ayuda { margin-top: 6px; font-size: 12.5px; color: var(--gris-2); }
.casilla { display: grid; grid-template-columns: 20px 1fr; gap: 2px 12px; align-items: start; cursor: pointer; font-size: 14px; font-weight: 600; }
.casilla input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--azul); }
.casilla small { grid-column: 2; font-size: 12.5px; font-weight: 500; color: var(--gris-2); }
.campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.campos .ancho { grid-column: 1 / -1; }

.tarjeta-blanca { padding: 26px 28px; border-radius: 16px; background: #fff; border: 1px solid var(--borde); box-shadow: 0 12px 32px -24px rgba(48, 48, 48, .25); }
.tarjeta-blanca + .tarjeta-blanca { margin-top: 24px; }
.tarjeta-blanca > h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.tarjeta-blanca > h2 + p { color: var(--gris-2); font-size: 13px; margin-bottom: 20px; }
.pie-acciones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.pie-acciones .izq { margin-right: auto; }

.notas { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.nota { padding: 14px 18px; border-radius: 12px; background: var(--tile-verde); color: #3f6d12; font-size: 14px; font-weight: 600; animation: nota .4s cubic-bezier(.2, .7, .2, 1) both; }
.nota-aviso { background: var(--tile-amarillo); color: #8a6500; }
.nota-error { background: #fdecec; color: #b3261e; }
.nota-info { background: var(--celeste); color: var(--azul-oscuro); }
@keyframes nota { from { opacity: 0; transform: translateY(-6px); } }

.lista-filtros { display: flex; flex-direction: column; gap: 8px; }
.lista-filtros a { display: flex; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border-radius: 12px; color: var(--texto); font-weight: 600; }
.lista-filtros a:hover { background: var(--fila); text-decoration: none; }
.lista-filtros a.activo { background: var(--celeste); color: var(--azul); }
.lista-filtros a .tile { width: 36px; height: 36px; border-radius: 9px; }
.lista-filtros a .tile svg { width: 18px; height: 18px; }
.lista-filtros a span:last-child { margin-left: auto; color: var(--gris-2); font-weight: 600; }

.carga { position: relative; display: block; padding: 22px 20px; border-radius: 16px; background: var(--celeste); border: 1.5px dashed #a8d2ff; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.carga svg { width: 30px; height: 30px; color: var(--azul); }
.carga strong { display: block; margin-top: 8px; font-size: 15px; }
.carga span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--gris-azul); }
.carga input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.carga:hover, .carga.encima { border-color: var(--azul); background: #e0efff; }
.carga.lista strong::after { content: " · " attr(data-archivo); font-weight: 500; color: var(--azul); }

/* ---------------------------------------------------------------- documento */

.doc-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.doc-cabecera h1 { font-size: 28px; font-weight: 600; margin-top: 6px; }
.estimado { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 28px 0; }
.estimado .estadistica { aspect-ratio: auto; min-height: 140px; }
.chequeos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chequeos li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fila); font-size: 13.5px; font-weight: 600; }
.chequeos li .tile { width: 30px; height: 30px; border-radius: 8px; }
.chequeos li .tile svg { width: 16px; height: 16px; }
.chequeos li.no { background: #fff8e6; color: #7a5a00; }
.vista-doc { border-radius: 16px; overflow: hidden; background: var(--fila); }
.vista-doc iframe, .vista-doc img { display: block; width: 100%; height: 560px; border: 0; background: var(--fila); }
.vista-doc img { height: auto; max-height: 560px; object-fit: contain; }
.vista-doc .pie { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--gris-2); }
.recorrido { display: flex; flex-direction: column; gap: 12px; }
.recorrido .fila { min-height: 64px; }
.montos { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.montos th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--gris-2); padding: 0 4px; }
.montos th.num { text-align: right; }
.montos td { padding: 0 4px; vertical-align: middle; font-weight: 600; }
.montos td:first-child { font-size: 13.5px; }
.montos input { height: 40px; }
pre.json { margin: 12px 0 0; padding: 16px; border-radius: 12px; background: var(--fila); font: 12px/1.55 ui-monospace, Consolas, monospace; color: var(--gris-2); max-height: 320px; overflow: auto; }
details.plegable > summary { cursor: pointer; font-weight: 600; color: var(--azul); list-style: none; }
details.plegable > summary::-webkit-details-marker { display: none; }

/* ------------------------------------------------------------------ libros */

.flecha-periodo { display: grid; color: var(--gris-2); }
.flecha-periodo:hover { color: var(--azul); }
.barra-libro { display: flex; align-items: center; gap: 12px; margin: -4px 0 26px; }
.barra-libro form { flex: 1; max-width: 460px; }
.barra-libro .boton svg { width: 18px; height: 18px; }
.resumen-libro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 26px; }
.resumen-libro .estadistica { aspect-ratio: auto; min-height: 136px; padding: 22px 22px 20px; }
.tabla-libro-marco { overflow-x: auto; border: 1px solid var(--borde); border-radius: 14px; }
.tabla-libro { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-libro th { background: var(--celeste); color: var(--gris-azul); font-size: 12px; font-weight: 600; text-align: left; padding: 12px 10px; white-space: nowrap; }
.tabla-libro td { padding: 11px 10px; border-top: 1px solid var(--borde); vertical-align: top; white-space: nowrap; }
.tabla-libro th:first-child, .tabla-libro td:first-child { padding-left: 16px; }
.tabla-libro th:last-child, .tabla-libro td:last-child { padding-right: 16px; }
.tabla-libro td small { display: block; margin-top: 2px; color: var(--gris-2); font-size: 11.5px; font-weight: 500; }
.tabla-libro td b { font-weight: 600; }
.tabla-libro .num { text-align: right; }
.tabla-libro .num small { display: inline; margin: 0 0 0 6px; }
.tabla-libro .linea { display: block; }
.tabla-libro td.nombre { white-space: normal; min-width: 170px; }
.tabla-libro tbody tr:hover { background: var(--fila); cursor: pointer; }
.tabla-libro tfoot td { background: var(--celeste); color: var(--azul-oscuro); font-weight: 700; border-top: 0; }

/* Ficha del documento: campos que solo aplican a compras o a ventas. */
#datos-documento[data-operacion="venta"] [data-solo="compra"], #datos-documento[data-operacion="compra"] [data-solo="venta"] { display: none !important; }
.subtitulo-form { font-size: 15px; font-weight: 700; }

/* ------------------------------------------------- burbujas de la escena de la portada */

@keyframes burbuja { from { opacity: 0; transform: translateY(8px); } }
.escribiendo { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: 4px 16px 16px 16px; background: #fff; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--gris); animation: punto 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; }
.escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

/* ---------------------------------------------------------------- ajustes */

.tabla-conceptos { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.tabla-conceptos th { text-align: left; font-size: 12.5px; color: var(--gris-2); font-weight: 600; padding: 0 6px; white-space: nowrap; }
.tabla-conceptos td { padding: 0 6px; vertical-align: middle; }
.tabla-conceptos input[type=text] { height: 38px; padding: 0 10px; }
.qr img { display: block; width: 100%; max-width: 260px; aspect-ratio: 1; padding: 12px; border-radius: 16px; background: #fff; }
dl.datos { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; font-size: 14px; }
dl.datos dt { color: var(--gris-2); }
dl.datos dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ---------------------------------------------------------------- entrada */

.entrada { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 36%); }
.entrada-izq { padding: 50px 64px; display: flex; flex-direction: column; }
.entrada-izq .logo { padding-left: 0; gap: 14px; font-size: 21px; }
.entrada-izq .logo svg { width: 48px; height: 48px; }
.entrada-izq .logo-nombre span { display: inline; }
.entrada-izq .logo-nombre small { display: block; margin-top: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gris-azul); }
.entrada-izq .contenido { margin: auto 0; }
.entrada-izq h2 { font-size: 34px; font-weight: 700; line-height: 1.2; margin-bottom: 36px; max-width: 620px; }
.entrada-izq h2 span { color: var(--azul); }
.entrada-der { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--celeste); }
.entrada-der form, .tarjeta-entrada { width: 100%; max-width: 360px; padding: 36px 32px; border-radius: 20px; background: #fff; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -40px rgba(0, 110, 211, .45); }
.entrada-der h1 { font-size: 26px; font-weight: 700; }
.entrada-der form > p, .tarjeta-entrada > p { color: var(--gris-2); margin-top: -10px; }

/* Escena de la entrada: el recorrido de una factura, del chat al comprobante (app.js la anima). */
.entrada-izq .contenido { width: 100%; max-width: 1040px; container-type: inline-size; }
.escena { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 28px; transition: opacity .4s; }
.escena.inicial { opacity: 0; }
.escena.sin-transicion, .escena.sin-transicion * { transition: none !important; }

.escena-chat { display: flex; flex-direction: column; min-width: 0; border-radius: 20px; background: #fff; border: 1px solid var(--borde); box-shadow: 0 30px 60px -42px rgba(0, 110, 211, .45); overflow: hidden; }
.chat-cabeza { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--borde); }
.chat-cabeza b { display: block; font-size: 14px; font-weight: 700; }
.chat-cabeza small { display: block; font-size: 12px; color: var(--gris-2); }
.chat-cabeza small.activo { color: var(--azul); }
/* La marca llena la foto de perfil: el círculo recorta el recuadro y el filo dorado no se dibuja. */
.chat-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden; background: var(--tinta); }
.chat-avatar svg { display: block; width: 100%; height: 100%; }
.chat-avatar .marca-filo { display: none; }
.chat-hilo { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; background: var(--fila); }
.chat-hilo > * { transition: opacity .3s; }
.chat-hilo.saliendo > * { opacity: 0; }
.escena .escribiendo { padding: 12px 14px; }
.escena .escribiendo.nueva { animation: burbuja .35s cubic-bezier(.2, .7, .2, 1) both; }
.chat-redactor { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--borde); color: var(--gris); font-size: 13px; }
.chat-redactor > span:first-child { flex: 1; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--fila); display: flex; align-items: center; }
.chat-enviar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--azul); color: #fff; }
.chat-enviar svg { width: 18px; height: 18px; }

.escena-proceso { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pasos li { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 9px 14px 9px 9px; border-radius: 12px; background: var(--fila); transition: opacity .3s; }
.pasos li > div { min-width: 0; }
.pasos b { display: block; font-size: 14px; font-weight: 600; }
.pasos small { display: block; font-size: 12px; color: var(--gris-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pasos .tile { position: relative; width: 40px; height: 40px; border-radius: 9px; background: var(--tile-verde); color: var(--icono-verde); transition: background-color .3s, color .3s; }
.pasos .tile svg { position: absolute; width: 20px; height: 20px; transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1); }
.pasos .tile svg:not(.ok), .pasos li[data-estado] .tile svg.ok { opacity: 0; transform: scale(.5); }
.pasos li[data-estado] .tile svg:not(.ok) { opacity: 1; transform: none; }
.pasos li[data-estado="espera"] { opacity: .55; }
.pasos li[data-estado="espera"] .tile { background: var(--tile-gris); color: var(--icono-gris); }
.pasos li[data-estado="espera"] small { visibility: hidden; }
.pasos li[data-estado="activo"] .tile { background: var(--tile-azul); color: var(--icono-azul); }
.pasos li[data-estado="activo"] small { color: var(--azul); }
/* La barra inferior dura lo mismo que el paso: se ve cuánto tarda cada etapa. */
.pasos li::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--azul); transform: scaleX(0); transform-origin: left; opacity: 0; }
.pasos li[data-estado="activo"]::after { opacity: 1; animation: avance var(--dur, 1s) linear forwards; }
@keyframes avance { to { transform: scaleX(1); } }

.escena-resultado { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.escena .tarjeta-color { transition: background-color .5s, color .5s, box-shadow .5s; }
.escena .tarjeta-color > div:first-child { max-width: calc(100% - 70px); }
.escena .tarjeta-color .ilustracion { width: 70px; height: 80px; right: 14px; bottom: 12px; transition: opacity .5s, filter .5s; }
.escena .tarjeta-color.pendiente { background: var(--fila); color: var(--gris-2); box-shadow: 0 10px 22px -10px transparent; }
.escena .tarjeta-color.pendiente .fondo-anillo { stroke: #e6e6e6; }
.escena .tarjeta-color.pendiente .valor-anillo { stroke: transparent; }
.escena .tarjeta-color.pendiente .ilustracion { opacity: .7; filter: grayscale(1); }
.escena .anillo circle { transition: stroke .5s, stroke-dashoffset .9s cubic-bezier(.2, .7, .2, 1); }
.escena .estadistica { aspect-ratio: auto; min-height: 150px; padding: 22px 20px 20px; }
.escena .estadistica b small { display: inline; margin: 0 0 0 4px; font-size: 18px; color: var(--azul-oscuro); }
@container (max-width: 640px) {
  .escena { grid-template-columns: minmax(0, 1fr); }
  .escena-chat { display: none; }
}

/* -------------------------------------------------- movimiento (cambios de estado) */

.progreso { position: fixed; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 50; pointer-events: none; }
.progreso::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--azul); transform: translateX(-110%); opacity: 0; }
body.ocupado .progreso::after { opacity: 1; animation: progreso 1.3s ease-in-out infinite; }
@keyframes progreso { to { transform: translateX(380%); } }
[data-recien] { animation: sello .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes sello { 0% { opacity: 0; transform: scale(1.03); } 30% { opacity: 1; transform: none; box-shadow: 0 0 0 3px var(--azul); } 100% { box-shadow: 0 0 0 0 transparent; } }
.llega { animation: llega 1.6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes llega { 0% { opacity: 0; transform: translateY(-10px); } 20% { opacity: 1; transform: none; box-shadow: 0 0 0 2px var(--azul); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cambia { animation: cambia 1.4s ease-out both; }
@keyframes cambia { 0%, 30% { box-shadow: 0 0 0 2px var(--azul); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cuenta.tic { animation: tic .6s cubic-bezier(.2, .7, .2, 1); }
@keyframes tic { 30% { transform: scale(1.25); } }
.latido { animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------------------------------------------------------------- responsivo */

@media (max-width: 1380px) {
  :root { --panel: 400px; }
}
@media (max-width: 1180px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .panel { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--borde); padding: 32px 48px; }
  .menu a { padding-left: 30px; }
  .logo { padding-left: 20px; }
  .plan, .prueba-aviso { margin-left: 20px; margin-right: 20px; }
  .estadisticas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .panel.ajustado .estadisticas { flex: none; min-height: 0; max-height: none; grid-template-rows: none; }
  .panel.ajustado .estadistica { min-height: 150px; }
}
@media (max-width: 760px) {
  .app, .app.sin-panel { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: static; height: auto; padding: 18px 0 8px; border-right: 0; border-bottom: 1px solid var(--borde); }
  .logo { padding-left: 20px; }
  .menu { flex-direction: row; overflow-x: auto; margin-top: 12px; gap: 0; }
  .menu a { height: 44px; padding: 0 14px; gap: 8px; font-size: 14px; white-space: nowrap; }
  .menu .punto-activo { display: none; }
  .plan, .prueba-aviso { display: none; }
  .principal { padding: 28px 18px 40px; }
  .panel { grid-column: 1; padding: 28px 18px; }
  .tarjetas, .filas, .campos, .estimado { grid-template-columns: minmax(0, 1fr); }
  .estadisticas, .resumen-libro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .barra-libro { flex-wrap: wrap; }
  .actividad { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; height: auto; max-height: none; padding-bottom: 0; }
  .principal.ajustado .grafico.ancho { height: 220px; }
  .cabecera { flex-wrap: wrap; gap: 12px 20px; }
  .entrada { grid-template-columns: minmax(0, 1fr); }
  .entrada-izq { padding: 28px 20px; }
  .entrada-izq .logo { margin-bottom: 26px; }
  .escena { display: none; }
}

/* ----------------------------------------------------- cuentas y suscripción */

.entrada-enlaces { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13px; color: var(--gris-2); }
.entrada-der form > p.entrada-enlaces { margin-top: 0; }
.entrada-der form > p.mensaje-texto, .tarjeta-entrada > p.mensaje-texto { margin-top: 0; color: var(--texto); line-height: 1.6; }
.entrada-der form > p.nota { margin-top: 0; }
.tarjeta-entrada .boton { align-self: flex-start; }
.entrada-lead { max-width: 620px; margin: -18px 0 30px; font-size: 16px; color: var(--gris-2); }
.opcional { font-weight: 500; color: var(--gris-2); }
fieldset.campos { min-width: 0; margin: 0; padding: 0; border: 0; }

.planes-registro { border: 0; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; max-width: 900px; }
.planes-registro legend { padding: 0; margin-bottom: 14px; font-size: 15px; font-weight: 700; }
.planes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.plan-opcion, .plan-tarjeta { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 16px; border: 1.5px solid var(--borde); background: #fff; }
.plan-opcion { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plan-opcion:hover { border-color: var(--celeste-2); }
.plan-opcion:has(input:checked), .plan-tarjeta.actual { border-color: var(--azul); box-shadow: 0 16px 32px -24px rgba(0, 110, 211, .6); }
.plan-opcion input { position: absolute; top: 18px; right: 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--azul); }
.plan-nombre { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.plan-nombre small { padding: 2px 8px; border-radius: 99px; background: var(--celeste); color: var(--azul); font-size: 11px; font-weight: 700; }
.plan-precio { font-size: 13px; color: var(--gris-2); }
.plan-precio b { font-size: 22px; font-weight: 800; color: var(--azul-oscuro); }
.plan-desc { font-size: 13px; color: var(--gris-2); }
.plan-opcion ul, .plan-tarjeta ul { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.plan-opcion li::before, .plan-tarjeta li::before { content: "✓"; margin-right: 8px; color: var(--icono-verde); font-weight: 800; }

/* Caja lateral del plan: cambia de color cuando hay que pagar. */
.plan.plan-gracia, .plan.plan-vencida { background: var(--tile-amarillo); }
.plan.plan-gracia p, .plan.plan-vencida p { color: #8a6500; }
.plan.plan-suspendida { background: #fdecec; }
.plan.plan-suspendida p { color: #b3261e; }

.avisos-cuenta .aviso-fijo { display: flex; align-items: center; justify-content: space-between; gap: 16px; animation: none; }
.avisos-cuenta .aviso-fijo > form, .avisos-cuenta .aviso-fijo > .boton { flex: none; }

.estado-suscripcion { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 26px 28px; border-radius: 16px; background: var(--celeste); }
.estado-suscripcion .etq { font-size: 12px; font-weight: 700; color: var(--gris-azul); text-transform: uppercase; letter-spacing: .05em; }
.estado-suscripcion h2 { margin: 2px 0 4px; font-size: 26px; font-weight: 700; color: var(--azul-oscuro); }
.estado-suscripcion p:last-child { color: var(--gris-2); }
.estado-suscripcion.activa { background: var(--tile-verde); }
.estado-suscripcion.activa h2 { color: #3f6d12; }
.estado-suscripcion.gracia, .estado-suscripcion.vencida { background: var(--tile-amarillo); }
.estado-suscripcion.gracia h2, .estado-suscripcion.vencida h2 { color: #8a6500; }
.estado-suscripcion.suspendida { background: #fdecec; }
.estado-suscripcion.suspendida h2 { color: #b3261e; }

.uso + .uso { margin-top: 16px; }
.uso-cabeza { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.uso-barra { height: 8px; border-radius: 99px; background: var(--fila); overflow: hidden; }
.uso-barra i { display: block; height: 100%; border-radius: inherit; background: var(--azul); }
.uso-barra i.alto { background: var(--icono-amarillo); }
.uso-barra i.lleno { background: var(--rojo); }

.instrucciones-pago { margin: 0; white-space: pre-line; font-size: 14px; line-height: 1.6; }
.numero-grande { margin: 0; font-size: 24px; font-weight: 800; color: var(--azul-oscuro); letter-spacing: .01em; }

.acciones-fila { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; }
.pago-admin { padding: 20px 22px; }
.acciones-pago { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--borde); }
.acciones-pago .rechazo { display: flex; gap: 8px; margin-left: auto; }
.acciones-pago .rechazo input { width: 240px; height: 34px; }
.acciones-pago .boton svg { width: 16px; height: 16px; }
.cabecera .pestanas.derecha { margin-left: auto; }

.legal { max-width: 760px; margin: 0 auto; padding: 48px 24px 72px; }
.legal .logo { margin-bottom: 36px; padding-left: 0; }
.legal h1 { margin-bottom: 16px; font-size: 30px; font-weight: 700; }
.legal h2 { margin: 28px 0 8px; font-size: 18px; font-weight: 700; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; }
.legal ul { padding-left: 20px; }
.legal-pie { margin-top: 40px; color: var(--gris-2); }
.legal-vigencia { margin-bottom: 20px; color: var(--gris-2); }
.legal .legal-marca { margin-top: 12px; font-size: 13px; color: var(--gris-2); }

@media (max-width: 760px) {
  .estado-suscripcion { grid-template-columns: minmax(0, 1fr); }
  .avisos-cuenta .aviso-fijo { flex-direction: column; align-items: flex-start; }
  .acciones-pago .rechazo { width: 100%; margin-left: 0; }
  .acciones-pago .rechazo input { flex: 1; width: auto; }
}

/* ------------------------------------------- escena: chat con aspecto de WhatsApp */
/* Solo la escena de la entrada. */

.escena-chat.wa { border: 0; background: #efeae2; font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wa .chat-cabeza { gap: 8px; padding: 10px 12px 10px 6px; background: #008069; color: #fff; border-bottom: 0; }
.wa .chat-avatar { width: 34px; height: 34px; }
.wa-contacto { min-width: 0; }
.wa-contacto b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa .chat-cabeza b { font-size: 15px; font-weight: 600; color: #fff; }
.wa .chat-cabeza small, .wa .chat-cabeza small.activo { font-size: 11.5px; color: rgba(255, 255, 255, .85); }
.wa-i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wa-volver { width: 22px; height: 22px; }
.wa-iconos { margin-left: auto; display: flex; gap: 14px; }

.wa .chat-hilo { gap: 6px; padding: 10px 14px 12px; background-color: #efeae2; background-size: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' fill='none' stroke='%23000' stroke-opacity='.05' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 18h16v22l-4-2.5-4 2.5-4-2.5-4 2.5z M24 25h8 M24 30h6'/%3E%3Cpath d='M98 30l5 5 9-10'/%3E%3Ccircle cx='70' cy='70' r='7'/%3E%3Cpath d='M112 88h22v16h-22z M112 94h22'/%3E%3Cpath d='M30 104l6 6 M36 104l-6 6'/%3E%3Ccircle cx='86' cy='130' r='3'/%3E%3Cpath d='M128 132c4-6 10-6 14 0'/%3E%3C/svg%3E"); }
.wa-fecha { align-self: center; margin-bottom: 2px; padding: 4px 10px; border-radius: 7px; background: #fff; color: #54656f; font-size: 11px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }

.wa-burbuja { position: relative; max-width: 88%; padding: 3px; border-radius: 7.5px; background: #fff; color: #111b21; font-size: 12.5px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa-burbuja::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; background: inherit; }
.wa-burbuja.mia { align-self: flex-end; border-top-right-radius: 0; background: #d9fdd3; }
.wa-burbuja.mia::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-burbuja:not(.mia) { align-self: flex-start; border-top-left-radius: 0; }
.wa-burbuja:not(.mia)::before { left: -8px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.wa-burbuja.nueva { animation: burbuja .35s cubic-bezier(.2, .7, .2, 1) both; }

.wa-doc { width: 220px; max-width: 100%; border-radius: 6px; overflow: hidden; background: #f5f6f6; }
.wa-burbuja.mia .wa-doc { background: #c9efc0; }
/* Primera página del PDF, como la vista previa del documento. */
.wa-vista { height: 80px; padding: 9px 11px 0; display: flex; flex-direction: column; gap: 5px; overflow: hidden; background: #fff;
  border-bottom: 1px solid rgba(11, 20, 26, .08); }
.wa-vista__cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 7px; line-height: 1; white-space: nowrap; }
.wa-vista__cabeza b { font-weight: 800; letter-spacing: .06em; color: #3b4a54; }
.wa-vista__cabeza em { font-style: normal; font-weight: 600; color: #8696a0; }
.wa-linea { display: block; width: var(--w); height: 3px; flex: none; border-radius: 2px; background: #d3dbdf; }
.wa-tabla { display: grid; gap: 4px; margin-top: 3px; padding-top: 4px; border-top: 1px solid #e3e8ea; }
.wa-tabla span { display: block; height: 4px; border-radius: 1px; background: linear-gradient(90deg, #e1e7ea 0 58%, transparent 58% 70%, #e1e7ea 70% 100%); }
.wa-total { display: block; width: 36%; height: 6px; flex: none; margin: 2px 0 0 auto; border-radius: 1px; background: #a9b8bf; }
.wa-archivo { display: flex; align-items: center; gap: 8px; padding: 8px 8px 7px; }
.wa-archivo > span:last-child { min-width: 0; }
.wa-archivo b { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-archivo small { display: block; margin-top: 1px; font-size: 10.5px; color: #667781; }
.wa-pdf { flex: none; width: 24px; height: 29px; padding-bottom: 4px; display: grid; place-items: end center; border-radius: 3px; background: #e5534b; color: #fff;
  font: 700 7px/1 system-ui, sans-serif; clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%); }
.wa-texto { padding: 5px 6px 0; white-space: pre-wrap; line-height: 1.4; }
.wa-texto b { font-weight: 600; }
.wa-hora { display: flex; justify-content: flex-end; align-items: center; gap: 3px; padding: 1px 5px 1px 0; font-size: 10.5px; color: #667781; }
.wa-leido { width: 17px; height: 11px; fill: none; stroke: #53bdeb; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.wa .escribiendo { position: relative; padding: 11px 13px; border-radius: 0 7.5px 7.5px 7.5px; background: #fff; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa .escribiendo::before { content: ""; position: absolute; top: 0; left: -8px; width: 8px; height: 13px; background: #fff; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.wa .escribiendo i { background: #8696a0; }

.wa .chat-redactor { gap: 6px; padding: 6px 8px 8px; border-top: 0; background: transparent; }
.wa .chat-redactor > .wa-campo { flex: 1; height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border-radius: 20px;
  background: #fff; color: #8696a0; font-size: 14px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa-campo > span { flex: 1; }
.wa-campo .wa-i { color: #8696a0; }
.wa-mic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #00a884; color: #fff; }

/* ---------- Facturas: compra / venta ---------- */
.op { display: inline-block; margin-right: 7px; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.op.venta { background: var(--tile-azul); color: var(--azul-oscuro); }
.op.compra { background: var(--tile-naranja); color: #b35c00; }
.pestanas .n { margin-left: 5px; font-size: 12px; color: var(--gris); }
.pestanas a.activa .n { color: var(--azul); }
.resumen-facturas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.resumen-facturas .estadistica { aspect-ratio: auto; min-height: 128px; }
.libros-rapidos { display: flex; flex-direction: column; gap: 10px; }
.libro-rapido { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 12px; background: var(--fila); }
.libro-rapido .tile { width: 40px; height: 40px; border-radius: 10px; }
.libro-rapido .tile svg { width: 20px; height: 20px; }
.libro-rapido .cuerpo { min-width: 0; flex: 1; }
.libro-rapido .cuerpo b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libro-rapido .cuerpo small { display: block; font-size: 12px; color: var(--gris-2); }
.libro-rapido .acciones { display: flex; gap: 6px; }
@container (max-width: 820px) { .resumen-facturas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
