/* Estilo moderno (11-11-2026, rama estilo-moderno-20261111). Encargo del titular: «más limpio, menos texto incrustado,
   el texto con un formato más moderno (negrita o similar, lo que tenga Holded), emojis donde queden bien, amigable»;
   «mucho texto escrito es como un puñetazo en la cara»; «fondos blancos, que se vea moderno»; «blanco y limpio, y con
   iconos modernos». Propuesta y referencias: docs/ESTILO_MODERNO_2026-11-11.md. Hoja aparte, cargada la última, para
   unir sin choques con otras ramas; solo usa los tokens de app.css (ningún color escrito aquí: lo vigilan los tests).
   Letra: Inter (app.css). Iconos: Lucide, trazo 1,75 (apps/core/templatetags/conta.py y static/iconos/). */

/* ---- 1. Blanco y limpio: sin armazón de color; se separa con espacio y filetes finos ---- */
.lateral { border-right: 1px solid var(--app-borde); }
.superior { background: var(--app-superficie); border-bottom: 1px solid var(--app-borde); }
.marco > main { border: 0; border-radius: 0; background: var(--app-superficie); padding-top: var(--e-6); }
.lateral details > summary .icono { color: var(--app-lateral-suave); }
.lateral details > summary.activa .icono { color: var(--app-lateral-acento); }
.lateral details > ul a[aria-current] { color: var(--app-primario); font-weight: 600; box-shadow: none;
  border-radius: var(--app-radio); }
.lateral details > ul a:hover { color: var(--app-texto); }
/* Tarjetas: filete fino y sin sombra (la sombra se queda en menús y ventanas) */
main article, .tarjeta.kpi.destacada, .tarjetas > .tarjeta, .tarjetas > article, .tabla { box-shadow: none; }
.tarjeta.kpi.destacada { border: 1px solid var(--app-borde); }
main article article:not(.mensaje), main .tarjeta-panel article:not(.mensaje) { background: var(--app-superficie); }

/* ---- 2. Tipografía: títulos y cifras en negrita, etiquetas más ligeras y en gris ---- */
main h1 { font-size: var(--t-h1); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
main h2 { font-size: var(--t-h2); font-weight: 650; letter-spacing: -.015em; }
main h3 { font-size: var(--t-h3); font-weight: 600; letter-spacing: -.01em; }
main strong, main b { font-weight: 600; }
.tarjeta .valor, .tarjeta-oscura .valor, .importe-grande, .resultado-declaracion .importe-grande {
  font-weight: 700; letter-spacing: -.03em; }
.tarjeta .rotulo, .fila-lista .rotulo, .tarjeta-oscura .rotulo { font-weight: 500; font-size: var(--t-s); }
.tarjeta .rotulo { color: var(--app-texto-suave); }
main table th { background: var(--app-superficie); font-weight: 500; font-size: var(--t-xs); letter-spacing: .01em;
  border-bottom: 1px solid var(--app-borde); }
main tr.total :is(td, th), main tr.nivel-1 td { font-weight: 700; }
main label, main legend, .filtros > :is(label, div) { font-weight: 500; }
.subtitulo, main .acciones + p.subtitulo { color: var(--app-texto-suave); font-size: var(--t-m); }
/* Pestañas y chips: el activo en negrita y azul; el resto, en gris */
:is(.subnav, .pestanas) > a { font-weight: 500; }

/* ---- 3. Icono de la sección junto al título (el mismo juego que el menú) ---- */
main[data-seccion] h1:not(dialog h1, .panel-cabecera h1)::before {
  content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: .4em; vertical-align: -.14em;
  background: var(--app-primario); -webkit-mask: var(--icono-seccion) center / contain no-repeat;
  mask: var(--icono-seccion) center / contain no-repeat; }
main[data-seccion=inicio] { --icono-seccion: url("../iconos/inicio.svg"); }
main[data-seccion=ventas] { --icono-seccion: url("../iconos/ventas.svg"); }
main[data-seccion=crm] { --icono-seccion: url("../iconos/crm.svg"); }
main[data-seccion=proyectos] { --icono-seccion: url("../iconos/proyectos.svg"); }
main:is([data-seccion=compras], [data-seccion=gastos]) { --icono-seccion: url("../iconos/compras.svg"); }
main[data-seccion=existencias] { --icono-seccion: url("../iconos/existencias.svg"); }
main:is([data-seccion=bancos], [data-seccion=banco]) { --icono-seccion: url("../iconos/bancos.svg"); }
main[data-seccion=impuestos] { --icono-seccion: url("../iconos/impuestos.svg"); }
main[data-seccion=contabilidad] { --icono-seccion: url("../iconos/contabilidad.svg"); }
main[data-seccion=ajustes] { --icono-seccion: url("../iconos/ajustes.svg"); }
main[data-seccion=informes] { --icono-seccion: url("../iconos/informes.svg"); }
/* El Resumen saluda: sin icono y con la mano (emoji decorativo: el lector de pantalla no lo lee) */
.panel-cabecera h1::after { content: " 👋" / ""; }

/* ---- 4. Avisos: blancos con una barra de color a la izquierda (sin cajas sobre fondo de color) ---- */
.mensaje, main article.mensaje, .mensaje:is(.success, .error, .warning, .info, .alerta-config) {
  background: var(--app-superficie); color: var(--app-texto); border: 1px solid var(--app-borde);
  border-left: 3px solid var(--app-borde-fuerte); border-radius: var(--app-radio); }
.mensaje.alerta-config { border-left-color: var(--aviso-borde); }
.mensaje.success { border-left-color: var(--ok-borde); }
.mensaje.error { border-left-color: var(--error-borde); }
.mensaje.warning { border-left-color: var(--aviso-borde); }
.mensaje.info { border-left-color: var(--app-primario); }
.mensaje.error > strong:first-child, .mensaje.error .aviso-titulo { color: var(--error); }
.mensaje.info::before { content: "💡 " / ""; }
.aviso-ocultable :is(.aviso-ocultable-botones, .aviso-ocultable-botones a, .aviso-ocultable-botones button) {
  color: var(--app-texto-suave); }

/* ---- 5. Estados vacíos y confirmaciones: un toque amable ---- */
.estado-vacio:not(.estado-vacio-filtrado) > .estado-vacio-titulo::after { content: " ✨" / ""; }
.estado-vacio-filtrado .estado-vacio-titulo::before { content: "🔍 " / ""; }
.estado-vacio-titulo { font-weight: 650; letter-spacing: -.015em; }
.aviso-flotante strong { font-weight: 650; }

/* Catálogos (Integraciones, Contablio Store): la descripción de cada tarjeta, en una línea; entera al pasar por encima
   o con el foco dentro */
.integ-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden;
  color: var(--app-texto-suave); }
:is(article, li, div):is(:hover, :focus-within) > .integ-desc { -webkit-line-clamp: unset; line-clamp: none; }

/* Integraciones: lo de los integradores (API, webhooks, asistentes) plegado al final, discreto */
details.integ-desarrolladores > summary { color: var(--app-texto-suave); font-size: var(--t-s); font-weight: 500; }

/* ---- 6. Botón «Ayuda» junto al título: discreto, el texto ya no está en la pantalla ---- */
.ayuda-pantalla .boton-panel-ayuda, [data-panel-ayuda] { font-weight: 500; }

/* ---- 7. Bandas de entorno (demo, empresa de ejemplo, base de pruebas, VERI*FACTU en pruebas): una tira fina ----
   Titular (11-11-2026): «la línea azul de entorno demo tiene que ser mucho más pequeña… igual de grande que la barra que
   tenía Holded de los días que faltaban para el plan gratis». Una sola línea de 30 px, letra de 12-13 px, centrada; no
   es fija (no tapa nada) y lo que no cabe se corta con «…» (el texto entero, en el title). */
.banda-fina { position: static; display: flex; flex-wrap: nowrap; align-items: center; justify-content: center;
  gap: var(--e-3); height: 30px; min-height: 0; padding: 0 var(--e-4); margin: 0; overflow: visible;
  font-size: .8333rem; line-height: 1.2; font-weight: 500; letter-spacing: 0; white-space: nowrap; border: 0; }
.banda-fina.banda-ejemplo { background: var(--app-primario-fondo); color: var(--app-sobre-color); }
.banda-fina.aviso-base-pruebas { background: var(--peligro); color: var(--app-sobre-peligro); }
.banda-fina .banda-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.banda-fina .banda-texto strong { font-weight: 650; }
.banda-fina small { display: inline; font-size: inherit; font-weight: 400; opacity: .85; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.banda-fina :is(a, button.enlace, details > summary) { flex: 0 0 auto; margin: 0; padding: 0; width: auto; height: auto;
  min-height: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer; }
.banda-fina form { margin: 0; flex: 0 0 auto; }
.banda-fina details { margin: 0; flex: 0 0 auto; position: relative; }
.banda-fina details > summary { display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; }
.banda-fina details > summary::after { width: .7rem; height: .7rem; margin: 0; filter: invert(1); }
.banda-fina details > ul { position: absolute; top: calc(100% + 6px); right: 0; left: auto; z-index: 1100; min-width: 16rem;
  white-space: normal; font-size: var(--t-s); }
.banda-fina details > ul :is(a, button.enlace) { color: var(--app-texto); text-decoration: none; font-weight: 500; }
/* La de VERI*FACTU en pruebas (amarilla, se minimiza o se cierra): más baja y en una línea en el escritorio */
.aviso-entorno { font-size: .8rem; padding: .3rem 1rem; line-height: 1.3; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.banda-fina details.dropdown > summary, .banda-fina details.dropdown > summary:is(:hover, :focus, :focus-visible) {
  height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: inherit; font-weight: 600; line-height: 1.2; }
.banda-fina details.dropdown > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---- 8. El nombre de la empresa no se sale de su caja: una línea y «…» (entero en el title) ---- */
.superior .selector-empresa { min-width: 0; flex: 0 1 auto; max-width: 30rem; }
.superior .selector-empresa > summary { display: flex; align-items: center; min-width: 0; max-width: 100%; overflow: hidden;
  white-space: nowrap; }
.superior .selector-empresa > summary > .nombre-empresa { display: block; min-width: 0; flex: 0 1 auto; max-width: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.superior .selector-empresa > summary > .ejercicio-empresa { flex: 0 0 auto; white-space: nowrap; }
.una-linea { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 9. Tablas como una hoja de cálculo (titular 11-11-2026: «que se corten… que manualmente se puedan abrir como en
   el Excel, pero que no se ajuste el tamaño del texto»; «como lo tiene Holded»). Letra fija e igual en todas las celdas,
   una línea por celda con «…» (entero en el title, static/js/columnas_ajustables.js) y filas de la misma altura. Las
   columnas se ensanchan arrastrando el borde de la cabecera. Solo en el escritorio: en el móvil la tabla va en tarjetas. */
@media (min-width: 769px) {
  main table:not(.tabla-lineas, [data-sin-ajuste]) :is(td, th) { font-size: var(--t-m); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 26rem; }
  main table:not(.tabla-lineas, [data-sin-ajuste]) th { font-size: var(--t-xs); position: relative; }
  /* Lo que se despliega dentro de una celda (menús, campos) no se recorta */
  main table :is(td, th):has(details, select, input:not([type=checkbox], [type=hidden]), textarea, .dropdown) {
    overflow: visible; max-width: none; }
  main table td.vacio-fila, main table td[colspan] { white-space: normal; max-width: none; }
  main table.columnas-fijas { table-layout: fixed; max-width: none; }
  main table.columnas-fijas :is(td, th) { max-width: none; }
  .asa-columna { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2;
    user-select: none; }
  .asa-columna::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 2px; border-radius: 1px;
    background: transparent; transition: background-color var(--dur-rapida) var(--curva); }
  th:hover > .asa-columna::after, .ajustando-columna .asa-columna:hover::after { background: var(--app-borde-fuerte); }
  .asa-columna:hover::after { background: var(--app-primario); }
  .ajustando-columna, .ajustando-columna * { cursor: col-resize !important; user-select: none !important; }
  .medida-columna { position: absolute; visibility: hidden; white-space: nowrap; }
}

/* ---- 10. Móvil: los mismos criterios con menos aire ---- */
@media (max-width: 768px) {
  .marco > main { padding-top: var(--e-4); }
  main[data-seccion] h1::before { width: 1em; height: 1em; }
  /* Tarjetas del móvil: también una línea por dato, con «…» (el nombre largo no estira la tarjeta) */
  /* (app.css pone white-space: normal !important en las tarjetas: solo así se le gana) */
  main table:is(.tarjetas-movil, .lista-movil) td:not(:has(details, select, input:not([type=checkbox], [type=hidden]), textarea, .dropdown, small)) {
    white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  .banda-fina { justify-content: flex-start; gap: var(--e-2); padding: 0 var(--e-3); }
  .banda-fina .banda-detalle { display: none; }
  .superior .selector-empresa { max-width: none; }
  .superior .selector-empresa > summary > .ejercicio-empresa { display: none; }
}
/* ---- 11. Auditoría visual de la demo (12-11-2026, _coordinacion/informes/AUDITORIA_VISUAL_DEMO_2026-11-12.md) ---- */
/* C2: el texto de los botones-enlace, centrado. La regla de app.css (display:inline-flex) está en :where()
   (especificidad cero) y Pico (`[role=button]{display:inline-block}`) le gana: con min-height el texto quedaba pegado
   arriba. No se toca el display (las clases que esconden botones seguirían ganando): la altura sale del relleno y de
   la altura de línea, así que el texto queda siempre en el centro. */
a[role=button] { min-height: 0; line-height: 1.25rem; padding-top: .6rem; padding-bottom: .6rem; }
a[role=button].pequeno { padding-top: .35rem; padding-bottom: .35rem; }
/* C4: escala de capas única. La franja de la demo (y la de base de pruebas) por DEBAJO del menú lateral y su velo */
:root { --z-franja: 40; --z-barra: 50; --z-velo: 55; --z-menu: 60; --z-dialogo: 90; }
.banda-ejemplo, .aviso-base-pruebas, .banda-fina { z-index: var(--z-franja) !important; }
/* I1: botones de cabecera iguales en todas las pantallas (antes 32 px/13 px en unas y 41 px/15 px en otras) */
@media (min-width: 769px) {
  main .acciones:has(> h1) > :is(a[role=button], button),
  main .acciones:has(> h1) > :is(.crear, .exportar-listado) > a[role=button],
  main .acciones:has(> h1) > details > summary,
  main .acciones:has(> h1) > .crear > details > summary,
  main .acciones:has(> h1) > form > button {
    height: auto; min-height: 0; padding-top: .6rem; padding-bottom: .6rem; padding-left: .875rem; padding-right: .875rem;
    font-size: var(--t-m); font-weight: 500; line-height: 1.25rem; }
  main .acciones:has(> h1) > .crear > a[role=button] { padding-left: .875rem; padding-right: .875rem; }
  /* la flecha del desplegable (Pico: alto de 1,5 líneas) hacía «Exportar ▾» 4 px más alto que los demás */
  main .acciones:has(> h1) details.dropdown > summary::after { height: 1.25rem; background-size: .9rem auto; }
  main .acciones:has(> h1) > .crear > details > summary[role=button] { padding-left: .55rem; padding-right: .6rem; }
}
/* «Exportar ▾»: una sola forma en toda la app (static/js/exportar_desplegable.js convierte «Exportar a Excel · CSV ·
   PDF» en el mismo botón con desplegable que «Exportar el resumen») */
.exportar-listado.como-desplegable > :not(details) { display: none !important; }
.cabecera-movil-oculta { display: none !important; }
/* El «⋯» de la cabecera: en el móvil siempre; en el escritorio solo si la cabecera no cabía en una fila
   (static/js/cabecera_movil.js pliega los últimos botones y el menú enseña solo esos) */
@media (min-width: 769px) {
  .acciones:not(.plegada) > details.mas-cabecera-movil { display: none !important; }
  .acciones.plegada > .plegado-escritorio { display: none !important; }
  .acciones.plegada > details.mas-cabecera-movil { margin: 0; order: 9; }
  /* si ni plegando los botones cabe, el título largo se corta con «…» (entero en el title: cabecera_movil.js) */
  .acciones.plegada > h1 { flex: 0 1 auto; min-width: 12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .acciones.plegada > details.mas-cabecera-movil > summary { padding-left: .8rem; padding-right: .8rem; }
  .acciones.plegada > details.mas-cabecera-movil > summary::after { display: none; }
  .acciones.plegada > details.mas-cabecera-movil li:not(.en-menu-escritorio) { display: none; }
  details.dropdown.mas-cabecera-movil > summary + ul { left: auto; right: 0; width: auto; min-width: 14rem; }
  details.dropdown.mas-cabecera-movil > summary + ul li button { width: 100%; justify-content: flex-start; background: none;
    border: 0; color: var(--app-texto); font-weight: 500; padding: .45rem .9rem; }
}
/* I7: «De las ventas al beneficio» a todo el ancho: con 9-10 escalones en media tarjeta los nombres del eje salían
   cortados («Amortiz…», «Resulta… de explota…») y las cifras se pisaban */
.graficas-pareja > article:is(:has(#grafica-cascada-resultado), :has(#grafica-gastos-cuenta)) { grid-column: 1 / -1; }
/* La vuelta a la pantalla de antes, encima del título (auditoría visual: la cabecera en una fila) */
p.migas { margin: 0 0 var(--e-1); font-size: var(--t-s); }
/* I7: leyenda fija (no se pulsa) con el mismo aspecto que la de las gráficas */
.leyenda-fija-item { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .6rem; font-size: var(--t-s);
  color: var(--app-texto-suave); }
/* C7: números de documento enteros, nunca «…» (todos empiezan igual: cortados no se distingue ninguno) */
main table :is(td, th).sin-cortar, main table td:has(> .num-doc) { overflow: visible; text-overflow: clip; min-width: 8.5rem; }

@media (max-width: 768px) {
  /* Botones táctiles de 44 px, sin partir línea (si no caben, «…») */
  main :is(button:not(.enlace), summary[role=button]) { min-height: 2.75rem; }
  main a[role=button], main a[role=button].pequeno { padding-top: .75rem; padding-bottom: .75rem; }  /* 20 + 24 = 44 px */
  main .acciones > :is(a[role=button], button, form) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* I1 en el móvil: todos los controles de la cabecera de 44 px y la misma letra; el texto centrado por su altura de
     línea (también en los enlaces con aspecto de botón, que Pico deja en inline-block) */
  main .acciones:has(> h1) > :is(a[role=button], button),
  main .acciones:has(> h1) > :is(.crear, .exportar-listado) > a[role=button],
  main .acciones:has(> h1) > details > summary,
  main .acciones:has(> h1) > .crear > details > summary,
  main .acciones:has(> h1) > form > button {
    height: 2.75rem; min-height: 0; padding-top: 0; padding-bottom: 0; line-height: calc(2.75rem - 2px);
    font-size: var(--t-m); font-weight: 500; }
  /* C3: cabecera en dos filas como máximo: título (+ Ayuda) · acción principal + «⋯» (static/js/cabecera_movil.js) */
  main .acciones[data-cabecera-movil] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); }
  main .acciones[data-cabecera-movil] > h1 { flex: 1 1 0; min-width: 8rem; margin: 0; overflow-wrap: anywhere; }
  main .acciones[data-cabecera-movil] > .ayuda-pantalla { order: 2; margin: 0; }
  main .acciones[data-cabecera-movil] > .solo-escritorio-cabecera { display: none !important; }
  main .acciones[data-cabecera-movil] > .principal-cabecera { flex: 1 1 100%; order: 5; }
  main .acciones[data-cabecera-movil] > .principal-cabecera > a[role=button] { width: 100%; }
  main .acciones[data-cabecera-movil] > .principal-cabecera.crear { display: flex; }
  main .acciones[data-cabecera-movil] > .principal-cabecera.crear > a[role=button] { flex: 1 1 auto; }
  .mas-cabecera-movil { order: 3; margin: 0; flex: 0 0 auto; }
  .mas-cabecera-movil > summary[role=button] { width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.25rem; margin: 0; }
  .mas-cabecera-movil > summary[role=button]::after { display: none; }
  details.dropdown.mas-cabecera-movil > summary + ul { left: auto; right: 0; width: auto; min-width: 15rem;
    max-width: calc(100vw - 2rem); }
  details.dropdown.mas-cabecera-movil > summary + ul li { white-space: normal; }
  .mas-cabecera-movil > summary + ul li > :is(form, .en-linea) { margin: 0; }
  .mas-cabecera-movil > summary + ul li button { width: 100%; justify-content: flex-start; min-height: 2.75rem;
    background: none; border: 0; color: var(--app-texto); font-weight: 500; padding: .55rem .9rem; }
  /* I10: el buscador en su propia fila al 100 %; debajo «Filtros» y «Vistas» a la misma altura */
  .barra-filtros { flex-wrap: wrap !important; align-items: center; }
  .barra-filtros > form.barra-compacta { display: contents; }
  .barra-filtros .filtros-buscar { flex: 1 1 100% !important; max-width: none; order: -1; }
  .barra-filtros > .vistas-guardadas, .barra-filtros > .vistas-guardadas summary { align-self: center; }
  .barra-filtros details, .barra-filtros .vistas-guardadas, .barra-filtros summary { margin-top: 0; margin-bottom: 0; }
  .barra-filtros :is(.mas-filtros > summary, .vistas-guardadas summary) { height: 2.75rem; }
  /* I11 y C5: tarjetas de lista compactas (antes ~300 px con una fila rótulo/valor por dato): título e importe en la
     primera línea y el resto en letra pequeña, cada dato con su rótulo corto delante y sin montarse encima del valor.
     Las tarjetas con campos (formularios) siguen como estaban. */
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .8rem; padding: .55rem .8rem; margin-bottom: .45rem; }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td {
    display: inline-block; width: auto; max-width: 100%; padding: 0; font-size: var(--t-s); color: var(--app-texto-suave); }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td[data-etiqueta] {
    padding-left: 0; }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td[data-etiqueta]::before {
    content: attr(data-etiqueta) " "; float: none; width: auto; margin: 0 .2rem 0 0; padding: 0; font-size: var(--t-xs);
    font-weight: 500; }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td:first-child,
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td.titulo-tarjeta {
    flex: 1 1 60%; min-width: 0; font-size: var(--t-m); font-weight: 600; color: var(--app-texto); }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td:first-child::before,
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td.titulo-tarjeta::before {
    display: none; }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td.num:not(.solo-escritorio) {
    color: var(--app-texto); font-variant-numeric: tabular-nums; }
  /* los botones de la tarjeta, juntos al final y en la misma fila */
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td:has(> :is(a[role=button], button, form, .botones, details)) {
    flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); }
  main table.tarjetas-movil:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td.col-boton:is(:has(> a), :has(> button), :empty) {
    flex: 0 0 auto; display: inline-flex; }
  main table.tarjetas-movil > tbody > tr > td.col-boton:empty { display: none; }
  /* C9: tablas de datos contables que siguen siendo tabla: la primera columna fija al desplazar de lado */
  .tabla > table:not(.tarjetas-movil) > tbody > tr > :first-child:not([colspan]),
  .tabla > table:not(.tarjetas-movil) > thead > tr > :first-child { position: sticky; left: 0; z-index: 1;
    background: var(--app-superficie); }
  /* una tabla vacía (solo el estado vacío) no se desplaza de lado: sin cabeceras y a lo ancho de la pantalla */
  .tabla > table:has(> tbody > tr > td.vacio-fila):not(:has(> tbody > tr > td:not(.vacio-fila))) {
    display: block; width: 100% !important; min-width: 0 !important; table-layout: auto; }
  .tabla > table:has(> tbody > tr > td.vacio-fila):not(:has(> tbody > tr > td:not(.vacio-fila))) > :is(thead, colgroup) {
    display: none; }
  .tabla > table:has(> tbody > tr > td.vacio-fila):not(:has(> tbody > tr > td:not(.vacio-fila))) :is(tbody, tr, td) {
    display: block; width: 100%; }
}

/* ---- 12. Una línea por fila y columnas fijas (titular, 12-11-2026; _coordinacion/informes/
   AUDITORIA_EXTRACTO_2026-11-12.md). Lo vigila scripts/recorrido_demo.py («fila-alta», «celda-cortada»). ---- */
/* Letra fija en la tabla: un <small> dentro de una celda no cambia el tamaño (antes, el concepto del extracto a 14 y a
   11,7 px según la fila); sigue en gris */
@media (min-width: 769px) {
  main table:not(.tabla-lineas, [data-sin-ajuste]) > tbody > tr > td small { font-size: inherit; color: var(--app-texto-suave); }
  /* Los botones de fila, todos de la misma altura y en su columna */
  main table > tbody > tr > td :is(button, a[role=button], summary).pequeno { height: var(--control-alto-s);
    min-height: var(--control-alto-s); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
  main table > tbody > tr > td.col-boton { width: 1%; white-space: nowrap; }
}
/* El «⋯» de una fila: cuadrado, sin la flecha de los desplegables */
details.dropdown.mas-acciones > summary::after { display: none !important; }
main table td details.acciones-fila > summary { width: var(--control-alto-s); min-width: var(--control-alto-s);
  padding: 0; justify-content: center; }
/* «Bajo mínimo» marca la cifra (Stock) en lugar de ir en una segunda línea */
.etiqueta.cifra-alerta { font-size: inherit; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Tarjeta clicable entera (Cuentas bancarias): el nombre es el enlace estirado; lo demás que se pulsa, por encima */
li.banco-tarjeta { position: relative; }
li.banco-tarjeta a.abrir-tarjeta::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
li.banco-tarjeta :is(details, form, .banco-tarjeta-pie a, .banco-tarjeta-detalle a, button) { position: relative; z-index: 1; }
@media (hover: hover) { li.banco-tarjeta:hover { border-color: var(--app-borde-fuerte); cursor: pointer; } }
/* Resumen de cifras (IVA en otros países): la fila del resultado, en negrita */
table.resumen-cifras tr.total td { font-weight: 650; }
.conclusion-compensa { margin: 0 0 var(--e-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Extracto: anchos de partida (el sitio que sobra, para el concepto) */
@media (min-width: 769px) {
  table.extracto th.col-fecha { width: 7rem; }
  table.extracto th.col-cuenta { width: 11rem; }
  table.extracto th.col-estado { width: 8.5rem; }
  table.extracto th.col-accion { width: 5.5rem; }
}
/* Reposición: la cifra sugerida, entera y a la derecha; el «Cómo se calcula», desplegado por encima de la tabla */
table.reposicion input[type=number] { width: 7rem; text-align: right; font-variant-numeric: tabular-nums; }
table.reposicion td.estado-repo details.calculo-repo { display: inline-block; vertical-align: middle; margin-left: var(--e-1); }
table.reposicion td.estado-repo details.calculo-repo > summary { width: var(--control-alto-s); padding: 0; justify-content: center; }
table.reposicion td.estado-repo details.calculo-repo > ul { min-width: 22rem; white-space: normal; z-index: 70; }

@media (max-width: 768px) {
  /* Las cifras de una tarjeta nunca se cortan: si algo cede, el rótulo o el título (A4) */
  main table:is(.tarjetas-movil, .lista-movil) td.num { overflow: visible !important; text-overflow: clip !important; }
  /* Tarjetas compactas cuyo título no es la primera columna (titulo-primero): el título en la primera línea y los
     datos detrás, en letra pequeña y en fila (antes, uno debajo de otro: tarjetas de 170 px en Stock) */
  main table.tarjetas-movil.titulo-primero:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr {
    flex-direction: row !important; }
  main table.tarjetas-movil.titulo-primero:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td.titulo-tarjeta {
    order: -1; flex: 1 1 100% !important; font-size: var(--t-m) !important; font-weight: 600 !important; color: var(--app-texto) !important;
    white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  main table.tarjetas-movil.titulo-primero:not(:has(input:not([type=hidden], [type=checkbox]), select, textarea)) > tbody > tr > td:first-child:not(.titulo-tarjeta) {
    flex: 0 1 auto !important; font-size: var(--t-s) !important; font-weight: 400 !important; color: var(--app-texto-suave) !important; }
  /* Pestañas de cuenta (extracto) en una fila que se desplaza de lado, no apiladas */
  .cuentas-pestanas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cuentas-pestanas > a { flex: 0 0 auto; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Lo secundario de una tarjeta, solo en el escritorio; ni rótulos sin dato ni filas vacías (el detalle plegado) */
  main table.tarjetas-movil td.solo-escritorio, main table.tarjetas-movil > tbody > tr > td:empty,
  main table.tarjetas-movil tr.detalle-antiguedad:empty, main table.tarjetas-movil tr.fila-sugerencias:has(> td:empty) {
    display: none !important; }
  /* El botón de fila (col-boton) va al final de la última línea, no en una línea suya */
  main table.tarjetas-movil:not(.extracto) > tbody > tr > td.col-boton:not(:empty) { flex: 0 0 auto !important;
    display: inline-flex !important; margin-left: auto !important; }
  main table.tarjetas-movil > tbody > tr > td.col-boton form { margin: 0; }
  /* Extracto del banco: 1: concepto · importe. 2: fecha · estado · botón. 3: saldo, en pequeño y entero */
  main table.extracto.tarjetas-movil > tbody > tr:not(.fila-sugerencias) {
    display: grid !important; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: .6rem; row-gap: .15rem;
    align-items: center; padding: .55rem .8rem !important; }
  main table.extracto.tarjetas-movil > tbody > tr > td { display: block !important; width: auto !important; padding: 0 !important;
    min-width: 0; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  main table.extracto.tarjetas-movil > tbody > tr > td::before { display: none !important; content: none !important; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-concepto { grid-column: 1 / 4; grid-row: 1; font-size: var(--t-m);
    font-weight: 600; color: var(--app-texto); }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-importe { grid-column: 4; grid-row: 1; font-size: var(--t-m);
    font-weight: 650; text-align: right; color: var(--app-texto); }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-fecha { grid-column: 1; grid-row: 2; font-size: var(--t-s);
    color: var(--app-texto-suave); }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-estado { grid-column: 2; grid-row: 2; overflow: visible; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-saldo { grid-column: 1 / 4; grid-row: 3; font-size: var(--t-xs);
    color: var(--app-texto-suave); text-align: left; overflow: visible; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-saldo::before { content: "Saldo " !important; display: inline !important; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-accion { grid-column: 4; grid-row: 2 / 4; justify-self: end; overflow: visible; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-accion:empty { display: none !important; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-cuenta { display: none !important; }
  main table.extracto.tarjetas-movil > tbody > tr > td.c-accion :is(button, summary) { height: 36px; min-height: 36px; }

  /* Antigüedad › Totales por tramo: tarjeta de dos líneas fijas. 1: tramo · importe. 2: % · nº de clientes */
  main table.tramos-antiguedad.tarjetas-movil :is(tbody, tfoot) > tr {
    display: grid !important; grid-template-columns: minmax(0, 1fr) auto; column-gap: .8rem; row-gap: .1rem;
    align-items: baseline; padding: .55rem .8rem !important; margin-bottom: .45rem; }
  main table.tramos-antiguedad.tarjetas-movil :is(tbody, tfoot) > tr > td { display: block !important; width: auto !important;
    padding: 0 !important; min-width: 0; white-space: nowrap !important; }
  main table.tramos-antiguedad.tarjetas-movil :is(tbody, tfoot) > tr > td::before { display: none !important; content: none !important; }
  main table.tramos-antiguedad.tarjetas-movil td.c-tramo { grid-column: 1; grid-row: 1; overflow: hidden; text-overflow: ellipsis;
    font-weight: 600; font-size: var(--t-m); color: var(--app-texto); }
  main table.tramos-antiguedad.tarjetas-movil td.c-importe { grid-column: 2; grid-row: 1; text-align: right; font-weight: 650;
    font-size: var(--t-m); color: var(--app-texto); overflow: visible; }
  main table.tramos-antiguedad.tarjetas-movil td.c-pct { grid-column: 1; grid-row: 2; text-align: left; font-size: var(--t-s);
    color: var(--app-texto-suave); }
  main table.tramos-antiguedad.tarjetas-movil td.c-terceros { grid-column: 2; grid-row: 2; text-align: right; font-size: var(--t-s);
    color: var(--app-texto-suave); }
  main table.tramos-antiguedad.tarjetas-movil td.c-terceros::after { content: attr(data-sufijo); }
  main table.tramos-antiguedad.tarjetas-movil tfoot > tr { border-top: 2px solid var(--app-borde-fuerte); }
}
@media print {
  main[data-seccion] h1::before, .panel-cabecera h1::after,
  .mensaje.info::before, .estado-vacio-titulo::before, .estado-vacio-titulo::after { content: none; }
}
