/* ============================================================
   Tienda · el aspecto de todas las pantallas (TPV y gestión)
   ------------------------------------------------------------
   Sale de la referencia que trajo Jesús el 20-10-2026: tonos cálidos de
   centro de estética, el nombre del negocio con letra de imprenta elegante,
   menú de iconos a la izquierda, fichas con foto y el ticket a la derecha.

   REGLA QUE MANDA EN TODO ESTE ARCHIVO: NINGUNA PANTALLA HACE SCROLL.
   El cuerpo de la página mide lo que la ventana y no se mueve; lo que no
   cabe se pagina con flechas grandes (tienda.js, tnPaginar). Por eso aquí
   casi todo son rejillas que reparten el alto, no bloques apilados.

   Los colores de ESTADO (verde, ámbar, rojo) son los de siempre y no
   cambian con el aspecto: el personal los tiene aprendidos (regla 3).
   ============================================================ */

:root {
    --tn-marca: #9A4A20;          /* marrón tostado: botones y cabecera del ticket */
    --tn-marca-osc: #7B3816;
    --tn-marca-suave: #F5E6DA;
    --tn-marca-linea: #E7C9B3;
    --tn-tinta: #3A2619;          /* texto */
    --tn-suave: #7A6556;          /* texto secundario */
    --tn-fondo: #FBF3EA;          /* el de la página, detrás de todo */
    --tn-papel: rgba(255, 252, 248, .95);
    --tn-papel-2: rgba(255, 249, 243, .88);
    --tn-linea: #ECDCCD;
    --tn-ok: #15803D;  --tn-ok-suave: #E4F3E8;
    --tn-aviso: #B45309; --tn-aviso-suave: #FCEFD9;
    --tn-mal: #B91C1C; --tn-mal-suave: #FBE5E2;
    --tn-r: 14px;
    --tn-sombra: 0 10px 28px -18px rgba(90, 50, 25, .45);
    --tn-serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --tn-sans: 'Figtree', system-ui, sans-serif;
}

/* ---------- La página: del tamaño de la ventana, quieta ---------- */
html.tn, html.tn body { height: 100%; }
body.tn-body {
    margin: 0; height: 100vh; height: 100dvh; overflow: hidden;
    font-family: var(--tn-sans); color: var(--tn-tinta); font-size: 15px;
    background: var(--tn-fondo);
}
body.tn-body *, body.tn-body *::before, body.tn-body *::after { box-sizing: border-box; }

/* ---------- Armazón: raíl de iconos + zona de trabajo ---------- */
.tn-app { height: 100%; display: grid; grid-template-columns: 112px minmax(0, 1fr); }
.tn-rail { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 10px; min-height: 0; }
.tn-logo { display: grid; place-items: center; height: 64px; margin-bottom: 6px; }
.tn-logo img { max-width: 76px; max-height: 60px; object-fit: contain; }
.tn-logo svg { width: 58px; height: 46px; color: var(--tn-marca); }
.tn-rail a, .tn-rail button {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
    border-radius: 16px; border: 0; background: transparent; color: var(--tn-tinta);
    text-decoration: none; font: 500 13.5px var(--tn-sans); cursor: pointer; text-align: center;
}
.tn-rail a svg, .tn-rail button svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.6; }
/* Los iconos de color de Jesús (img.tn-ic) miden lo mismo que los de línea, en cada tamaño de pantalla. */
.tn-rail a .tn-ic, .tn-rail button .tn-ic { width: 30px; height: 30px; }
/* El apartado elegido, en azul muy claro con su borde (como las pestañas): sobre el marino
   los iconos cian no se verían. Solo cuando lleva icono de color. */
.tn-rail .on:has(.tn-ic) { background: var(--tn-marca-suave); color: var(--tn-tinta); box-shadow: inset 0 0 0 2px var(--tn-marca); }
.tn-rail .on:has(.tn-ic):hover { background: var(--tn-marca-suave); }
.tn-rail a:hover, .tn-rail button:hover { background: var(--tn-papel-2); }
.tn-rail .on { background: var(--tn-marca); color: #fff; box-shadow: 0 10px 22px -10px rgba(122, 56, 22, .8); }
.tn-rail .on:hover { background: var(--tn-marca-osc); }
.tn-rail .tn-rail-pie { margin-top: auto; }
/* TPV: los botones de vender (Agenda, Regalo, Documento, Tickets, Caja, Menú) debajo de
   «Productos», separados por una raya, con su nombre siempre (Jesús, 28-10). Algo más
   bajos que los de arriba para que quepan todos sin bajar (regla 6), sin pasar de 48 px. */
.tv-rail-acc { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--tn-linea); }
.tn-rail .tv-raccion { position: relative; gap: 4px; padding: 8px 2px; font-size: 12.5px; }
.tn-rail .tv-raccion .tn-ic { width: 26px; height: 26px; }
.tn-rail .tv-raccion .tv-insignia { top: 2px; right: 6px; }

.tn-zona { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; padding: 14px 18px 14px 6px; gap: 12px; }
.tn-cab { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tn-nombre { min-width: 0; }
.tn-nombre h1 { margin: 0; font-family: var(--tn-serif); font-weight: 600; font-size: 38px; line-height: 1; letter-spacing: -.01em; color: var(--tn-tinta);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-nombre small { display: block; margin-top: 5px; font-size: 11.5px; letter-spacing: .32em; color: var(--tn-suave); }
.tn-cab-der { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tn-hora { text-align: right; line-height: 1.1; margin-right: 6px; }
.tn-hora small { display: block; font-size: 13px; color: var(--tn-suave); }
.tn-hora b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* «Pedir ayuda», en la cabecera de la gestión (28-10: flotando tapaba botones). Botón de icono redondo (tn_ib()). */
.tn-cab-der .ayuda-btn { height: 40px; min-width: 40px; border-radius: 999px; color: var(--tn-marca); white-space: nowrap; }
.tn-cab-der .ayuda-btn svg { width: 22px; height: 22px; stroke-width: 2; }
.tn-accion {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-width: 108px; height: 72px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--tn-linea);
    background: var(--tn-papel); color: var(--tn-tinta); text-decoration: none; font: 500 14.5px var(--tn-sans); cursor: pointer;
    box-shadow: var(--tn-sombra);
}
.tn-accion svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tn-accion .tn-ic { width: 26px; height: 26px; }
.tn-accion:hover { border-color: var(--tn-marca-linea); color: var(--tn-marca-osc); }

/* Título de una pantalla de gestión (dentro de la zona de trabajo). */
.tn-titulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tn-titulo h2 { margin: 0; font-family: var(--tn-serif); font-size: 32px; font-weight: 600; line-height: 1; }
.tn-titulo .tn-sub { font-size: 14px; color: var(--tn-suave); }

/* ---------- Piezas comunes ---------- */
.tn-caja { background: var(--tn-papel); border: 1px solid var(--tn-linea); border-radius: 18px; box-shadow: var(--tn-sombra); min-height: 0; }
.tn-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
    border-radius: 12px; border: 1px solid var(--tn-linea); background: #fff; color: var(--tn-tinta);
    font: 600 14.5px var(--tn-sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.tn-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tn-btn:hover { border-color: var(--tn-marca-linea); color: var(--tn-marca-osc); }
.tn-btn.pri { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; }
.tn-btn.pri:hover { background: var(--tn-marca-osc); color: #fff; }
.tn-btn.rojo { background: var(--tn-mal); border-color: var(--tn-mal); color: #fff; }
.tn-btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.tn-redondo { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
              background: var(--tn-marca-suave); color: var(--tn-marca); cursor: pointer; flex-shrink: 0; }
.tn-redondo svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; }

.tn-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.tn-chip.ok { background: var(--tn-ok-suave); color: var(--tn-ok); }
.tn-chip.av { background: var(--tn-aviso-suave); color: var(--tn-aviso); }
.tn-chip.mal { background: var(--tn-mal-suave); color: var(--tn-mal); }
.tn-chip.gr { background: var(--tn-linea); color: var(--tn-suave); }

.tn-aviso { padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.tn-aviso.success { background: var(--tn-ok-suave); color: #14532D; }
.tn-aviso.error { background: var(--tn-mal-suave); color: #7F1D1D; }
.tn-aviso.warning, .tn-aviso.info { background: var(--tn-aviso-suave); color: #78350F; }

/* Paginador: flechas grandes, que se aciertan con el dedo (regla 6). */
.tn-pag { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; flex-shrink: 0; }
.tn-pag button { width: 64px; height: 44px; border-radius: 12px; border: 1px solid var(--tn-linea); background: #fff;
                 color: var(--tn-tinta); font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.tn-pag button:disabled { opacity: .35; cursor: default; }
.tn-pag span { font-size: 13.5px; color: var(--tn-suave); }
.tn-pag[hidden] { display: none; }

/* ============================================================
   TPV
   ============================================================ */
/* El ticket, hasta 470 px (antes 560): a 1909 de ancho el TOTAL quedaba lejos de lo que se vende (revisión 28-10). */
.tv { display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 470px); gap: 18px; min-height: 0; height: 100%; }
.tv-cat { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; min-width: 0; min-height: 0; }
.tv-buscar { position: relative; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px 0 18px;
             background: var(--tn-papel); border: 1px solid var(--tn-linea); border-radius: 16px; box-shadow: var(--tn-sombra); }
.tv-buscar > svg { width: 22px; height: 22px; stroke: var(--tn-tinta); fill: none; stroke-width: 2; flex-shrink: 0; }
.tv-buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 17px var(--tn-sans); color: var(--tn-tinta); }
.tv-buscar input::placeholder { color: var(--tn-suave); font-weight: 400; }
.tv-buscar .tv-ico { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--tn-tinta); }
.tv-buscar .tv-ico svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tv-buscar .tv-ico.on { background: var(--tn-marca); color: #fff; }
.tv-buscar .tv-ico.hide { display: none; }

.tv-cats { display: flex; gap: 10px; overflow: hidden; flex-wrap: nowrap; min-width: 0; }
.tv-cats button { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 20px; border-radius: 26px; flex-shrink: 0;
                  border: 1px solid var(--tn-linea); background: var(--tn-papel); color: var(--tn-tinta); font: 500 15.5px var(--tn-sans); cursor: pointer; }
.tv-cats button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tv-cats button.on { background: var(--tn-marca); color: #fff; border-color: var(--tn-marca); }
/* Sin esto, el display de arriba ganaba al atributo hidden y las categorías del otro grupo (Servicios/Productos) seguían saliendo. */
.tv-cats button[hidden] { display: none; }
/* Flechas de las categorías que no caben (el TPV no hace scroll). */
.tv-cats-zona { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tv-cats-zona .tv-cats { flex: 1; }
.tv-cats-fl { flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--tn-marca); color: #fff;
              font: 700 26px/1 var(--tn-sans); cursor: pointer; }
.tv-cats-fl[hidden] { display: none; }
/* Aviso flotante encima de la rejilla: no empuja nada. */
.tv-rejilla-zona { position: relative; }
.tv-toast { position: absolute; z-index: 5; top: 6px; left: 50%; transform: translateX(-50%); width: min(640px, 94%);
            box-shadow: 0 14px 30px -12px rgba(20, 30, 40, .45); }
.tv-toast > span { flex: 1; min-width: 0; }
.tv-toast a { color: inherit; white-space: nowrap; }
.tv-toast button { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .6); color: inherit;
                   display: grid; place-items: center; cursor: pointer; }
.tv-toast button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }

/* La rejilla: tnRejilla() decide cuántas columnas y filas caben y pagina el resto. */
.tv-rejilla-zona { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.tv-rejilla { display: grid; gap: 14px; min-height: 0; align-content: start; grid-template-columns: repeat(var(--tv-cols, 4), minmax(0, 1fr)); grid-auto-rows: var(--tv-alto, 200px); }
.tv-item[hidden] { display: none; }
.tv-ficha { position: relative; height: 100%; width: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 0; overflow: hidden;
            border: 1px solid var(--tn-linea); border-radius: 18px; background: var(--tn-papel); cursor: pointer; text-align: left; color: var(--tn-tinta);
            box-shadow: var(--tn-sombra); font-family: var(--tn-sans); }
.tv-ficha:active { transform: translateY(1px); }
.tv-foto { min-height: 0; margin: 5px 5px 0; border-radius: 14px; overflow: hidden; background: var(--tn-marca-suave); display: grid; place-items: center; }
/* La foto ENTERA (contain), no recortada: el botón del TPV es bajo y ancho y con «cover» solo se veía
   una franja del producto (Jesús, 30-10: «mira cómo me salen las fotos»). Fondo blanco, como las fotos de tienda. */
.tv-foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* El fondo BLANCO de la foto se funde con el fondo de la ficha (multiply): se ve el producto, no un recuadro
   blanco pegado (Jesús, 30-10: «quiero transparencias y cosas que queden bonito»). Fondo en degradado suave. */
.tv-foto:has(> img:not(.tv-icono)) { background: radial-gradient(120% 100% at 50% 35%, #FFFFFF 0%, var(--tn-marca-suave) 78%); }
.tv-foto img:not(.tv-icono) { mix-blend-mode: multiply; padding: 6px; box-sizing: border-box; }
.tv-foto .tv-ini { font-family: var(--tn-serif); font-size: 38px; font-weight: 600; color: var(--tn-marca); }
.tv-pie { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 10px 12px 12px 16px; }
.tv-pie b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; font-weight: 600; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; }
/* El precio. Sin el «:not», el círculo del «+» (también un span) bajaba 6 px y perdía el centrado: salía cortado y con la cruz arriba a la izquierda (28-10). */
.tv-pie span:not(.tn-redondo) { display: block; margin-top: 6px; font-size: 21px; font-weight: 700; color: var(--tn-marca-osc); font-variant-numeric: tabular-nums; }
.tv-ficha .tn-redondo { pointer-events: none; }
.tv-bajo { position: absolute; top: 12px; right: 12px; z-index: 1; }
/* Sin foto en ninguna: fichas más bajas, solo texto (caben muchas más). */
.tv-rejilla.sin-fotos .tv-ficha, .tv-rejilla.densa .tv-ficha { grid-template-rows: 1fr; }
.tv-rejilla.sin-fotos .tv-foto, .tv-rejilla.densa .tv-foto { display: none; }
.tv-rejilla.sin-fotos .tv-pie, .tv-rejilla.densa .tv-pie { height: 100%; align-items: center; }
.tv-vacio { display: grid; place-items: center; text-align: center; color: var(--tn-suave); padding: 30px; }

/* Ticket */
.tk { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; border-radius: 20px;
      background: var(--tn-papel); border: 1px solid var(--tn-linea); box-shadow: 0 18px 40px -22px rgba(90, 50, 25, .55); }
.tk-cab { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px; background: var(--tn-marca); color: #fff; }
.tk-cab svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tk-cab h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .03em; }
.tk-cab .cuenta { margin-left: auto; font-size: 15px; opacity: .92; }
.tk-cab button { border: 0; background: transparent; color: #fff; font: 600 15px var(--tn-sans); text-decoration: underline; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tk-cab button svg { width: 20px; height: 20px; }
/* El cliente del ticket (módulo «Clientes y puntos»): una píldora en el sitio de la
   palabra «TICKET» (que se queda solo para el lector de pantalla), que ocupa lo que
   quede y corta el nombre con «…». contain: inline-size = su texto no ensancha el
   ticket (sin él, un nombre largo sacaba «Vaciar» y el TOTAL por la derecha).
   Sin subrayado: es un botón, no un enlace. */
.tk-cab.con-cli h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tk-cab .tk-cli-f { display: contents; }
.tk-cab .tk-cli { contain: inline-size; min-width: 0; flex: 1 1 auto; max-width: 240px; height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px;
    text-decoration: none; white-space: nowrap; overflow: hidden; justify-content: flex-start; }
.tk-cab .tk-cli span { overflow: hidden; text-overflow: ellipsis; }
.tk-cab .tk-cli small { flex: none; font-weight: 700; }
/* Ticket estrecho (el de 1256 px de ancho mide ~380): «N artículos» cede su sitio al
   nombre del cliente (las cantidades siguen en cada línea). */
@container (max-width: 440px) { .tk-cab.con-cli .cuenta { display: none; } .tk-cab.con-cli form { margin-left: auto; } }
.tk-cab .tk-cli svg { flex: none; width: 18px; height: 18px; }
.cli-ventana { width: min(580px, 94vw); padding: 22px; display: grid; gap: 12px; }
.cli-actual { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--tn-linea); border-radius: 12px; }
.cli-acc { display: flex; flex-wrap: wrap; gap: 8px; }
.cli-acc form { display: flex; gap: 8px; }
.cli-acc .tn-btn { height: 44px; }
.cli-canje select { height: 44px; }
.cli-buscar input { height: 46px; }
.cli-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cli-lista .tn-btn { width: 100%; height: 50px; display: grid; justify-items: start; align-content: center; gap: 0; padding: 0 12px; text-align: left; overflow: hidden; }
.cli-lista .tn-btn b, .cli-lista .tn-btn small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-lista .tn-btn small { font-weight: 400; opacity: .8; }
.cli-nada { grid-column: 1 / -1; margin: 0; color: var(--tn-suave); }
.cli-nuevo { display: grid; gap: 6px; }
.cli-tres { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.cli-tres input { height: 46px; min-width: 0; }
@media (max-width: 600px) { .cli-lista, .cli-tres { grid-template-columns: 1fr; } }
.tk-lineas { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; padding: 4px 18px 0; }
.tk-lista { display: flex; flex-direction: column; min-height: 0; }
/* Cada línea en dos filas: arriba qué es y cuánto suma; abajo los mandos.
   En una sola fila, con el ticket de 380 px, el nombre se quedaba en «Limp…». */
.tk-linea { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "foto nom imp" "foto acc q";
            column-gap: 12px; row-gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--tn-linea); }
.tk-linea[hidden] { display: none; }
.tk-mini { grid-area: foto; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--tn-marca-suave); display: grid; place-items: center;
           font-family: var(--tn-serif); font-weight: 600; font-size: 22px; color: var(--tn-marca); align-self: center; }
.tk-mini img { width: 100%; height: 100%; object-fit: cover; }
.tk-nom { grid-area: nom; min-width: 0; }
.tk-nom b { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-nom small { display: block; margin-top: 2px; color: var(--tn-suave); font-size: 13px; }
.tk-nom .desc { color: var(--tn-ok); font-weight: 600; }
.tk-linea .imp { grid-area: imp; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tk-linea .imp s { display: block; font-size: 12px; font-weight: 500; color: var(--tn-suave); }
.tk-acc { grid-area: acc; display: flex; align-items: center; gap: 8px; }
.tk-q { grid-area: q; justify-self: end; }
.tk-cant { display: flex; align-items: center; gap: 4px; }
.tk-cant button { width: 44px; height: 40px; border-radius: 11px; border: 1px solid var(--tn-linea); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--tn-tinta); }
.tk-cant .n { min-width: 28px; text-align: center; font-weight: 700; font-size: 17px; }
.tk-quitar { width: 44px; height: 40px; border: 0; background: transparent; color: var(--tn-mal); cursor: pointer; display: grid; place-items: center; }
.tk-quitar svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tk-pct { width: 44px; height: 40px; border-radius: 11px; border: 1px solid var(--tn-linea); background: #fff; font-weight: 700; color: var(--tn-suave); cursor: pointer; }
.tk-pct.on { background: var(--tn-ok-suave); color: var(--tn-ok); border-color: #B7DFC2; }
.tk-vacio { display: grid; place-items: center; text-align: center; color: var(--tn-suave); gap: 10px; padding: 20px; }
.tk-vacio svg { width: 64px; height: 64px; stroke: var(--tn-marca-linea); fill: none; stroke-width: 1.3; }

.tk-pie { padding: 0 18px 16px; display: grid; gap: 10px; }
.tk-descuento { display: flex; align-items: center; gap: 12px; height: 50px; border: 0; border-bottom: 1px solid var(--tn-linea); background: transparent;
                width: 100%; font: 500 15.5px var(--tn-sans); color: var(--tn-tinta); cursor: pointer; padding: 0 2px; }
.tk-descuento svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tk-descuento .fl { margin-left: auto; }
.tk-descuento .tn-chip { margin-left: 4px; }
.tk-total { display: flex; align-items: baseline; justify-content: space-between; }
.tk-total span { font-size: 18px; font-weight: 700; letter-spacing: .03em; }
.tk-total b { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.tk-sub { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--tn-suave); }
.tk-pagos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tk-pagos button { height: 48px; border-radius: 12px; border: 1px solid var(--tn-linea); background: #fff; color: var(--tn-tinta);
                   font: 600 15.5px var(--tn-sans); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.tk-pagos button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tk-pagos button.on { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; }
.tk-cobrar { height: 70px; width: 100%; border: 0; border-radius: 16px; background: var(--tn-marca); color: #fff; cursor: pointer;
             font: 700 23px var(--tn-sans); display: flex; align-items: center; justify-content: center; gap: 12px;
             box-shadow: 0 14px 26px -14px rgba(122, 56, 22, .9); }
.tk-cobrar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.tk-cobrar:hover { background: var(--tn-marca-osc); }
.tk-cobrar[disabled] { background: var(--tn-marca-linea); color: var(--tn-suave); box-shadow: none; cursor: default; }
/* Calcular el cambio (efectivo) y el aviso del TPV del panel, que no cobra efectivo. */
.tk-pagos.con-cambio { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 6px; }
.tk-pagos.con-cambio button { gap: 5px; padding: 0 6px; font-size: 14.5px; }
.tk-pagos button.tk-cambio-btn { padding: 0 12px; font-size: 14px; border-style: dashed; }
/* Los botones de pago encogen el texto antes que salirse del ticket. */
.tk-pagos button { min-width: 0; overflow: hidden; }
.tk-pagos button svg { flex-shrink: 0; }
.tk-cambio { text-align: center; font-size: 26px; font-weight: 700; padding: 10px; border-radius: 14px; background: var(--tn-marca-suave); color: var(--tn-tinta); }
.tk-cambio.ok { background: var(--tn-ok-suave); color: #14532D; }
.tk-cambio.mal { background: var(--tn-mal-suave); color: #7F1D1D; }
/* Da menos del total: «Resto con tarjeta / con otro», en el sitio del botón de cobrar. */
.tv-resto { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.tv-resto .tk-cobrar { font-size: 16px; padding-inline: 8px; }
.tk-sin-caja { font-size: 13px; color: var(--tn-suave); text-align: center; }
.tk-sin-caja a { color: var(--tn-tinta); font-weight: 600; }
/* Ventana de caja compacta: cabe entera aunque salga el aviso de ventas sin terminar. */
.cj-form { display: grid; gap: 8px; }
.cj-form label { margin-bottom: 0; }
.cj-cerrar { margin-top: auto; border-top: 1px solid var(--tn-linea); padding-top: 12px; }
.cj-cerrar #cjDiff { font-weight: 700; margin-left: 6px; }
.cj-confirma { display: flex !important; gap: 10px; align-items: center; font-size: 14px !important; color: var(--tn-tinta) !important; }

/* Ventanas (Caja, descuentos, teclado): encima de todo, del tamaño justo. */
.tn-velo { position: fixed; inset: 0; z-index: 50; background: rgba(58, 38, 25, .5); display: none; align-items: center; justify-content: center; padding: 16px; }
.tn-velo.abierta { display: flex; }
.tn-ventana { position: relative; background: var(--tn-ventana, #FFFCF8); border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(40, 20, 8, .6);
              max-width: 100%; max-height: 100%; overflow: hidden; }
/* Las ventanas de los botones de la columna izquierda del TPV, AL LADO del botón (tienda.js,
   lateral()): el velo deja libre la columna (sus botones se siguen tocando), la ventana se
   desliza desde el botón y una flecha lo señala. */
.tn-velo.abierta.lateral { display: block; left: var(--lat-izq, 112px); padding: 0; background: rgba(22, 58, 82, .14); }
.tn-velo.lateral > .tn-ventana { position: fixed; left: var(--lat-x); top: var(--lat-y); margin: 0;
    max-width: calc(100vw - var(--lat-x) - 14px); max-height: calc(100vh - 24px);
    transform-origin: 0 var(--lat-flecha); animation: tnLateral .24s cubic-bezier(.2, .9, .25, 1) both;
    box-shadow: 0 24px 60px -18px rgba(22, 40, 58, .45), 0 0 0 1px var(--tn-linea); }
.tn-velo.lateral::before { content: ''; position: fixed; z-index: 1; left: calc(var(--lat-x) - 8px); top: calc(var(--lat-y) + var(--lat-flecha) - 8px);
    width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px; background: var(--tn-ventana, #FFFCF8);
    box-shadow: -1px 1px 0 var(--tn-linea); animation: tnLateralFlecha .24s ease-out both; }
.tn-velo.lateral > .tn-ventana { z-index: 2; }
html[data-tema="noche"] .tn-velo.lateral::before { background: #241E1A; }
/* «Ver los documentos ya hechos» al pie de la ventana Documento con ticket. */
.doc-hechos { margin: 12px 0 0; text-align: right; font-size: 14px; }
@keyframes tnLateral { from { opacity: 0; transform: translateX(-22px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tnLateralFlecha { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tn-velo.lateral > .tn-ventana, .tn-velo.lateral::before { animation: none; } }
.tn-ventana .tn-cerrar { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0;
                         background: #F3E9E0; cursor: pointer; display: grid; place-items: center; color: var(--tn-tinta); z-index: 2; }
.tn-ventana .tn-cerrar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.tn-ventana h2 { margin: 0; font-family: var(--tn-serif); font-size: 30px; font-weight: 600; line-height: 1; }

.cj { width: 860px; display: grid; grid-template-columns: 1fr 1fr; }
.cj-iz { background: var(--tn-fondo, #F5FCFD); padding: 24px; display: flex; flex-direction: column; gap: 9px; border-right: 1px solid var(--tn-linea); }
.cj-iz .quien { font-size: 13.5px; color: var(--tn-suave); margin-bottom: 6px; }
.cj-par { display: flex; justify-content: space-between; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.cj-par b { font-weight: 700; }
.cj-par.ok { color: var(--tn-ok); } .cj-par.mal { color: var(--tn-mal); }
.cj-esperado { margin-top: auto; background: var(--tn-marca); color: #fff; border-radius: 16px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; }
.cj-esperado b { font-size: 30px; font-weight: 700; }
.cj-de { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.cj-de label, .tn-campo label { display: block; font-size: 13px; font-weight: 600; color: var(--tn-suave); margin-bottom: 5px; }
.cj-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cj-movs { font-size: 13.5px; color: var(--tn-suave); display: grid; gap: 4px; }
.cj-movs div { display: flex; justify-content: space-between; }

/* Campos (ventanas y gestión) */
.tn-in, body.tn-body .tn-zona input[type=text], body.tn-body .tn-zona input[type=search], body.tn-body .tn-zona input[type=email],
body.tn-body .tn-zona input[type=tel], body.tn-body .tn-zona input[type=number], body.tn-body .tn-zona input[type=date],
body.tn-body .tn-zona input[type=time], body.tn-body .tn-zona input[type=password], body.tn-body .tn-zona select, body.tn-body .tn-zona textarea,
.tn-ventana input[type=text], .tn-ventana select {
    width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--tn-linea); background: #fff;
    font: 500 15px var(--tn-sans); color: var(--tn-tinta); outline: none;
}
body.tn-body .tn-zona textarea { height: auto; padding: 10px 13px; resize: none; }
body.tn-body input:focus, body.tn-body select:focus, body.tn-body textarea:focus { border-color: var(--tn-marca); box-shadow: 0 0 0 3px var(--tn-marca-suave); }
body.tn-body input[type=checkbox], body.tn-body input[type=radio] { width: 20px; height: 20px; margin: 0; accent-color: var(--tn-marca); flex-shrink: 0; }

/* Teclado numérico del buscador. El fondo, del tema (--tn-ventana): con un blanco fijo, en «Noche» las cifras
   salían en crema sobre blanco y no se leían. */
.tv-pad { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: none; padding: 12px; border-radius: 18px;
          background: var(--tn-ventana, #FFFCF8); border: 1px solid var(--tn-linea); box-shadow: 0 20px 40px -18px rgba(60, 30, 10, .5); }
.tv-pad.open { display: block; }
.tv-pad-k { display: grid; grid-template-columns: repeat(3, 78px); gap: 8px; }
.tv-pad-k button { height: 54px; border-radius: 12px; border: 1px solid var(--tn-linea); background: var(--tn-ventana, #fff); font: 700 21px var(--tn-sans); cursor: pointer; color: var(--tn-tinta); }
.tv-pad-k .ok { background: var(--tn-marca); color: #fff; border-color: var(--tn-marca); font-size: 14px; }

/* ============================================================
   GESTIÓN: lo que traen las pantallas, con el aspecto nuevo
   ============================================================
   Las pantallas de gestión siguen escribiendo sus clases de siempre
   (card, btn, badge, alert, form-group, tablas con data-apilar). Aquí se
   les da el aspecto nuevo y se reparten en la zona de trabajo sin scroll:
   .tn-hoja coloca las tarjetas en columnas y tienda.js pagina las tablas.  */
.tn-hoja { min-height: 0; display: grid; gap: 16px; grid-template-columns: repeat(var(--tn-cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-items: stretch; }
.tn-hoja.dos { --tn-cols: 2; }
.tn-hoja.lado { grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 420px); }
.tn-hoja > * { min-height: 0; }
.tn-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.tn-col > .card:has(table) { flex: 1; }

body.tn-body .card { background: var(--tn-papel); border: 1px solid var(--tn-linea); border-radius: 18px; box-shadow: var(--tn-sombra);
                     padding: 16px 18px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
body.tn-body .card > strong:first-child, body.tn-body .card > .card-title { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
body.tn-body .text-muted { color: var(--tn-suave); }
body.tn-body .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 11px;
                    border: 1px solid var(--tn-marca); background: var(--tn-marca); color: #fff; font: 600 14.5px var(--tn-sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
body.tn-body .btn:hover { background: var(--tn-marca-osc); }
body.tn-body .btn-secondary { background: #fff; color: var(--tn-tinta); border-color: var(--tn-linea); }
body.tn-body .btn-secondary:hover { background: #fff; border-color: var(--tn-marca-linea); color: var(--tn-marca-osc); }
body.tn-body .btn-danger { background: #fff; color: var(--tn-mal); border-color: #EFC4BF; }
body.tn-body .btn-danger:hover { background: var(--tn-mal-suave); }
body.tn-body .btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
body.tn-body .badge { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; border: 0; background: var(--tn-marca-suave); color: var(--tn-suave); }
body.tn-body .badge-active { background: var(--tn-ok-suave); color: var(--tn-ok); }
body.tn-body .badge-trial { background: var(--tn-aviso-suave); color: var(--tn-aviso); }
body.tn-body .badge-cancelled, body.tn-body .badge-suspended { background: var(--tn-mal-suave); color: var(--tn-mal); }
body.tn-body .alert { padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; margin: 0; border: 0; }
body.tn-body .alert-success { background: var(--tn-ok-suave); color: #14532D; }
body.tn-body .alert-error, body.tn-body .alert-danger { background: var(--tn-mal-suave); color: #7F1D1D; }
body.tn-body .alert-warning, body.tn-body .alert-info { background: var(--tn-aviso-suave); color: #78350F; }
body.tn-body .form-group { margin: 0 0 10px; }
body.tn-body .form-group label, body.tn-body .tn-zona label { font-size: 13px; font-weight: 600; color: var(--tn-suave); }
body.tn-body .form-group > label { display: block; margin-bottom: 5px; }
body.tn-body .grid { display: grid; gap: 12px; }
body.tn-body .grid-form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.tn-body .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.tn-body .flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.tn-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
body.tn-body th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--tn-suave); padding: 8px 10px; border-bottom: 1px solid var(--tn-linea); background: transparent; }
body.tn-body td { padding: 0 10px; height: 50px; border-bottom: 1px solid var(--tn-linea); vertical-align: middle; }
body.tn-body tr[hidden] { display: none; }
body.tn-body .tn-tabla { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.tn-body .tn-tabla-cuerpo { flex: 1; min-height: 0; overflow: hidden; }
body.tn-body h1, body.tn-body h2, body.tn-body h3 { color: var(--tn-tinta); }

/* ---------- La zona de trabajo de la gestión ----------
   Cabecera (título, pestañas, hora) y debajo .tn-contenido: los avisos en
   fila y luego .tn-hoja, donde tienda.js mete las tarjetas de la pantalla
   en COLUMNAS (una tarjeta: entera; dos: la del formulario estrecha y la de
   la lista ancha; tres o más: a partes iguales). Cada tarjeta mide todo el
   alto; sus tablas se pasan por páginas.                                   */
.tn-gestion .tn-cab { flex-wrap: nowrap; }
.tn-pestanas { flex: 1; justify-content: flex-start; margin-left: 10px; }
.tn-pestanas a { display: inline-flex; align-items: center; height: 46px; padding: 0 20px; border-radius: 24px; flex-shrink: 0;
                 border: 1px solid var(--tn-linea); background: var(--tn-papel); color: var(--tn-tinta); text-decoration: none; font: 500 15px var(--tn-sans); }
.tn-pestanas a.on { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; }
/* Pestañas con su icono de color encima del nombre (iconos de Jesús, 27-10). La elegida va
   en un azul muy claro con su borde (sobre el marino, los iconos cian no se verían). */
.tn-pest-zona a.tn-pest { display: inline-flex; align-items: center; flex-shrink: 0; border: 1px solid var(--tn-linea); background: var(--tn-papel); color: var(--tn-tinta); text-decoration: none;
                         flex-direction: column; justify-content: center; gap: 2px; height: 56px; min-width: 76px; padding: 0 12px;
                         border-radius: 14px; font: 600 12.5px var(--tn-sans); line-height: 1.15; text-align: center; }
.tn-pest-zona a.tn-pest .tn-ic { width: 26px; height: 26px; flex-shrink: 0; }
/* Muchas pestañas (Catálogo con todos sus módulos): se estrechan antes que salirse; el nombre largo se corta con «…». */
.tn-pest-zona { gap: 6px; }
.tn-pest-zona a.tn-pest { flex: 0 1 auto; min-width: 62px; padding: 0 9px; }
.tn-pest-zona a.tn-pest span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* En el móvil la fila de pestañas se arrastra de lado: enteras, sin cortar el nombre. */
@media (max-width: 900px) { .tn-pest-zona a.tn-pest { flex-shrink: 0; } }
.tn-pest-zona a.tn-pest:hover { border-color: var(--tn-marca-linea); background: var(--tn-marca-suave); }
.tn-pest-zona a.tn-pest.on { background: var(--tn-marca-suave); border-color: var(--tn-marca); color: var(--tn-tinta); box-shadow: 0 0 0 1px var(--tn-marca) inset; }
/* Con el dedo (Ajustes → Aspecto → «En este aparato», o una pantalla táctil en «Automático»):
   lo que se pulsa en la gestión, más grande y separado. El TPV ya es así siempre. */
html[data-modo="tactil"] .tn-pest-zona a.tn-pest { height: 68px; min-width: 88px; padding: 0 14px; font-size: 13.5px; gap: 4px; }
html[data-modo="tactil"] .tn-pest-zona a.tn-pest .tn-ic { width: 32px; height: 32px; }
html[data-modo="tactil"] .tn-pest-zona { gap: 8px; }
/* Con el dedo, si no caben todas, la fila de pestañas se arrastra de lado (sin barra). */
html[data-modo="tactil"] .tn-pestanas { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
html[data-modo="tactil"] body.tn-body .tn-gestion :is(.btn, a.btn, button.btn) { min-height: 48px; padding-left: 18px; padding-right: 18px; }
html[data-modo="tactil"] body.tn-body .tn-gestion :is(.btn-sm, a.btn-sm) { min-height: 44px; }
html[data-modo="tactil"] body.tn-body .tn-gestion :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea) { min-height: 48px; font-size: 16px; }
html[data-modo="tactil"] body.tn-body .tn-gestion :is(input[type=checkbox], input[type=radio]) { width: 24px; height: 24px; }
html[data-modo="tactil"] body.tn-body .tn-gestion table td { height: 52px; }
/* Con ratón: más junto (cabe más en la pantalla). */
html[data-modo="raton"] body.tn-body .tn-gestion :is(.btn-sm, a.btn-sm) { min-height: 34px; }
.tn-contenido { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tn-contenido > .alert, .tn-contenido > [class*="aviso"] { flex-shrink: 0; }
.tn-contenido > .soporte-pie { flex-shrink: 0; margin: 0 !important; padding: 0 90px 0 4px !important; border: 0 !important; font-size: 12.5px !important; }
.tn-hoja { flex: 1; min-height: 0; display: grid; gap: 16px; grid-auto-rows: minmax(0, 1fr); }
.tn-hoja[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.tn-hoja[data-n="2"] { grid-template-columns: minmax(320px, .85fr) minmax(0, 1.6fr); }
.tn-hoja[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tn-hoja[data-n="4"], .tn-hoja[data-n="5"], .tn-hoja[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.tn-hoja.lista-primero[data-n="2"] { grid-template-columns: minmax(0, 1.6fr) minmax(320px, .85fr); }
.tn-hoja > * { min-height: 0; min-width: 0; }
/* Último recurso: si una tarjeta (un formulario largo) no cabe, se desplaza
   ELLA por dentro, no la página. Las listas nunca llegan aquí: se paginan. */
body.tn-body .tn-hoja > .card { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--tn-marca-linea) transparent; }
body.tn-body .tn-hoja .card { container-type: inline-size; }
@container (max-width: 560px) { body.tn-body .grid-form-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 380px) { body.tn-body .grid-form-3, body.tn-body .grid-2 { grid-template-columns: minmax(0, 1fr); } }
/* Las celdas de acciones: los botones en fila, no apilados (filas bajas). */
body.tn-body td form { display: inline-flex; margin: 0; gap: 6px; vertical-align: middle; }
body.tn-body td:last-child { white-space: nowrap; text-align: right; }
body.tn-body td .btn + form, body.tn-body td form + form, body.tn-body td .btn + .btn { margin-left: 6px; }
/* Filtros y buscadores: una franja fina encima de la lista. */
body.tn-body .tn-contenido > .card.tn-fila { flex-shrink: 0; flex-direction: row; align-items: center; padding: 10px 14px; overflow: visible; }
body.tn-body .card.tn-fila form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
body.tn-body .card.tn-fila .form-group { margin: 0; }
/* Un formulario dentro de su ventana. */
.tn-ventana-form { width: min(820px, 100%); padding: 26px 26px 22px; }
.tn-form-dentro { display: flex; flex-direction: column; gap: 12px; }
.tn-form-dentro > strong:first-child { font-family: var(--tn-serif); font-size: 28px; font-weight: 600; padding-right: 50px; }
.tn-gestion .tn-cab-der .tn-btn.pri { height: 50px; font-size: 15.5px; }
@media (max-width: 1400px) { .tn-gestion .tn-titulo .tn-sub { display: none; } }
.tn-propio { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
/* Pantallas estrechas (tablet en vertical, móvil): el raíl se queda solo con
   iconos y las columnas se apilan; aquí sí se deja bajar, porque una sola
   columna no cabe y partir cada tarjeta en páginas sería peor. */
/* Tallas y colores: la tabla (talla, color, código, precio, stock) no cabía en un
   tercio del ancho y escondía el precio y el stock. Ocupa la columna ancha de la
   derecha a todo el alto; las otras tarjetas, apiladas a la izquierda. */
@media (min-width: 901px) {
    body.tn-body .tn-hoja:has(> #varTabla) { grid-template-columns: minmax(300px, .8fr) minmax(0, 2fr) !important; }
    body.tn-body .tn-hoja > #varTabla { grid-column: 2; grid-row: 1 / span 3; }
    /* Mi suscripción: la lista de módulos es lo largo de la pantalla; con un sexto
       del alto solo se veía su explicación. Ocupa dos filas. */
    body.tn-body .tn-hoja > #susModulos { grid-row: span 2; }
    /* La ficha de una persona en Cuotas: en tres tercios, las tablas de lo que paga
       y de sus cuotas no cabían y escondían «Dar de baja» y «No se cobra». Dos
       mitades: lo que paga (y sus bonos) a la izquierda; sus cuotas, a la derecha a todo el alto. */
    body.tn-body .tn-hoja:has(> #cuSusCuotas) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
    body.tn-body .tn-hoja[data-n="3"] > #cuSusCuotas { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 900px) {
    body.tn-body { overflow: auto; height: auto; }
    .tn-app { grid-template-columns: 76px minmax(0, 1fr); height: auto; min-height: 100vh; }
    .tn-rail a, .tn-rail button { font-size: 12px; padding: 10px 2px; }   /* 12 px: el mínimo de la guía, también en el móvil */
    .tn-rail-grupo { margin-inline: -8px; }   /* «Mostrador» a 12 px no cabía en los 56 px de la columna estrecha */
    .tn-hoja, .tn-hoja.lado, .tn-hoja.dos { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .tv { grid-template-columns: 1fr; height: auto; }
    .tn-hoja, .tn-hoja[data-n] { grid-template-columns: 1fr !important; grid-auto-rows: auto; }
    .tn-gestion .tn-cab { flex-wrap: wrap; } .tn-pestanas { overflow-x: auto; }
    .tn-nombre h1 { font-size: 28px; }
    .tn-hora { display: none; }
    .cj { width: auto; grid-template-columns: 1fr; }
}
/* Pantallas BAJAS (la del mostrador mide 1256 × 545): la cabecera, el total y
   los botones se aprietan para que en el ticket quepan varias líneas. Nada
   baja de 40 px de alto: se sigue acertando con el dedo. */
@media (max-height: 700px) and (min-width: 901px) {
    .tn-zona { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
    .tn-rail { padding-top: 8px; gap: 2px; }
    .tn-logo { height: 46px; margin-bottom: 2px; }
    .tn-rail a, .tn-rail button { padding: 8px 4px; font-size: 12.5px; }
    .tn-rail a :is(svg, .tn-ic), .tn-rail button :is(svg, .tn-ic) { width: 26px; height: 26px; }
    .tn-nombre h1 { font-size: 30px; } .tn-nombre small { margin-top: 3px; font-size: 10.5px; }
    .tn-hora b { font-size: 22px; } .tn-hora small { font-size: 12px; }
    .tn-accion { height: 56px; min-width: 92px; font-size: 13.5px; gap: 3px; }
    .tv-rail-acc { margin-top: 4px; padding-top: 6px; gap: 2px; }
    .tn-rail .tv-raccion { padding: 5px 2px; font-size: 11.5px; gap: 2px; min-height: 48px; justify-content: center; }
    .tn-rail .tv-raccion .tn-ic { width: 23px; height: 23px; }
    .tv-cat { gap: 8px; } .tv-buscar { height: 48px; } .tv-cats button { height: 44px; padding: 0 16px; font-size: 14.5px; }
    .tv-cats-fl { width: 44px; height: 44px; }
    .tk-cab { height: 48px; } .tk-cab h3 { font-size: 17px; }
    .tk-linea { padding: 6px 0; row-gap: 4px; }
    .tk-mini { width: 44px; height: 44px; }
    .tk-nom small { display: none; }
    .tk-cant button, .tk-pct, .tk-quitar { height: 38px; }
    .tn-pag { padding: 4px 8px; } .tn-pag button { height: 40px; }
    .tk-pie { gap: 6px; padding-bottom: 10px; }
    .tk-descuento { height: 40px; font-size: 14.5px; }
    .tk-total b { font-size: 32px; } .tk-total span { font-size: 15px; }
    .tk-pagos button { height: 42px; font-size: 14px; }
    .tk-cobrar { height: 54px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Barras de filtros (un <form method="get"> suelto en la pantalla) ----------
   Gastos, Ventas, Informe… traen sus filtros como un formulario de búsqueda.
   Van en UNA fila arriba, con cada desplegable a su ancho: apilados a todo el
   ancho se comían la pantalla entera y la lista quedaba fuera.            */
body.tn-body .tn-contenido > form[method="get"], body.tn-body .tn-contenido > .tn-fila form[method="get"], body.tn-body .tn-filtros {
    flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 0;
}
body.tn-body .tn-contenido form[method="get"] select, body.tn-body .tn-contenido form[method="get"] input:not([type=checkbox]):not([type=radio]) {
    width: auto; flex: 0 1 auto; min-width: 120px; max-width: 280px; min-height: 44px;
}
body.tn-body .tn-contenido form[method="get"] input[type=search], body.tn-body .tn-contenido form[method="get"] input[name=q] { flex: 1 1 220px; max-width: 360px; }
body.tn-body .tn-contenido form[method="get"] .form-group { margin: 0; flex: 0 1 auto; min-width: 0; }
body.tn-body .tn-contenido form[method="get"] .form-group label { font-size: 12px; margin-bottom: 2px; }

/* ---------- Ajustes: apartados lado a lado, tarjetas bajas ---------- */
body.tn-body .tn-ajustes { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
body.tn-body .tn-ajustes .aj-portada { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 18px; align-content: start; max-width: none; }
body.tn-body .tn-ajustes .aj-buscar-caja, body.tn-body .tn-ajustes .aj-vacio { grid-column: 1 / -1; }
body.tn-body .tn-ajustes .aj-buscar-caja { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body.tn-body .tn-ajustes .aj-buscar { flex: 0 1 420px; }
body.tn-body .tn-ajustes .aj-grupo { margin: 0; min-width: 0; }
body.tn-body .tn-ajustes .aj-grupo h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 13px; letter-spacing: .02em; text-transform: none; color: var(--tn-tinta-suave, #7a6152); }
body.tn-body .tn-ajustes .aj-rejilla { display: flex; flex-direction: column; gap: 8px; grid-template-columns: none !important; }
body.tn-body .tn-ajustes .aj-tarjeta { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; border-radius: 14px; text-decoration: none; }
body.tn-body .tn-ajustes .aj-tx { display: flex; flex-direction: column; min-width: 0; }
body.tn-body .tn-ajustes .aj-tx b { font-size: 15px; text-decoration: none; }
body.tn-body .tn-ajustes .aj-tx small { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.tn-body .tn-ajustes .aj-ic { flex-shrink: 0; }
/* «Para empezar»: una franja baja con lo que falta (se va sola cuando está todo). */
body.tn-body .aj-empezar { background: var(--tn-papel); border: 1px solid var(--tn-linea); border-left: 5px solid var(--tn-aviso, #D97706);
                           border-radius: 14px; padding: 10px 14px; }
body.tn-body .aj-empezar h2 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--tn-tinta); }
body.tn-body .aj-empezar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
body.tn-body .aj-empezar li { font-size: 14px; display: flex; align-items: center; min-height: 36px; }
body.tn-body .aj-empezar li a { color: var(--tn-tinta); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
body.tn-body .aj-empezar li.hecho { color: var(--tn-suave); gap: 8px; }
body.tn-body .aj-empezar .aj-ok { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px;
                                  background: var(--tn-ok-suave); color: var(--tn-ok); flex-shrink: 0; }
body.tn-body .aj-empezar .aj-ok.falta { background: transparent; border: 2px solid var(--tn-aviso, #D97706); }

/* Las flechas de página se tienen que ver y acertar con el dedo: en marca y centradas junto al «Página x de y». */
body.tn-body .tn-pag { justify-content: center; gap: 18px; }
body.tn-body .tn-pag button { width: 88px; height: 48px; font-size: 26px; font-weight: 700; color: #fff; background: var(--tn-marca); border-color: var(--tn-marca); }
body.tn-body .tn-pag button:disabled { background: #fff; color: var(--tn-marca); border-color: var(--tn-linea); }
body.tn-body .tn-pag span { font-size: 15px; font-weight: 600; color: var(--tn-tinta); min-width: 120px; text-align: center; }

/* Foto (opcional) del producto: en el formulario y en la lista. */
body.tn-body .tn-foto-campo { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
body.tn-body .tn-foto-ver, body.tn-body .tn-mini { display: inline-grid; place-items: center; flex-shrink: 0; overflow: hidden; background: var(--tn-marca-suave); color: var(--tn-marca); font-family: 'Cormorant Garamond', serif; font-weight: 700; }
body.tn-body .tn-foto-ver { width: 72px; height: 72px; border-radius: 16px; font-size: 32px; }
body.tn-body .tn-mini { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; margin-right: 10px; vertical-align: middle; }
body.tn-body .tn-foto-ver img, body.tn-body .tn-mini img { width: 100%; height: 100%; object-fit: cover; }
body.tn-body .tn-ajustes .aj-portada { max-width: none !important; width: 100%; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
body.tn-body .tn-ajustes .aj-futura { display: none; }
/* Buscador y atajos en UNA línea; y en la pantalla baja del mostrador, tarjetas de una línea y cuatro columnas. */
body.tn-body .tn-ajustes .aj-buscar-caja { flex-wrap: nowrap; }
body.tn-body .tn-ajustes .aj-sug { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
@media (max-height: 700px) and (min-width: 901px) {
    body.tn-body .tn-ajustes .aj-portada { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
    body.tn-body .tn-ajustes .aj-tarjeta { min-height: 44px; padding: 6px 10px; gap: 10px; }
    body.tn-body .tn-ajustes .aj-tx small { -webkit-line-clamp: 1; font-size: 12px; }
    body.tn-body .tn-ajustes .aj-ic { transform: scale(.85); }
    body.tn-body .tn-ajustes .aj-rejilla { gap: 6px; }
    body.tn-body .tn-ajustes .aj-grupo h2 { margin-bottom: 4px; }
    body.tn-body .tn-ajustes .aj-buscar input { min-height: 40px; }
}

/* ---------- Informe: cifras en fila arriba; gráfica a la izquierda y listas a la derecha ---------- */
body.tn-body .tn-informe { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
body.tn-body .tn-informe > .kpi-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
body.tn-body .tn-informe .kpi-ticket { margin: 0; padding: 10px 18px; min-height: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
body.tn-body .tn-informe .kpi-ticket .eyebrow { width: 100%; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--tn-suave); }
body.tn-body .tn-informe .kpi-ticket .value { font-family: inherit; font-size: 26px; font-weight: 700; color: var(--tn-tinta); white-space: nowrap; }
body.tn-body .tn-informe .kpi-ticket .foot { font-size: 13px; color: var(--tn-suave); }
body.tn-body .tn-informe > .chart-card { margin: 0 !important; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.tn-body .tn-informe .mini-bars { flex: 1; min-height: 0; }
body.tn-body .tn-informe > .grid { margin: 0 !important; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
body.tn-body .tn-informe > .grid > .card { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.tn-body .tn-informe > .grid:first-child, body.tn-body .tn-informe > .kpi-row + .grid { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-height: 700px) and (min-width: 901px) { body.tn-body .tn-informe .kpi-ticket { padding: 6px 14px; } body.tn-body .tn-informe .kpi-ticket .value { font-size: 21px; } }
body.tn-body .tn-informe > .grid > .card { height: 100%; max-height: 100%; }
/* Mejor tres columnas a todo el alto (gráfica · formas de pago · más vendidos) que dos listas apretadas una encima de otra. */
body.tn-body .tn-informe { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
body.tn-body .tn-informe > .grid { display: contents; }
body.tn-body .tn-informe > .grid > .card { height: auto; max-height: none; }

/* Servicios (Estética): el horario de la agenda, en una franja baja; así la lista de profesionales tiene sitio. */
body.tn-body #horario { flex: 0 0 auto !important; }
body.tn-body #horario > p { display: none; }
body.tn-body #horario form { margin-top: 8px !important; gap: 8px !important; flex-wrap: nowrap !important; }
body.tn-body #horario .form-group { flex: 1 1 0; min-width: 0; }
body.tn-body #horario input, body.tn-body #horario select { width: 100%; min-width: 0; }
body.tn-body #horario .btn { white-space: nowrap; }
body.tn-body #profesionales { flex: 1 1 auto; }
body.tn-body #profesionales td, body.tn-body #servicios td { padding-top: 6px; padding-bottom: 6px; }
body.tn-body #horario form { flex-wrap: wrap !important; }
body.tn-body #horario .form-group { flex: 1 1 104px; }
body.tn-body #horario .btn { flex: 1 1 100%; }
/* El buscador de una barra de filtros: ancho cómodo y el botón pegado a él, no al otro extremo. */
body.tn-body .tn-contenido form[method="get"] { justify-content: flex-start; }
body.tn-body .tn-contenido form[method="get"] .form-group:has(input[type=search]) { flex: 0 1 460px; }
body.tn-body .tn-contenido form[method="get"] .form-group input[type=search] { width: 100%; max-width: none; }

/* ---------- Pantalla del PIN (terminal y gestión): tienda/partials/tn_pin.php ---------- */
body.tn-pin { min-height: 100vh; height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 16px; }
.tn-pin-caja { width: min(860px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: clamp(24px, 6vw, 72px); align-items: center; }
.tn-pin-quien { text-align: left; }
.tn-pin-logo { margin-bottom: 10px; color: var(--tn-marca); }
.tn-pin-logo img { max-width: 120px; max-height: 80px; object-fit: contain; }
.tn-pin-quien h1 { font-family: var(--tn-serif); font-size: clamp(30px, 4vw, 44px); font-weight: 600; line-height: 1.05; margin: 0; color: var(--tn-tinta); }
.tn-pin-lema { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--tn-suave); margin: 6px 0 0; }
.tn-pin-sub { margin: 18px 0 0; font-size: 16px; color: var(--tn-suave); line-height: 1.45; }
.tn-pin-sub strong { color: var(--tn-tinta); font-size: 18px; }
.tn-pin-volver { display: inline-flex; align-items: center; min-height: 48px; margin-top: 16px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--tn-linea); background: #fff; color: var(--tn-tinta); font-weight: 600; text-decoration: none; }
.tn-pin-teclado { background: rgba(255,255,255,.92); border: 1px solid var(--tn-linea); border-radius: 24px; padding: 18px; box-shadow: 0 12px 34px rgba(58,38,25,.12); }
.tn-pin-err { min-height: 22px; text-align: center; color: #B91C1C; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.tn-pin-disp { height: 56px; line-height: 56px; text-align: center; font-size: 34px; letter-spacing: 14px; font-weight: 700; color: var(--tn-tinta);
    background: var(--tn-marca-suave); border-radius: 14px; margin-bottom: 12px; }
.tn-pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tn-pin-pad button { height: 64px; border-radius: 16px; border: 1px solid var(--tn-linea); background: #fff; font-size: 26px; font-weight: 700; color: var(--tn-tinta); cursor: pointer; font-family: inherit; }
.tn-pin-pad button:active { background: var(--tn-marca-suave); transform: translateY(1px); }
.tn-pin-pad .borrar { color: var(--tn-suave); }
.tn-pin-pad .ok { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; font-size: 18px; }
.tn-pin-bloq { margin: 0; font-size: 16px; line-height: 1.5; color: var(--tn-tinta); }
@media (max-height: 600px) { .tn-pin-pad button { height: 54px; } .tn-pin-disp { height: 46px; line-height: 46px; font-size: 28px; } .tn-pin-teclado { padding: 14px; } }
@media (max-width: 700px) {
    body.tn-pin { height: auto; overflow: auto; }
    .tn-pin-caja { grid-template-columns: 1fr; gap: 18px; }
    .tn-pin-quien { text-align: center; }
}

/* ---------- Ticket: cada línea en UNA fila (20-10, captura de Jesús) ----------
   En dos filas cabían 2 artículos por página en el mostrador. En una sola fila
   (foto pequeña · nombre y precio · % − 1 + · importe · papelera) caben 4-5,
   y las teclas siguen siendo de dedo (40 px).                               */
.tk-linea { grid-template-columns: 40px minmax(0, 1fr) auto auto auto; grid-template-areas: "foto nom acc imp q"; align-items: center; column-gap: 8px; row-gap: 0; padding: 6px 0; }
.tk-mini { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
.tk-nom b { font-size: 15px; }
.tk-nom small { font-size: 12px; margin-top: 0; }
.tk-acc { gap: 4px; }
.tk-pct, .tk-cant button { width: 40px; height: 40px; }
.tk-cant .n { min-width: 22px; font-size: 16px; }
/* «+» y «−» que no se pueden usar (a peso, con número de serie, tarjeta regalo,
   cuota o bono): que se vea que no van, no solo que no hagan nada. */
.tk-cant button:disabled { opacity: .3; cursor: default; }
/* Los kilos de una pesada y el número de serie se ven SIEMPRE, también en la
   pantalla baja del mostrador (donde el «precio / ud» se esconde para que quepan
   más líneas): quien cobra tiene que ver qué pesó y qué IMEI lleva. */
body.tn-body .tk-nom small.nota { display: block !important; }
.tk-linea .imp { font-size: 16px; min-width: 64px; }
.tk-quitar { width: 36px; height: 40px; }
@media (max-height: 700px) and (min-width: 901px) {
    .tk-linea { padding: 4px 0; }
    .tk-mini { width: 34px; height: 34px; }
    .tk-nom small { display: none; }
    .tk-descuento { height: 40px; }
    .tk-total b { font-size: 34px; }
    .tk-pagos button { height: 44px; }
    .tk-cobrar { height: 56px; }
    .tk-pie { gap: 7px; padding-bottom: 12px; }
}
/* Si el ticket es estrecho (tablet en vertical), vuelve a dos filas. */
/* En un ticket de menos de 520 px (el mostrador, la tablet) no cabe todo en una fila sin cortar el nombre:
   arriba nombre e importe, debajo los botones, todo bajo. Siguen cabiendo 4 artículos por página. */
@container (max-width: 520px) {
    .tk-linea { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "foto nom imp" "foto acc q"; row-gap: 2px; column-gap: 10px; padding: 5px 0; }
    .tk-mini { width: 34px; height: 34px; align-self: start; margin-top: 2px; }
    .tk-pct, .tk-cant button { width: 38px; height: 34px; }
    .tk-quitar { height: 34px; }
}
.tk { container-type: inline-size; }
/* Pantalla baja (mostrador, o la ventana con zoom): tablas más apretadas para que quepan más filas por página. */
@media (max-height: 700px) and (min-width: 901px) {
    body.tn-body td { height: 42px; }
    body.tn-body th { padding-top: 4px; padding-bottom: 4px; }
    body.tn-body td .btn-sm, body.tn-body td .btn { height: 34px; min-height: 34px; }
    body.tn-body .tn-hoja > .card > strong:first-child, body.tn-body .tn-hoja > .card > h2:first-child, body.tn-body .tn-hoja > .card > h3:first-child { font-size: 19px; margin-bottom: 2px; }
    body.tn-body .tn-hoja > .card { padding-top: 10px; padding-bottom: 6px; }
    body.tn-body .tn-contenido > .card.tn-fila { padding-top: 6px; padding-bottom: 6px; }
}
/* Pantalla baja: «Descuento al ticket» y el TOTAL comparten fila, y el pie y las flechas
   del ticket encogen; así caben 3 artículos por página en vez de 2. */
@media (max-height: 700px) and (min-width: 901px) {
    .tk-pie { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; }
    .tk-pie > .tk-descuento { grid-column: 1; border-bottom: 0; height: 38px; padding-right: 6px; }
    .tk-pie > .tk-descuento .fl { display: none; }
    .tk-pie > .tk-total { grid-column: 2; justify-content: flex-end; gap: 10px; }
    .tk-pie > .tk-total:first-child { grid-column: 1 / -1; }
    .tk-pie > .tk-total span { font-size: 14px; }
    .tk-pie > .tk-total b { font-size: 30px; }
    .tk-pie > .tk-sub, .tk-pie > form, .tk-pie > .tk-cobrar { grid-column: 1 / -1; }
    .tk-pie > form { gap: 6px !important; }
    .tk-pagos button { height: 40px; }
    .tk-cobrar { height: 52px; }
    .tk .tn-pag { padding: 2px 8px; }
    .tk .tn-pag button { height: 40px; width: 72px; }
    .tk-linea { padding: 3px 0; }
}
/* Casi, más pequeño y pegado a la esquina: a 64 px tapaba el último botón de las listas
   (p. ej. «Anular» en Ventas). A 46 px queda a la altura de las flechas de página, que van centradas. */
body.tn-body .ia-fab { right: 12px; bottom: 10px; width: 46px; height: 46px; }
body.tn-body .ia-fab-circle, body.tn-body .ia-fab video, body.tn-body .ia-fab img { width: 46px !important; height: 46px !important; }
body.tn-body .ia-fab-dot { width: 11px; height: 11px; }
/* (El margen de «Guardar horario» para Casi ya no hace falta: Casi está en la cabecera desde el 28-10.) */

/* Bonos de la clienta, en su ficha: lo que le queda, bien visible. */
body.tn-body .tn-bonos { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
body.tn-body .tn-bonos li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--tn-ok-suave, #E9F6EE); }
body.tn-body .tn-bonos li strong { color: #15803D; font-size: 17px; }
body.tn-body .tn-bonos li.gastado { background: #f3f3f3; color: var(--tn-suave); }
/* Servicios: desde el rediseño del 28-10 van en dos columnas (.es-pantalla, al final): servicios y bonos a lo
   ancho, con todas sus columnas; en la estrecha de las profesionales no cabe «Estado» (sale junto al nombre). */
body.tn-body #profesionales td:nth-child(2), body.tn-body #profesionales th:nth-child(2) { display: none; }
body.tn-body #servicios td, body.tn-body #bonos td { white-space: nowrap; }
body.tn-body #servicios td:first-child, body.tn-body #bonos td:first-child { white-space: normal; }
.tk-total b { white-space: nowrap; } /* «280,00 €» nunca en dos renglones */

/* ---------- HOY (tienda/hoy.php): tres columnas que se leen de un vistazo ---------- */
body.tn-body .tn-hoy { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
body.tn-body .tn-hoy.sin-agenda { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
body.tn-body .tn-hoy > .card { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.tn-hoy .hoy-eti { font-size: 13px; font-weight: 700; color: var(--tn-suave); }
.tn-hoy .hoy-gordo { font-size: clamp(34px, 4.2vw, 52px); font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--tn-tinta); font-variant-numeric: tabular-nums; }
.tn-hoy .hoy-cifras { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--tn-suave); }
.tn-hoy .hoy-cifras b { color: var(--tn-tinta); font-size: 16px; }
.tn-hoy .hoy-cifras .ok b { color: #15803D; } .tn-hoy .hoy-cifras .aviso b { color: #B45309; } .tn-hoy .hoy-cifras .mal b { color: #B91C1C; }
.tn-hoy .hoy-pagos, .tn-hoy .hoy-lista, .tn-hoy .hoy-equipo, .tn-hoy .hoy-tareas, .tn-hoy .hoy-citas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tn-hoy .hoy-pagos li, .tn-hoy .hoy-lista li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.tn-hoy .hoy-lista li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-hoy .hoy-lista b.mal { color: #B91C1C; white-space: nowrap; }
.tn-hoy .hoy-lista small { color: var(--tn-suave); font-weight: 500; }
.tn-hoy .hoy-sep { border-top: 1px solid var(--tn-linea); margin: 4px 0; }
.tn-hoy .hoy-nota { margin: 0; font-size: 14px; color: var(--tn-suave); }
.tn-hoy .hoy-nota.ok { color: #15803D; } .tn-hoy .hoy-nota.aviso { color: #B45309; } .tn-hoy .hoy-nota.mal { color: #B91C1C; font-weight: 600; }
.tn-hoy .hoy-mas { margin-top: auto; align-self: flex-start; color: var(--tn-marca); font-weight: 700; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.tn-hoy .hoy-sep + .hoy-eti ~ .hoy-mas { margin-top: 0; }
.tn-hoy .hoy-proxima { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--tn-tinta);
    background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 6px solid var(--c); }
.tn-hoy .hoy-proxima .hora { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-hoy .hoy-proxima .quien { min-width: 0; flex: 1; }
.tn-hoy .hoy-proxima b { display: block; font-size: 19px; }
.tn-hoy .hoy-proxima small, .tn-hoy .hoy-citas small { display: block; color: var(--tn-suave); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-hoy .hoy-proxima .ahora { background: #15803D; color: #fff; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.tn-hoy .hoy-caja { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tn-hoy .hoy-citas li a { display: flex; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 12px; border-left: 4px solid var(--c); background: #fff; text-decoration: none; color: var(--tn-tinta); }
.tn-hoy .hoy-citas .hora { font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-hoy .hoy-citas .quien { min-width: 0; }
.tn-hoy .hoy-citas li.vacio { color: var(--tn-suave); font-size: 14px; }
.tn-hoy .hoy-equipo li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.tn-hoy .hoy-equipo .ini { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.tn-hoy .hoy-equipo b { margin-left: auto; font-size: 14px; color: var(--tn-suave); }
.tn-hoy .hoy-tareas li { font-size: 14px; padding: 8px 10px; border-radius: 12px; line-height: 1.35; }
.tn-hoy .hoy-tareas li.aviso { background: #FEF6E7; color: #7A4A06; }
.tn-hoy .hoy-tareas li.ok { background: #E9F6EE; color: #15803D; }
.tn-hoy .hoy-tareas a { color: inherit; text-decoration: none; display: block; }
@media (max-height: 700px) and (min-width: 901px) {
    .tn-hoy .hoy-gordo { font-size: 36px; }
    .tn-hoy .hoy-proxima { padding: 10px 12px; } .tn-hoy .hoy-proxima .hora { font-size: 24px; } .tn-hoy .hoy-proxima b { font-size: 16px; }
    body.tn-body .tn-hoy > .card { gap: 5px; }
    /* El raíl lleva siete apartados con «Hoy»: un poco más bajos para que quepan sin bajar. */
    .tn-rail a, .tn-rail button { padding: 6px 4px; }
    .tn-rail a :is(svg, .tn-ic), .tn-rail button :is(svg, .tn-ic) { width: 23px; height: 23px; }
    .tn-rail .tn-logo { margin-bottom: 0; }
}
@media (max-width: 900px) { body.tn-body .tn-hoy, body.tn-body .tn-hoy.sin-agenda { grid-template-columns: 1fr; } }

/* ---------- Ficha de la clienta o del cliente (clientes.php?id=, una sola desde el 29-10) ---------- */
body.tn-body .tn-ficha { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.tn-ficha .fi-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex-shrink: 0; }
.tn-ficha .fi-cumple { margin-left: auto; font-weight: 700; color: var(--tn-marca); }
/* Las alergias, en rojo y arriba: lo primero que se lee antes de tocar a nadie (regla 3: rojo = alerta). */
.tn-ficha .fi-alergia, .ec-alergia { flex-shrink: 0; background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; border-left: 6px solid #B91C1C; border-radius: 12px; padding: 8px 14px; font-size: 15px; }
.tn-alergia-chip { display: inline-block; background: #FEE2E2; color: #991B1B; border-radius: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.tn-ficha .fi-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1.3fr); gap: 14px; }
body.tn-body .tn-ficha .fi-cols > .card { min-height: 0; margin: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.tn-ficha .fi-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tn-ficha .fi-datos > div { background: var(--tn-marca-suave); border-radius: 12px; padding: 8px 6px; text-align: center; }
.tn-ficha .fi-datos b { display: block; font-size: 19px; color: var(--tn-tinta); white-space: nowrap; }
.tn-ficha .fi-datos small { font-size: 12px; color: var(--tn-suave); }
.tn-ficha .fi-datos .aviso { background: #FEF6E7; } .tn-ficha .fi-datos .aviso b { color: #B45309; }
.tn-ficha .fi-nota { margin: 0; font-size: 13.5px; } .tn-ficha .fi-nota.aviso { color: #B45309; }
.tn-ficha .fi-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 14px; }
.tn-ficha .fi-lista li { display: flex; justify-content: space-between; gap: 10px; }
.tn-ficha .fi-lista span { color: var(--tn-suave); } .tn-ficha .fi-lista .mal { color: #B91C1C; }
/* Importar y exportar clientes (clientes_importar.php): resumen, casillas y avisos por fila. */
.cio-lista { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: 14px; }
.cio-lista li { display: flex; justify-content: space-between; gap: 10px; }
.cio-lista li b { text-align: right; } .cio-lista span { color: var(--tn-suave); }
.cio-lista .mal, .cio-lista .mal span { color: #B91C1C; } .cio-lista .av, .cio-lista .av span { color: var(--tn-aviso); }
.cio-casillas { margin-top: 12px; display: grid; gap: 6px; font-size: 14px; }
.cio-casillas label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.cio-sub { margin: 14px 0 0; font-weight: 700; font-size: 14px; }
.cio-puntos { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--tn-suave); }
body.tn-body td.cio-que { white-space: normal; text-align: left; min-width: 220px; }
/* Los avisos de una fila ocupan varios renglones: la celda crece (las de la gestión miden 50 px fijos). */
body.tn-body .cio-tabla td { height: auto; padding-top: 6px; padding-bottom: 6px; overflow-wrap: anywhere; }
.cio-que.salta b { color: #B91C1C; } .cio-que.junta b { color: var(--tn-aviso); }
.cio-aviso { display: block; color: var(--tn-aviso); font-size: 12.5px; }

/* ---------- Clientes: la lista con las columnas del programa anterior (Jesús, 27-10) ----------
   Es una pantalla de gestión: la tabla baja dentro de su tarjeta con la cabecera fija, y se pasa
   de página abajo (50 por página). Las columnas se reparten el ancho; lo largo se corta con «…»
   y se lee entero al pasar el ratón (title). En el móvil, cada cliente es una tarjeta (tablas.js). */
body.tn-body .cl-pantalla { min-height: 0; }
/* Las tarjetas de la gestión van en columna: esta barra, en fila (buscador ancho y los botones a su lado). */
body.tn-body .cl-pantalla > .card.cl-barra { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; align-items: end; flex-shrink: 0; padding: 10px 14px; overflow: visible; }
body.tn-body .cl-pantalla > .cl-barra .form-group { flex: 1 1 320px; max-width: 560px; }
body.tn-body .cl-pantalla > .cl-barra .form-group input[type=search] { width: 100%; max-width: none; }
body.tn-body .cl-lista { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 8px; }
body.tn-body .cl-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
body.tn-body .cl-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--tn-linea); border-radius: 10px; }
body.tn-body table.cl-tabla { table-layout: fixed; width: 100%; min-width: 1100px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
body.tn-body .cl-tabla th { position: sticky; top: 0; z-index: 1; background: var(--tn-marca-suave); color: var(--tn-tinta); font-size: 11px;
    text-transform: uppercase; letter-spacing: .04em; padding: 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Títulos que ordenan: toda la celda se pulsa; la columna por la que se ordena, marcada y con su flecha. */
body.tn-body .cl-tabla th a { display: flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
body.tn-body .cl-tabla th:hover { background: var(--tn-marca-linea); }
body.tn-body .cl-tabla th.on { background: var(--tn-marca-linea); color: var(--tn-marca-osc); }
body.tn-body .cl-flecha { font-size: 9px; flex-shrink: 0; }
body.tn-body .cl-tabla td { height: 40px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
body.tn-body .cl-tabla td:last-child { text-align: left; }
body.tn-body .cl-tabla tbody tr { cursor: pointer; }
body.tn-body .cl-tabla tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tn-marca-suave) 35%, transparent); }
body.tn-body .cl-tabla tbody tr:hover td { background: var(--tn-marca-suave); }
body.tn-body .cl-tabla td.cl-nom a { font-weight: 600; color: var(--tn-tinta); text-decoration: none; }
body.tn-body .cl-tabla td.cl-nom a:hover { text-decoration: underline; }
body.tn-body .cl-tabla td.cl-cod, body.tn-body .cl-tabla td.cl-nif { font-variant-numeric: tabular-nums; }
body.tn-body .cl-tabla td.cl-tels span { display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
body.tn-body .cl-tabla td.cl-tels span + span { font-size: 11.5px; color: var(--tn-suave); }
body.tn-body .cl-tabla tr.cl-de-baja td { color: var(--tn-suave); }
body.tn-body .cl-nada { color: var(--tn-linea); }
body.tn-body .cl-estado { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
body.tn-body .cl-estado.activo { background: var(--tn-ok-suave); color: var(--tn-ok); }
body.tn-body .cl-estado.baja { background: var(--tn-mal-suave); color: var(--tn-mal); }
body.tn-body .cl-tabla col.c-cod { width: 6%; }   body.tn-body .cl-tabla col.c-est { width: 6.5%; }
body.tn-body .cl-tabla col.c-tipo { width: 6.5%; }  body.tn-body .cl-tabla col.c-nom { width: 14%; }
body.tn-body .cl-tabla col.c-fis { width: 11%; }  body.tn-body .cl-tabla col.c-dir { width: 12%; }
body.tn-body .cl-tabla col.c-pob { width: 8%; }   body.tn-body .cl-tabla col.c-cp { width: 5%; }
body.tn-body .cl-tabla col.c-prov { width: 7.5%; } body.tn-body .cl-tabla col.c-tel { width: 8.5%; }
body.tn-body .cl-tabla col.c-nif { width: 7%; }   body.tn-body .cl-tabla col.c-mail { width: 8%; }
body.tn-body .cl-pag { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 8px; flex-wrap: wrap; flex-shrink: 0; }
body.tn-body .cl-pag .disabled { pointer-events: none; opacity: .4; }
body.tn-body .cl-baja { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
/* La ficha completa no cabe en una pantalla baja (1256×545): su ventana baja para llegar a «Guardar». */
body.tn-body .tn-ventana-form:has(input[name="poblacion"]) { overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 899px) {
    /* En el móvil, apiladas: sin anchos fijos ni cortes, cada dato en su renglón. */
    body.tn-body .cl-pantalla, body.tn-body .cl-pantalla > *, body.tn-body .cl-scroll { min-width: 0; max-width: 100%; }
    body.tn-body .cl-scroll { overflow: visible; border: 0; }
    body.tn-body table.cl-tabla { min-width: 0; width: 100%; table-layout: auto; }
    /* Un correo o una dirección sin espacios se parten en vez de ensanchar la pantalla. */
    body.tn-body .cl-tabla td { white-space: normal; height: auto; min-width: 0; overflow-wrap: anywhere; text-overflow: clip; }
    body.tn-body .cl-tabla td.cl-tels span + span { font-size: inherit; }
    body.tn-body .cl-pantalla > .cl-barra .form-group { flex-basis: 100%; }
    body.tn-body .cl-tabla th { position: static; }
}
/* ---------- Documentos (módulo «Albaranes y facturas»): las mismas maneras que la lista de Clientes ---------- */
body.tn-body .dc-pantalla { min-height: 0; }
body.tn-body .dc-pantalla > .card.dc-barra { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; align-items: center; flex-shrink: 0; padding: 10px 14px; overflow: visible; }
body.tn-body .dc-barra input[type=search] { flex: 1 1 220px; max-width: 380px; }
body.tn-body .dc-barra select { width: auto; }
body.tn-body .dc-pest { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
body.tn-body .dc-lista { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 8px; }
body.tn-body .dc-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
body.tn-body .dc-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--tn-linea); border-radius: 10px; }
body.tn-body table.dc-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
body.tn-body .dc-tabla th { position: sticky; top: 0; z-index: 1; background: var(--tn-marca-suave); color: var(--tn-tinta); font-size: 11px;
    text-transform: uppercase; letter-spacing: .04em; padding: 9px 8px; white-space: nowrap; text-align: left; }
body.tn-body .dc-tabla td { padding: 6px 8px; height: 44px; text-align: left; vertical-align: middle; }
body.tn-body .dc-tabla .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.tn-body .dc-tabla tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tn-marca-suave) 35%, transparent); }
body.tn-body .dc-tabla tr.dc-grupo td { border-top: 2px solid var(--tn-linea); }
body.tn-body .dc-tabla td small { display: block; color: var(--tn-suave); font-size: 12px; }
body.tn-body .dc-tabla tr.dc-anulado td { color: var(--tn-suave); }
body.tn-body .dc-acc { white-space: nowrap; }
body.tn-body .dc-acc form { display: inline; }
body.tn-body .dc-cobrar { display: flex; gap: 6px; align-items: center; }
body.tn-body .dc-tabla .dc-cobrar input { width: 96px; flex: 0 0 96px; min-height: 40px; text-align: right; }
body.tn-body .dc-tabla .dc-cobrar select { width: auto; flex: 0 0 auto; min-height: 40px; }
body.tn-body .dc-estado { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; }
body.tn-body .dc-estado.abierto { background: var(--tn-aviso-suave); color: var(--tn-aviso); }
body.tn-body .dc-estado.hecho { background: var(--tn-ok-suave); color: var(--tn-ok); }
body.tn-body .dc-estado.anulado { background: var(--tn-mal-suave); color: var(--tn-mal); }
body.tn-body .dc-nota { margin: 8px 0 0; color: var(--tn-suave); font-size: 13px; }
/* Albaranes sin facturar: la cabecera de cada cliente con su botón «Facturar sus N albaranes». */
body.tn-body .dc-tabla tr.dc-grupo-cab td { background: var(--tn-marca-suave); height: auto; padding: 6px 8px; }
body.tn-body .dc-grupo-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
body.tn-body .dc-grupo-fila form { display: inline; }
/* «Factura de un ticket ya cobrado» en la cabecera de Facturas. */
body.tn-body .dc-fac-ticket { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
body.tn-body .dc-fac-ticket label { margin: 0; font-weight: 600; font-size: 13.5px; }
body.tn-body .dc-fac-ticket input { width: 130px; min-height: 40px; }
@media (max-width: 899px) {
    body.tn-body .dc-pantalla, body.tn-body .dc-pantalla > *, body.tn-body .dc-scroll { min-width: 0; max-width: 100%; }
    body.tn-body .dc-scroll { overflow: visible; border: 0; }
    body.tn-body .dc-tabla th { position: static; }
    body.tn-body .dc-tabla td { height: auto; overflow-wrap: anywhere; }
    body.tn-body .dc-cobrar { flex-wrap: wrap; }
}
/* La ficha del cliente: «Puede pagar más tarde» y lo que debe (módulo «documentos»). */
.tn-ficha .fi-credito form { display: inline; }
.tn-ficha .fi-credito .btn { padding: 2px 10px; min-height: 0; font-size: 12.5px; }
.tn-ficha .fi-notas { margin: 0; font-size: 14px; background: #fff; border: 1px dashed var(--tn-linea); border-radius: 12px; padding: 8px 10px; overflow: hidden; }
.tn-ficha .fi-vender { margin-top: auto; display: flex; gap: 8px; }
.tn-ficha .fi-vender select { flex: 1; min-width: 0; }
.tn-ficha .fi-prof { display: block; color: var(--tn-suave); font-size: 12px; }
.fi-v-tit { font-family: 'Cormorant Garamond', serif; font-size: 24px; }
.fi-ventana { width: min(760px, 94vw); max-height: 94vh; display: flex; flex-direction: column; padding: 20px 22px !important; }
.fi-subir { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.fi-subir input[type=text] { flex: 1; min-width: 160px; }
.fi-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; min-height: 0; }
.fi-galeria figure { margin: 0; position: relative; }
.fi-galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--tn-marca-suave); }
.fi-galeria figcaption { font-size: 12px; color: var(--tn-suave); margin-top: 3px; }
.fi-galeria .fi-borrar { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 20px; cursor: pointer; }
.fi-firmados { overflow-y: auto; min-height: 0; }
.fi-firmados details { border-bottom: 1px solid var(--tn-linea); padding: 8px 0; }
.fi-firmados summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; gap: 4px; }
.fi-firma-img { max-width: 100%; height: 90px; object-fit: contain; border: 1px solid var(--tn-linea); border-radius: 10px; background: #fff; }
.fi-firmar-cab { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.fi-firmar-cab select { width: auto; }
.fi-firma-caja { position: relative; margin-top: 8px; border: 2px dashed var(--tn-marca); border-radius: 14px; background: #fff; }
.fi-firma-caja canvas { display: block; width: 100%; height: clamp(110px, 24vh, 200px); touch-action: none; cursor: crosshair; }
.fi-firma-guia { position: absolute; left: 14px; bottom: 8px; font-size: 12px; color: var(--tn-suave); pointer-events: none; }
.fi-firmar-pie { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
/* Ficha de Clientes (dos columnas: resumen y compras); en el móvil, una, como las demás. */
.tn-ficha .fi-cols.dos { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
@media (max-width: 900px) { .tn-ficha .fi-cols, .tn-ficha .fi-cols.dos { grid-template-columns: 1fr; } }
.tn-ficha .fi-historial td:nth-child(3), .tn-ficha .fi-historial td:first-child { white-space: nowrap; }
body.tn-body .fi-firmar-cab select { width: auto !important; max-width: 60%; } .fi-firmar-cab { padding-right: 50px; } /* que el desplegable no tape la X de cerrar */
.tn-hoy .hoy-tareas li.fiesta { background: var(--tn-marca-suave); color: var(--tn-marca-osc); }

/* ---------- Horario de una profesional (est_horario.php) ---------- */
body.tn-body .tn-horario { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 14px; }
body.tn-body .tn-horario > .card { min-height: 0; margin: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.tn-horario .ho-tabla td { height: auto; padding: 3px 6px; }
.tn-horario .ho-tramo { display: inline-flex; align-items: center; gap: 6px; }
.tn-horario .ho-tramo input { width: 112px !important; min-height: 38px; padding: 4px 8px; }
.tn-horario .ho-pie { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tn-horario .ho-pie .btn:last-child { margin-left: auto; }
.tn-horario .ho-ausencia { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.tn-horario .ho-ausencia .btn { grid-column: 1 / -1; }
.tn-horario .ho-lista { list-style: none; margin: 8px 0 0; padding: 0; min-height: 0; flex: 1; }
.tn-horario .ho-lista li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--tn-linea); font-size: 14px; }
@media (max-height: 700px) and (min-width: 901px) { .tn-horario .ho-tramo input { min-height: 32px; } .tn-horario > .card > p { display: none; } }
@media (max-width: 900px) { body.tn-body .tn-horario { grid-template-columns: 1fr; } }
@media (max-height: 700px) and (min-width: 901px) {
    .tn-horario .ho-tabla td, .tn-horario .ho-tabla th { padding-top: 1px; padding-bottom: 1px; height: 34px; }
    .tn-horario .ho-tramo input { min-height: 30px !important; height: 30px; font-size: 14px; padding: 2px 6px; }
    .tn-horario .ho-pie { margin-top: 4px; }
    .tn-horario .ho-pie .btn { min-height: 36px; height: 36px; }
}
/* Los botones de la semana, siempre visibles: arriba del todo si no caben abajo. */
.tn-horario #hoForm { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tn-horario #hoForm .ho-pie { order: -1; margin: 0 0 6px; }

/* ---------- Comisiones por profesional (est_comisiones.php) ---------- */
body.tn-body .tn-comisiones { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.tn-comisiones .co-barra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tn-comisiones .ag-grupo { display: inline-flex; background: #fff; border: 1px solid var(--tn-linea); border-radius: 14px; padding: 3px; gap: 2px; }
.tn-comisiones .ag-grupo a { min-height: 42px; min-width: 46px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-weight: 600; color: var(--tn-tinta); text-decoration: none; }
.tn-comisiones .ag-grupo .flecha { font-size: 22px; }
.tn-comisiones .co-mes { font-family: 'Cormorant Garamond', serif; font-size: 24px; }
.tn-comisiones .co-total { margin-left: auto; background: #fff; border: 1px solid var(--tn-linea); border-radius: 12px; padding: 8px 14px; }
.tn-comisiones .co-total b { font-size: 20px; color: var(--tn-marca); }
body.tn-body .tn-comisiones .co-tabla { flex: 1; min-height: 0; margin: 0; overflow: auto; }
.tn-comisiones .co-ini { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
.tn-comisiones tfoot td { border-top: 2px solid var(--tn-linea); }
.tn-comisiones .co-nota { font-size: 13px; margin: 10px 0 0; }

/* ---------- Tarjetas regalo en el TPV ---------- */
.rg-vender, .rg-pagar { display: grid; gap: 8px; margin-top: 14px; }
.rg-pagar { border-top: 1px solid var(--tn-linea); padding-top: 14px; }
.rg-rapidos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rg-rapidos .tn-btn { height: 52px; font-size: 18px; font-weight: 700; }
.rg-codigo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 2px dashed var(--tn-marca); border-radius: 14px; margin-top: 8px; }
.rg-codigo b { font-size: 26px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.rg-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #E9F6EE; color: #15803D; border-radius: 12px; padding: 6px 10px; font-size: 13.5px; }
.rg-quitar { border: 0; background: transparent; color: var(--tn-mal, #B91C1C); font-weight: 700; cursor: pointer; text-decoration: underline; }
/* Tarjeta regalo que no paga todo: «Cambiar» (cuánto paga) junto a «Quitar», en la misma fila. */
.rg-chip { min-width: 0; }   /* va dentro de una rejilla: sin esto el texto en una fila la ensancharía */
.rg-chip > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* una sola fila: no le quita sitio al ticket */
.rg-acc { display: flex; gap: 10px; flex-shrink: 0; }
.rg-quitar.rg-cambiar { color: inherit; }
.tk-pagos.solo { grid-template-columns: 1fr; }

/* ---- Albaranes y facturas (módulo «documentos») ---- */
/* Qué es este ticket (factura, albaranes, presupuesto): azul, para no confundirlo con la tarjeta regalo (verde). */
.doc-chip { background: var(--tn-marca-suave); color: var(--tn-tinta); }
.doc-v h2 { margin-bottom: 4px; }
.doc-quien { margin: 0 0 14px; color: var(--tn-suave); line-height: 1.6; }
.doc-quien b { color: var(--tn-tinta); }
.doc-falta { color: var(--tn-mal, #B91C1C); font-weight: 600; }
.doc-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc-opciones form { display: contents; }
.doc-op { display: grid; gap: 4px; align-content: start; text-align: left; min-height: 104px; padding: 14px 16px; border: 1px solid var(--tn-linea);
          border-radius: 16px; background: var(--tn-papel); color: inherit; cursor: pointer; font: inherit; }
.doc-op b { font-size: 18px; }
.doc-op span { font-size: 13.5px; color: var(--tn-suave); line-height: 1.35; }
.doc-op em { font-style: normal; font-size: 13px; color: var(--tn-mal, #B91C1C); line-height: 1.3; }
.doc-op:not(:disabled):hover { border-color: var(--tn-marca); box-shadow: 0 0 0 2px var(--tn-marca) inset; }
.doc-op:disabled { cursor: not-allowed; background: transparent; }
.doc-op:disabled b { color: var(--tn-suave); }
.doc-pie { margin: 14px 0 0; text-align: center; }
.doc-cambiar { border: 0; background: transparent; color: var(--tn-marca-osc); text-decoration: underline; font: inherit; font-weight: 600; cursor: pointer; padding: 0 4px; }
/* Completar el NIF y la dirección sin salir del TPV. */
.doc-datos { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border-radius: 14px; background: var(--tn-mal-suave); }
/* Dos filas: nombre fiscal (ancho) y NIF; calle (ancha), CP, población y Guardar. */
.doc-datos-campos { display: grid; grid-template-columns: 2fr .9fr 1.2fr auto; gap: 6px; }
.doc-datos-campos input[name="nombre_fiscal"] { grid-column: 1 / 3; }
.doc-datos-campos input[name="nif"] { grid-column: 3 / 5; }
.doc-datos-campos input[name="direccion"] { grid-column: 1; }
.doc-datos-campos input { min-height: 44px; min-width: 0; }
/* La tarjeta de la factura cobrada: sus formas de pago son botones (un toque). */
.doc-op-fac { cursor: default; }
.doc-op-fac.apagada b { color: var(--tn-suave); }
.doc-pagos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.doc-pagos form { display: contents; }
.doc-pagos .tn-btn { min-height: 44px; padding: 0 14px; }
@media (max-width: 760px) { .doc-datos-campos { grid-template-columns: 1fr 1fr; } .doc-datos-campos input[name] { grid-column: auto; } }
@media (max-width: 560px) { .doc-opciones { grid-template-columns: 1fr; } .doc-op { min-height: 0; } }
@media (max-height: 700px) and (min-width: 901px) {
    .tk-pie > .doc-chip { grid-column: 1 / -1; }
    /* La ventana «Documento» cabe entera (con los datos que faltan a la vista) en 545 de alto. */
    .doc-v { padding: 14px 22px !important; }
    .doc-v h2 { font-size: 26px; }
    .doc-quien { margin-bottom: 8px; }
    .doc-datos { padding: 8px 10px; gap: 6px; margin-bottom: 8px; }
    .doc-datos-campos input, .doc-pagos .tn-btn { min-height: 40px; }
    .doc-op { min-height: 0; padding: 9px 14px; gap: 2px; }
    .doc-pie { margin-top: 8px; }
}


/* ============================================================
   TEMAS (Ajustes → Aspecto, <html data-tema>). Cambian la MARCA y el
   papel; los colores de estado (--tn-ok, --tn-aviso, --tn-mal) no se tocan
   en ninguno (regla 3). Lo de arriba del todo es «terracota»; el de SERIE
   desde el 24-10-2026 es «cielo» (Jesús: azul pastel #B3EBF2, fondo muy
   claro, botones marino). «propio» es «Tu color»: sus variables las escribe
   host_ui_css_propio() (includes/functions.php) en la cabecera de la página.
   ============================================================ */
/* CIELO: fondo casi blanco con velo azul; el pastel #B3EBF2 solo en los
   detalles (bordes de marca); botones y cabecera del ticket en marino.
   Contraste medido: blanco sobre marino 11,9:1; texto apagado sobre el
   fondo 6,3:1 y sobre el tinte suave 5,8:1. */
html[data-tema="cielo"] {
    --tn-marca: #163A52; --tn-marca-osc: #0F2A3D; --tn-marca-suave: #E3F6F9; --tn-marca-linea: #B3EBF2;
    --tn-tinta: #0F2A33; --tn-suave: #4A626B; --tn-linea: #D6EFF3; --tn-fondo: #F5FCFD; --tn-ventana: #FFFFFF;
    --tn-papel: rgba(255, 255, 255, .97); --tn-papel-2: rgba(245, 252, 253, .92);
    --tn-sombra: 0 10px 28px -18px rgba(15, 42, 51, .35);
}
html[data-tema="propio"] { --tn-ventana: #FFFFFF; --tn-sombra: 0 10px 28px -18px rgba(0, 0, 0, .3); }
html[data-tema="cielo"] body.tn-body::before, html[data-tema="propio"] body.tn-body::before { background: var(--tn-fondo); }
html[data-tema="arena"] {
    --tn-marca: #B4441F; --tn-marca-osc: #8F3417; --tn-marca-suave: #F7EBE5; --tn-marca-linea: #EBCFC2;
    --tn-tinta: #2B2522; --tn-suave: #6E6560; --tn-linea: #E9E3DE;
    --tn-papel: rgba(255, 255, 255, .96); --tn-papel-2: rgba(252, 250, 248, .9);
}
html[data-tema="jade"] {
    --tn-marca: #1D7A60; --tn-marca-osc: #155E4A; --tn-marca-suave: #E3F2EC; --tn-marca-linea: #BFE0D3;
    --tn-tinta: #1E2B27; --tn-suave: #5A6B65; --tn-linea: #DCE8E3;
    --tn-papel: rgba(253, 255, 254, .96); --tn-papel-2: rgba(246, 251, 249, .9);
}
html[data-tema="ciruela"] {
    --tn-marca: #9A3F8F; --tn-marca-osc: #7A2F71; --tn-marca-suave: #F6E8F3; --tn-marca-linea: #E7C8E1;
    --tn-tinta: #2E2230; --tn-suave: #6D5F70; --tn-linea: #EDE1EB;
    --tn-papel: rgba(255, 253, 255, .96); --tn-papel-2: rgba(251, 246, 250, .9);
}
html[data-tema="grafito"] {
    --tn-marca: #3B5BD0; --tn-marca-osc: #2D47A8; --tn-marca-suave: #E8EDFB; --tn-marca-linea: #C7D3F4;
    --tn-tinta: #1F2330; --tn-suave: #5E6475; --tn-linea: #E1E4EC;
    --tn-papel: rgba(255, 255, 255, .97); --tn-papel-2: rgba(247, 248, 252, .92);
}
html[data-tema="arena"] body.tn-body::before { background: linear-gradient(135deg, #FBF8F5 0%, #F1E7DF 100%); }
html[data-tema="jade"] body.tn-body::before { background: linear-gradient(135deg, #F7FBF9 0%, #DDEFE7 100%); }
html[data-tema="ciruela"] body.tn-body::before { background: linear-gradient(135deg, #FCF8FB 0%, #EEDDEA 100%); }
html[data-tema="grafito"] body.tn-body::before { background: linear-gradient(135deg, #F8F9FC 0%, #E2E7F3 100%); }

/* NOCHE: oscuro cálido para trabajar de noche o con poca luz. Las tarjetas y
   los botones que en el resto son blancos pasan a carbón; el texto, a crema. */
html[data-tema="noche"] {
    --tn-marca: #E0703F; --tn-marca-osc: #C65A2B; --tn-marca-suave: #3A2A22; --tn-marca-linea: #5A3F31;
    --tn-tinta: #F2E9E1; --tn-suave: #B9A99C; --tn-linea: #3A322C;
    --tn-papel: rgba(33, 29, 26, .97); --tn-papel-2: rgba(42, 36, 32, .94);
    --tn-ok-suave: #173322; --tn-aviso-suave: #3B2A12; --tn-mal-suave: #3B1A18;
    --tn-sombra: 0 10px 28px -18px rgba(0, 0, 0, .8);
    --tn-fondo: #141110;
    /* El fondo de lo que flota o se toca encima del papel (ventanas, teclados, menús, listas): el mismo carbón
       que las tarjetas. Sin él, todo lo que usa var(--tn-ventana, #fff) salía BLANCO con el texto en crema
       (el teclado del buscador, las tallas, la Recepción, el «Más ▾» de las pestañas). */
    --tn-ventana: #241E1A;
    color-scheme: dark;
}
html[data-tema="noche"] body.tn-body { background: #141110; }
html[data-tema="noche"] body.tn-body::before { background: radial-gradient(circle at 20% 10%, #2A211C 0%, #141110 60%); }
html[data-tema="noche"] body.tn-body :is(.card, .tn-caja, .tn-ventana, .tv-ficha, .tk, .ag-col, .ag-dato, .ag-grupo, .tn-accion, .tn-btn, .tn-pin-teclado,
    .tn-pin-pad button, .rg-codigo, .hoy-citas li a, .fi-notas, .ag-avisos, .ag-espera, .co-total, .tn-pestanas a, .tv-cats a, .tv-buscar,
    .btn-secondary, .tk-cant button, .tk-pct, .tk-pagos button, .tn-pag button, .as-tema, .tn-pin-volver, .tn-bonos li, input, select, textarea) {
    background-color: #241E1A !important; color: var(--tn-tinta) !important; border-color: var(--tn-linea) !important;
}
html[data-tema="noche"] body.tn-body :is(.tn-pestanas a.on, .tv-cats a.on, .ag-grupo a.on, .tk-pagos button.on, .tn-pag button:not(:disabled), .tn-btn.pri, .btn:not(.btn-secondary):not(.btn-danger), .tn-pin-pad .ok, .tn-rail .on, .ag-nueva) {
    background-color: var(--tn-marca) !important; color: #fff !important; border-color: var(--tn-marca) !important;
}
html[data-tema="noche"] body.tn-body .tk-cab { background: var(--tn-marca-osc); }
html[data-tema="noche"] body.tn-body :is(th, td) { border-color: var(--tn-linea) !important; color: var(--tn-tinta); }
html[data-tema="noche"] body.tn-body .ag-cita { background: color-mix(in srgb, var(--c) 30%, #1A1512); color: var(--tn-tinta); }
html[data-tema="noche"] body.tn-body .ag-cita .h { color: color-mix(in srgb, var(--c) 55%, #fff); }
html[data-tema="noche"] body.tn-body .tv-foto, html[data-tema="noche"] body.tn-body .tk-mini, html[data-tema="noche"] body.tn-body .tn-mini { background: #3A2A22; }
html[data-tema="noche"] body.tn-body .tn-logo svg, html[data-tema="noche"] body.tn-body .tn-pin-logo svg { color: var(--tn-tinta); fill: currentColor; }
/* Textos de ESTADO sobre carbón. El verde y el ámbar de siempre (#15803D, #B45309) dan 3,3:1 sobre #241E1A,
   por debajo de 4,5:1. En «Noche» se escriben con el MISMO tono, más claro (como hace Radix en sus escalas
   oscuras): verde 8,8:1 y ámbar 7,7:1. Siguen siendo verde y ámbar (regla 3); solo cambia la luz, y solo en
   la LETRA: los rellenos con texto blanco encima (el «Cobrada» de la agenda, botones) no se tocan. */
html[data-tema="noche"] body.tn-body :is(.ag-dato.ok b, .tn-recepcion .rc-ok, .tvm-importe.ok, .pl-op b em) { color: #3DD68C; }
html[data-tema="noche"] body.tn-body :is(.ag-dato.aviso b, .tn-recepcion .rc-lista li.tarde .h, .tvm-op.agotada span) { color: #F59E0B; }
/* La elegida de «qué ver» (.tn-seg): marca oscura sobre su tinte daba 3,2:1 en «Noche»; en crema, 11,4:1. */
html[data-tema="noche"] body.tn-body .tn-seg a.on { color: var(--tn-tinta); }
/* La «×» de las ventanas: su círculo beige fijo dejaba la cruz en crema sin contraste en «Noche». */
html[data-tema="noche"] body.tn-body .tn-ventana .tn-cerrar { background: var(--tn-marca-suave); }

/* UNA SOLA FAMILIA DE COLORES dentro de Tienda. Las piezas que vienen del panel de siempre (portada y
   cabecera de Ajustes, Casi, Mi suscripción, los avisos) pintan con --stoki-*, que style.css define por tema
   con OTROS valores: en «Noche», otro naranja y un gris frío; en «Grafito» otro azul; en «Arena», otro rojo.
   Aquí salen de las --tn-* del tema elegido. En «Cielo» y en «Tu color» ya valían lo mismo (no cambia nada).
   --stoki-bg y --stoki-surface-soft se quedan como estaban: no tienen pareja exacta en las --tn-*. */
body.tn-body {
    --stoki-primary: var(--tn-marca); --stoki-primary-dark: var(--tn-marca-osc); --stoki-primary-soft: var(--tn-marca-suave);
    --stoki-surface: var(--tn-ventana, #fff); --stoki-border: var(--tn-linea);
    --stoki-text: var(--tn-tinta); --stoki-text-muted: var(--tn-suave);
}

/* ---------- Aspecto (aspecto.php) ---------- */
body.tn-body .tn-aspecto { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; }
body.tn-body .tn-aspecto > .card { margin: 0; min-height: 0; overflow: hidden; }
.tn-aspecto .as-temas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
/* «Tu color»: la rueda del navegador, en la esquina de la muestra; pulsar en toda la tarjeta la abre. */
.tn-aspecto .as-propio .as-muestra { position: relative; }
.tn-aspecto .as-propio input[type="color"] { position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; padding: 0; background: none; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.tn-aspecto .as-propio input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.tn-aspecto .as-propio input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.tn-aspecto .as-temas form { margin: 0; }
.tn-aspecto .as-tema { width: 100%; text-align: left; border: 2px solid var(--tn-linea); border-radius: 16px; background: #fff; padding: 10px; cursor: pointer; display: grid; gap: 4px; font: inherit; color: var(--tn-tinta); position: relative; }
.tn-aspecto .as-tema.on { border-color: var(--tn-marca); box-shadow: 0 0 0 3px var(--tn-marca-suave); }
.tn-aspecto .as-tema small { color: var(--tn-suave); font-size: 12px; line-height: 1.3; }
.tn-aspecto .as-tema em { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--tn-marca); border-radius: 8px; padding: 1px 7px; }
.tn-aspecto .as-muestra { height: 46px; border-radius: 10px; border: 1px solid rgba(0,0,0,.08); display: flex; align-items: flex-end; padding: 6px; }
.tn-aspecto .as-muestra i { width: 44px; height: 16px; border-radius: 6px; display: block; }
.tn-aspecto .as-logo { min-height: 110px; border: 2px dashed var(--tn-linea); border-radius: 14px; display: grid; place-items: center; padding: 10px; background: #fff; }
.tn-aspecto .as-logo img { max-width: 100%; max-height: 140px; object-fit: contain; }
@media (max-height: 700px) and (min-width: 901px) { .tn-aspecto .as-tema small { display: none; } .tn-aspecto .as-muestra { height: 34px; } .tn-aspecto .as-logo { min-height: 44px; } }
/* «En este aparato» (táctil o ratón) va en la columna de la derecha, bajo el Logo; los colores ocupan la izquierda entera. */
@media (min-width: 901px) {
    body.tn-body .tn-aspecto { grid-template-rows: auto minmax(0, 1fr); }
    body.tn-body .tn-aspecto > .card:first-child { grid-row: 1 / 3; }
}
.tn-aspecto :is(.as-puntero, .as-botones) { grid-template-columns: 1fr; gap: 6px; }
.tn-aspecto :is(.as-puntero, .as-botones) .as-tema { padding: 8px 12px; }
.tn-aspecto :is(.as-puntero, .as-botones) .as-tema em { position: static; justify-self: start; }
/* El tamaño de los botones (28-10): tres en una fila siempre (son cortos). */
.tn-aspecto .as-botones { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Pantalla baja: las tres en una fila (la elegida se ve por su borde) para que quepa sin bajar. */
@media (max-height: 700px) and (min-width: 901px) {
    .tn-aspecto .as-puntero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tn-aspecto :is(.as-puntero, .as-botones) .as-tema { padding: 8px; text-align: center; font-size: 13.5px; }
    .tn-aspecto :is(.as-puntero, .as-botones) .as-tema em { display: none; }
    .tn-aspecto .as-botones-desc { display: none; }
    .tn-aspecto > .card p.text-muted { font-size: 13px; margin-bottom: 6px !important; }
}
@media (max-width: 900px) { body.tn-body .tn-aspecto { grid-template-columns: 1fr; } .tn-aspecto .as-temas { grid-template-columns: repeat(2, 1fr); } }

/* «✓ Cobrado»: aparece, se queda un momento y se va. Sin movimiento si el sistema pide reducirlo. */
.tn-hecho { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; z-index: 60; pointer-events: none;
    animation: tnHecho 1.9s ease forwards; }
.tn-hecho-ok { width: 110px; height: 110px; border-radius: 50%; background: #15803D; color: #fff; display: grid; place-items: center; font-size: 62px; font-weight: 700;
    box-shadow: 0 18px 40px -12px rgba(21, 128, 61, .6); }
.tn-hecho b { font-size: 30px; color: var(--tn-tinta); background: var(--tn-papel); padding: 6px 18px; border-radius: 14px; box-shadow: var(--tn-sombra); }
@keyframes tnHecho { 0% { opacity: 0; transform: scale(.85); } 15% { opacity: 1; transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .tn-hecho { animation: tnHechoQuieto 1.9s steps(1) forwards; } @keyframes tnHechoQuieto { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } } }
/* ---------- Resumen del mes (resumen.php) ---------- */
body.tn-body .tn-resumen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.tn-resumen .co-barra { display: flex; align-items: center; gap: 12px; }
.tn-resumen .ag-grupo { display: inline-flex; background: #fff; border: 1px solid var(--tn-linea); border-radius: 14px; padding: 3px; gap: 2px; }
.tn-resumen .ag-grupo a { min-height: 42px; min-width: 46px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-weight: 600; color: var(--tn-tinta); text-decoration: none; }
.tn-resumen .ag-grupo .flecha { font-size: 22px; }
.tn-resumen .co-mes { font-family: var(--tn-serif); font-size: 24px; }
.tn-resumen .rs-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 14px; }
body.tn-body .tn-resumen .rs-cols > .card { margin: 0; min-height: 0; overflow: auto; }
.tn-resumen .rs-frases p { font-size: 19px; line-height: 1.5; margin: 0 0 12px; color: var(--tn-tinta); }
.tn-resumen .rs-frases .rs-casi { font-size: 14px; }
.tn-resumen .rs-cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.tn-resumen .rs-cifras > div { background: var(--tn-marca-suave); border-radius: 14px; padding: 12px; }
.tn-resumen .rs-cifras small { display: block; color: var(--tn-suave); font-size: 13px; }
.tn-resumen .rs-cifras b { font-size: 24px; }
.tn-resumen .rs-cifras .ok b { color: #15803D; } .tn-resumen .rs-cifras .mal b { color: #B91C1C; }
@media (max-width: 900px) { .tn-resumen .rs-cols { grid-template-columns: 1fr; } }

/* Devolver (rectificar.php): lo que se devuelve a la izquierda; motivo, forma y botones a la derecha. Así cabe sin bajar. */
body.tn-body #rectForm { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 22px; row-gap: 8px; align-content: start; }
body.tn-body #rectForm > * { grid-column: 2; margin: 0 !important; max-width: none !important; }
body.tn-body #rectForm > .flex-between, body.tn-body #rectForm > table, body.tn-body #rectForm > .tn-tabla { grid-column: 1; }
body.tn-body #rectForm > table, body.tn-body #rectForm > .tn-tabla { grid-row: 2 / span 8; align-self: start; }
body.tn-body #rectForm .tn-tabla-cuerpo { min-height: 120px; }
body.tn-body #rectForm .form-group label[style] { min-height: 34px !important; }
/* Con seis pestañas (Ventas) en una pantalla estrecha, más juntas para que quepan todas. */
@media (max-width: 1400px) { body.tn-body .tn-pestanas a:not(.tn-pest) { padding-left: 12px; padding-right: 12px; font-size: 14px; } body.tn-body .tn-cab .tn-titulo h2 { font-size: 26px; } }
.rep-pie { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; } .rep-pie .btn:last-child { margin-left:auto; }

/* ---------- Reserva online (t/cita.php): una web normal para el móvil, aquí SÍ se baja ---------- */
/* height:auto y overflow visible (08-11, Jesús: «no deja hacer scroll y no se ve lo de abajo»): style.css pone a TODO body
   height:100% y overflow:hidden (el panel cabe en la pantalla), y estas páginas del cliente (reservar cita, apuntar una
   reparación, seguirla, mis reparaciones) se quedaban quietas: en un móvil no se llegaba al botón. El fondo, el del tema
   de la tienda (antes un beige fijo que venía de Estética). */
html.tn:has(> body.tn-reserva), body.tn-reserva { height: auto; overflow: visible; }
body.tn-reserva { margin: 0; min-height: 100vh; font-family: var(--tn-sans); color: var(--tn-tinta); background: var(--tn-fondo, #F5FCFD); }
body.tn-reserva::before { content: none; }
.rv { max-width: 640px; margin: 0 auto; padding: 18px 16px 40px; }
.rv-cab { text-align: center; padding: 10px 0 14px; }
.rv-cab h1 { font-family: var(--tn-serif); font-size: 34px; font-weight: 600; margin: 6px 0 0; }
.rv-cab p { margin: 2px 0 0; color: var(--tn-suave); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.rv-logo { color: var(--tn-marca); }
.rv-logo img { max-height: 70px; max-width: 160px; }
.rv-caja { background: var(--tn-ventana, #fff); border: 1px solid var(--tn-linea); border-radius: 18px; padding: 16px; margin-top: 12px; box-shadow: var(--tn-sombra); }
.rv-caja h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.rv-caja h2 span { width: 28px; height: 28px; border-radius: 50%; background: var(--tn-marca); color: #fff; display: inline-grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.rv-servicios { display: grid; gap: 8px; }
.rv-op { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border: 1.5px solid var(--tn-linea); border-radius: 14px; text-decoration: none; color: var(--tn-tinta); min-height: 52px; }
.rv-op small { color: var(--tn-suave); white-space: nowrap; }
.rv-op.on, .rv-chip.on, .rv-dia.on, .rv-hora.on { border-color: var(--tn-marca); background: var(--tn-marca-suave); color: var(--tn-marca-osc); }
.rv-fila { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rv-chip { padding: 10px 16px; border: 1.5px solid var(--tn-linea); border-radius: 999px; text-decoration: none; color: var(--tn-tinta); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.rv-dias { display: grid; grid-auto-flow: column; grid-auto-columns: 58px; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rv-dia { scroll-snap-align: start; border: 1.5px solid var(--tn-linea); border-radius: 14px; text-align: center; padding: 8px 0; text-decoration: none; color: var(--tn-tinta); }
.rv-dia small { display: block; font-size: 12px; color: var(--tn-suave); text-transform: capitalize; }
.rv-dia b { font-size: 20px; }
.rv-horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.rv-hora { text-align: center; padding: 12px 0; border: 1.5px solid var(--tn-linea); border-radius: 12px; text-decoration: none; color: var(--tn-tinta); font-weight: 700; }
.rv-form { display: grid; gap: 10px; }
.rv-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.rv-form input, .rv-form textarea { min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--tn-linea); border-radius: 12px; font: inherit; font-weight: 400; }
.rv-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 54px; border: 0; border-radius: 14px; background: var(--tn-marca); color: #fff !important; font: 700 17px var(--tn-sans); text-decoration: none; cursor: pointer; padding: 0 22px; }
.rv-suave { color: var(--tn-suave); font-size: 13.5px; margin: 6px 0 0; }
.rv-resumen { margin: 0 0 10px; }
.rv-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.rv-hecha { text-align: center; }
.rv-ok { width: 70px; height: 70px; border-radius: 50%; background: #15803D; color: #fff; display: inline-grid; place-items: center; font-size: 38px; font-weight: 700; }
.rv-hecha h2 { justify-content: center; } .rv-hecha .rv-btn { margin-top: 12px; }
.bi-foto { border:0; padding:0; background:none; cursor:pointer; width:100%; display:block; border-radius:12px; } .bi-foto:focus-visible { outline:3px solid var(--tn-marca); }

/* ---------- Modo recepción (recepcion.php): botones enormes y quién llega ---------- */
body.tn-body .tn-recepcion { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.6fr); gap: 14px; }
.tn-recepcion .rc-botones { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.tn-recepcion .rc-btn { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 14px; padding: 14px 20px; border-radius: 22px;
    background: var(--tn-papel); border: 1px solid var(--tn-linea); text-decoration: none; color: var(--tn-tinta); box-shadow: var(--tn-sombra); min-height: 0; margin: 0; }
.tn-recepcion .rc-btn svg { grid-row: 1 / span 2; width: 48px; height: 48px; stroke: currentColor; fill: none; stroke-width: 1.6; align-self: center; }
.tn-recepcion .rc-btn b { font-size: 24px; }
.tn-recepcion .rc-btn small { color: var(--tn-suave); font-size: 14px; }
.tn-recepcion .rc-btn.pri { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; }
.tn-recepcion .rc-btn.pri small { color: rgba(255,255,255,.85); }
.tn-recepcion .rc-buscar input { width: 100%; min-height: 46px; margin-top: 4px; }
body.tn-body .tn-recepcion .rc-hoy { margin: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.tn-recepcion .rc-caja { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tn-recepcion .rc-lista { list-style: none; margin: 0; padding: 0; }
/* Cada cita, sobre el fondo de ventana del tema: en «Noche», con #fff fijo, quien llega salía en crema sobre blanco. */
.tn-recepcion .rc-lista li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-left: 5px solid var(--c); border-radius: 12px; background: var(--tn-ventana, #fff); margin-bottom: 8px; }
.tn-recepcion .rc-lista .h { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-recepcion .rc-lista .q b { display: block; font-size: 17px; }
.tn-recepcion .rc-lista .q small { color: var(--tn-suave); }
.tn-recepcion .rc-lista form { margin: 0; }
.tn-recepcion .rc-lista li.hecha { opacity: .6; }
.tn-recepcion .rc-lista li.tarde .h { color: var(--tn-aviso); }
.tn-recepcion .rc-ok { color: var(--tn-ok); font-weight: 700; grid-column: span 2; text-align: right; }
.tn-recepcion .rc-vacio { color: var(--tn-suave); border: 0 !important; background: none !important; }
@media (max-width: 900px) { body.tn-body .tn-recepcion { grid-template-columns: 1fr; } .tn-recepcion .rc-botones { grid-template-rows: none; } }

/* ---------- El menú en dos bloques: MOSTRADOR (sin PIN) y GESTIÓN (con PIN) ----------
   Cada bloque lleva su título; los de gestión, un candado pequeño en la esquina
   (solo desde el mostrador: el dueño en su panel no teclea PIN). El bloque de
   gestión va sobre un fondo un poco más oscuro para que se vea que es otra cosa. */
/* El título de cada bloque, a 12 px (el mínimo de la guía) y en frase, sin mayúsculas forzadas ni espaciado:
   así «Mostrador» cabe en la columna aunque sea estrecha. Antes 10,5 px en mayúsculas (9,5 en pantallas bajas). */
.tn-rail-grupo { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; line-height: 1.15;
    color: var(--tn-suave); padding: 6px 0 2px; }
.tn-rail-grupo.pin { margin-top: 6px; border-top: 1px solid var(--tn-linea); padding-top: 8px; color: var(--tn-marca); }
.tn-rail-grupo svg { width: 12px !important; height: 12px !important; stroke: currentColor; fill: none; stroke-width: 2.2; }
.tn-rail a.con-pin, .tn-accion.con-pin { position: relative; }
.tn-rail a.con-pin:not(.on) { background: rgba(154, 74, 32, .05); }
.tn-candado { position: absolute; top: 5px; right: 6px; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: var(--tn-papel); font-style: normal; }
.tn-candado svg { width: 11px !important; height: 11px !important; stroke: var(--tn-marca); fill: none; stroke-width: 2.4; }
.on .tn-candado { background: rgba(255,255,255,.25); } .on .tn-candado svg { stroke: #fff; }
/* Nueve botones en el raíl: en la pantalla baja del mostrador, un poco más juntos. La LETRA no baja de 12 px
   (guía de pantallas; antes 11,5 y 11 en los botones y 9,5 en «Mostrador»/«Gestión» a 1273 × 545, que es la
   pantalla de Jesús): para que quepan se quita relleno, separación y el logo, no tamaño de letra. */
@media (max-height: 700px) and (min-width: 901px) {
    .tn-rail { gap: 1px; padding-top: 6px; }
    .tn-rail a, .tn-rail button { padding: 4px 4px; font-size: 12px; }
    .tn-rail a :is(svg, .tn-ic), .tn-rail button :is(svg, .tn-ic) { width: 21px; height: 21px; }
    .tn-rail .tn-logo { transform: scale(.75); margin: -6px 0 -6px; }
    .tn-rail-grupo { padding: 2px 0 0; }
    .tn-rail-grupo.pin { margin-top: 3px; padding-top: 3px; }
    /* En la columna de la GESTIÓN (la que lleva títulos de bloque), el icono más pegado a su nombre: con
       nueve botones y el logo, así cabe entera a 545 de alto. La del TPV no se toca. */
    .tn-rail:has(> .tn-rail-grupo) > :is(a, button) { gap: 3px; }
    /* Diez o más (una tienda con agenda, cuotas y documentos): sin el logo y algo más bajos, para que quepan todos. */
    .tn-rail:has(> a:nth-of-type(10)) { gap: 0; padding-top: 4px; }
    .tn-rail:has(> a:nth-of-type(10)) .tn-logo { display: none; }
    .tn-rail:has(> a:nth-of-type(10)) :is(a, button) { padding: 3px 4px; gap: 3px; }
    .tn-rail:has(> a:nth-of-type(10)) :is(a, button) :is(svg, .tn-ic) { width: 19px; height: 19px; }
}
/* ---- Módulos de venta (26-10-2026): las ventanas del TPV para elegir talla y
   color, pesar y dar el número de serie (assets/js/tpv_modulos.js). Tamaño fijo
   y botones grandes; lo que no cabe se pasa con flechas (regla 6: sin scroll).
   Fondos con var(--tn-ventana) y letra con var(--tn-tinta), no blanco fijo: un <button> no hereda el color,
   y en «Noche» (color-scheme: dark) las tallas y las teclas salían claras sobre blanco. ---- */
.tvm-ventana { width: min(760px, 94vw); padding: 22px 24px; display: grid; gap: 10px; }
.tvm-sub { margin: 0 46px 0 0; color: var(--tn-suave); font-size: 15px; }
.tvm-rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 74px; gap: 10px; }
.tvm-op { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 8px 12px; min-width: 0; border-radius: 14px;
          border: 1px solid var(--tn-linea); background: var(--tn-ventana, #fff); color: var(--tn-tinta); font: 500 13.5px var(--tn-sans); cursor: pointer; text-align: left; }
.tvm-op b { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvm-op span { color: var(--tn-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvm-op:hover { border-color: var(--tn-marca-linea); }
.tvm-op.agotada span { color: var(--tn-aviso); }
.tvm-pag { display: flex; align-items: center; justify-content: center; gap: 14px; }
.tvm-pag[hidden] { display: none; }
.tvm-pag button { width: 72px; height: 48px; border-radius: 12px; border: 1px solid var(--tn-linea); background: var(--tn-ventana, #fff); color: var(--tn-tinta); font-size: 26px; cursor: pointer; }
.tvm-pag button:disabled { opacity: .35; cursor: default; }
.tvm-pag span { color: var(--tn-suave); font-size: 14px; }
.tvm-peso { width: min(640px, 94vw); }
.tvm-dos { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; align-items: start; }
.tvm-col { display: grid; gap: 10px; }
.tvm-unidad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tvm-unidad button { height: 46px; border-radius: 12px; border: 1px solid var(--tn-linea); background: var(--tn-ventana, #fff); color: var(--tn-tinta); font: 600 15px var(--tn-sans); cursor: pointer; }
.tvm-unidad button.on { background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; }
.tn-ventana .tvm-col input[type=text] { height: 60px; font-size: 28px; font-weight: 700; text-align: right; }
.tvm-importe { min-height: 24px; font-size: 15px; color: var(--tn-suave); }
.tvm-importe.ok { color: var(--tn-ok); font-weight: 700; }
.tvm-teclas { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 56px; gap: 8px; }
.tvm-teclas button { border-radius: 12px; border: 1px solid var(--tn-linea); background: var(--tn-ventana, #fff); color: var(--tn-tinta); font: 700 22px var(--tn-sans); cursor: pointer; }
.tvm-teclas button:active { background: var(--tn-marca-suave); }
.tvm-serie-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
@media (max-width: 900px) { .tvm-rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tvm-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tvm-dos { grid-template-columns: 1fr; } }

/* =====================================================================
   BOTONES DE ICONO Y TÁCTIL / RATÓN (Jesús, 27-10: «mejor estética; con ratón
   solo el icono y al pasar el cursor su nombre; con pantalla táctil, el texto,
   sin palabras de más»). html[data-modo] lo pone tn_cabeza.php.
   ===================================================================== */
/* El nombre al pasar el ratón: una etiqueta oscura junto al botón (a la izquierda, para no
   salirse de las tablas; .tip-abajo, debajo, en la barra de arriba del TPV). */
html[data-modo="raton"] :is(.tn-ib, .tn-accion)[data-tip]:is(:hover, :focus-visible)::after {
    content: attr(data-tip); position: absolute; z-index: 40; pointer-events: none; white-space: nowrap;
    background: var(--tn-tinta); color: #fff; font: 600 12.5px var(--tn-sans); padding: 6px 10px; border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2); right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
}
html[data-modo="raton"] .tn-accion[data-tip]:is(:hover, :focus-visible)::after { right: auto; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); }

/* El botón de icono de la gestión (tn_ib()). */
.tn-ib { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-width: 38px; padding: 0 8px;
         border: 1px solid var(--tn-linea); border-radius: 11px; background: var(--tn-papel); color: var(--tn-tinta); font: 600 13px var(--tn-sans);
         text-decoration: none; cursor: pointer; vertical-align: middle; transition: background .12s, border-color .12s; }
.tn-ib .tn-ic { width: 22px; height: 22px; }
.tn-ib svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tn-ib:hover { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
.tn-ib.peligro { color: var(--tn-mal); } .tn-ib.peligro:hover { border-color: var(--tn-mal); background: var(--tn-mal-suave); }
.tn-ib:disabled { opacity: .45; cursor: not-allowed; }
html[data-modo="raton"] .tn-ib .tn-ib-txt { display: none; }
/* Crear (Nueva factura…): siempre con su nombre, que no se confunda con las pestañas del mismo icono. */
html[data-modo="raton"] .tn-ib.con-txt .tn-ib-txt { display: inline; }
.tn-ib.con-txt { padding: 0 12px; }
html[data-modo="raton"] .tn-ib.con-txt[data-tip]:hover::after { display: none; }
html[data-modo="tactil"] .tn-ib { height: 46px; padding: 0 14px; }
.tn-acciones { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tn-acciones form { display: inline; margin: 0; }

/* La barra de arriba del TPV: con ratón, cuadrados con solo el icono; con el dedo, icono y nombre. */
.tn-accion { position: relative; }
.tn-accion .tn-ic { width: 28px; height: 28px; }
html[data-modo="raton"] .tn-accion { min-width: 0; width: 58px; height: 58px; padding: 0; }
html[data-modo="raton"] .tn-accion .tn-accion-txt { display: none; }
html[data-modo="raton"] .tn-accion .tn-ic { width: 30px; height: 30px; }

/* El MENÚ del TPV: lo que no es vender, en iconos grandes. */
.tv-menu { width: min(620px, 94vw); padding: 22px 24px; }
.tv-menu-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 10px; }
.tv-menu-rejilla a { position: relative; display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 104px; padding: 12px 8px;
                     border: 1px solid var(--tn-linea); border-radius: 16px; background: var(--tn-papel); color: var(--tn-tinta); text-decoration: none;
                     font: 600 14px var(--tn-sans); text-align: center; }
.tv-menu-rejilla a .tn-ic { width: 40px; height: 40px; }
.tv-menu-rejilla a:hover { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
.tv-menu-rejilla a.con-pin { background: rgba(154, 74, 32, .04); }
/* Pie del Menú: el nombre del terminal a la izquierda y «Salir del terminal» como botón a la derecha (29-10: era un enlace gris diminuto). */
.tv-menu-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--tn-linea); color: var(--tn-suave); font-size: 13.5px; }
.doc-nuevos { margin-top: 4px; }
.tk-sin-serie { color: var(--tn-mal) !important; font-weight: 700; }

/* =====================================================================
   NUEVA FACTURA / ALBARÁN / PRESUPUESTO (nuevo_documento.php): el documento a
   la izquierda (tipo, cliente, líneas) y a la derecha el total y qué hacer.
   ===================================================================== */
body.tn-body .nd { display: grid; gap: 14px; min-height: 0; }
body.tn-body .nd > .card, body.tn-body .nd .card { margin: 0; }
.nd-hecho { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--tn-ok-suave); border-color: var(--tn-ok); }
.nd-hecho > div { flex: 1; display: grid; gap: 2px; min-width: 220px; }
.nd-hecho b { font-size: 18px; color: var(--tn-ok); } .nd-hecho span { color: var(--tn-tinta); font-size: 14px; }
.nd-hecho .btn { display: inline-flex; align-items: center; gap: 8px; } .nd-hecho .btn .tn-ic { width: 20px; height: 20px; }
.nd-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); gap: 14px; align-items: start; }
.nd-main { display: grid; gap: 14px; min-width: 0; }
.nd h3 { margin: 0 0 10px; font: 600 15px var(--tn-sans); text-transform: uppercase; letter-spacing: .05em; color: var(--tn-suave); }
.nd-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.nd-tipos { display: inline-flex; gap: 6px; padding: 4px; border-radius: 16px; background: var(--tn-marca-suave); }
.nd-tipos form { margin: 0; }
.nd-tipos button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent;
                   color: var(--tn-tinta); font: 600 15px var(--tn-sans); cursor: pointer; }
.nd-tipos button .tn-ic { width: 24px; height: 24px; }
.nd-tipos button.on { background: var(--tn-papel); box-shadow: 0 1px 4px rgba(0, 0, 0, .12), 0 0 0 1px var(--tn-marca) inset; }
.nd-tipos button:disabled { opacity: .4; cursor: not-allowed; }
.nd-albs { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; } .nd-albs form { margin: 0; }
.nd-link { border: 0; background: none; padding: 0; color: var(--tn-marca-osc); text-decoration: underline; font: inherit; font-weight: 600; cursor: pointer; }
.nd-cli-ficha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .nd-cli-ficha form { margin: 0; }
.nd-cli-ficha > div { flex: 1; display: grid; gap: 3px; min-width: 220px; }
.nd-cli-ficha b { font-size: 17px; } .nd-cli-ficha span { color: var(--tn-suave); font-size: 13.5px; } .nd-cli-ficha em { justify-self: start; }
.nd-falta { display: grid; grid-template-columns: 2fr 1fr 2fr .9fr 1.3fr auto; gap: 6px; margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--tn-mal-suave); }
.nd-falta > span { grid-column: 1 / -1; color: var(--tn-mal); font-weight: 600; font-size: 13.5px; }
.nd-falta input { min-width: 0; }
.nd-buscar { display: flex; gap: 8px; } .nd-buscar input { flex: 1; min-width: 0; }
.nd-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 8px; }
.nd-res form { margin: 0; }
.nd-res button { width: 100%; display: grid; gap: 2px; text-align: left; padding: 9px 12px; border: 1px solid var(--tn-linea); border-radius: 12px;
                 background: var(--tn-papel); color: var(--tn-tinta); font: inherit; cursor: pointer; }
.nd-res button:hover { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
.nd-res button span { color: var(--tn-suave); font-size: 12.5px; }
.nd-nuevo { margin-top: 10px; } .nd-nuevo summary { cursor: pointer; font-weight: 600; color: var(--tn-marca-osc); }
.nd-nuevo-f { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.nd-nuevo-f .ancho { grid-column: span 2; }
/* La línea libre (B13): plegada bajo el buscador de productos. */
.nd-libre { margin-top: 8px; } .nd-libre summary { cursor: pointer; font-weight: 600; color: var(--tn-marca-osc); font-size: 14px; }
.nd-libre-f { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 6px; margin-top: 8px; }
@media (max-width: 700px) { .nd-libre-f { grid-template-columns: 1fr 1fr; } .nd-libre-f input[name="concepto"] { grid-column: span 2; } }
.nd-tabla-zona { margin-top: 12px; overflow-x: auto; }
table.nd-tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.nd-tabla th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--tn-suave); padding: 8px 6px; border-bottom: 1px solid var(--tn-linea); }
.nd-tabla td { padding: 6px; border-bottom: 1px solid var(--tn-linea); vertical-align: middle; }
.nd-tabla .r { text-align: right; white-space: nowrap; }
.nd-tabla td small { display: block; color: var(--tn-suave); font-size: 12.5px; }
.nd-tabla td small.nd-aviso { color: var(--tn-mal); font-weight: 600; }
.nd-tabla tr.nd-sin-serie td { background: var(--tn-mal-suave); }
.nd-tabla .nd-cod { font-variant-numeric: tabular-nums; color: var(--tn-suave); font-size: 13px; }
.nd-tabla form { margin: 0; }
.nd-tabla input { width: 84px; min-height: 36px; text-align: right; padding: 4px 8px; }
.nd-tabla input[name="qty"] { width: 64px; }
.nd-vacio { text-align: center; color: var(--tn-suave); padding: 22px 6px !important; }
.nd-quitar { width: 46px; text-align: right; }
.nd-lado { position: sticky; top: 10px; display: grid; gap: 12px; }
.nd-total { display: flex; align-items: baseline; justify-content: space-between; }
.nd-total span { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tn-suave); }
.nd-total b { font: 700 34px var(--tn-sans); font-variant-numeric: tabular-nums; }
table.nd-iva { width: 100%; font-size: 13px; color: var(--tn-suave); } .nd-iva .r { text-align: right; }
.nd-dto { display: flex; align-items: center; gap: 8px; } .nd-dto label { margin: 0; font-size: 13px; } .nd-dto input { width: 80px; text-align: right; }
.nd-acciones { display: grid; gap: 8px; border-top: 1px solid var(--tn-linea); padding-top: 12px; }
.nd-acciones form { margin: 0; }
.nd-acc-tit { font-weight: 700; }
.nd-pagos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .nd-pagos .btn { width: 100%; }
.nd-ancho { width: 100%; }
.nd-hacer { display: grid; gap: 6px; } .nd-hacer label { margin: 0; font-size: 13px; }
.nd-porque { margin: 0; color: var(--tn-mal); font-size: 13px; font-weight: 600; }
.nd-nota { color: var(--tn-suave); font-size: 12.5px; }
html[data-modo="tactil"] .nd-tabla input { min-height: 46px; }
@media (max-width: 1100px) { .nd-cols { grid-template-columns: 1fr; } .nd-lado { position: static; } }
@media (max-width: 700px) { .nd-falta, .nd-nuevo-f { grid-template-columns: 1fr 1fr; } .nd-falta > input, .nd-nuevo-f .ancho { grid-column: span 2; }
/* La línea libre (B13): plegada bajo el buscador de productos. */
.nd-libre { margin-top: 8px; } .nd-libre summary { cursor: pointer; font-weight: 600; color: var(--tn-marca-osc); font-size: 14px; }
.nd-libre-f { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 6px; margin-top: 8px; }
@media (max-width: 700px) { .nd-libre-f { grid-template-columns: 1fr 1fr; } .nd-libre-f input[name="concepto"] { grid-column: span 2; } } .nd-tipos { width: 100%; } .nd-tipos button { padding: 0 10px; } }

/* =====================================================================
   MOSTRADOR (migración 252): aparcar tickets y la ventana «Tickets».
   ===================================================================== */
/* «Aparcar» y «Vaciar», juntos a la derecha de la cabecera del ticket. */
.tk-cab .tk-cab-acc { display: flex; align-items: center; gap: 16px; flex: none; }
.tk-cab .tk-cab-acc form { margin: 0; }
@container (max-width: 440px) { .tk-cab.con-cli .tk-cab-acc { margin-left: auto; } .tk-cab .tk-cab-acc .txt { display: none; } }
/* Con el dedo, el nombre se ve siempre (Jesús, 27-10); el cliente cede sitio. */
@container (max-width: 440px) { html[data-modo="tactil"] .tk-cab .tk-cab-acc .txt { display: inline; } html[data-modo="tactil"] .tk-cab .tk-cab-acc { gap: 12px; } }
/* El número de aparcados en la esquina del botón «Tickets» (ámbar: es un aviso, regla 3). */
.tv-insignia { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
               background: var(--tn-aviso); color: #fff; font: 700 12.5px/22px var(--tn-sans); text-align: center; box-shadow: 0 0 0 2px var(--tn-papel); }
/* La ventana: dos columnas, cada lista de 5 en 5 con flechas (sin scroll, regla 6). */
.tvt { width: min(980px, 96vw); padding: 22px 24px; }
.tvt-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin-top: 10px; }
.tvt-col { min-width: 0; display: grid; align-content: start; gap: 8px; }
.tvt-col h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--tn-suave); text-transform: uppercase; letter-spacing: .04em; }
.tvt-col h3 svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tvt-col h3 small { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--tn-aviso-suave); color: var(--tn-aviso); font-size: 12.5px; line-height: 22px; text-align: center; }
.tvt-lista { display: grid; gap: 6px; }
.tvt-fila { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 8px 6px 14px; border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); }
.tvt-fila.anulado .tvt-dato b { text-decoration: line-through; color: var(--tn-suave); }
.tvt-dato { min-width: 0; flex: 1; display: grid; gap: 2px; }
.tvt-dato b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvt-dato span { font-size: 13px; color: var(--tn-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvt-dato .tn-chip { font-style: normal; padding: 1px 8px; font-size: 11.5px; margin-left: 4px; }
.tvt-acc { display: flex; align-items: center; gap: 6px; flex: none; }
.tvt-acc form { margin: 0; }
.tvt-seguir { height: 42px; padding: 0 18px; font-size: 15px; }
.tvt-vacio { margin: 0; padding: 14px; border: 1px dashed var(--tn-linea); border-radius: 14px; color: var(--tn-suave); font-size: 14px; }
@media (max-width: 900px) { .tvt-cols { grid-template-columns: 1fr; } }

/* ---- Colores por categoría (migración 252, shp_colores_categoria()). Tonos de Radix:
   fondo suave (3), texto (11-12, medido ≥ 5:1) y franja (9). Ninguno es el verde, ámbar
   o rojo de los estados (regla 3). En «Noche», sus tonos oscuros. ---- */
[data-color="azul"]     { --cc-s: #E6F4FE; --cc-t: #0B5CAD; --cc-f: #0090FF; }
[data-color="turquesa"] { --cc-s: #DEF7F9; --cc-t: #0C6A82; --cc-f: #00A2C7; }
[data-color="violeta"]  { --cc-s: #F4F0FE; --cc-t: #6550B9; --cc-f: #6E56CF; }
[data-color="rosa"]     { --cc-s: #FEE9F5; --cc-t: #B0207C; --cc-f: #D6409F; }
[data-color="naranja"]  { --cc-s: #FFEFD6; --cc-t: #A83F00; --cc-f: #F76B15; }
[data-color="lima"]     { --cc-s: #EEF6D6; --cc-t: #4A6526; --cc-f: #99D52A; }
[data-color="marron"]   { --cc-s: #F6EEE7; --cc-t: #815E46; --cc-f: #AD7F58; }
[data-color="gris"]     { --cc-s: #F0F0F0; --cc-t: #646464; --cc-f: #8D8D8D; }
html[data-tema="noche"] [data-color="azul"]     { --cc-s: #0D2847; --cc-t: #70B8FF; }
html[data-tema="noche"] [data-color="turquesa"] { --cc-s: #082C36; --cc-t: #4CCCE6; }
html[data-tema="noche"] [data-color="violeta"]  { --cc-s: #291F43; --cc-t: #BAA7FF; }
html[data-tema="noche"] [data-color="rosa"]     { --cc-s: #37172F; --cc-t: #FF8DCC; }
html[data-tema="noche"] [data-color="naranja"]  { --cc-s: #331E0B; --cc-t: #FFA057; }
html[data-tema="noche"] [data-color="lima"]     { --cc-s: #1F2917; --cc-t: #D4FF70; }
html[data-tema="noche"] [data-color="marron"]   { --cc-s: #2E201A; --cc-t: #DBB594; }
html[data-tema="noche"] [data-color="gris"]     { --cc-s: #222222; --cc-t: #B4B4B4; }
/* El botón del producto: franja arriba y la inicial en su color; la categoría, con su punto. */
.tv-item[data-color] .tv-ficha { box-shadow: inset 0 4px 0 var(--cc-f); }
.tv-item[data-color] .tv-foto { background: var(--cc-s); }
.tv-item[data-color] .tv-ini { color: var(--cc-t); }
.tv-cats button[data-color]::before, .cat-muestra[data-color]:not([data-color=""])::before {
    content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--cc-f); box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.cat-color { display: flex; align-items: center; gap: 8px; margin: 0; }
.cat-color select { max-width: 160px; }
.cat-muestra { display: inline-flex; width: 12px; }
/* Ventas por cliente (E22): los clientes más anchos y lo que se debe al lado; en el móvil, uno debajo de otro. */
.ic-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; align-items: start; }
.ic-cols > .card { margin: 0; min-width: 0; }
.ic-cols td.av { color: var(--tn-aviso); font-weight: 700; } .ic-cols td.mal { color: var(--tn-mal); font-weight: 700; }
@media (max-width: 900px) { .ic-cols { grid-template-columns: 1fr; } }
/* La graduación (fichas.php, F28): la rejilla OD/OI de la ventana, con casillas que no se salen. */
.fi-grad { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fi-grad th { font-size: 13px; font-weight: 600; text-align: left; padding: 0 4px 4px; }
.fi-grad th[scope="row"] { width: 42px; }
.fi-grad td { padding: 3px 4px; }
.fi-grad input { width: 100%; min-width: 0; text-align: center; }
/* Las listas de fichas.php: los botones bajo el nombre o la fecha, y la última columna
   (texto) sin el «nowrap» ni la alineación a la derecha de las columnas de botones. */
.fi-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fi-acc form, body.tn-body .fi-acc > * { margin: 0; }
body.tn-body td.fi-texto { white-space: normal; text-align: left; }
.fi-ojo { display: block; } .fi-nw { white-space: nowrap; }
/* La ficha de un encargo o una reparación (encargos.php, B15/F25). */
.en-datos { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 12px; margin: 12px 0 0; font-size: 14.5px; }
.en-datos dt { color: var(--tn-suave); font-weight: 600; } .en-datos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.en-estados { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.en-cifras { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.en-cifras li { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.en-cifras .en-falta { font-size: 19px; border-top: 1px solid var(--tn-linea); padding-top: 6px; }
/* El icono del producto (F27): la lista para elegirlo en su ficha y el botón del TPV. */
.pr-iconos { margin-top: 12px; border: 1px solid var(--tn-linea); border-radius: 12px; padding: 8px 12px; }
.pr-iconos summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pr-iconos summary .tn-ic { width: 28px; height: 28px; }
.pr-ico-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; max-height: 300px; overflow-y: auto; }
.pr-ico-grupo { grid-column: 1 / -1; }
.pr-ico-grupo { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--tn-suave); text-transform: uppercase; letter-spacing: .04em; }
.pr-ico { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-align: center; }
.pr-ico input { position: absolute; opacity: 0; pointer-events: none; }
.pr-ico .tn-ic { width: 34px; height: 34px; }
.pr-ico small { font-size: 11px; line-height: 1.2; color: var(--tn-suave); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-ico:has(input:checked) { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
.pr-ico:has(input:focus-visible) { outline: 2px solid var(--tn-marca); }
.pr-ico-sin { width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; color: var(--tn-suave); }
.tv-foto .tv-icono { width: 58%; height: 58%; object-fit: contain; }
.tv-pie .tv-icono-mini { width: 22px; height: 22px; flex: none; margin-right: 6px; vertical-align: middle; }

/* ============================================================
   REVISIÓN DEL TPV (Jesús, 28-10: «hazlos, y las decisiones que propones»).
   ============================================================ */
/* La letra: la elegante (Cormorant) solo en los centros de estética, para lo que se
   eligió (data-letra="clasica", tn_cabeza.php); en las demás tiendas, la misma letra
   limpia de todo, en negrita. Más pequeña: la sans a 38 px pesaba demasiado. */
html[data-letra="limpia"] { --tn-serif: 'Figtree', system-ui, sans-serif; }
html[data-letra="limpia"] body.tn-body :is(.tn-nombre h1, .tn-titulo h2, .tn-ventana h2, .tn-form-dentro > strong:first-child) { font-weight: 700; letter-spacing: -.02em; }
html[data-letra="limpia"] body.tn-body .tn-nombre h1 { font-size: 28px; }
html[data-letra="limpia"] body.tn-body .tn-titulo h2 { font-size: 25px; }
html[data-letra="limpia"] body.tn-body .tn-ventana h2 { font-size: 24px; }
html[data-letra="limpia"] body.tn-body .tn-form-dentro > strong:first-child { font-size: 24px; }

/* El TPV, más blanco: el celeste de «Cielo» se queda en la gestión; en el mostrador,
   un fondo neutro casi blanco para que mande lo que se vende (con «Noche», el suyo). */
html:not([data-tema="noche"]) body.tn-body.tn-tpv,
html:not([data-tema="noche"]) body.tn-body.tn-tpv::before { background: #F5F7F8; }

/* Nada que se lea por debajo de 12 px, y el texto apagado del tema (6,3:1 sobre el fondo). */
body.tn-body .tn-nombre small { font-size: 12px; letter-spacing: .14em; }
body.tn-body .tn-rail :is(.tv-raccion, .tv-grupo) { font-size: 12px; }
body.tn-body .tv-buscar input::placeholder { opacity: 1; }

/* El estado de la caja, junto al nombre del terminal: verde (regla 3), con su punto. */
.tn-estado { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; letter-spacing: 0; font-weight: 600; }
.tn-estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tn-estado.ok { color: var(--tn-ok); }

/* Catálogo vacío: un botón grande para empezar. */
.tv-vacio-nuevo > div { display: grid; gap: 14px; justify-items: center; font-size: 15px; color: var(--tn-tinta); }
.tv-vacio-nuevo b { font-size: 20px; }
.tv-vacio-nuevo span { color: var(--tn-suave); font-size: 14px; }
.tv-vacio-nuevo span a { color: var(--tn-marca); font-weight: 600; }
.tv-vacio-btn { display: inline-flex; align-items: center; min-height: 56px; padding: 0 28px; border-radius: 16px;
    background: var(--tn-marca); color: #fff; font: 700 18px var(--tn-sans); text-decoration: none; box-shadow: var(--tn-sombra); }
.tv-vacio-btn:hover { background: var(--tn-marca-osc); color: #fff; }

/* «Cobrar» sin nada en el ticket: gris neutro con lo que falta (6,5:1), no un celeste apagado que parecía roto. */
body.tn-body .tk-cobrar[disabled] { background: #E6EAED; color: #4A5560; font-size: 17px; font-weight: 600; }
html[data-tema="noche"] body.tn-body .tk-cobrar[disabled] { background: #2E2723 !important; color: #C9BFB8 !important; }

/* Base e IVA encima del total: lo mismo que dirá el ticket impreso. */
.tk-iva { display: flex; justify-content: flex-end; gap: 16px; font-size: 13px; color: var(--tn-suave); font-variant-numeric: tabular-nums; }
body.tn-body .tk-pie > .tk-iva { grid-column: 1 / -1; margin-top: -4px; }

/* El cliente del ticket: su nombre (se cambia tocándolo) y una «×» clara para quitarlo. */
.tk-cab .tk-cli.con { background: rgba(255, 255, 255, .14); text-decoration: none; }
.tk-cab .tk-cli-x { flex: none; width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .6); text-decoration: none; }
.tk-cab .tk-cli-x:hover { background: rgba(255, 255, 255, .16); }
.tk-cab .tk-cli-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }
/* Entrar al panel (t/login.php, 28-10): la misma pantalla que el PIN del mostrador, con correo y contraseña. */
.tn-entrar-caja form { display: grid; gap: 14px; }
.tn-entrar-caja label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--tn-tinta); }
body.tn-body .tn-entrar-caja input { height: 50px; font-size: 16px; }
body.tn-body .tn-entrar-caja .btn { height: 54px; font-size: 17px; width: 100%; margin-top: 4px; }
.tn-entrar-caja .olvido { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--tn-suave); text-align: center; }
.tn-entrar-caja .olvido a { color: var(--tn-marca-osc); font-weight: 600; }
/* La lista de clientes con solo la agenda (clientes.php sin «Clientes y puntos»): sus columnas. */
body.tn-body table.cl-tabla.est-tabla { min-width: 820px; }
body.tn-body .est-tabla col.c-cod { width: 8%; }    body.tn-body .est-tabla col.c-nom { width: 22%; }
body.tn-body .est-tabla col.c-tel { width: 13%; }   body.tn-body .est-tabla col.c-mail { width: 17%; }
body.tn-body .est-tabla col.c-cumple { width: 9%; } body.tn-body .est-tabla col.c-notas { width: 19%; }
body.tn-body .est-tabla col.c-cita { width: 12%; }
body.tn-body .est-tabla td .btn-sm { height: 30px; }
/* El icono de color de cada categoría (migración 263): en su botón del TPV y en Catálogo → Categorías.
   Sobre el botón marcado (fondo de color) va en una pastilla blanca para que se siga viendo. */
.tv-cats button img.tv-cat-ic { width: 26px; height: 26px; margin-left: -8px; }
.tv-cats button.on img.tv-cat-ic { background: #fff; border-radius: 50%; padding: 2px; }
.cat-ico { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tn-suave); }
.cat-ico .tn-ic { width: 34px; height: 34px; }
.cat-ico small { font-size: 12px; text-decoration: underline; }
.cat-ico-sin { width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; color: var(--tn-suave); }
.cat-ico-ventana { width: min(760px, 96vw); padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.cat-ico-ventana > strong { font-size: 18px; padding-right: 48px; }
.cat-ico-ventana p { margin: 0; }
.cat-ico-ventana form { display: flex; flex-direction: column; min-height: 0; }
.cat-ico-ventana .pr-ico-rejilla { max-height: min(56vh, 460px); }
.cat-ico-ventana .tn-cerrar { position: absolute; top: 14px; right: 14px; }
/* La barrita de estado del TPV (tpv_estado.js, 28-10): internet e impresora, con los colores de siempre. */
.tv-estados { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; line-height: 1.2; white-space: nowrap; }
.tv-estados .tn-estado { margin-left: 0; }
.tv-estados .tn-estado[hidden] { display: none; }
.tn-estado.aviso { color: var(--tn-aviso); }
.tn-estado.mal { color: var(--tn-mal); }
.tn-estado.nada { color: var(--tn-suave); }
@media (max-width: 760px) { .tv-estados { display: none; } }
/* El tamaño de los botones de ESTE aparato (Ajustes → Aspecto, shp_botones, 28-10). «zoom» agranda el botón
   entero (letra, icono y relleno) sin tocar cada regla. En el TPV, solo lo que no puede empujar nada fuera de la
   pantalla (regla 6): las categorías, que ya pasan con flechas. La columna de la izquierda NO: con «muy grandes»
   no cabría (medido a 1273 × 545) y sus botones ya son de dedo. */
html[data-botones="grandes"] body.tn-body :is(.btn, .tn-ib, .tn-accion, .tv-cats button, .tv-cats-fl) { zoom: 1.15; }
html[data-botones="muy"] body.tn-body :is(.btn, .tn-ib, .tn-accion, .tv-cats button, .tv-cats-fl) { zoom: 1.3; }
/* La cabecera del ticket (Jesús, 28-10: «lo mejor posible, con algún toque de otro tono de azul o color»).
   El color del tema que se funde en diagonal con un segundo tono suyo y, abajo, una raya clara de acento.
   Cada segundo tono está medido con el texto blanco encima (todos pasan 4,5:1; el que menos, 4,87). */
:root { --tn-cab-2: #B5561F; --tn-cab-raya: #F2B48C; }
html[data-tema="cielo"]   { --tn-cab-2: #1B6A86; --tn-cab-raya: #7FDDEA; }
html[data-tema="arena"]   { --tn-cab-2: #9C3A3A; --tn-cab-raya: #F4B9A0; }
html[data-tema="jade"]    { --tn-cab-2: #1E6585; --tn-cab-raya: #8FD6C2; }
html[data-tema="ciruela"] { --tn-cab-2: #5E3FA0; --tn-cab-raya: #E2B4DA; }
html[data-tema="grafito"] { --tn-cab-2: #1F6FA8; --tn-cab-raya: #A9BDF3; }
html[data-tema="propio"]  { --tn-cab-2: var(--tn-marca-osc); --tn-cab-raya: var(--tn-marca-linea); }
html[data-tema="noche"]   { --tn-cab-2: #A5402F; --tn-cab-raya: #F09A6B; }
body.tn-body .tk-cab { background: linear-gradient(115deg, var(--tn-marca) 0%, var(--tn-marca) 42%, var(--tn-cab-2) 100%);
    box-shadow: inset 0 -4px 0 var(--tn-cab-raya); position: relative; }
html[data-tema="noche"] body.tn-body .tk-cab { background: linear-gradient(115deg, var(--tn-marca-osc) 0%, var(--tn-marca-osc) 42%, var(--tn-cab-2) 100%); }
/* El icono del ticket, en una pastilla del color de acento: el «toque» que se ve de lejos. */
body.tn-body .tk-cab > svg:first-child { width: 36px; height: 36px; padding: 6px; border-radius: 11px; background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1.5px var(--tn-cab-raya); flex: none; }
/* Ajustes → Facturas: elegir la plantilla viéndola (settings.php, 28-10). Cada vista es la factura de
   ejemplo de verdad (794 × 1123) encogida a la cuarta parte; no se puede tocar dentro. */
.pl-elegir { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.pl-op { position: relative; display: grid; gap: 4px; padding: 10px; border: 2px solid var(--tn-linea); border-radius: 14px; background: var(--tn-ventana, #fff); color: var(--tn-tinta); cursor: pointer; }
.pl-op:hover { border-color: var(--tn-marca-linea); }
.pl-op.on, .pl-op:has(input:checked) { border-color: var(--tn-marca); box-shadow: 0 0 0 3px var(--tn-marca-suave); }
.pl-op input { position: absolute; opacity: 0; pointer-events: none; }
.pl-op:has(input:focus-visible) { outline: 2px solid var(--tn-marca); outline-offset: 2px; }
.pl-mini { display: block; width: 100%; aspect-ratio: 794 / 1123; overflow: hidden; border-radius: 6px; border: 1px solid var(--tn-linea); background: #e9f1f4; position: relative; }
.pl-mini iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1163px; border: 0; transform-origin: 0 0; transform: scale(var(--pl-escala, .23)); pointer-events: none; }
.pl-op b { font-size: 15px; } .pl-op b em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--tn-ok); margin-left: 4px; }
.pl-op small { font-size: 12.5px; color: var(--tn-suave); line-height: 1.35; }
.pl-op a { font-size: 12.5px; color: var(--tn-marca-osc); font-weight: 600; }
/* =====================================================================
   REDISEÑO · TANDA 1: LAS PIEZAS COMUNES (28-10, DISENO-REVISION.md; criterio: skill stoki-pantallas)
   Lo que se repetía en muchas pantallas, arreglado una vez aquí.
   ===================================================================== */

/* 1 · El menú de la izquierda de la gestión cabe en cualquier alto. A 1909×817 (la pantalla de
   Jesús) usaba los tamaños grandes y Catálogo, Cuentas y Ajustes quedaban fuera. Entre 701 y ~1000
   de alto, los botones se ajustan al alto (por debajo de 700 ya hay reglas propias, más arriba). Si aun
   así no cupiera (muchos módulos), el menú se desplaza él solo, sin barra: nunca se esconde nada. */
.tn-app:has(> .tn-gestion) > .tn-rail { overflow-y: auto; scrollbar-width: none; }
.tn-app:has(> .tn-gestion) > .tn-rail::-webkit-scrollbar { display: none; }
@media (min-height: 701px) and (min-width: 901px) {
    .tn-app:has(> .tn-gestion) > .tn-rail { gap: clamp(2px, .4vh, 6px); padding-top: clamp(8px, 1.4vh, 14px); }
    .tn-app:has(> .tn-gestion) > .tn-rail .tn-logo { height: clamp(42px, 6vh, 64px); }
    .tn-app:has(> .tn-gestion) > .tn-rail :is(a, button) { padding: clamp(5px, calc((100vh - 545px) / 40), 12px) 4px; gap: 4px; font-size: clamp(12px, 1.5vh, 13.5px); }
    .tn-app:has(> .tn-gestion) > .tn-rail :is(a, button) :is(svg, .tn-ic) { width: clamp(24px, 3.1vh, 30px); height: clamp(24px, 3.1vh, 30px); }
}

/* 2 · Las pestañas, ENTERAS: las que no caben van a «Más ▾» (tienda.js, pestanas()). Antes se
   estrechaban hasta «Produ…» o desaparecían detrás del botón principal. */
.tn-pest-zona { overflow: hidden; }
.tn-pest-zona a.tn-pest { flex: 0 0 auto; }
.tn-pest-zona a.tn-pest span { max-width: none; overflow: visible; }
html[data-modo="tactil"] .tn-pestanas { overflow: hidden; }
.tn-pest-mas { position: relative; flex-shrink: 0; }
.tn-pest-mas[hidden] { display: none; }
.tn-pest-mas > summary { list-style: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 56px; min-width: 62px; padding: 0 10px; border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel);
    color: var(--tn-tinta); font: 600 12.5px var(--tn-sans); cursor: pointer; }
.tn-pest-mas > summary::-webkit-details-marker { display: none; }
.tn-pest-mas > summary svg { width: 22px; height: 22px; fill: currentColor; }
.tn-pest-mas[open] > summary, .tn-pest-mas.con-elegida > summary { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
.tn-pest-mas-lista { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 220px; padding: 6px;
    background: var(--tn-ventana, #fff); border: 1px solid var(--tn-linea); border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(20, 30, 40, .35);
    display: flex; flex-direction: column; gap: 2px; }
.tn-pest-mas-lista a.tn-pest { flex-direction: row !important; justify-content: flex-start !important; height: 44px !important; width: 100%;
    border-color: transparent !important; background: transparent !important; box-shadow: none !important; font-size: 14px !important; gap: 10px !important; padding: 0 12px !important; }
.tn-pest-mas-lista a.tn-pest:hover { background: var(--tn-marca-suave) !important; }
.tn-pest-mas-lista a.tn-pest.on { background: var(--tn-marca-suave) !important; }
html[data-modo="tactil"] .tn-pest-mas > summary { height: 68px; min-width: 76px; }

/* 3 · Un solo botón relleno por pantalla: en las barras de búsqueda y filtros («Buscar», «Ver»),
   los botones son SECUNDARIOS. El relleno se queda para la acción principal de la cabecera. */
body.tn-body :is(.tn-contenido form[method="get"], .cl-barra) :is(button, a).btn:not(.btn-secondary):not(.btn-danger) {
    background: #fff; color: var(--tn-tinta); border-color: var(--tn-linea); }
body.tn-body :is(.tn-contenido form[method="get"], .cl-barra) :is(button, a).btn:not(.btn-secondary):not(.btn-danger):hover {
    border-color: var(--tn-marca-linea); color: var(--tn-marca-osc); }

/* 4 · «No hay nada» dentro de una tabla: centrado y con aire, no una frase pegada a la derecha
   (la regla «la última celda, a la derecha» de las acciones se la llevaba también). */
body.tn-body td[colspan]:only-child { text-align: center !important; white-space: normal; height: auto; padding: 28px 16px !important; color: var(--tn-suave); font-size: 14px; }

/* 5 · Las tarjetas sin lista, a su alto: estiradas hasta abajo dejaban cajas de 600 px casi vacías
   (Ajustes, Hoy, Gastos…). Las que llevan una tabla o una lista siguen ocupando el alto (se paginan). */
body.tn-body .tn-hoja > .card:not(:has(table, [data-tn-paginar], .cl-scroll, .tn-tabla, .fr-prods)) { align-self: start; }
/* Una pantalla de UNA tarjeta que es un formulario (no una lista): al ancho de lectura, no a 1700 px. */
body.tn-body .tn-hoja[data-n="1"] > .card:not(:has(table, [data-tn-paginar], .cl-scroll, .tn-tabla)) { max-width: 760px; }

/* 6 · La cabecera de una parte de Ajustes: una línea (dónde estás y para qué es), sin repetir el
   título que ya dice la cabecera de la pantalla, y encima de las tarjetas (tienda.js ya no la mete
   como una columna más). */
body.tn-body .tn-contenido > .ajc-cab { flex-shrink: 0; margin: 0 0 2px; }
body.tn-body .ajc-cab h1 { display: none; }
@media (min-width: 860px) {
    body.tn-body .ajc-cab { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
    body.tn-body .ajc-cab .ajc-migas ol { margin: 0; }
}
body.tn-body .ajc-cab p.ajc-desc { font-size: 13.5px; color: var(--tn-suave); }

/* 7 · Casi (el perrito), en la cabecera junto a «Pedir ayuda» (tienda.js, casiArriba()). */
body.tn-body .ia-fab.en-cabecera { position: relative; right: auto; bottom: auto; width: 40px; height: 40px; flex-shrink: 0; z-index: 2; }
body.tn-body .ia-fab.en-cabecera :is(.ia-fab-circle, video, img) { width: 40px !important; height: 40px !important; }
body.tn-body .ia-fab.en-cabecera .ia-fab-tip { right: auto; left: 50%; top: calc(100% + 8px); bottom: auto; transform: translateX(-50%); }

/* 8 · El ESTADO VACÍO común (tn_vacio() en tn_iconos.php): icono, una frase, una línea y un botón de ancho normal. */
.tn-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 28px 16px; margin: auto 0; }
.tn-vacio .tn-ic { width: 52px; height: 52px; opacity: .9; margin-bottom: 4px; }
.tn-vacio b { font-size: 16px; color: var(--tn-tinta); }
.tn-vacio p { margin: 0; max-width: 46ch; color: var(--tn-suave); font-size: 14px; line-height: 1.45; }
.tn-vacio .btn, .tn-vacio .tn-btn { margin-top: 10px; }

/* 9 · El título de una tarjeta, siempre igual (serif): unas pantallas lo ponían en negrita normal. */
body.tn-body .card > :is(h2, h3):first-child, body.tn-body .card > .cl-cab > strong:first-child { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; line-height: 1.1; margin: 0; }

/* 10 · Botones de acción de una tarjeta (al lado de su título): pequeños y secundarios. */
.tn-card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tn-card-cab > strong { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; line-height: 1.1; }/* La descripción de la parte de Ajustes ya sale junto al título de la cabecera en pantallas anchas
   (a partir de 1401 px; por debajo, la cabecera la esconde y aquí sí hace falta). */
@media (min-width: 1401px) { body.tn-body .ajc-cab p.ajc-desc { display: none; } }
/* ---------- Servicios (est_servicios.php), rediseño 28-10: servicios y bonos a lo ancho; profesionales y horario en la estrecha ---------- */
body.tn-body .es-pantalla { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); gap: 16px; min-height: 0; }
body.tn-body .es-pantalla > .tn-col > .card#horario, body.tn-body .es-pantalla > .tn-col > .card#bonos { flex: 0 0 auto; }
body.tn-body .es-horario { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 8px; }
body.tn-body .es-horario .form-group { margin: 0; }
body.tn-body .es-horario input[type=time] { width: 120px; }
body.tn-body .es-horario select { width: 140px; }
body.tn-body .es-baja { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--tn-linea); }
body.tn-body .es-baja .text-muted { font-size: 13px; }
@media (max-width: 900px) { body.tn-body .es-pantalla { grid-template-columns: 1fr; } }
body.tn-body .es-pantalla #horario .es-horario .form-group { flex: 0 0 auto; }
body.tn-body .es-pantalla #horario .es-horario input[type=time] { width: 124px; }
body.tn-body .es-pantalla #horario .es-horario select { width: 140px; }
body.tn-body .es-pantalla #horario .es-horario .btn { flex: 0 0 auto; width: auto; }
/* ---------- Tablets e impresoras (aparatos.php), rediseño 28-10: lista + una ventana por tablet ---------- */
body.tn-body table.cl-tabla.ap-tabla { min-width: 760px; }
body.tn-body .ap-tabla td.cl-nom b { display: block; }
body.tn-body .ap-tabla .ap-modelo { display: block; font-size: 12px; color: var(--tn-suave); }
body.tn-body .ap-tabla td { height: 54px; }
.ap-ventana { width: min(880px, 96vw); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 4px; }
.ap-ventana > div:first-of-type strong { font-family: var(--tn-serif); font-size: 24px !important; }
.ap-ventana h4 { font-size: 15px; }
.ap-ventana .ap-imp { align-items: center !important; }
/* ---------- Partes de Ajustes (settings.php y demás), rediseño 28-10 ---------- */
/* El INTERRUPTOR (un sí/no que se guarda al tocarlo). Verde no: es el color de «bien» (regla 3); el del negocio. */
.tn-switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.tn-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tn-switch i { display: block; width: 50px; height: 28px; border-radius: 14px; background: var(--tn-linea); transition: background .15s; position: relative; }
.tn-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.tn-switch input:checked + i { background: var(--tn-marca); }
.tn-switch input:checked + i::after { left: 25px; }
.tn-switch input:focus-visible + i { outline: 2px solid var(--tn-marca); outline-offset: 2px; }
body.tn-body .aj-ops { gap: 0; padding-top: 6px; padding-bottom: 6px; }
body.tn-body .aj-op { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 14px 0; margin: 0; }
body.tn-body .aj-op + .aj-op { border-top: 1px solid var(--tn-linea); }
body.tn-body .aj-op-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body.tn-body .aj-op-tx b { font-size: 15.5px; }
body.tn-body .aj-op-tx > span { font-size: 13.5px; color: var(--tn-suave); line-height: 1.45; }
body.tn-body .aj-op-tx .tn-chip { align-self: flex-start; }
body.tn-body .aj-op .tn-switch { margin-top: 2px; }
body.tn-body .aj-mas { font-size: 13px; color: var(--tn-suave); }
body.tn-body .aj-mas summary { cursor: pointer; color: var(--tn-marca-osc); font-weight: 600; width: max-content; }
body.tn-body .aj-mas p { margin: 6px 0 0; line-height: 1.5; max-width: 62ch; }
body.tn-body .aj-ayuda { margin: 0; font-size: 13.5px; line-height: 1.45; max-width: 62ch; }
body.tn-body .aj-fila { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; }
body.tn-body .aj-fila .form-group { margin: 0; }
body.tn-body .aj-corto { width: 170px; }
body.tn-body .aj-medio { width: 240px; }
body.tn-body .aj-quitar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--tn-linea); }
body.tn-body .aj-quitar .text-muted { font-size: 13px; }
/* Facturas: la plantilla y los datos para empresas, uno encima de otro y al ancho de lectura. */
body.tn-body .aj-pila { max-width: 1120px; overflow-y: auto; scrollbar-width: thin; }
body.tn-body .aj-pila > .card { flex-shrink: 0; }
body.tn-body .aj-pila .pl-elegir { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 980px; }
@media (max-width: 900px) { body.tn-body .aj-pila .pl-elegir { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Reserva online / Puntos: lo que no vale mientras está apagado, en gris (se ve, pero no llama la atención). */
body.tn-body .aj-apagado > :not(strong) { opacity: .55; }
body.tn-body .rv-enlace { flex: 1 1 320px; max-width: 560px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }body.tn-body .pt-pantalla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1280px; }
body.tn-body .pt-pantalla > .card { min-height: 0; max-height: 100%; display: flex; flex-direction: column; }
body.tn-body .pt-ejemplo { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--tn-fondo, #F5F7F8); color: var(--tn-suave); }
body.tn-body table .num, body.tn-body .pt-tabla th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { body.tn-body .pt-pantalla { grid-template-columns: 1fr; } }body.tn-body .aj-fila input.aj-corto { width: 170px; max-width: 100%; }
body.tn-body .aj-fila input.aj-medio { width: 240px; max-width: 100%; }

/* REDISEÑO · TANDA 2 · piezas de lista. El SELECTOR de qué ver (Quién debe / Al día…): una tira con la elegida en el
   tono de la marca, para que no parezca un botón de acción (guía: un solo botón relleno por pantalla). */
body.tn-body .tn-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--tn-linea); border-radius: 12px; background: var(--tn-ventana, #fff); align-self: end; }
body.tn-body .tn-seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 9px; color: var(--tn-suave); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
body.tn-body .tn-seg a b { font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--tn-linea); color: var(--tn-tinta); }
body.tn-body .tn-seg a:hover { background: var(--tn-marca-suave); color: var(--tn-tinta); }
body.tn-body .tn-seg a.on { background: var(--tn-marca-suave); color: var(--tn-marca-osc); box-shadow: inset 0 0 0 1px var(--tn-marca-linea); }
body.tn-body .tn-seg a.on b { background: var(--tn-marca-osc); color: #fff; }
body.tn-body .cl-barra .cl-barra-der { margin-left: auto; }
body.tn-body .cl-pantalla > .cl-barra .tn-seg + input + .form-group, body.tn-body .cl-pantalla > .cl-barra .tn-seg ~ .form-group { flex: 0 1 320px; }
/* Tabla de una lista con filas altas (cuotas, encargos): la cabecera fija y el resto como la de Clientes. */
body.tn-body table.cu-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
body.tn-body .cu-tabla th { position: sticky; top: 0; z-index: 1; background: var(--tn-marca-suave); color: var(--tn-tinta); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 9px 10px; }
body.tn-body .cu-tabla td { padding: 9px 10px; vertical-align: middle; border-top: 1px solid var(--tn-linea); text-align: left; }
body.tn-body .cu-tabla tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tn-marca-suave) 35%, transparent); }
body.tn-body .cu-tabla td.cl-nom a { font-weight: 600; color: var(--tn-tinta); text-decoration: none; }
body.tn-body .cu-tabla td.cl-nom a:hover { text-decoration: underline; }
body.tn-body .cu-tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.tn-body .cu-cobrar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0; }
body.tn-body .cu-recibos { display: flex; flex-direction: column; gap: 3px; }
body.tn-body .cu-recibos label { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; white-space: nowrap; }
body.tn-body .cl-lista > .tn-vacio { flex: 1; }
@media (max-width: 900px) { body.tn-body .cl-barra .cl-barra-der { margin-left: 0; } body.tn-body .cu-recibos label { white-space: normal; } body.tn-body .cu-tabla th { position: static; } }body.tn-body .cu-pila { display: flex; flex-direction: column; gap: 16px; max-width: 1280px; overflow-y: auto; scrollbar-width: thin; }
body.tn-body .cu-pila > .card { flex-shrink: 0; }
/* Tarifas y bonos lado a lado cuando caben sin partir los importes (Jesús, 29-10: «ordénala», ocupaba media pantalla). */
@media (min-width: 1500px) {
    body.tn-body .cu-pila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; max-width: none; }
}
body.tn-body .cu-tabla td.cu-acc { text-align: right; white-space: nowrap; }
body.tn-body .cu-tabla td.cu-acc form { display: inline; }
body.tn-body .tn-card-cab + .cu-tabla, body.tn-body .tn-card-cab + .tn-vacio { margin-top: 10px; }
/* Gastos (fiscal_pantallas.php): a todo el ancho, con la barra de lista común y las cifras sin bordes de colores. */
body.tn-body .fg { max-width: none; padding-bottom: 0; }
body.tn-body .fg-barra { background: var(--tn-ventana, #fff); border: 1px solid var(--tn-linea); border-radius: 16px; padding: 10px 14px; margin-bottom: 12px; }
body.tn-body .fg-filtros { flex: 1 1 auto; }
body.tn-body .fg-filtros input[type=search] { flex: 1 1 220px; max-width: 320px; }
body.tn-body .fg-sp { display: none; }
body.tn-body .fg-barra > :is(a, form):first-of-type:not(.fg-filtros) { margin-left: auto; }
body.tn-body .fg-kpi { border-radius: 14px; border-color: var(--tn-linea); }
body.tn-body .fg-kpi b { font-size: 24px; }
body.tn-body .fg-card { border-color: var(--tn-linea); border-radius: 16px; }
body.tn-body .fg-card .tn-vacio { padding: 36px 16px; }/* Productos: la categoría, estrecha; la tabla, con las cifras a la derecha; el estado es un chip que se toca. */
body.tn-body .cl-pantalla > .cl-barra .form-group.pr-cat { flex: 0 1 240px; }
body.tn-body .pr-tabla td.cu-acc, body.tn-body .pr-tabla th:last-child { text-align: right; white-space: nowrap; }
body.tn-body .pr-tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.tn-body button.pr-estado { border: 0; cursor: pointer; font-family: inherit; }
body.tn-body button.pr-estado:hover { filter: brightness(.96); text-decoration: underline; }body.tn-body .cl-pantalla > .cl-barra .form-group.pr-cat select { width: 100%; max-width: none; }
body.tn-body .cl-pantalla > .cl-barra:has(.pr-cat) .form-group:not(.pr-cat) { flex: 1 1 200px; max-width: 380px; }
body.tn-body .cl-pantalla > .cl-barra:has(.pr-cat) .form-group.pr-cat { flex: 0 1 200px; }/* Las flechas de página de las LISTAS de la gestión, secundarias (en el TPV siguen grandes y rellenas: se tocan con
   prisa). Rellenas competían con el único botón principal de la pantalla (revisión de diseño, 28-10). */
html body.tn-body .tn-gestion .tn-contenido .tn-pag button { width: 64px; height: 44px; font-size: 22px; background: var(--tn-ventana, #fff); color: var(--tn-marca-osc); border-color: var(--tn-linea); }
html body.tn-body .tn-gestion .tn-contenido .tn-pag button:not(:disabled):hover { background: var(--tn-marca-suave); }
html body.tn-body .tn-gestion .tn-contenido .tn-pag button:disabled { color: var(--tn-suave); }
/* Nuevo documento (revisión de diseño, 28-10): el tipo, una tira sin tarjeta alrededor; títulos como en el resto; lo que
   falta para poder hacerlo, en gris (es una ayuda, no un error); los botones de cobro apagados, claros y no gris pizarra. */
body.tn-body .nd-cab { background: transparent; border: 0; box-shadow: none; padding: 0; }
body.tn-body .nd h3 { text-transform: none; letter-spacing: 0; color: var(--tn-tinta); }
body.tn-body .nd-total span { text-transform: none; letter-spacing: 0; font-size: 17px; color: var(--tn-tinta); }
body.tn-body .nd-porque { color: var(--tn-suave); font-weight: 500; display: flex; gap: 6px; align-items: baseline; }
body.tn-body .nd-porque::before { content: "i"; flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--tn-linea); color: var(--tn-tinta); font: 700 12px/18px var(--tn-sans); text-align: center; }
body.tn-body .nd-acciones .btn:disabled { background: var(--tn-fondo); color: var(--tn-suave); border: 1px dashed var(--tn-linea); opacity: 1; cursor: not-allowed; box-shadow: none; }
body.tn-body .nd-buscar input[type=search] { max-width: none; flex: 1 1 auto; }
body.tn-body .nd-falta { background: var(--tn-aviso-suave); }
body.tn-body .nd-falta > span { color: var(--tn-aviso); }body.tn-body .nd { height: 100%; grid-template-rows: auto minmax(0, 1fr); align-content: start; }
body.tn-body .nd:has(> .nd-hecho) { grid-template-rows: auto auto minmax(0, 1fr); }
body.tn-body .nd-cols { min-height: 0; height: 100%; }
body.tn-body .nd-main { min-height: 0; max-height: 100%; overflow-y: auto; scrollbar-width: thin; align-content: start; padding-bottom: 2px; }
body.tn-body .nd-cab { justify-content: flex-start; }
body.tn-body .tn-contenido form.nd-buscar[method="get"] input[type=search] { max-width: none; flex: 1 1 auto; }
@media (max-width: 1100px) { body.tn-body .nd, body.tn-body .nd-cols { height: auto; } body.tn-body .nd-main { max-height: none; overflow: visible; } }
/* El campo de ARCHIVO común (tn_archivo() en tn_iconos.php). */
body.tn-body .tn-archivo { position: relative; display: flex; align-items: center; gap: 12px; flex: 1 1 320px; max-width: 520px; min-height: 56px; padding: 8px 16px; margin: 0;
    border: 1.5px dashed var(--tn-marca-linea); border-radius: 14px; background: var(--tn-marca-suave); cursor: pointer; font-weight: 400; }
body.tn-body .tn-archivo:hover, body.tn-body .tn-archivo:focus-within { border-color: var(--tn-marca); }
body.tn-body .tn-archivo:focus-within { outline: 2px solid var(--tn-marca); outline-offset: 2px; }
body.tn-body .tn-archivo > svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--tn-marca-osc); }
body.tn-body .tn-archivo-tx { display: grid; gap: 1px; min-width: 0; }
body.tn-body .tn-archivo-tx b { color: var(--tn-marca-osc); font-size: 15px; }
body.tn-body .tn-archivo-tx small { color: var(--tn-suave); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tn-body .tn-archivo.lleno .tn-archivo-tx small { color: var(--tn-tinta); font-weight: 600; }
body.tn-body .tn-archivo input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }body.tn-body .card .aj-fila > .tn-archivo + .btn { align-self: center; }
body.tn-body .cio-puntos { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--tn-suave); max-width: 72ch; }
/* Un botón suelto dentro de una tarjeta, de su ancho (la guía: nada de botones a todo el ancho). */
body.tn-body .tn-hoja > .card > .btn, body.tn-body .aj-pila > .card > .btn { align-self: flex-start; }
body.tn-body .tn-archivo > .tn-ic { width: 28px; height: 28px; flex-shrink: 0; }
body.tn-body table .nw { white-space: nowrap; }
body.tn-body .rg-saldo { color: var(--tn-tinta); font-size: 15px; }
/* «Leer con la cámara» (escaner.js) junto a su campo en una barra de lista, no debajo. */
body.tn-body .cl-barra .form-group:has(> .esc-campo) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: end; max-width: 640px; }
body.tn-body .cl-barra .form-group:has(> .esc-campo) > label { grid-column: 1 / -1; }
body.tn-body .cl-barra .esc-campo { margin-top: 0 !important; }
body.tn-body .cl-pantalla > .card.cad-barra { align-items: center; }
body.tn-body .cad-barra .tn-seg { align-self: center; }
/* Ajustes · «Para empezar» en una línea: título con su barrita y, al lado, solo lo que falta. */
body.tn-body .aj-empezar { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
body.tn-body .aj-empezar h2 { margin: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
body.tn-body .aj-empezar li.hecho { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.tn-body .aj-progreso { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--tn-linea); overflow: hidden; }
body.tn-body .aj-progreso i { display: block; height: 100%; background: var(--tn-ok); border-radius: 3px; }/* «Más ▾» de una barra de acciones: un menú pequeño bajo el botón. */
body.tn-body .tn-mas-acc { position: relative; display: inline-block; }
body.tn-body .tn-mas-acc > summary { list-style: none; cursor: pointer; }
body.tn-body .tn-mas-acc > summary::-webkit-details-marker { display: none; }
body.tn-body .tn-mas-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; display: grid; padding: 6px; border-radius: 14px;
    background: var(--tn-ventana, #fff); border: 1px solid var(--tn-linea); box-shadow: 0 12px 30px rgba(15, 42, 51, .14); }
body.tn-body .tn-mas-menu a { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--tn-tinta); font-weight: 600; text-decoration: none; white-space: nowrap; }
body.tn-body .tn-mas-menu a:hover { background: var(--tn-marca-suave); }
body.tn-body .tn-seg.mrg-vistas, body.tn-body .mrg-dias .tn-seg, body.tn-body .mrg-por.tn-seg { align-self: center; }
body.tn-body .mrg-dias { display: inline-flex; align-items: center; gap: 8px; }
body.tn-body .mrg-por.tn-seg a { min-height: 32px; font-size: 13px; }
/* Horario de una profesional: «Guardar horario» es lo principal; apuntar vacaciones, secundario y de su ancho. */
body.tn-body .btn.ho-apuntar { justify-self: start; align-self: flex-start; width: auto; }

/* REDISEÑO · TANDA 3 · «Hoy» como panel: las cifras arriba (fila de 3-4) y las tarjetas debajo a su alto natural. */
body.tn-body .tn-hoy { grid-template-rows: auto minmax(0, 1fr); align-items: start; align-content: start; }
body.tn-body .tn-hoy > .card { max-height: 100%; }
body.tn-body .hoy-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
body.tn-body .hoy-kpi { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 96px; padding: 14px 20px; border-radius: 18px;
    background: var(--tn-papel, #fff); border: 1px solid var(--tn-linea); }
body.tn-body .hoy-kpi > b { font-size: 30px; font-weight: 700; line-height: 1; color: var(--tn-tinta); font-variant-numeric: tabular-nums; }
body.tn-body .hoy-kpi > small { font-size: 13px; color: var(--tn-suave); }
body.tn-body .hoy-kpi.grande { background: var(--tn-marca-suave); border-color: var(--tn-marca-linea); }
body.tn-body .hoy-kpi .hoy-gordo { font-size: clamp(32px, 3.4vw, 46px); }
body.tn-body .tn-hoy .hoy-mas { margin-top: 6px; }
@media (max-height: 640px) and (min-width: 901px) { body.tn-body .hoy-kpi { min-height: 76px; padding: 10px 16px; } body.tn-body .hoy-kpi > b { font-size: 24px; } }
@media (max-width: 900px) { body.tn-body .hoy-kpis { grid-template-columns: 1fr 1fr; } body.tn-body .hoy-kpi.grande { grid-column: 1 / -1; } }/* Las cifras de un panel (Hoy, Resumen): la etiqueta y los colores de estado, también fuera de .tn-hoy. */
body.tn-body .hoy-kpi .hoy-eti { font-size: 13px; font-weight: 700; color: var(--tn-suave); }
body.tn-body .hoy-kpi.ok > b { color: #15803D; } body.tn-body .hoy-kpi.mal > b { color: #B91C1C; }
body.tn-body .tn-resumen .rs-frases { flex: 0 0 auto; max-width: 980px; }
body.tn-body .tn-resumen .rs-frases p:last-of-type { margin-bottom: 0; }body.tn-body .tn-informe > .hoy-kpis + .grid { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.tn-body .tn-informe .chart-head h3 { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; }
body.tn-body .hoy-kpi.grande > small { margin-top: 2px; }@media (max-height: 640px) and (min-width: 901px) { body.tn-body .hoy-kpi .hoy-gordo { font-size: 30px; } body.tn-body .hoy-kpi.grande > small { display: none; } }
/* Ventana Regalo: sus dos pestañas. */
body.tn-body .rg-pest { align-self: flex-start; margin: 6px 0 4px; }
body.tn-body .rg-pest a { min-height: 44px; font-size: 15px; }
body.tn-body #vRegalo form[hidden] { display: none !important; }
body.tn-body .tn-fila .tn-seg, body.tn-body .card.tn-fila > .tn-seg { align-self: center; }
/* Un botón principal que cierra una tarjeta lateral (Etiquetas: «Imprimir etiquetas»), de su ancho. */
body.tn-body .tn-hoja > .card > form > .btn:last-child:not(.btn-sm) { align-self: flex-start; width: auto; }
/* Cierre del mes: la marca de cada repaso (verde bien, ámbar a revisar: regla 3). */
body.tn-body .gn-marca { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 800; vertical-align: -3px; margin-right: 4px; }
body.tn-body .gn-marca.ok { background: var(--tn-ok-suave); color: var(--tn-ok); }
body.tn-body .gn-marca.av { background: var(--tn-aviso-suave); color: var(--tn-aviso); }
body.tn-body .gn-meses.tn-seg a b { background: var(--tn-ok-suave); color: var(--tn-ok); }
/* El menú «Más» de las pestañas se abre hacia la izquierda: en el móvil, abierto hacia la derecha se salía de la pantalla. */
.tn-pest-mas-lista { left: auto; right: 0; }
/* Móvil: la parte derecha de la cabecera (Casi, ayuda, cerrar) baja de línea si no cabe, en vez de salirse. */
@media (max-width: 600px) { .tn-gestion .tn-cab-der { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; min-width: 0; flex-shrink: 1; } .tn-gestion .tn-cab-der .tn-btn.pri { flex: 1 1 100%; order: 9; } }

/* ---------- Una sola ficha de cliente (29-10): lo de la agenda y lo de las compras juntos ----------
   El historial con «Citas | Compras» arriba a la derecha de su título; cada tabla en su caja
   (.fi-hist-parte), que deja pasar el alto para que tienda.js pagine dentro y, escondida, no ocupa.
   Las acciones que son un formulario (Vender a su nombre) se ven como un botón más de la barra, y
   dentro de «Más» como una línea del menú. */
.tn-ficha .fi-hist-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
/* Su título, como el de las demás tarjetas (no es el primer «strong» de la tarjeta: va junto a «Citas | Compras»). */
.tn-ficha .fi-hist-cab > strong { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
.tn-ficha .fi-hist-seg a { min-height: 34px; padding: 0 12px; }
.tn-ficha .fi-hist-parte { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tn-ficha .fi-hist-parte[hidden] { display: none; }
.tn-ficha .fi-barra form.fi-accion { display: inline-flex; margin: 0; }
body.tn-body .tn-mas-menu form { display: contents; }
body.tn-body .tn-mas-menu button { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--tn-tinta); font: inherit; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
body.tn-body .tn-mas-menu button:hover { background: var(--tn-marca-suave); }
/* Desde el mostrador, «Garantía de la tienda: N meses» pide el PIN de administración: su candado. */
body.tn-body .cl-barra-der .tn-ico-l, body.tn-body .cl-barra-der svg { width: 15px; height: 15px; margin-left: 6px; opacity: .7; }
/* Revisión de la lista única (29-10): en el móvil la lista de la agenda (est-tabla) no se queda en 820 px (su
   min-width ganaba al de las tarjetas apiladas y se salía de lado); y el Resumen de la ficha, que con la agenda
   y «Clientes y puntos» junta muchas filas, baja dentro de su tarjeta en vez de cortarse a 545 de alto. */
@media (max-width: 899px) { body.tn-body table.cl-tabla.est-tabla { min-width: 0; } }
body.tn-body .tn-ficha .fi-cols > .card.fi-resumen { overflow-y: auto; overscroll-behavior: contain; }
/* El logo (el del negocio o, sin él, el de Stoki: 29-10) nunca más alto que su hueco: en el TPV bajo (545 px) el hueco
   mide 46 px y la imagen de 60 se montaba sobre el primer botón de la columna. */
.tn-logo { grid-template-rows: minmax(0, 1fr); }
.tn-logo img { max-height: min(60px, 100%); }
/* Portada de Ajustes: los grupos, uno debajo de otro en columnas, sin huecos (Jesús, 29-10: «si muevo el tamaño de la
   ventana mira lo que pasa»). En rejilla, cada fila medía lo del grupo más largo («El mostrador», cuatro tarjetas) y
   la fila siguiente empezaba por debajo: quedaban huecos enormes que cambiaban con el ancho de la ventana. */
body.tn-body .tn-ajustes .aj-portada { display: block; columns: 280px; column-gap: 18px; }
body.tn-body .tn-ajustes .aj-portada > * { break-inside: avoid; margin-bottom: 16px; }
body.tn-body .tn-ajustes .aj-portada > .aj-buscar-caja, body.tn-body .tn-ajustes .aj-portada > .aj-vacio { column-span: all; }
@media (max-height: 700px) and (min-width: 901px) {
    body.tn-body .tn-ajustes .aj-portada { columns: 230px; column-gap: 14px; }
    body.tn-body .tn-ajustes .aj-portada > * { margin-bottom: 10px; }
}

/* ============================================================
   TPV · REJILLA DE CATEGORÍAS (30-10). Con muchos productos el TPV abre en baldosas de
   categoría (foto o icono, y cuántos artículos). Dentro de una, «← Categorías» y su nombre en
   una barra de 50 px, el mismo alto que tenía la fila de pestañas: la rejilla no cambia de
   tamaño al entrar y salir. Botón de 50 px: se acierta con el dedo.
   ============================================================ */
.tv-migas { display: flex; align-items: center; gap: 14px; min-width: 0; height: 50px; }
.tv-migas[hidden] { display: none; }
.tv-migas .tn-btn { height: 50px; padding: 0 20px; font-size: 16px; flex-shrink: 0; }
.tv-migas b { font-family: var(--tn-serif, inherit); font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-catb-ico .tn-ic, .tv-catb-ico svg { width: 46%; height: 46%; object-fit: contain; }
.tv-catb-ico svg { stroke: var(--tn-marca); fill: none; stroke-width: 1.4; }
.tv-catb .tv-catb-n { color: var(--tn-suave); font-weight: 500; }
.tv-catb .tn-redondo { font-size: 22px; line-height: 1; }
/* Catálogo → Categorías: la foto en la lista y en su ventana. */
.cat-foto { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.cat-foto.grande { width: 72px; height: 72px; border-radius: 12px; }
.cat-foto-fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
/* Sin la barra de «← Categorías» (inicio de la rejilla de categorías) la rejilla sube a la segunda fila y se queda
   con TODO el alto: si no, caía en una fila «auto» y medía lo que su contenido (baldosas de 110 px). */
.tv-cat:has(> .tv-migas[hidden]) { grid-template-rows: auto minmax(0, 1fr); }

/* El «N artículos» de una baldosa, pequeño y gris: sin esto heredaba los 21 px del precio y no cabía. */
.tv-catb .tv-pie span.tv-catb-n { font-size: 13.5px; font-weight: 500; margin-top: 4px; color: var(--tn-suave); }

/* La fila de la foto va dentro de la ventana del icono, cuyos formularios son columnas: sin esto la caja de
   «Poner una foto» tomaba 320 px de ALTO (su flex-basis) y tapaba la lista de iconos. */
.cat-ico-ventana .cat-foto-fila form { flex-direction: row; }
.cat-ico-ventana .cat-foto-fila .tn-archivo { flex: 0 1 360px; }

/* Muchas categorías (rejilla «densa», sin fotos grandes): la foto o el icono de cada una, en pequeño a la izquierda.
   Si no, la foto de la categoría (lo que pidió Jesús) desaparecía justo en las tiendas con más categorías. */
.tv-rejilla.densa .tv-catb .tv-ficha { grid-template-rows: 1fr; grid-template-columns: 56px minmax(0, 1fr); }
.tv-rejilla.densa .tv-catb .tv-foto { display: grid; width: 46px; height: 46px; margin: 0 0 0 10px; align-self: center; border-radius: 10px; }
.tv-rejilla.densa .tv-catb .tv-pie { padding-left: 10px; }

/* En la rejilla densa el «›» quitaba el sitio del nombre (la baldosa entera ya se toca). */
.tv-rejilla.densa .tv-catb .tn-redondo { display: none; }
.tv-rejilla.densa .tv-catb .tv-pie { grid-template-columns: minmax(0, 1fr); }

/* La baldosa de categoría, como una tarjeta (Jesús, 30-10: «tiene que salir bonito, no a lo bruto»). Arriba, la
   foto quedaba en una franja baja y ancha (recortada, o diminuta). Ahora: un CUADRO a la izquierda con la foto
   entera sobre blanco (o el icono sobre su color), del alto de la baldosa, y a la derecha el nombre (hasta dos
   líneas) y cuántos artículos. Igual con foto o sin ella. Toda la baldosa se toca: sin el «›». */
.tv-rejilla .tv-catb .tv-ficha { grid-template-rows: 1fr; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.tv-rejilla .tv-catb .tv-foto { display: grid; width: calc(var(--tv-alto, 96px) - 18px); height: calc(var(--tv-alto, 96px) - 18px);
    margin: 0 0 0 9px; align-self: center; border-radius: 14px; }
.tv-rejilla .tv-catb .tv-foto:not(.tv-catb-ico) { background: radial-gradient(120% 100% at 50% 30%, #FFFFFF 0%, var(--tn-marca-suave) 82%); }
.tv-rejilla .tv-catb .tv-foto img { padding: 7px; }
/* La tarjeta, con un velo de color muy suave de izquierda a derecha y sombra al pasar: no una caja plana. */
.tv-rejilla .tv-catb .tv-ficha { background: linear-gradient(100deg, color-mix(in srgb, var(--tn-marca-suave) 55%, #fff) 0%, #fff 55%); }
.tv-rejilla .tv-catb .tv-ficha:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--tn-marca) 14%, transparent); }
.tv-rejilla .tv-catb .tv-pie { padding: 0 14px; grid-template-columns: minmax(0, 1fr); align-self: center; }
.tv-rejilla .tv-catb .tv-pie b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; line-height: 1.2;
    font-size: 15.5px; overflow-wrap: normal; word-break: normal; hyphens: none; }
.tv-rejilla .tv-catb .tn-redondo { display: none; }
/* También con muchas categorías (rejilla densa): el cuadro de la foto, del alto de la baldosa (antes 46 px: no se veía). */
.tv-rejilla.densa .tv-catb .tv-ficha { grid-template-columns: auto minmax(0, 1fr); }
.tv-rejilla.densa .tv-catb .tv-foto { width: calc(var(--tv-alto, 80px) - 16px); height: calc(var(--tv-alto, 80px) - 16px); margin: 0 0 0 8px; border-radius: 12px; }
.tv-rejilla.densa .tv-catb .tv-pie { padding: 0 10px; }
.tv-rejilla.densa .tv-catb .tv-foto img { padding: 4px; }

/* ===== ANTES DE TIEMPO (31-10) =====
   Jesús: «al dar en Catálogo me carga la primera pantalla por uno o dos segundos». Mientras la página llega,
   tienda.js aún no ha metido el formulario «Nuevo …» en su ventana ni repartido las filas en páginas, y se
   veían en su sitio provisional. html.tn-js lo pone tn_cabeza.php (hay JS); html.tn-listo, tienda.js al cargar. */
html.tn-js [data-tn-form]:not(.tn-form-dentro) { display: none !important; }
html.tn-js:not(.tn-listo) body.tn-body .tn-contenido table:not(.tn-sin-paginar) > tbody > tr:nth-child(n+16) { display: none; }
/* Al pasar de una pantalla a otra, un fundido corto en vez del parpadeo en blanco (navegadores que lo saben
   hacer; los demás cambian como siempre). Sin él para quien pide menos movimiento. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Recuperar la contraseña por correo (recuperar.php, 31-10): el aviso de «te hemos mandado un enlace» y la nota de la
   contraseña, dentro de la misma caja que «Entrar». El aviso no es verde: no se sabe si el correo existe (así nadie averigua
   qué correos tienen cuenta). El enlace-botón de la caja, centrado como el «Entrar». */
.tn-entrar-caja .tn-pin-ok { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--tn-marca-suave); color: var(--tn-tinta); font-size: 14.5px; line-height: 1.5; }
.tn-entrar-caja .tn-pin-nota { margin: -6px 0 0; font-size: 13px; color: var(--tn-suave); }
body.tn-body .tn-entrar-caja > a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ===== LA ✓ QUE SE MUEVE (31-10) =====
   tn_check_marca() (tn_iconos.php) dibuja la ✓ de Stoki cuando el negocio no tiene logo propio. En reposo está entera;
   tienda.js le pone cada 20-40 s UNA de estas tres, nunca la misma dos veces seguidas (Jesús: «que no sea aburrido»),
   con los tiempos y curvas de su «Stoki Logo Animado»: tc-dibuja (se vuelve a trazar y da el saltito), tc-brilla
   (un brillo la cruza) y tc-salta (salta y se aplasta al caer). Con «menos movimiento» en el aparato, quieta. */
.tn-logo svg.tn-check { width: auto; height: min(46px, 100%); aspect-ratio: 246 / 194; }
.tn-pin-logo .tn-check { width: 96px; height: auto; }
svg.tn-check { overflow: visible; }   /* el salto y el «pop» se salen un poco de su caja: que no se corten */
.tn-check .tc-corto, .tn-check .tc-largo { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tn-check .tc-todo { transform-box: view-box; transform-origin: 357px 470px; }
.tn-check .tc-brillo { transform-box: view-box; transform: translateX(-120px); }
.tn-check.tc-dibuja .tc-corto { animation: tcDibuja .45s cubic-bezier(.6,0,.4,1) both; }
.tn-check.tc-dibuja .tc-largo { animation: tcDibuja .6s cubic-bezier(.2,.7,.2,1) .4s both; }
.tn-check.tc-dibuja .tc-todo { animation: tcPop .5s cubic-bezier(.3,1.6,.5,1) .95s both; }
.tn-check.tc-brilla .tc-brillo { animation: tcBrillo 1.3s ease-in-out both; }
.tn-check.tc-salta .tc-todo { animation: tcSalta .9s cubic-bezier(.3,0,.3,1) both; }
@keyframes tcDibuja { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tcPop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes tcBrillo { from { transform: translateX(-120px); } to { transform: translateX(330px); } }
@keyframes tcSalta {
    0%, 100% { transform: none; }
    20% { transform: translateY(6px) scale(1.1, .88); }
    50% { transform: translateY(-34px) scale(.95, 1.06); }
    75% { transform: translateY(0) scale(1.08, .92); }
    88% { transform: translateY(-6px) scale(.98, 1.02); }
}
@media (prefers-reduced-motion: reduce) { .tn-check * { animation: none !important; } }

/* Subfamilias en Categorías (31-10): la subfamilia, metida un poco y con su flecha, debajo de su familia. */
.cat-sub td:nth-child(2) form { padding-left: 18px; }
.cat-rama { color: var(--tn-suave); font-weight: 700; align-self: center; }

/* TPV (31-10): mientras la página llega entera, la rejilla no se enseña desordenada (los miles de productos antes de
   repartirse en páginas: «se pone la página fea»). tn-listo lo pone tienda.js. Y el producto que se está añadiendo
   en segundo plano (pos_view.php, «AÑADIR SIN RECARGAR») se marca un instante. */
html.tn-js:not(.tn-listo) #tvRejilla, html.tn-js:not(.tn-listo) #tvPag { visibility: hidden; }
.tv-enviando .tv-ficha { opacity: .55; transition: opacity .1s; }

/* «Tickets» del TPV, buscar otro día o un número (31-10): el día, el número y «Buscar» en una fila, encima de la lista. */
.tvt-buscar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tvt-buscar input[type="date"] { width: auto; flex: 0 0 auto; height: 44px; }
.tvt-buscar input[type="search"] { flex: 1 1 140px; min-width: 0; height: 44px; }
.tvt-buscar .tn-btn { height: 44px; }

/* ===== COBRAR Y COBRADO (31-10) =====
   Jesús: «un botón de cobrar que abra una ventana para el tipo de cobro y, al hacerlo, un cartel de cobrado con el
   total, una simulación del ticket y Continuar». vCobrar: el total grande y un botón grande por forma (≥ 76 px: se toca
   con prisa). vCobrado: lo cobrado a la izquierda, el ticket a la derecha. Las dos caben a 1273×545 (regla 6). */
.tn-ventana.tvc { width: min(560px, 94vw); padding: 22px 24px; display: grid; gap: 14px; }
.tvc-cab { display: grid; gap: 2px; padding-right: 40px; }
.tvc-cab h2 { margin: 0; }
.tvc-total { font-size: 42px; line-height: 1.1; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--tn-tinta); }
.tvc-nota { color: var(--tn-suave); font-size: 13px; }
.tvc-paso { display: grid; gap: 12px; }
.tvc-paso[hidden] { display: none; }
.tvc-pide { margin: 0; font-size: 13px; font-weight: 600; color: var(--tn-suave); }
.tvc-formas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tvc-formas.muchas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tvc-forma { min-height: 76px; padding: 8px; border-radius: 14px; border: 1px solid var(--tn-linea); background: #fff; color: var(--tn-tinta);
             font: 700 17px var(--tn-sans); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-width: 0; }
.tvc-forma span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvc-forma svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0; }
.tvc-forma:hover, .tvc-forma:focus-visible { border-color: var(--tn-marca); outline: 2px solid var(--tn-marca); outline-offset: -2px; }
.tvc-forma:disabled { opacity: .55; cursor: wait; }
.tvc-pie { margin: 0; font-size: 13px; color: var(--tn-suave); }
#tvEntrega { min-height: 56px; font-size: 26px; font-weight: 700; text-align: center; border-radius: 12px; border: 1px solid var(--tn-linea); }
.tvc-botones { display: flex; gap: 10px; }
.tvc-botones .tn-btn { min-height: 52px; }
.tvc-botones .tk-cobrar { flex: 1; }

.tn-ventana.tvd { width: min(780px, 94vw); padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.tvd-iz { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.tvd-iz h2 { margin: 0; }
.tvd-ok { width: 56px; height: 56px; border-radius: 50%; background: var(--tn-ok); color: #fff; display: grid; place-items: center;
          font-size: 30px; font-weight: 800; animation: tvd-entra .35s ease-out; }
@keyframes tvd-entra { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tvd-ok { animation: none; } }
.tvd-total { font-size: 48px; line-height: 1.05; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--tn-tinta); }
.tvd-pago { color: var(--tn-suave); font-size: 15px; }
.tvd-cambio { font-size: 24px; font-weight: 800; padding: 6px 14px; border-radius: 12px; background: var(--tn-ok-suave); color: #14532D; }
.tvd-cambio[hidden] { display: none; }
.tvd-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.tvd-acc .tn-btn { min-height: 44px; }
.tvd-seguir { width: 100%; }
.tvd-papel { background: #fff; color: #222; border: 1px solid var(--tn-linea); border-radius: 6px; padding: 16px 16px 12px;
             font: 12.5px/1.45 ui-monospace, Consolas, "Courier New", monospace; box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .35);
             max-height: calc(100vh - 110px); overflow: hidden; }
.tvd-papel hr { border: 0; border-top: 1px dashed #BBB; margin: 8px 0; }
.tvd-fila { display: flex; justify-content: space-between; gap: 10px; }
.tvd-fila span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvd-fila span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tvd-neg { text-align: center; font-weight: 700; font-size: 14px; }
.tvd-gris { color: #6B6B6B; }
.tvd-tot { font-weight: 800; font-size: 15px; }
.tvd-gracias { text-align: center; margin-top: 10px; }
@media (max-width: 700px) {
    .tn-ventana.tvd { grid-template-columns: 1fr; }
    .tvd-papel { max-height: 240px; }
}
/* Menú del TPV → «Al abrir, enseñar» (31-10): una fila corta encima de la rejilla del menú. */
.tv-menu-inicio { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; color: var(--tn-suave); font-size: 13.5px; font-weight: 600; }
.tv-menu-inicio .tn-seg a { min-height: 44px; }

/* ===== LA BOLSA DEL TICKET VACÍO (31-10) =====
   tn_bolsa_viva() (tn_iconos.php), en el ticket vacío del TPV. Al salir se traza sola (asa y luego la bolsa); tienda.js
   le pone después, cada 12-25 s, una de tres: tb-cae (cae un paquetito del color del negocio y la bolsa se aplasta y
   rebota), tb-balancea (se mece colgada del asa) y tb-dibuja (se vuelve a trazar). Solo transform, opacity y el trazo:
   no mueve nada de alrededor (el TPV no se descoloca). Con «menos movimiento» en el aparato, quieta. */
.tk-vacio svg.tn-bolsa { overflow: visible; }
.tn-bolsa .tb-todo { transform-box: view-box; transform-origin: 12px 4px; }
.tn-bolsa .tb-asa, .tn-bolsa .tb-cuerpo { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tn-bolsa .tb-asa { animation: tbTraza .45s ease-out both; }
.tn-bolsa .tb-cuerpo { animation: tbTraza .7s cubic-bezier(.2,.7,.2,1) .3s both; }
.tk-vacio svg.tn-bolsa .tb-cosa { fill: var(--tn-marca); stroke: none; opacity: 0; transform-box: view-box; transform-origin: 12px 10.6px; }
.tn-bolsa.tb-dibuja .tb-asa { animation: tbTraza2 .45s ease-out both; }
.tn-bolsa.tb-dibuja .tb-cuerpo { animation: tbTraza2 .7s cubic-bezier(.2,.7,.2,1) .3s both; }
.tn-bolsa.tb-balancea .tb-todo { animation: tbMece 1.6s ease-in-out both; }
.tn-bolsa.tb-cae .tb-cosa { animation: tbCae 1.1s cubic-bezier(.5,0,.75,0) both; }
.tn-bolsa.tb-cae .tb-todo { transform-origin: 12px 20px; animation: tbAplasta 1.1s ease-out both; }
@keyframes tbTraza { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tbTraza2 { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tbMece {
    0%, 100% { transform: rotate(0); }
    18% { transform: rotate(9deg); }
    40% { transform: rotate(-7deg); }
    60% { transform: rotate(4deg); }
    80% { transform: rotate(-2deg); }
}
@keyframes tbCae {
    0% { transform: translateY(-14px) rotate(-20deg); opacity: 0; }
    12% { opacity: 1; }
    45% { transform: translateY(2px) rotate(8deg); opacity: 1; }
    62% { transform: translateY(5px) rotate(8deg); opacity: 0; }
    100% { transform: translateY(5px); opacity: 0; }
}
@keyframes tbAplasta {
    0%, 42% { transform: none; }
    52% { transform: scale(1.08, .9); }
    68% { transform: scale(.97, 1.04); }
    82%, 100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .tn-bolsa * { animation: none !important; } }

/* ===== LA FICHA DEL PRODUCTO EN DOS COLUMNAS (31-10, Jesús: «que quepa sin bajar») =====
   products.php: a la izquierda los datos (Nombre | Categoría, y Código | Precio | IVA) y «Compra y margen»; a la
   derecha las opciones. Con la ventana más ancha cabe entera a 1273×545 (antes medía 866 px de alto). Si aun así no
   cabe (todos los módulos, una pantalla más baja), la ventana se desplaza en vez de cortar lo de abajo. */
.tn-ventana-form:has(.pr-ficha) { width: min(1180px, 100%); padding: 16px 24px 14px; overflow-y: auto; overscroll-behavior: contain; }
.tn-form-dentro:has(.pr-ficha) { gap: 8px; }
.tn-form-dentro:has(.pr-ficha) > strong:first-child { font-size: 24px; }
.tn-form-dentro:has(.pr-ficha) > form { margin-top: 6px !important; }
.pr-ficha { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
.pr-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pr-opciones { border-left: 1px solid var(--tn-linea); padding-left: 24px; }
.pr-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "nom nom cat" "cod pre iva"; gap: 10px 12px; }
.pr-datos > :nth-child(1) { grid-area: nom; } .pr-datos > :nth-child(2) { grid-area: cod; } .pr-datos > :nth-child(3) { grid-area: cat; }
.pr-datos > :nth-child(4) { grid-area: pre; } .pr-datos > :nth-child(5) { grid-area: iva; }
/* El código con la cámara AL LADO (escaner.js, data-escaner="icono"): no añade una fila. */
.pr-codigo:has(.esc-icono) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; align-items: end; }
.pr-codigo:has(.esc-icono) > label { grid-column: 1 / -1; }
.esc-icono { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; margin: 0; }
.esc-icono svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.pr-ficha .prv-compra { margin-top: 2px; padding-top: 8px; gap: 8px; }
.pr-ficha .prv-margen { padding: 6px 12px; font-size: 13.5px; }
/* Las opciones: cada fila en tres columnas (casilla con su ayuda | campo | campo), sin márgenes propios. */
.pr-opciones .pr-fila3, .pr-opciones > .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 0 !important; align-items: end; }
.pr-opciones .pr-fila3 > :first-child, .pr-opciones > .grid > .form-group:has(input[type="checkbox"]) { align-self: start; }
body.tn-body .pr-ficha .tn-foto-campo { margin-top: 0; }
body.tn-body .pr-ficha .tn-foto-ver { width: 56px; height: 56px; font-size: 26px; }
.pr-ficha .pr-iconos { margin-top: 0; }
.pr-botones { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--tn-linea); }
.pr-archivar { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 960px) {
    .pr-ficha { grid-template-columns: 1fr; gap: 14px; }
    .pr-opciones { border-left: 0; padding-left: 0; border-top: 1px solid var(--tn-linea); padding-top: 12px; }
}
@media (max-width: 560px) {
    .pr-datos { grid-template-columns: 1fr 1fr; grid-template-areas: "nom nom" "cat cat" "cod cod" "pre iva"; }
    .pr-opciones .pr-fila3, .pr-opciones > .grid { grid-template-columns: 1fr 1fr; }
    .pr-archivar { margin-left: 0; }
    .pr-botones { flex-wrap: wrap; }
}
/* Foto e icono en una fila: la foto con su botón a la izquierda, el icono (plegado) a la derecha; abierto, ocupa la fila. */
.pr-imagen { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.pr-imagen .pr-foto .text-muted { display: none !important; }
.pr-imagen .pr-iconos[open] { grid-column: 1 / -1; }
.pr-imagen .pr-iconos summary { font-size: 14px; }

/* ===== EL CARTEL «COBRADO», ANIMADO (31-10, del diseño «Stoki TPV» que trajo Jesús) =====
   La ✓ del logo se dibuja dentro de su círculo verde (verde = bien, regla 3) y salen unas chispas; el texto sube
   detrás; el ticket baja por la ranura de una «impresora» a saltitos y con el borde de papel rasgado. Todo con
   transform, opacity y el trazo: no mueve nada fuera del cartel. Con «menos movimiento», todo quieto y a la vista. */
.tvd .tvd-ok { width: 84px; height: 84px; border-radius: 0; background: none; display: block; overflow: visible; animation: none; }
.tvd-ok .tvd-fondo { fill: var(--tn-ok-suave); transform-box: fill-box; transform-origin: center; animation: tvdCrece .55s cubic-bezier(.3,1.5,.5,1) .35s both; }
.tvd-ok .tvd-aro { fill: none; stroke: var(--tn-ok); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tvdTraza .7s cubic-bezier(.6,0,.3,1) .05s forwards; }
.tvd-ok .tvd-t1, .tvd-ok .tvd-t2 { stroke-width: 20; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tvd-ok .tvd-t1 { stroke: #4FE8EF; animation: tvdTraza .3s ease-out .6s forwards; }
.tvd-ok .tvd-t2 { stroke: #22C4EC; mix-blend-mode: multiply; animation: tvdTraza .4s ease-out .85s forwards; }
.tvd-ok .tvd-chispas { fill: none; stroke: var(--tn-ok); stroke-width: 6; stroke-linecap: round; opacity: 0; transform-box: view-box; transform-origin: 100px 100px; animation: tvdChispa .9s ease-out 1.1s both; }
@keyframes tvdTraza { to { stroke-dashoffset: 0; } }
@keyframes tvdCrece { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes tvdChispa { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
.tvd-iz > h2, .tvd-iz > .tvd-total, .tvd-iz > .tvd-pago { animation: tvdSube .45s ease-out both; }
.tvd-iz > h2 { animation-delay: .5s; } .tvd-iz > .tvd-total { animation-delay: .62s; } .tvd-iz > .tvd-pago { animation-delay: .74s; }
@keyframes tvdSube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tvd-impresora { position: relative; padding-top: 14px; overflow: hidden; min-width: 0; }
.tvd-ranura { position: absolute; top: 0; left: 6px; right: 6px; height: 16px; border-radius: 10px; background: #1B2433; z-index: 2; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .45); }
.tvd-impresora .tvd-papel { border-radius: 0; border-top: 0; animation: tvdImprime 1.8s steps(12) .3s both;
    -webkit-mask: linear-gradient(#000 calc(100% - 8px), transparent 0), radial-gradient(circle 5px at 8px 100%, transparent 5px, #000 5.5px) 0 100% / 16px 8px repeat-x;
            mask: linear-gradient(#000 calc(100% - 8px), transparent 0), radial-gradient(circle 5px at 8px 100%, transparent 5px, #000 5.5px) 0 100% / 16px 8px repeat-x;
    padding-bottom: 18px; max-height: calc(100vh - 124px); }
@keyframes tvdImprime { from { transform: translateY(-105%); } to { transform: none; } }
/* «Por correo»: en la misma fila que los botones (el cartel no crece). */
.tvd-correo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: 100%; margin-top: auto; padding-top: 8px; }
.tvd-correo[hidden], .tvd-acc[hidden] { display: none; }
.tvd-correo input[type="email"] { min-height: 44px; border-radius: 10px; border: 1px solid var(--tn-linea); padding: 0 12px; font-size: 15px; min-width: 0; }
.tvd-correo .tn-btn { min-height: 44px; }
.tvd-correo-msg { grid-column: 1 / -1; font-size: 13px; color: var(--tn-suave); min-height: 0; }
.tvd-correo-msg.ok { color: var(--tn-ok); } .tvd-correo-msg.mal { color: var(--tn-mal); }
@media (prefers-reduced-motion: reduce) {
    .tvd-ok *, .tvd-iz > *, .tvd-impresora .tvd-papel { animation: none !important; }
    .tvd-ok .tvd-aro, .tvd-ok .tvd-t1, .tvd-ok .tvd-t2 { stroke-dashoffset: 0; }
}

/* ===== ¿QUIÉN ATIENDE? (31-10, dependientes; includes/dependientes.php) =====
   La ventana sin cerrar: las personas como círculos grandes con sus iniciales (se tocan con el dedo) y el teclado
   del PIN al lado. Cabe a 1273×545 con hasta ocho personas (luego pasan a la siguiente fila y la ventana baja).
   En la cabecera del TPV, quién atiende y «Cambiar». */
/* ¿QUIÉN ATIENDE? (rehecha el 10-11, maqueta «J2» de Jesús): primero la gente, CENTRADA; al tocar a alguien, a la
   izquierda su foto con la aurora de los colores de su foto y a la derecha el teclado. Mide como mucho ~330 px de
   alto con su pie: cabe a 1273 × 545 sin bajar (regla 6). Teclas de 56 px (dedo). */
.tn-ventana.tvq { width: min(860px, 96vw); padding: 26px 28px 16px; display: grid; gap: 16px; }
.tvq h2 { margin: 0; text-align: center; }
.tvq-p1 { display: grid; gap: 20px; justify-items: center; padding: 6px 0 2px; }
.tvq-gente { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 100%; }
/* Cada persona es SOLO su foto y su nombre (Jesús, 10-11: «noto innecesario el borde»; eligió «solo la foto»). Al pasar
   el ratón o tocarla, un anillo del color del negocio alrededor de la foto. Toda la tarjeta (120 px) se puede tocar. */
.tvq-persona { width: 120px; display: grid; justify-items: center; gap: 8px; padding: 8px 6px; border: 0; border-radius: 16px;
    background: transparent; color: var(--tn-tinta); font: inherit; cursor: pointer; transition: transform .15s;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tvq-persona .tvq-av { transition: box-shadow .15s, transform .15s; }
.tvq-persona:hover .tvq-av, .tvq-persona:active .tvq-av { box-shadow: 0 0 0 3px var(--tn-papel), 0 0 0 6px var(--tn-marca); }
.tvq-persona:active .tvq-av { transform: scale(.96); }
.tvq-persona:focus-visible { outline: none; }
.tvq-persona:focus-visible .tvq-av { box-shadow: 0 0 0 3px var(--tn-papel), 0 0 0 6px var(--tn-marca); }
/* El TPV de detrás, un poco difuminado (Jesús: «flojito»): la ventana destaca sin que se pierda dónde estás. */
#vQuien.tn-velo { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@media (prefers-reduced-transparency: reduce) { #vQuien.tn-velo { -webkit-backdrop-filter: none; backdrop-filter: none; } }
.tvq-av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; position: relative;
    color: #fff; font: 800 22px var(--tn-sans); background: hsl(var(--h, 200) 55% 36%); }
.tvq-av.con-foto { background: var(--tn-marca-suave); }
.tvq-av img, .tv-quien-av img, .eq-foto-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-quien-av.con-foto, .eq-foto-av.con-foto { overflow: hidden; background: var(--tn-marca-suave); }
.tvq-nom { font-weight: 700; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.tvq-p2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 32px; align-items: center; padding: 4px 0; }
.tvq-p2[hidden], .tvq-p1[hidden] { display: none; }
.tvq-yo { display: grid; justify-items: center; gap: 10px; min-width: 0; }
.tvq-foto { position: relative; width: 96px; height: 96px; margin: 16px 0 6px; }
.tvq-av.grande { width: 96px; height: 96px; font-size: 34px; z-index: 1; box-shadow: 0 0 0 4px #fff; }
/* La aurora: dos luces difuminadas que giran despacio detrás de la foto, con los colores de la foto (--a1, --a2 los
   pone el script). Gira el conjunto (transform): el difuminado se calcula una vez y la tablet no sufre. */
.tvq-aurora { position: absolute; inset: -28px; border-radius: 50%; opacity: 0; transition: opacity .5s; pointer-events: none; }
.tvq-aurora.on { opacity: 1; animation: tvqGira 7s linear infinite; }
.tvq-aurora i { position: absolute; width: 64%; height: 64%; border-radius: 50%; filter: blur(12px); opacity: .85; }
.tvq-aurora i:first-child { left: 0; top: 0; background: var(--a1, #55EBFD); }
.tvq-aurora i:last-child { right: 0; bottom: 0; background: var(--a2, #01B9D9); }
@keyframes tvqGira { to { transform: rotate(360deg); } }
.tvq-yo-nom { font-size: 19px; font-weight: 800; text-align: center; overflow-wrap: anywhere; position: relative; z-index: 2; }
/* La luz se sale del círculo a propósito; el nombre, los huecos y «No soy yo» van siempre por encima de ella. */
.tvq-huecos, .tvq-cambiar, .tvq-error { position: relative; z-index: 2; }
.tvq-huecos { display: flex; gap: 10px; min-height: 16px; }
.tvq-huecos span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tn-marca-linea); box-sizing: border-box;
    transition: background .15s, border-color .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.tvq-huecos span.on { background: var(--tn-marca); border-color: var(--tn-marca); transform: scale(1.15); }
.tvq-huecos.mal span { border-color: var(--tn-mal); }
.tvq-cambiar { background: none; border: 0; color: var(--tn-marca); font: 600 14px var(--tn-sans); cursor: pointer; min-height: 40px; padding: 8px 12px; }
/* El teclado del PIN es el «K2» que eligió Jesús (10-11): solo los números, sin cajas; al tocar uno se marca un fondo
   suave del color del negocio, y «Entrar» es un círculo con una flecha (apagado hasta 4 cifras). Cada tecla sigue
   midiendo 54 px de alto y un tercio del ancho: se acierta con el dedo aunque no se vea el borde. */
.tvq-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; justify-items: stretch; }
.tvq-k { height: 54px; border: 0; border-radius: 14px; background: transparent; color: var(--tn-tinta); font: 400 28px var(--tn-sans);
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
    transition: transform .08s, background .12s, color .12s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tvq-k:hover { background: var(--tn-marca-suave); }
.tvq-k:active { transform: scale(.93); background: var(--tn-marca-suave); color: var(--tn-marca); }
.tvq-k:focus-visible { outline: 3px solid var(--tn-marca); outline-offset: 2px; }
.tvq-borrar { color: var(--tn-marca); }
.tvq-ok { justify-self: center; width: 54px; border-radius: 50%; background: var(--tn-marca); color: #fff; opacity: .4; transition: opacity .2s, transform .08s; }
.tvq-ok:hover, .tvq-ok:active { background: var(--tn-marca); color: #fff; }
.tvq-ok.listo { opacity: 1; }
.tvq-ok svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tvq-teclado.tiembla { animation: tvqTiembla .35s; }
@keyframes tvqTiembla { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.tvq-ayuda { margin: 0; color: var(--tn-suave); text-align: center; }
.tvq-botones { display: flex; justify-content: center; }
.tvq-error { margin: 0; color: var(--tn-mal); font-weight: 600; text-align: center; }
.tvq-pie { display: flex; justify-content: space-between; color: var(--tn-suave); font-size: 13px; border-top: 1px solid var(--tn-linea); padding-top: 10px; }
@media (max-width: 700px) {
    .tvq-p2 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .tvq-foto, .tvq-av.grande { width: 72px; height: 72px; }
    .tvq-foto { margin: 10px 0 2px; }
    .tvq-k { height: 48px; font-size: 26px; }
    .tvq-ok { width: 48px; }
    .tvq-persona { width: 112px; }
}
@media (prefers-reduced-motion: reduce) { .tvq-aurora.on { animation: none; } .tvq-teclado.tiembla { animation: none; } }
/* La foto en Equipo: arriba de la ventana «Editar» (foto a la izquierda, qué es y los botones a la derecha), y su
   círculo en la barra de la ficha, que abre esa ventana. */
body.tn-body .eq-foto-fila { display: flex; align-items: center; gap: 16px; margin: 12px 0 4px; padding-bottom: 14px; border-bottom: 1px solid var(--tn-linea); }
body.tn-body .eq-foto-av { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
    background: var(--tn-marca); color: #fff; font: 800 26px var(--tn-sans); }
body.tn-body .eq-foto-acc { display: grid; gap: 8px; min-width: 0; flex: 1 1 auto; }
body.tn-body .eq-foto-tx { font-size: 13.5px; color: var(--tn-suave); }
body.tn-body .eq-foto-tx b { color: var(--tn-tinta); }
body.tn-body .eq-foto-bot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.tn-body .eq-foto-bot form { margin: 0; }
body.tn-body .eq-barra-av { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; flex: 0 0 auto; }
body.tn-body .eq-barra-av .eq-foto-av { width: 40px; height: 40px; font-size: 15px; }
body.tn-body .eq-barra-av:focus-visible { outline: 3px solid var(--tn-marca); outline-offset: 2px; }
.tv-quien { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.tv-quien-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tn-marca); color: #fff; font: 800 12px var(--tn-sans); }
.tv-quien .tn-btn { height: 34px; padding: 0 10px; font-size: 13px; }
/* Ajustes → ¿Quién atiende?: una fila por persona (iniciales, nombre, «Atiende en el TPV», su PIN y Guardar). */
.dep-fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--tn-linea); }
.dep-nombre { min-width: 160px; }
.dep-casilla { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
/* El ticket del cartel «Cobrado» (31-10): su código de barras, como el papel, y la firma del programa al pie. */
.tvd-codigo { display: grid; justify-items: center; gap: 2px; margin-top: 8px; }
.tvd-codigo svg { max-width: 100%; height: 34px; }
.tvd-codigo small { font-size: 10.5px; color: #6B6B6B; }
.tvd-firma { text-align: center; font-size: 10.5px; color: #6B6B6B; margin-top: 2px; }
/* En el móvil el cartel «Cobrado» va en una columna y es más alto que la pantalla: se desplaza por dentro (no se corta). */
.tn-ventana.tvd { overflow-y: auto; overscroll-behavior: contain; }

/* ---------- NUEVA FACTURA ORDENADA (01-11, Jesús: «organizar mejor esta página, la veo muy regada») ----------
   Factura / Albarán / Presupuesto suben junto al título ($mgCabMedio en manage_header.php); «Cliente» y «Productos»
   son una franja cada uno (título, casilla y su botón «+» en la misma línea); la lista de líneas se queda con el
   resto del alto, y la columna del total llega hasta abajo con los botones de cobrar al pie, todos del mismo tamaño. */
body.tn-body .tn-cab-medio { flex: 0 0 auto; display: flex; align-items: center; }
body.tn-body .tn-cab-medio .nd-tipos { width: auto; }
body.tn-body .tn-cab-medio .nd-tipos button { height: 40px; padding: 0 14px; }
body.tn-body .nd-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.tn-body .nd-fila > h3 { margin: 0; flex: 0 0 auto; min-width: 92px; }
body.tn-body .nd-fila > .nd-buscar { flex: 1 1 320px; min-width: 0; margin: 0; }
body.tn-body .nd-fila > .nd-abre { flex: 0 0 auto; }
body.tn-body .nd-cli, body.tn-body .nd-lin { padding: 12px 16px; }
body.tn-body .nd-res:not(:has(*)) { display: none; }
/* Sin el aviso de «hecho», la única fila de .nd (las columnas) se queda con todo el alto. */
body.tn-body .nd:not(:has(> .nd-hecho)) { grid-template-rows: minmax(0, 1fr); }
body.tn-body .nd-nadie { grid-column: 1 / -1; margin: 0; color: var(--tn-suave); font-size: 14px; }
body.tn-body .nd-res .nd-nadie .nd-link { display: inline; width: auto; border: 0; padding: 0; margin-left: 6px; background: none; border-radius: 0; }
body.tn-body .nd-nuevo { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--tn-linea); }
body.tn-body .nd-albs { margin: 0; padding: 0 4px; font-size: 14px; }
body.tn-body .nd-albs form { display: inline; }
/* Productos se estira: su tabla es lo que crece (con pocas líneas, el hueco queda dentro de la tarjeta, no fuera). */
@media (min-width: 1101px) {
    body.tn-body .nd-main { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
    body.tn-body .nd-main > .nd-cli { flex: 0 0 auto; }
    body.tn-body .nd-main > .nd-lin { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    body.tn-body .nd-lin > .nd-tabla-zona { flex: 1 1 auto; min-height: 0; overflow: auto; }
    body.tn-body .nd-main > .nd-cli { max-height: 60%; overflow-y: auto; }
    body.tn-body .nd-cols { align-items: stretch; }
    body.tn-body .nd-lado { position: static; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
    body.tn-body .nd-lado > .nd-acciones { margin-top: auto; }
}
body.tn-body .nd-tabla thead th { position: sticky; top: 0; background: var(--tn-papel); z-index: 1; }
body.tn-body .nd-pagos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.tn-body .nd-pagos .btn { white-space: normal; line-height: 1.2; height: auto; min-height: 44px; }
/* Con un número impar de formas de cobro, la última ocupa la fila entera: no se queda una sola a media fila. */
body.tn-body .nd-pagos > form:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 900px) { body.tn-body .tn-cab-medio { order: 5; flex-basis: 100%; } body.tn-body .tn-gestion .tn-cab:has(.tn-cab-medio) { flex-wrap: wrap; } }

/* ---------- LA LETRA DEL DNI (01-11): el aviso si la letra escrita no cuadra (tienda.js, nifCampo) ---------- */
body.tn-body input.tn-nif-mal { border-color: var(--tn-mal); box-shadow: 0 0 0 1px var(--tn-mal) inset; }
body.tn-body .tn-nif-aviso { display: block; color: var(--tn-mal); font-size: 12.5px; font-weight: 600; margin-top: 3px; }
body.tn-body .tn-nif-aviso[hidden] { display: none; }

/* ---------- LA LISTA DE CLIENTES, MÁS APROVECHADA (01-11, Jesús: «¿podemos aprovechar más el espacio?») ----------
   Sin la tarjeta de buscar de arriba: título, buscador e «Importar o exportar» en una línea; debajo, la cuenta y las
   flechas de página en otra; filas de 34 px y ocho columnas que caben sin barra de lado a lado. */
body.tn-body .cl-compacta .cl-cab { align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
body.tn-body .cl-compacta .cl-buscar { flex: 1 1 320px; max-width: 620px; margin: 0; }
body.tn-body .tn-contenido .cl-compacta form.cl-buscar[method="get"] input[type=search] { width: 100%; max-width: none; }
body.tn-body .cl-compacta .cl-cab > .btn { margin-left: auto; }
body.tn-body .cl-datos { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.tn-body .cl-cuenta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 34px; margin-bottom: 6px; font-size: 13.5px; }
body.tn-body .cl-cuenta .cl-pag { padding-top: 0; gap: 6px; }
body.tn-body .cl-cuenta .cl-pag .btn { min-width: 34px; }
body.tn-body .cl-compacta table.cl-tabla { min-width: 900px; }
body.tn-body .cl-compacta .cl-tabla td { height: 34px; padding: 1px 8px; line-height: 1.2; }
body.tn-body .cl-compacta .cl-tabla td.cl-nom small { display: block; font-size: 11.5px; color: var(--tn-suave); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
body.tn-body .cl-compacta .cl-tabla td.cl-nom { white-space: nowrap; }
body.tn-body .cl-compacta .cl-tabla td.cl-nom a { display: block; overflow: hidden; text-overflow: ellipsis; }
body.tn-body .cl-compacta .cl-tabla td.cl-nom:has(.tn-alergia-chip) a { display: inline; }
body.tn-body .cl-punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
body.tn-body .cl-punto.activo { background: var(--tn-ok); }
body.tn-body .cl-punto.baja { background: var(--tn-mal); }
body.tn-body .cl-est-txt, body.tn-body .cl-tipo-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.tn-body .cl-letra { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--tn-marca-suave); color: var(--tn-tinta); font-size: 12px; font-weight: 700; }
body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-cod { width: 6%; }  body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-est { width: 4.5%; }
body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-tipo { width: 5%; } body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-nom { width: 21%; }
body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-dir { width: 25%; } body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-tel { width: 11%; }
body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-nif { width: 10%; } body.tn-body .cl-compacta .cl-tabla:not(.est-tabla) col.c-mail { width: 17.5%; }
/* La agenda sola (est-tabla) sigue con sus columnas. */
body.tn-body .cl-compacta table.cl-tabla.est-tabla { min-width: 820px; }
@media (max-width: 899px) {
    body.tn-body .cl-compacta table.cl-tabla { min-width: 0; }
    body.tn-body .cl-compacta .cl-tabla td { height: auto; padding: 4px 8px; }
    body.tn-body .cl-est-txt, body.tn-body .cl-tipo-txt { position: static; width: auto; height: auto; clip: auto; margin-left: 6px; }
    body.tn-body .cl-letra { display: none; }
    body.tn-body .cl-compacta .cl-cab > .btn { margin-left: 0; }
}

/* ---------- «COBRADOS HOY» CON EL ASPECTO DEL PROGRAMA (01-11, Jesús: «muy cuadrada y no tiene que ver») ----------
   En el TPV los campos de la ventana «Tickets» salían con el borde gris y las esquinas del navegador. */
.tvt-buscar input[type="date"], .tvt-buscar input[type="search"] {
    box-sizing: border-box; border: 1px solid var(--tn-linea); border-radius: 12px; background: var(--tn-papel);
    color: var(--tn-tinta); font: 500 15px var(--tn-sans); padding: 0 14px; outline: none; -webkit-appearance: none; appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
.tvt-buscar input[type="date"] { font-variant-numeric: tabular-nums; padding-right: 8px; }
.tvt-buscar input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.tvt-buscar input::placeholder { color: var(--tn-suave); }
.tvt-buscar input:focus { border-color: var(--tn-marca); box-shadow: 0 0 0 3px var(--tn-marca-suave); }

/* ---------- GASTOS SIN HUECOS (01-11, Jesús: «hay espacios vacíos y grandes innecesarios») ----------
   Filtros y botones en UNA fila (sin «Ver»: cambian al tocar); los desplegables, del ancho de lo que dicen; «Por pagar»,
   una franja baja; las cifras, más bajas; y el aviso de «no hay gastos», compacto. */
body.tn-body .fg-barra { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
body.tn-body .fg-filtros { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; }
body.tn-body .fg-filtros select { flex: 0 0 auto; width: auto; max-width: 190px; }
body.tn-body .tn-contenido form.fg-filtros[method="get"] select[name="c"] { flex: 0 1 190px; width: 190px; min-width: 120px; max-width: 190px; }
body.tn-body .fg-filtros input[type=search] { flex: 1 1 150px; min-width: 110px; max-width: 280px; }
body.tn-body .fg-barra > :not(.fg-filtros) { flex: 0 0 auto; white-space: nowrap; }
body.tn-body .fg-pagar { padding: 6px 14px; margin-bottom: 10px; }
body.tn-body .fg-pagar summary { min-height: 34px; font-size: 14.5px; }
body.tn-body .fg-pagar[open] summary { margin-bottom: 6px; }
body.tn-body .fg-kpis { margin-bottom: 10px; gap: 10px; }
body.tn-body .fg-kpi { padding: 10px 14px; }
body.tn-body .fg-kpi b { font-size: 22px; margin: 2px 0 0; }
body.tn-body .fg-card .tn-vacio { padding: 18px 16px; }
body.tn-body .fg-card .tn-vacio .tn-ic, body.tn-body .fg-card .tn-vacio img { width: 44px; height: 44px; }
@media (max-width: 1100px) { body.tn-body .fg-barra { flex-wrap: wrap; } body.tn-body .fg-filtros { flex-basis: 100%; flex-wrap: wrap; } }

/* ---------- «APUNTAR UN GASTO» CON BOTONES (01-11, Jesús: «sueldo de trabajadores, luz, agua, local, pero intuitivo») ----------
   Ventana de dos pasos (partials/gasto_rapido.php): botones grandes con su dibujo y, al tocar uno, solo lo justo. Arriba de
   Gastos, los que se repiten cada mes y toca apuntar (partials/gasto_repetidos.php). */
body.tn-body .gr-ventana { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; box-sizing: border-box; }
body.tn-body .gr-paso > strong { display: block; font-family: var(--tn-serif); font-size: 22px; }
body.tn-body .gr-paso > .text-muted { margin: 2px 0 14px; }
body.tn-body .gr-botones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
body.tn-body .gr-boton { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 84px; padding: 10px 6px;
    border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); color: var(--tn-tinta); font: 600 14px var(--tn-sans);
    cursor: pointer; text-align: center; line-height: 1.2; transition: border-color .15s, background .15s; }
body.tn-body .gr-boton:hover, body.tn-body .gr-boton:focus-visible { border-color: var(--tn-marca); background: var(--tn-marca-suave); outline: none; }
body.tn-body .gr-boton svg { width: 28px; height: 28px; stroke: var(--tn-marca-osc); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.tn-body .gr-otra { margin: 14px 0 0; font-size: 14px; }
body.tn-body .gr-cab { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
body.tn-body .gr-cab strong { font-family: var(--tn-serif); font-size: 22px; }
body.tn-body .gr-campos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 10px; }
body.tn-body .gr-campos[hidden] { display: none; }
body.tn-body .gr-campos .form-group { margin: 0; }
body.tn-body .gr-campos .form-group small { display: block; color: var(--tn-suave); font-size: 12.5px; margin-top: 2px; }
body.tn-body .gr-ancho { grid-column: 1 / -1; }
body.tn-body .gr-nota { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--tn-aviso-suave); color: var(--tn-tinta); }
body.tn-body .gr-repite { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--tn-linea); border-radius: 12px; cursor: pointer; font-size: 14px; }
body.tn-body .gr-repite input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
body.tn-body .gr-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
body.tn-body .gr-mes { padding: 10px 14px; margin-bottom: 10px; }
body.tn-body .gr-mes-cab { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
body.tn-body .gr-mes-cab strong { font-size: 16px; }
body.tn-body .gr-mes-lista { display: grid; gap: 6px; }
body.tn-body .gr-mes-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 6px 10px; border: 1px solid var(--tn-linea); border-radius: 12px; background: var(--tn-papel); }
body.tn-body .gr-mes-que { flex: 1 1 200px; display: grid; min-width: 0; }
body.tn-body .gr-mes-que small { color: var(--tn-suave); font-size: 12.5px; }
body.tn-body .gr-mes-fila label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--tn-suave); }
body.tn-body .gr-mes-fila input[type=text] { width: 96px; text-align: right; }
body.tn-body .gr-todos summary { cursor: pointer; font-size: 13.5px; color: var(--tn-marca-osc); font-weight: 600; }
body.tn-body .gr-mes-lista + .gr-todos { margin-top: 8px; }
body.tn-body .gr-todos ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
body.tn-body .gr-todos li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
body.tn-body .gr-todos li form { margin: 0; }
@media (max-width: 700px) { body.tn-body .gr-botones { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.tn-body .gr-campos { grid-template-columns: 1fr 1fr; } }

/* ---------- FAMILIAS A MUCHOS ARTÍCULOS (01-11, Jesús eligió A, B y C; includes/familias_lote.php) ----------
   A: casilla en cada fila de Productos y una barra «Poner en…» al pie de la lista; B: «+ Artículos» en cada categoría
   (Productos abre con esa familia elegida y un aviso arriba); C: «Ordenar artículos por el nombre» en Categorías. */
body.tn-body .pr-marca-th, body.tn-body .pr-marca-td { width: 36px; text-align: center; padding-left: 6px; padding-right: 0; }
body.tn-body .pr-marca-th input, body.tn-body .pr-marca-td input { width: 18px; height: 18px; margin: 0; cursor: pointer; vertical-align: middle; }
html[data-modo="tactil"] body.tn-body .pr-marca-td input { width: 24px; height: 24px; }
body.tn-body .pr-mover { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; padding: 8px 12px; border-radius: 12px;
    background: var(--tn-marca-suave); border: 1px solid var(--tn-marca-linea); flex-shrink: 0; }
body.tn-body .pr-mover[hidden] { display: none; }
body.tn-body .pr-mover-n { font-weight: 700; }
body.tn-body .pr-mover-n.mal { color: var(--tn-mal); }
body.tn-body .pr-mover-der { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.tn-body .pr-mover-der label { margin: 0; font-size: 13.5px; }
body.tn-body .pr-mover-der select { width: auto; max-width: 260px; }
body.tn-body .cl-pantalla > .pr-afam { flex-direction: row; text-align: left; font-size: 14px; }
body.tn-body .pr-afam { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; flex-shrink: 0;
    background: var(--tn-marca-suave); border-color: var(--tn-marca-linea); }
body.tn-body .cat-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.tn-body .cat-num { display: inline-block; min-width: 2.5em; font-variant-numeric: tabular-nums; }
body.tn-body .gr-boton-fila { display: flex; align-items: flex-end; }
body.tn-body .regla-lista { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: 14px; }
body.tn-body .regla-lista li { display: grid; min-width: 0; }
body.tn-body .regla-lista li small { color: var(--tn-suave); font-size: 12px; }
/* Los títulos de las dos columnas, como los del resto del programa (sin mayúsculas). */
.tvt-col h3 { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 600; color: var(--tn-tinta); }
.tvt-col h3 svg { color: var(--tn-marca-osc); }
/* En el móvil, Factura / Albarán / Presupuesto caben en la fila (se estrechan) y la tabla vacía no se corta. */
@media (max-width: 900px) {
    body.tn-body .tn-cab-medio { min-width: 0; max-width: 100%; }
    body.tn-body .tn-cab-medio .nd-tipos { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body.tn-body .tn-cab-medio .nd-tipos button { width: 100%; justify-content: center; padding: 0 6px; gap: 5px; font-size: 14px; }
    body.tn-body .tn-cab-medio .nd-tipos button .tn-ic { width: 20px; height: 20px; }
    body.tn-body .nd-tabla-zona { max-height: none; height: auto; }
}

/* ---------- «NUEVO CLIENTE» EN VENTANA FLOTANTE (Nueva factura, 01-11, Jesús) ---------- */
body.tn-body .nd-nuevo-v { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; box-sizing: border-box; }
body.tn-body .nd-nuevo-v > strong { display: block; font-family: var(--tn-serif); font-size: 22px; }
body.tn-body .nd-nuevo-v > .text-muted { margin: 2px 0 14px; }
body.tn-body .nd-nuevo-v .nd-nuevo-f { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; margin: 0; }
body.tn-body .nd-nuevo-v .form-group { margin: 0; min-width: 0; }
body.tn-body .nd-nuevo-v .form-group input { width: 100%; max-width: none; box-sizing: border-box; }
body.tn-body .nd-nuevo-v .form-group label small { color: var(--tn-suave); font-weight: 400; }
body.tn-body .nd-nuevo-pie { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@media (max-width: 700px) { body.tn-body .nd-nuevo-v .nd-nuevo-f { grid-template-columns: 1fr 1fr; } body.tn-body .nd-nuevo-v .nd-nuevo-f .ancho { grid-column: 1 / -1; } }

/* ---------- EQUIPO (01-11, Jesús: «organízame todo lo que tiene que ver con empleados, quién atiende…») ----------
   tienda/equipo.php: arriba «¿Quién atiende?» en una franja (antes en Ajustes), la lista de personas y la ficha. */
body.tn-body .eq-quien { padding: 10px 14px; flex-shrink: 0; }
body.tn-body .eq-quien-f { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
body.tn-body .eq-quien-tx { flex: 1 1 280px; display: grid; gap: 1px; min-width: 0; }
body.tn-body .eq-quien-tx small { color: var(--tn-suave); font-size: 13px; }
body.tn-body .eq-min { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--tn-suave); }
body.tn-body .eq-min input { width: 72px; text-align: right; }
body.tn-body .eq-aviso { margin: 8px 0 0; color: var(--tn-aviso); font-size: 13.5px; font-weight: 600; }
body.tn-body .eq-tabla td { vertical-align: middle; }
body.tn-body .eq-tabla .tv-quien-av { width: 32px; height: 32px; font-size: 13px; margin-right: 10px; vertical-align: middle; display: inline-grid; }
body.tn-body .eq-nom { font-weight: 600; color: var(--tn-tinta); text-decoration: none; }
body.tn-body .eq-nom:hover { text-decoration: underline; }
body.tn-body .eq-sub { display: block; color: var(--tn-suave); font-size: 12px; font-weight: 400; }
body.tn-body .eq-tabla tbody tr { cursor: pointer; }
body.tn-body .eq-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
body.tn-body .eq-form .form-group { margin: 0; min-width: 0; }
body.tn-body .eq-form .form-group input, body.tn-body .eq-form .form-group select { width: 100%; max-width: none; box-sizing: border-box; }
body.tn-body .eq-ancho { grid-column: 1 / -1; }
body.tn-body .eq-tpv { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--tn-linea); border-radius: 12px; cursor: pointer; font-size: 14px; margin: 0; }
body.tn-body .eq-tpv input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
body.tn-body .eq-pie { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
body.tn-body .eq-ventana { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; box-sizing: border-box; }
body.tn-body .eq-ventana > strong { display: block; font-family: var(--tn-serif); font-size: 22px; }
body.tn-body .tn-ficha .eq-datos2 { grid-template-columns: repeat(2, 1fr); }
body.tn-body .tn-ficha .eq-estado { margin: 0 0 0 auto; }
body.tn-body .tn-ficha .fi-lista a { color: var(--tn-marca-osc); }
@media (max-width: 700px) { body.tn-body .eq-form { grid-template-columns: 1fr 1fr; } body.tn-body .tn-ficha .eq-estado { margin-left: 0; } }
body.tn-body .eq-sueltas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; flex-shrink: 0; background: var(--tn-aviso-suave); border-color: transparent; font-size: 14px; }
body.tn-body .eq-sueltas form, body.tn-body .eq-en-linea { margin: 0; display: inline; }
body.tn-body .cl-pantalla > .eq-sueltas { flex-direction: row; text-align: left; }
/* El formulario de una persona en cuatro columnas: teléfono, alta, contrato y horas en una fila; «Atiende» y su PIN en otra. */
body.tn-body .eq-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.tn-body .eq-form .eq-tpv.eq-ancho { grid-column: span 3; align-self: end; }
@media (max-width: 700px) { body.tn-body .eq-form { grid-template-columns: 1fr 1fr; } body.tn-body .eq-form .eq-tpv.eq-ancho { grid-column: 1 / -1; } }

/* ---------- APARATO NUEVO EN EL TPV (01-11, Jesús: «que avise solamente»; includes/tpv_entradas.php) ----------
   Encima de «Hoy», en ámbar (es un aviso, regla 3), con «Visto» en cada uno. */
body.tn-body .hoy-aparatos { flex-shrink: 0; padding: 10px 14px; margin-bottom: 12px; background: var(--tn-aviso-suave); border-color: transparent; }
body.tn-body .hoy-ap-cab { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
body.tn-body .hoy-ap-cab b { color: var(--tn-aviso); }
body.tn-body .hoy-ap-cab span { font-size: 13.5px; color: var(--tn-tinta); }
body.tn-body .hoy-ap-cab form { margin: 0 0 0 auto; }
body.tn-body .hoy-aparatos ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
body.tn-body .hoy-aparatos li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
body.tn-body .hoy-aparatos li form { margin: 0; }
/* Equipo: «3 de 5 personas de tu plan» y el aviso al llegar al tope, con «Ampliar el plan» (01-11). */
body.tn-body .eq-cuenta { font-size: 13.5px; color: var(--tn-suave); margin-right: auto; margin-left: 12px; }
body.tn-body .eq-cuenta.lleno { color: var(--tn-aviso); font-weight: 600; }
body.tn-body .cl-pantalla > .eq-tope { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; flex-shrink: 0; background: var(--tn-aviso-suave); border-color: transparent; font-size: 14px; text-align: left; }

/* ===== AJUSTES → PANTALLA DEL CLIENTE (01-11) =====
   Las fotos de la espera en miniatura, apaisadas como saldrán (16:9). Cuatro por fila y el «Quitar» ENCIMA de la
   foto (Jesús, 02-11): de dos en dos y con el botón debajo, con 4 fotos la tarjeta ya se salía por abajo y
   «Añadir foto» quedaba fuera de la pantalla. Tres o más por fila según el ancho; el «Quitar» es una × redonda
   en la esquina (con la palabra entera, a 1273 de ancho tapaba la miniatura). */
.pcf-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; margin: 14px 0 12px; }
.pcf-foto { position: relative; }
.pcf-foto img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--tn-linea); }
.pcf-foto .pcf-quitar { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; padding: 0; border-radius: 50%;
                        display: grid; place-items: center; font-size: 18px; line-height: 1; cursor: pointer;
                        background: var(--tn-papel, #fff); color: var(--tn-tinta, #163A52); border: 1px solid var(--tn-linea);
                        box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .35); }
html[data-modo="tactil"] .pcf-foto .pcf-quitar { width: 38px; height: 38px; top: -12px; right: -12px; }
.pcf-foto .pcf-quitar:hover, .pcf-foto .pcf-quitar:focus-visible { border-color: var(--tn-marca); }
/* La casilla «+ Añadir foto», del tamaño de una miniatura; el input de archivo va escondido dentro de la etiqueta. */
.pcf-anadir label { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                    border: 2px dashed var(--tn-linea); border-radius: 10px; cursor: pointer; color: var(--tn-marca);
                    font-size: 12.5px; font-weight: 600; text-align: center; }
.pcf-anadir label b { font-size: 22px; line-height: 1; }
.pcf-anadir label:hover, .pcf-anadir label:focus-within { border-color: var(--tn-marca); background: var(--tn-marca-suave, transparent); }
.pcf-anadir input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pcf-anadir label.subiendo { opacity: .55; pointer-events: none; }

/* QUITADO DEL TICKET (02-11-2026, quitados.php): las fechas y la persona en una fila dentro de la cabecera de la
   lista, como el buscador de Clientes; las cifras, separadas de la tabla. */
.qt-filtro { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.qt-filtro label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--tn-suave); }
.qt-kpis { margin: 4px 0 14px; }

/* ===== FOTOS QUE LLENAN SU CUADRO (02-11) =====
   Jesús (02-11, eligió la maqueta maquetas/fotos-categorias.html): en la baldosa de categoría la foto entera
   (contain) quedaba como una tira con margen azul y los iconos, pequeños y con mucho aire; mezclados no
   encajaban. Ahora la foto llena el cuadro (cover: desde ahora se sube ya cuadrada, assets/js/encuadre.js) y
   sin foto el icono va grande sobre un color suave (bal_tono(), includes/baldosas.php). Los PRODUCTOS siguen con
   la foto entera: su hueco es bajo y ancho, y con «cover» solo se veía una franja (Jesús, 30-10). */
.tv-rejilla .tv-catb .tv-foto.tv-catb-foto { background: var(--tn-marca-suave); }
.tv-rejilla .tv-catb .tv-foto.tv-catb-foto img { object-fit: cover; padding: 0; mix-blend-mode: normal; }
.tv-rejilla .tv-catb .tv-foto.tv-catb-ico[data-color] { background: var(--cc-s); }
.tv-rejilla .tv-catb .tv-catb-ico .tn-ic, .tv-rejilla .tv-catb .tv-catb-ico svg { width: 60%; height: 60%; }
.tv-rejilla .tv-catb .tv-catb-ico[data-color] svg { stroke: var(--cc-t); }
/* «Floristería - Flores frescas»: lo de delante, pequeño y en gris (una línea); el nombre, en grande (hasta dos, como siempre). */
.tv-catb .tv-pie small.tv-catb-antes { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--tn-suave);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px; }

/* La ventana de encuadrar (encuadre.js): encima de la que la abrió, con el cuadro tan grande como quepa. */
.tn-velo.en-velo { z-index: 60; }
.en-ventana { width: min(440px, calc(100vw - 32px)); padding: 22px 24px; box-sizing: border-box; overflow-y: auto; }
.en-ventana > strong { display: block; font-family: var(--tn-serif); font-size: 21px; font-weight: 600; padding-right: 48px; }
.en-ventana > p { margin: 4px 0 0; font-size: 13.5px; }
.en-marco { position: relative; width: min(100%, calc(100vh - 280px)); aspect-ratio: 1 / 1; margin: 12px auto 0; border-radius: 14px;
    overflow: hidden; background: #0D1B23; touch-action: none; cursor: grab; }
.en-marco:active { cursor: grabbing; }
.en-marco img { position: absolute; left: 0; top: 0; max-width: none; height: auto; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.en-rejilla { position: absolute; inset: 0; pointer-events: none; border: 2px solid #FFFFFF; border-radius: 14px;
    background: linear-gradient(90deg, transparent 33.1%, rgba(255,255,255,.5) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.5) 66.7%, transparent 66.9%),
                linear-gradient(0deg, transparent 33.1%, rgba(255,255,255,.5) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.5) 66.7%, transparent 66.9%); }
.en-zoom { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; color: var(--tn-suave); font-size: 20px; }
.en-zoom input { flex: 1; height: 40px; accent-color: var(--tn-marca); }
.en-botones { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* BORRAR LOS DATOS DE UN CLIENTE (02-11-2026, clientes.php #fiBorrar): la lista de lo que se va y lo que se queda, y los
   botones abajo a la derecha como en cualquier ventana. */
.cb-lista { margin: 0 0 14px; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.cb-form { display: flex; flex-direction: column; gap: 6px; }
.cb-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* LA FOTO DEL PRODUCTO LLENA SU CUADRO (02-11-2026). Jesús, con la foto de un ábaco que dejaba franjas de color alrededor:
   «arréglame esto en los productos», lo mismo que ya se hizo con las categorías (2.8.9). Desde la 2.8.9 la foto se
   encuadra al subirla (cuadrada), así que «cover» recorta poco; lo que se pierda, se arregla volviendo a encuadrarla.
   Los iconos y las iniciales siguen igual (contain sobre su color). */
.tv-foto:has(> img:not(.tv-icono):not(.tn-ic)) { background: var(--tn-marca-suave); }
.tv-foto img:not(.tv-icono):not(.tn-ic) { object-fit: cover; padding: 0; mix-blend-mode: normal; }
/* …salvo cuando el cuadro es una franja MUY baja y ancha (más de 3 veces más ancha que alta). Ahí «cover» enseñaría solo
   una raya del producto (lo que pasó el 30-10), así que vuelve la foto entera fundida con el fondo. Antes saltaba a 8:5;
   desde la 2.8.25 el cuadro normal a 1273×545 es 225×110 (2:1) y tiene que llenarse (Jesús eligió la C, 03-11). */
.tv-item:not(.tv-catb) .tv-foto { container-type: size; }
@container (min-aspect-ratio: 3/1) {
    .tv-foto img:not(.tv-icono):not(.tn-ic) { object-fit: contain; padding: 4px; mix-blend-mode: multiply; }
}

/* CAMBIAR Y ENCUADRAR LA FOTO DESDE SU CUADRO, CON VISTA PREVIA DEL TPV (02-11-2026). Jesús: «modificar la foto existente,
   encuadrarla o cambiarla presionando donde debería ir la foto» y «una vista previa, tanto ahí como en editar, de cómo
   se va a ver en el TPV». El cuadro de la foto es un <label> de su input (se toca y se elige otra); en la ficha del
   producto ese cuadro es el botón del TPV en pequeño; en la ventana de encuadrar, el botón va al lado del cuadro. */
.tn-foto-toca { cursor: pointer; border-radius: 14px; transition: box-shadow .15s; }
.tn-foto-toca:hover, .tn-foto-toca:focus-visible { box-shadow: 0 0 0 2px var(--tn-marca); }
.pr-tpv, .en-tpv-ficha { display: grid; border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); box-shadow: var(--tn-sombra); overflow: hidden; color: var(--tn-tinta); }
.pr-tpv { width: 112px; flex-shrink: 0; }
.pr-tpv-foto, .en-tpv-foto { position: relative; display: grid; place-items: center; margin: 4px 4px 0; aspect-ratio: 10 / 7; border-radius: 10px; overflow: hidden;
    background: var(--tn-marca-suave); color: var(--tn-marca); font-family: var(--tn-serif); font-size: 26px; font-weight: 600; }
.pr-tpv-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.en-tpv-foto img { position: absolute; left: 0; top: 0; max-width: none; height: auto; transform-origin: 0 0; pointer-events: none; }
.pr-tpv-pie, .en-tpv-pie { display: grid; gap: 1px; min-width: 0; padding: 5px 9px 7px; }
.pr-tpv-pie b, .en-tpv-pie b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-tpv-pie span, .en-tpv-pie span { font-size: 14px; font-weight: 700; color: var(--tn-marca-osc); font-variant-numeric: tabular-nums; }
.en-ventana { width: min(660px, calc(100vw - 32px)); }
.en-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 18px; align-items: start; margin-top: 12px; }
.en-cuerpo .en-marco { margin-top: 0; }
.en-tpv-tit { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--tn-suave); }
@media (max-width: 600px) { .en-cuerpo { grid-template-columns: 1fr; } .en-tpv { max-width: 170px; } }
/* En la columna de la derecha la foto y el icono van uno debajo de otro (al lado no caben). */
.pr-opciones .pr-imagen { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pr-opciones .pr-foto > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pr-opciones .pr-foto > div > * { margin-left: 0 !important; }

/* INFORME (02-11, revisión de pantallas): con «Quién vendió» son CUATRO tarjetas (gráfica, formas de pago, quién vendió y más
   vendidos) y la rejilla era de tres: la cuarta saltaba a otra fila y aplastaba las demás a una raya. Con ella, cuatro columnas. */
@media (min-width: 901px) { body.tn-body .tn-informe:has(#infDependientes) { grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr)); } }

/* ASPECTO (02-11, revisión de pantallas): en pantallas altas «Automático / Pantalla táctil / Ratón» iban una debajo de otra y
   la tarjeta «En este aparato» se comía el «Tamaño de los botones» (cortado, sin barra). Ahora siempre las tres en fila, y si
   aun así no cabe, la tarjeta se desliza en vez de esconder lo de abajo. */
@media (min-width: 901px) { .tn-aspecto .as-puntero { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
body.tn-body .tn-aspecto > .card { overflow-y: auto; }

/* EL MENÚ DE LA IZQUIERDA CON DOCE APARTADOS (02-11, revisión de pantallas): con todos los módulos (agenda, cuotas,
   encargos, documentos…) no cabía y «Ajustes» quedaba escondido abajo, a 1273×545 y también a 1909×817. Con doce o más,
   cada botón un poco más bajo (sin bajar la letra de 12 px ni la altura del dedo por debajo de 40 px). */
@media (max-height: 700px) and (min-width: 901px) {
    .tn-rail:has(> a:nth-of-type(12)) :is(a, button) { padding-top: 2px; padding-bottom: 2px; }
}
@media (min-height: 701px) and (min-width: 901px) {
    .tn-rail:has(> a:nth-of-type(12)) { gap: 2px; padding-top: 10px; }
    .tn-rail:has(> a:nth-of-type(12)) .tn-logo { height: 48px; margin-bottom: 2px; }
}
/* …y hasta 900 de alto (la pantalla de Jesús, 1909×817) tampoco caben con el logo: fuera el logo, como en la pantalla baja. */
@media (min-height: 701px) and (max-height: 900px) and (min-width: 901px) {
    .tn-rail:has(> a:nth-of-type(12)) .tn-logo { display: none; }
    .tn-rail:has(> a:nth-of-type(12)) :is(a, button) { padding-top: 7px; padding-bottom: 7px; gap: 4px; }
    .tn-rail:has(> a:nth-of-type(12)) :is(a, button) :is(svg, .tn-ic) { width: 26px; height: 26px; }
}

/* HOY (02-11, revisión de pantallas): con varios avisos arriba (aparatos nuevos) las tarjetas de abajo quedan bajas y
   «El equipo hoy» escondía su «Pendiente». Ahora la tarjeta se desliza por dentro en vez de cortar lo de abajo. */
body.tn-body .tn-hoy > .card { overflow-y: auto; }

/* EL MÓVIL Y LA TABLET DE PIE (hasta 900 de ancho; 02-11, revisión de pantallas; Jesús: «sí, el móvil»). La columna de la izquierda se comía 76 de los 390 px
   y todo lo demás se apretaba o se salía por la derecha. En el móvil pasa a ser una BARRA ABAJO que se arrastra de lado
   (como las apps), y la pantalla tiene todo el ancho. Los títulos de bloque y el logo no caben ahí: el candado de cada
   botón sigue diciendo cuáles piden el PIN. */
@media (max-width: 900px) {
    .tn-app { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .tn-app > .tn-rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: row; align-items: stretch; gap: 2px;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
        background: var(--tn-papel); border-top: 1px solid var(--tn-linea); box-shadow: 0 -8px 20px -14px rgba(0, 0, 0, .35); }
    .tn-app > .tn-rail::-webkit-scrollbar { display: none; }
    .tn-app > .tn-rail > .tn-logo, .tn-app > .tn-rail > .tn-rail-grupo { display: none; }
    .tn-app > .tn-rail :is(a, button) { flex: 0 0 auto; min-width: 64px; min-height: 52px; padding: 5px 4px; gap: 2px; font-size: 12px; justify-content: center; }
    .tn-app > .tn-rail :is(a, button) :is(svg, .tn-ic) { width: 24px; height: 24px; }
    .tn-app > .tn-rail .tv-rail-acc { flex-direction: row; gap: 2px; margin: 0 0 0 4px; padding: 0 0 0 6px; border-top: 0; border-left: 1px solid var(--tn-linea); }
    .tn-app > .tn-rail .tn-candado { top: 2px; right: 4px; }
}
@media (max-width: 900px) {
    /* La fila de filtros (Ventas: desde, hasta, ver…) no se partía en dos líneas y obligaba a la página a medir 690 px:
       el móvil la enseñaba entera encogida y con «Hasta» cortado. */
    body.tn-body .card.tn-fila { flex-wrap: wrap; }
    body.tn-body .card.tn-fila > form { flex: 1 1 100%; min-width: 0; max-width: 100%; }
    /* Un botón con un texto largo («Descargar el Agente de impresión para Windows (69 MB)») parte la línea en vez de salirse. */
    body.tn-body .tn-contenido :is(.btn, .tn-btn) { white-space: normal; max-width: 100%; height: auto; }
}
@media (max-width: 900px) {
    /* Las pestañas, en su propia línea bajo el título, enteras y arrastrando de lado (sin «Más»: tienda.js no lo pone en el móvil). */
    body.tn-body .tn-gestion .tn-cab { flex-wrap: wrap; row-gap: 8px; }
    body.tn-body .tn-gestion .tn-cab .tn-pest-zona { order: 5; flex: 1 1 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    body.tn-body .tn-gestion .tn-cab .tn-pest-zona::-webkit-scrollbar { display: none; }
    body.tn-body .tn-gestion .tn-cab .tn-pest-mas { display: none; }
}
/* Casi, si flota (fuera de la cabecera), por encima de la barra de abajo del móvil. */
@media (max-width: 900px) { body.tn-body .ia-fab:not(.en-cabecera) { bottom: calc(80px + env(safe-area-inset-bottom)); } }
/* El Informe en el móvil: una tarjeta debajo de otra (las tres o cuatro columnas del ordenador eran tiras de 100 px). */
@media (max-width: 900px) {
    body.tn-body .tn-informe { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    body.tn-body .tn-informe > .chart-card { min-height: 220px; }
    body.tn-body .tn-informe > .grid > .card { overflow: visible; }
}
/* La zona de la derecha medía lo que su contenido más ancho (una tabla de 800 px) y empujaba la página de lado en la
   tablet de pie: su columna, como mucho el ancho de la pantalla (lo que no cabe se desliza dentro de su tabla). */
@media (max-width: 900px) { body.tn-body .tn-zona { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
    /* La etiqueta de Casi («Casi · sin activar») es para el ratón; en la tablet quedaba fuera de la pantalla y la
       ensanchaba (se podía arrastrar de lado). */
    body.tn-body .ia-fab-tip { display: none; }
    /* «11 tickets · 559,00 € · en el cajón 559,00 €» de Terminales: parte la línea en vez de salirse. */
    body.tn-body td:has(> .tm-linea) { flex-wrap: wrap; row-gap: 4px; height: auto !important; max-height: none !important; }
    body.tn-body .tm-linea { flex: 1 1 100%; white-space: normal; text-align: right; }
}
/* Tablet de pie (641-899): las tablas aún no se apilan en tarjetas; si no caben, se deslizan dentro de su recuadro
   en vez de quedar cortadas (Productos). */
@media (min-width: 641px) and (max-width: 899px) { body.tn-body .cl-scroll { overflow-x: auto; } }

/* ===== REVISIÓN DE PANTALLAS DEL 03-11 (2.8.23): lo que se salía, se partía o no se leía ===== */
/* Los campos de teléfono, correo, número o fecha dentro de una ventana salían con el aspecto del navegador (el
   «Teléfono» de «Clienta del ticket», con el borde negro y sin redondear, al lado de un «Nombre» bien puesto). */
.tn-ventana :is(input[type=tel], input[type=email], input[type=number], input[type=search], input[type=date], input[type=time], input[type=password]) {
    width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--tn-linea); background: #fff;
    font: 500 15px var(--tn-sans); color: var(--tn-tinta); outline: none;
}
/* Una cifra no se parte: «202,00» arriba y el «€» solo debajo en la ventana Caja del móvil. */
.cj-esperado b { white-space: nowrap; }
.cj-esperado span { min-width: 0; }
body.tn-body .tn-zona td[data-label="Ventas"] > strong { white-space: nowrap; }   /* Arqueos: «546,50» y «€» debajo */
/* Las dos columnas de «Otro importe | Añadir al ticket» crecían con el texto del botón y lo sacaban de la ventana. */
.cj-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cj-dos > * { min-width: 0; }
@media (max-width: 480px) {
    /* Tarjeta regalo en el móvil: los cuatro importes en dos filas (el «100 €» quedaba fuera) y el campo encima del botón. */
    .rg-rapidos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #vRegalo .cj-dos { grid-template-columns: minmax(0, 1fr); }
    /* Cobrar con tres formas: en tres columnas de 74 px «Transferencia» se cortaba en «Transfe…». Una debajo de otra, con
       el icono al lado: se lee entera y sigue siendo un botón grande para el dedo. */
    .tvc-formas.muchas { grid-template-columns: minmax(0, 1fr); }
    .tvc-formas.muchas .tvc-forma { flex-direction: row; min-height: 56px; gap: 12px; }
}
/* Hoy: con varios aparatos nuevos, el aviso ocupaba la pantalla entera y escondía las cifras del día. Se ven tres y el
   resto se desliza dentro del aviso («Vistos todos» sigue arriba). */
body.tn-body .hoy-aparatos ul { max-height: 118px; overflow-y: auto; overscroll-behavior: contain; }
/* Recepción sin citas: «Hoy no hay citas.» heredaba la rejilla de la cita (64 px de hora) y salía en dos renglones apretados. */
.tn-recepcion .rc-lista li.rc-vacio { display: block; padding: 8px 0; }
/* «Quitado del ticket» en el móvil: el título y las fechas en la misma fila dejaban el título en tres renglones. */
body.tn-body #qtZona > .cl-cab { flex-wrap: wrap; row-gap: 10px; }
/* «Disponible», «abierta»…: el verde de serie daba 4,4:1 sobre su verde claro con letra pequeña; un peldaño más oscuro. */
html:not([data-tema="noche"]) body.tn-body .badge-active { color: #166534; }
/* Portada de Ajustes (Jesús, 03-11: «repartirla en columnas»): «El mostrador» tiene siete tarjetas y, como un grupo no
   se podía partir, su columna se salía por abajo a 1273×545 mientras «Tickets y facturas» tenía dos. Ahora un grupo
   largo sigue en la columna de al lado; lo que no se parte es cada tarjeta, y el título nunca se queda solo abajo. */
body.tn-body .tn-ajustes .aj-portada > .aj-grupo { break-inside: auto; }
body.tn-body .tn-ajustes .aj-grupo > h2 { break-after: avoid; }
body.tn-body .tn-ajustes .aj-portada .aj-rejilla { display: block; }
body.tn-body .tn-ajustes .aj-portada .aj-rejilla > * { break-inside: avoid; margin-bottom: 8px; }
@media (max-height: 700px) and (min-width: 901px) { body.tn-body .tn-ajustes .aj-portada .aj-rejilla > * { margin-bottom: 6px; } }
/* Como mucho cuatro columnas: a 1909 salían seis y un mismo grupo quedaba en tres trozos, con columnas sin título. */
body.tn-body .tn-ajustes .aj-portada { column-count: 4; }


/* LA FOTO DEL PRODUCTO, EL DOBLE DE ALTA (03-11-2026). Jesús, con el TPV de la demo a 8 productos por página: «mira
   estas qué mal se ven» (la foto quedaba en una franja de 60 px). Eligió la «C» de los ejemplos: el nombre en UNA línea
   (con «…» si no cabe; entero en el aria-label y al pulsar) y el precio un poco más bajo, para que la foto se lleve ese
   sitio. Solo en los productos con foto: las categorías y la rejilla sin fotos o densa siguen como estaban. */
.tv-rejilla:not(.sin-fotos):not(.densa) .tv-item:not(.tv-catb) .tv-pie { padding: 6px 10px 8px 14px; gap: 8px; }
.tv-rejilla:not(.sin-fotos):not(.densa) .tv-item:not(.tv-catb) .tv-pie b { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
    -webkit-line-clamp: unset; font-size: 15px; }
.tv-rejilla:not(.sin-fotos):not(.densa) .tv-item:not(.tv-catb) .tv-pie span:not(.tn-redondo) { margin-top: 2px; font-size: 19px; }
/* En el móvil y la tablet de pie, una línea son 11 letras («Prueba 1 cre…»): no se distinguen dos productos parecidos. Ahí
   el nombre lleva dos líneas y el botón crece esos 18 px, para que la foto no los pierda; por debajo de 900 la página baja. */
@media (max-width: 900px) {
    .tv-rejilla:not(.sin-fotos):not(.densa) { grid-auto-rows: calc(var(--tv-alto, 200px) + 18px); }
    .tv-rejilla:not(.sin-fotos):not(.densa) .tv-item:not(.tv-catb) .tv-pie b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
        white-space: normal; text-overflow: clip; }
}

/* ===== REVISIÓN DE LA DEMO (07-11) =====
   Informe: las barras de «Ventas por día» se estrechan en vez de salirse por la derecha; con más de 14 días, la cifra se
   esconde (está al pasar por encima) y la fecha sale en uno de cada cinco. Las tablas cortas, sin páginas: bajan por dentro. */
body.tn-body .tn-informe .mini-bars { overflow: hidden; gap: 4px; }
body.tn-body .tn-informe .mini-bars .bar-col { min-width: 0; }
body.tn-body .tn-informe .mini-bars.muchas .bar-val { display: none; }
body.tn-body .tn-informe .mini-bars.muchas .bar-col .bar-lbl { visibility: hidden; white-space: nowrap; }
body.tn-body .tn-informe .mini-bars.muchas .bar-col:nth-child(5n+1) .bar-lbl { visibility: visible; }
body.tn-body .tn-informe > .grid > .card.tn-sin-paginar { overflow-y: auto; }

/* La barra del ticket en el móvil (pos_view.php, «EL TICKET A MANO EN EL MÓVIL»): encima de la barra de abajo (64 px, como
   la de la ficha de reparación); el contenido deja sitio para las dos. Y los nombres de las categorías, en dos renglones
   (a 390 de ancho salían cortados: «Smartph», «Pescade»). */
.tv-movil-tk { display: none; }
@media (max-width: 900px) {
    .tv-movil-tk:not([hidden]) { display: flex; align-items: center; gap: 10px; position: fixed; left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 41;
        min-height: 52px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--tn-tinta); color: #fff; font: inherit; font-size: 15px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, .22); cursor: pointer; text-align: left; }
    .tv-movil-tk .tv-movil-n { min-width: 26px; height: 26px; border-radius: 999px; background: #fff; color: var(--tn-tinta); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; padding: 0 6px; }
    .tv-movil-tk b { font-size: 17px; }
    .tv-movil-tk .tv-movil-ver { margin-left: auto; font-weight: 600; }
    .tn-app:has(.tv-movil-tk:not([hidden])) { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
    .tv-rejilla .tv-catb .tv-pie b { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
}
/* En el móvil la foto de la categoría ocupaba media ficha y el nombre no cabía ni en dos renglones («Favorit…»): foto más pequeña. */
@media (max-width: 600px) {
    .tv-rejilla .tv-catb .tv-foto { width: 52px !important; height: 52px !important; }
    .tv-rejilla .tv-catb .tv-pie b { font-size: 15px; overflow-wrap: anywhere; }
}

/* LOS SERVICIOS EN FICHA BAJA (Jesús, 08-11: la «B» de maquetas/revision-demo.html): sin foto, el nombre, cuánto dura y el
   precio, con una raya del color de su categoría (o del azul del programa). La rejilla los pone en «sin-fotos» (tienda.js). */
.tv-rejilla.sin-fotos .tv-item[data-grupo="s"] .tv-ficha { border-left: 5px solid var(--cc-f, var(--tn-marca-linea)); }
.tv-rejilla .tv-pie .tv-dur { display: none; }
.tv-rejilla.sin-fotos .tv-pie .tv-dur { display: block; color: var(--tn-suave); font-size: 13px; font-weight: 500; margin-top: 2px; }

/* CASI EN LA CABECERA: su icono y su nombre en un botón (Jesús, 08-11: la «B» de maquetas/revision-demo.html). El perro
   sigue dentro de la conversación; aquí, a 40 px, no se entendía qué era. */
body.tn-body .ia-fab.en-cabecera { width: auto; height: 40px; }
body.tn-body .ia-fab.en-cabecera:hover { transform: none; }
body.tn-body .ia-fab.en-cabecera .ia-fab-circle { display: none; }
body.tn-body .ia-fab.en-cabecera .ia-fab-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 5px; border-radius: 20px;
    background: var(--tn-marca); color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; box-shadow: var(--tn-sombra); }
body.tn-body .ia-fab.en-cabecera .ia-fab-pill i { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
body.tn-body .ia-fab.en-cabecera .ia-fab-pill img { width: 19px !important; height: 19px !important; }
body.tn-body .ia-fab.en-cabecera:hover .ia-fab-pill { background: var(--tn-marca-osc); }
body.tn-body .ia-fab.en-cabecera .ia-fab-tip { display: none; }

/* «+ Nuevo ▾» de Documentos en la cabecera (Jesús, 08-11): el menú cae por debajo, alineado a la derecha. */
body.tn-body .dc-nuevo { position: relative; }
body.tn-body .dc-nuevo > summary { list-style: none; cursor: pointer; white-space: nowrap; }
body.tn-body .dc-nuevo > summary::-webkit-details-marker { display: none; }
body.tn-body .dc-nuevo .tn-mas-menu { right: 0; left: auto; top: calc(100% + 6px); min-width: 180px; z-index: 30; }

/* UNA SOLA BARRA (Jesús, 08-11: la «B» de maquetas/revision-demo.html): la misma en el TPV, el mostrador y la gestión,
   compacta para que quepa a 1273×545. En el TPV, arriba junto al buscador: Servicios/Productos, Regalo, Tickets y Caja. */
body.tn-body .tn-rail:has(> .tn-rail-grupo) > :is(a, button) { padding: clamp(4px, calc((100vh - 545px) / 40), 12px) 4px; gap: 3px; font-size: clamp(12px, 1.5vh, 13.5px); }
body.tn-body .tn-rail:has(> .tn-rail-grupo) > :is(a, button) :is(svg, .tn-ic) { width: clamp(22px, 3vh, 30px); height: clamp(22px, 3vh, 30px); }
.tv-arriba { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.tv-arriba .tv-buscar { flex: 1; min-width: 0; }
.tv-arriba .tv-grupos { flex-shrink: 0; align-self: center; flex-wrap: nowrap; }
.tv-arriba .tv-grupos button { border: 0; background: transparent; padding: 0 12px; height: 42px; border-radius: 9px; font: 600 14.5px var(--tn-sans); color: var(--tn-tinta); cursor: pointer; }
.tv-arriba .tv-grupos button.on { background: var(--tn-marca); color: #fff; }
.tv-arriba-btn { position: relative; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px;
    border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-ventana, #fff); font: 600 12px var(--tn-sans); color: var(--tn-tinta); cursor: pointer; }
.tv-arriba-btn .tn-ic { width: 24px; height: 24px; }
.tv-arriba-btn:hover { background: var(--tn-marca-suave); }
.tv-arriba-btn .tv-insignia { top: -6px; right: -6px; }
@media (max-width: 1150px) { .tv-arriba-btn { width: 54px; font-size: 11.5px; } .tv-arriba .tv-grupos button { padding: 0 8px; font-size: 13.5px; } }
@media (max-width: 900px) { .tv-arriba { flex-wrap: wrap; } .tv-arriba .tv-buscar { flex: 1 1 100%; } .tv-arriba-btn { min-height: 48px; } }

/* El botón de Casi fuera de la cabecera: su icono dentro del círculo azul (08-11: sin el perro). La regla de arriba ponía
   cualquier imagen del botón a 46 px (era la foto del perro). */
body.tn-body .ia-fab .ia-fab-circle img { width: 26px !important; height: 26px !important; }

/* Jesús, 08-11: «mira qué apretado está todo aquí sin motivo». (1) El aviso de la tienda de prueba, debajo del título y en un
   renglón pequeño (al lado empujaba el título a dos renglones). (2) «Factura A/3 hecha», una franja baja en una fila (otra regla
   de tarjetas la convertía en un bloque de media pantalla y no dejaba sitio a la tabla ni a los botones de cobrar). */
body.tn-body .tn-titulo:has(.dr-franja) { flex-direction: column; align-items: flex-start; gap: 3px; }
body.tn-body .tn-titulo h2 { white-space: nowrap; }
body.tn-body .dr-franja { white-space: nowrap; font-size: 12px; padding: 1px 8px; }
body.tn-body .nd > section.card.nd-hecho { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px;
    background: var(--tn-ok-suave); border-color: var(--tn-ok); min-height: 0; }
body.tn-body .nd > section.card.nd-hecho > div { flex: 1 1 260px; display: grid; gap: 2px; margin: 0; min-width: 0; }
body.tn-body .nd > section.card.nd-hecho > .btn { flex: 0 0 auto; width: auto; margin: 0; }
body.tn-body .nd-albs { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: 0 0 auto; }

/* PANTALLAS QUE NO BAJABAN (08-11, Jesús: «¿puedes buscar errores como ese en todo el programa?»; barrido de todas a
   1273×545). Mi suscripción, Gastos (la factura recibida) y Ajustes → Casi son más altas que la ventana y su zona no
   tenía desplazamiento: lo de abajo (las facturas de la cuota, «Productos que entran al stock», el final de la tarjeta de
   Casi) quedaba cortado sin forma de llegar. Bajan dentro de su zona, como Reparaciones; las que caben no cambian. */
/* Gastos y Casi van dentro de la hoja que monta tienda.js (.tn-hoja), que solo dejaba bajar a sus .card: ahora baja
   también lo que no es tarjeta (un formulario entero, un bloque propio). En Gastos, a 1273×545, «Guardar factura»
   quedaba 50 px por debajo del borde. */
body.tn-body .tn-contenido > .sus-pantalla, body.tn-body .tn-hoja > :not(.card) { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: var(--tn-marca-linea) transparent; padding-right: 4px; }

/* LA FOTO DE UN SERVICIO (Jesús, 08-11: «no sé cómo ponerle la foto a los servicios»), en la ventana de Servicios:
   la miniatura de la que tiene al lado de «Elegir una foto», y «Quitar la foto» debajo. */
.sv-foto-fila { display: flex; gap: 12px; align-items: center; }
.sv-foto-fila .tn-archivo { flex: 1 1 auto; min-width: 0; }
.sv-foto-mini { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--tn-linea); flex: 0 0 auto; }
.sv-quitar { display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--tn-suave); }
.sv-quitar input { width: auto; }
@media (max-width: 900px) { .sv-foto { grid-column: 1 / -1 !important; } }   /* en el móvil, la foto en su propia fila */

/* ¿IMPRIMIR EL TICKET? (Jesús, 08-11: eligió la «A»: dos botones grandes con su icono, tras la forma de pago). «Sí», el
   principal (relleno, el color de la marca); «No», secundario. Altos para el dedo (≥ 96 px): se toca con prisa. */
.tvc-imp { justify-items: center; text-align: center; gap: 10px; }
.tvc-imp-forma { margin: 0; color: var(--tn-suave); font-size: 15px; }
.tvc-imp-q { margin: 0; font-size: 24px; font-weight: 700; color: var(--tn-tinta); }
.tvc-imp-bt { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 4px; }
.tvc-imp-bt button { display: grid; justify-items: center; gap: 6px; min-height: 96px; padding: 14px 8px; border-radius: 16px; font: inherit;
    font-size: 19px; font-weight: 700; cursor: pointer; }
.tvc-imp-bt button svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tvc-imp-si { background: var(--tn-marca); color: #fff; border: 0; }   /* el mismo color que «Cobrar» */
.tvc-imp-si:hover { background: var(--tn-marca-osc); }
.tvc-imp-no { background: var(--tn-papel); color: var(--tn-tinta); border: 1px solid var(--tn-linea); }
.tvc-imp-bt button:focus-visible { outline: 3px solid var(--tn-marca); outline-offset: 2px; }
.tvc-imp-bt button:disabled { opacity: .6; cursor: default; }

/* LA MARCA DE SERVICIOS / PRODUCTOS: UNA LUPA DE CRISTAL (Jesús, 09-11, la «A»; tvGota() y tvLupa*() en pos_view.php).
   Quieta, .tv-ficha es la marca de siempre (el color del negocio) y el botón elegido no pinta su fondo. Al moverse,
   .tv-lente es el cristal: va ENCIMA de las letras (las dobla con el filtro #tvLenteF) y no recoge toques. */
.tv-arriba .tv-grupos { position: relative; isolation: isolate; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.tv-arriba .tv-grupos .tv-ficha, .tv-arriba .tv-grupos .tv-lente { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
.tv-arriba .tv-grupos .tv-ficha { z-index: 0; background: var(--tn-marca); border-radius: 9px; }
.tv-arriba .tv-grupos .tv-lente { z-index: 2; opacity: 0; visibility: hidden; border-radius: 9px;
    background: linear-gradient(180deg, rgba(255,255,255,.06), color-mix(in srgb, var(--tn-marca-linea, #B3EBF2) 14%, transparent));
    box-shadow:
        0 calc(12px * var(--g, 0)) calc(28px * var(--g, 0)) color-mix(in srgb, var(--tn-tinta) 20%, transparent),
        0 calc(3px * var(--g, 0)) calc(8px * var(--g, 0)) color-mix(in srgb, var(--tn-tinta) 12%, transparent),
        inset 0 1px 1px #fff,
        inset 0 -1.5px 2px color-mix(in srgb, var(--tn-tinta) 16%, transparent),
        inset 0 0 0 .6px color-mix(in srgb, var(--tn-tinta) 24%, transparent),
        inset 2px 3px 6px -3px rgba(255,255,255,.95),
        inset -3px -3px 8px -4px color-mix(in srgb, var(--tn-tinta) 32%, transparent); }
.tv-arriba .tv-grupos .tv-lente::before { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: .55;
    background: radial-gradient(90% 65% at 26% 6%, rgba(255,255,255,.9), rgba(255,255,255,0) 62%); }
.tv-arriba .tv-grupos button { position: relative; z-index: 1; transition: color .18s; }
.tv-arriba .tv-grupos.con-lupa button.on { background: transparent; }
.tv-arriba .tv-grupos.cristal button.on { color: var(--tn-tinta); }

/* LA LÍNEA «MOSTRADOR 1 · CAJA ABIERTA…» NO SE CORTA (revisión del TPV, 09-11: «Caja abierta desde las 22» cortado): si no
   cabe, cada aviso baja entero a la línea siguiente en vez de salirse por la derecha. */
body.tn-body .tn-cab .tn-nombre small { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 3px; }
body.tn-body .tn-cab .tn-nombre small > .tn-estado { white-space: nowrap; letter-spacing: normal; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* El buscador del TPV no se queda sin sitio para escribir (revisión del TPV, 09-11: a 1100 de ancho la caja medía 26 px).
   Por debajo de 1400, fuera el dibujo del código de barras (es solo un adorno: el lector funciona igual) y algo menos de
   hueco; y la caja nunca baja de lo que ocupa «Buscar…». */
.tv-arriba .tv-buscar input { min-width: 64px; }
@media (max-width: 1400px) {
    .tv-arriba .tv-buscar > span.tv-ico[aria-hidden="true"] { display: none; }
    .tv-arriba .tv-buscar { gap: 8px; padding-left: 14px; }
}

/* COMISIONES CON PAGOS (10-11, est_comisiones.php): lo que se le debe en grande y, debajo, sus % y lo ganado en el
   mes; «Pagar» en su fila; «Sin asignar» apagado (es dinero que no cuenta para nadie); «Para empezar» arriba. */
.tn-comisiones .co-sub { display: block; font-size: 12.5px; color: var(--tn-suave); font-weight: 400; margin-top: 2px; }
.tn-comisiones .co-debe { font-size: 17px; }
.tn-comisiones .co-nada { color: var(--tn-suave); }
.tn-comisiones .co-poner { font-weight: 600; }
.tn-comisiones .co-acc { text-align: right; white-space: nowrap; }
.tn-comisiones .co-sin td { color: var(--tn-suave); }
.tn-comisiones .co-ini-sin { background: var(--tn-linea); color: var(--tn-tinta); }
.tn-comisiones .co-empezar { margin: 0; }
.tn-comisiones .co-empezar ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.tn-comisiones .co-empezar li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.tn-body .tn-comisiones .co-pagos { margin: 0; flex: 0 0 auto; max-height: 40%; display: flex; flex-direction: column; }
.tn-comisiones .co-pagos .cl-scroll { min-height: 0; overflow: auto; margin-top: 8px; }
.co-ventana { max-width: 520px; }
.co-ventana .co-pag-f { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.co-ventana .co-pag-gasto, .co-ventana .co-pag-pie { grid-column: 1 / -1; }
.co-ventana .co-pag-gasto { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.co-ventana .co-pag-gasto input { width: auto; margin-top: 3px; }
.co-ventana .co-pag-gasto small { display: block; color: var(--tn-suave); font-size: 12.5px; }
.co-ventana .co-pag-pie { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 520px) { .co-ventana .co-pag-f { grid-template-columns: minmax(0, 1fr); } }

/* ============ «OTRO IMPORTE» DEL TPV (10-11-2026) ============
   Vender lo que no está en Productos. Ventana corta (tipo E de stoki-pantallas): los campos en rejilla, los
   botones abajo a la derecha. «Servicio / producto» y el IVA son botones que se eligen con el dedo (≥ 44 px),
   no desplegables: en el mostrador se toca, no se escribe. */
body.tn-body .ol-ventana { width: min(520px, 94vw); padding: 24px; }
body.tn-body .ol-ayuda { color: var(--tn-suave); margin: 8px 0 16px; font-size: 14px; }
body.tn-body .ol-form { display: grid; gap: 14px; }
body.tn-body .ol-form label > span,
body.tn-body .ol-campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--tn-suave); margin-bottom: 6px; }
body.tn-body .ol-form input[type=text],
body.tn-body .ol-form input[type=number] { width: 100%; min-height: 46px; box-sizing: border-box; font-size: 17px; }
body.tn-body .ol-fila { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
body.tn-body .ol-elige { display: flex; gap: 8px; flex-wrap: wrap; }
body.tn-body .ol-elige label { flex: 1 1 0; min-width: 0; position: relative; }
body.tn-body .ol-elige input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
body.tn-body .ol-elige label > span { display: flex; align-items: center; justify-content: center; min-height: 46px; margin: 0;
    border: 1.5px solid var(--tn-linea); border-radius: 12px; background: var(--tn-papel); color: var(--tn-tinta);
    font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
body.tn-body .ol-elige input:checked + span { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
body.tn-body .ol-elige input:focus-visible + span { outline: 2px solid var(--tn-marca); outline-offset: 2px; }
body.tn-body .ol-iva label > span { font-size: 14px; }
body.tn-body .ol-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
@media (max-width: 520px) { body.tn-body .ol-fila { grid-template-columns: minmax(0, 1fr) 96px; } }
/* Con «Otro importe» la fila de arriba del TPV lleva un botón más: hasta 1450 px los botones de icono pasan a 54 px
   (como ya hacían por debajo de 1150) para que el buscador no se quede en nada (medido a 1273: 137 px, antes 147). */
@media (max-width: 1450px) { .tv-arriba-btn { width: 54px; font-size: 11.5px; } .tv-arriba { gap: 6px; } }
/* La copia de la foto que vuelve a la lista con «‹ No soy yo» (pos_view.php, tvqVolver): suelta encima de todo. */
.tvq-av.tvq-vuela { position: fixed; z-index: 1000; margin: 0; pointer-events: none; transform-origin: top left; }

/* «LO QUE TE QUEDA» del Resumen del mes (12-11, resumen.php + includes/lo_que_queda.php): la cuenta a la izquierda,
   al ancho de lectura, y a la derecha lo que la completa (falta por apuntar, desde qué día ganas, el IVA). Es gestión:
   baja con la página. Las restas llevan el «−» delante del importe y van un poco metidas; cada «=» lleva su raya
   encima, y el resultado, la raya gruesa y el color de estado de siempre (verde bien, rojo mal: regla 3). */
body.tn-body .tn-resumen .rs-kpis .lq-kpi { text-decoration: none; color: inherit; }
body.tn-body .lq-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
body.tn-body .lq-cols > .card, body.tn-body .lq-lado > .card { margin: 0; }
body.tn-body .lq-lado { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
body.tn-body .lq-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
body.tn-body .lq-cab strong { font-family: var(--tn-serif); font-size: 21px; }
body.tn-body .lq-etiqueta { font-size: 12.5px; font-weight: 600; color: var(--tn-suave); white-space: nowrap; }
body.tn-body .lq-aviso { margin: 0 0 10px; }
body.tn-body .lq-tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
body.tn-body .lq-tabla th { text-align: left; font-size: 15px; font-weight: 700; padding: 8px 0; color: var(--tn-tinta); vertical-align: top; }
body.tn-body .lq-tabla th small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--tn-suave); }
body.tn-body .lq-tabla td { text-align: right; white-space: nowrap; font-size: 15.5px; font-weight: 700; padding: 8px 0 8px 16px; vertical-align: top; color: var(--tn-tinta); }
body.tn-body .lq-tabla .lq-menos th { padding-left: 16px; font-weight: 600; }
body.tn-body .lq-tabla .lq-menos td { font-weight: 500; }
body.tn-body .lq-tabla .lq-menos td::before { content: '− '; color: var(--tn-suave); }
body.tn-body .lq-tabla .lq-grupo th, body.tn-body .lq-tabla .lq-grupo td { padding-top: 16px; }
body.tn-body .lq-tabla .lq-igual th, body.tn-body .lq-tabla .lq-igual td { border-top: 1px solid var(--tn-linea); }
body.tn-body .lq-tabla .lq-total th, body.tn-body .lq-tabla .lq-total td { border-top: 2px solid var(--tn-tinta); padding-top: 12px; }
body.tn-body .lq-tabla .lq-total th { font-family: var(--tn-serif); font-size: 21px; }
body.tn-body .lq-tabla .lq-total td { font-size: 28px; }
body.tn-body .lq-tabla .lq-total.ok td, body.tn-body .lq-dia.ok b { color: var(--tn-ok); }
body.tn-body .lq-tabla .lq-total.mal td, body.tn-body .lq-dia.mal b { color: var(--tn-mal); }
body.tn-body .lq-antes { margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; }
body.tn-body .lq-como { margin-top: 10px; font-size: 14px; }
body.tn-body .lq-como summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--tn-tinta); }
body.tn-body .lq-como ul { margin: 0; padding-left: 18px; color: var(--tn-suave); line-height: 1.45; }
body.tn-body .lq-como li { margin: 4px 0; }
body.tn-body .lq-bloque strong { display: block; font-family: var(--tn-serif); font-size: 19px; margin-bottom: 4px; }
body.tn-body .lq-bloque p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; }
body.tn-body .lq-bloque p.text-muted { font-size: 13.5px; }
body.tn-body .lq-lista { list-style: none; margin: 8px 0 0; padding: 0; }
body.tn-body .lq-lista li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--tn-linea); font-size: 14.5px; }
body.tn-body .lq-lista li small { color: var(--tn-suave); font-size: 13px; }
body.tn-body .lq-lista li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
body.tn-body .lq-solo { max-width: 720px; margin: 0; }
@media (max-width: 900px) { body.tn-body .lq-cols { grid-template-columns: 1fr; } }
/* Con «Lo que te queda» el Resumen es más alto que la ventana (a 1273×545, unos 1.400 px): baja dentro de su zona, como
   Gastos o Reparaciones, y sus bloques no se encogen (una .card con overflow se dejaría aplastar en la columna flex). */
body.tn-body .tn-resumen { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--tn-marca-linea) transparent; padding-right: 4px; }
body.tn-body .tn-resumen > * { flex-shrink: 0; }
body.tn-body .lq-tabla .lq-total th small { font-family: var(--tn-sans); }   /* la explicación, con la letra de siempre, no la del título */
body.tn-body .lq-lista .lq-suma { font-weight: 700; border-bottom: 0; }   /* el total de lo ganado de comisión, debajo de cada persona */
/* «Lo que te queda»: lo vendido a cuenta en su propia línea, y los seis últimos meses en fichas pequeñas (cada una lleva a su
   Resumen; la del mes que se mira, marcada). En el móvil, de tres en tres para que «−1.234,56 €» quepa. */
body.tn-body .lq-tabla .lq-debe { display: block; margin-top: 2px; color: var(--tn-tinta); }
body.tn-body .lq-hist { margin: 0; }
body.tn-body .lq-hist ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
body.tn-body .lq-hist a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 4px; text-align: center;
    border: 1px solid var(--tn-linea); border-radius: 10px; text-decoration: none; color: var(--tn-tinta); background: var(--tn-papel); }
body.tn-body .lq-hist .este a { border-color: var(--tn-marca); background: var(--tn-marca-suave); }
body.tn-body .lq-hist a span { font-size: 12.5px; color: var(--tn-suave); }
body.tn-body .lq-hist a b { font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.tn-body .lq-hist a b.ok { color: var(--tn-ok); } body.tn-body .lq-hist a b.mal { color: var(--tn-mal); }
@media (max-width: 520px) { body.tn-body .lq-hist ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* En el móvil las cuatro cifras van de dos en dos: un poco más pequeñas para que el «€» no salte de línea. */
@media (max-width: 520px) { body.tn-body .rs-kpis .hoy-kpi > b { font-size: 24px; white-space: nowrap; } }
/* EL RESUMEN ORDENADO (12-11, Jesús: «el diseño de todo sale raro y disparejo y mal acomodado»). Un solo ancho para todo
   (como mucho 1480 px: en una pantalla muy ancha no se estira ni deja bloques sueltos con hueco al lado); cuatro cifras
   iguales; debajo, SIEMPRE dos columnas: la cuenta y, a su derecha, los bloques uno debajo de otro; y a todo el ancho los
   seis meses y las frases. Todos los títulos de tarjeta con la misma letra y tamaño, y las frases con la letra normal. */
body.tn-body .tn-resumen > * { width: 100%; max-width: 1480px; }
body.tn-body .tn-resumen .rs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.tn-body .tn-resumen .lq-cols { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); }
body.tn-body .tn-resumen .lq-cab strong, body.tn-body .tn-resumen .lq-bloque strong,
body.tn-body .tn-resumen .lq-hist > strong, body.tn-body .tn-resumen .rs-frases > strong { display: block; font-family: var(--tn-serif); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
body.tn-body .tn-resumen .rs-frases { max-width: 1480px; }
body.tn-body .tn-resumen .rs-frases p { font-size: 15px; line-height: 1.55; margin: 6px 0 0; }
body.tn-body .tn-resumen .rs-frases .rs-casi { font-size: 13.5px; margin-top: 10px; }
body.tn-body .tn-resumen .lq-hist ol { margin-top: 8px; }
body.tn-body .tn-resumen .lq-hist a { min-height: 64px; }
body.tn-body .tn-resumen .lq-hist a span { font-size: 13px; }
body.tn-body .tn-resumen .lq-hist a b { font-size: 16px; }
@media (max-width: 900px) {
    body.tn-body .tn-resumen .rs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.tn-body .tn-resumen .lq-cols { grid-template-columns: 1fr; }
}
/* «Lo que te queda»: el IRPF del autónomo, debajo del IVA en «Aparta para Hacienda» (con su raya, como otra parte del mismo
   bloque), el resultado de «Cómo acabarás el mes» en verde o en rojo, y la cifra de Hoy, que es un enlace sin subrayado. */
body.tn-body .lq-irpf { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tn-linea); }
body.tn-body .lq-irpf > b { display: block; font-size: 14.5px; }
body.tn-body .lq-lista b.lq-ok { color: var(--tn-ok); } body.tn-body .lq-lista b.lq-mal { color: var(--tn-mal); }
body.tn-body .hoy-kpis .lq-kpi { text-decoration: none; color: inherit; }
/* «Cuenta desde octubre, cuando empezaste con Stoki…» (13-11): un aviso suave dentro de «Aparta para Hacienda», con el ámbar
   de aviso de siempre (regla 3), para que quien empezó a mitad de año sepa que el IRPF puede salir corto. */
body.tn-body .lq-nota-aviso { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--tn-aviso-suave); color: #78350F; font-size: 13.5px; line-height: 1.45; }
body.tn-body .lq-nota-aviso a { color: inherit; font-weight: 600; }

/* ============================================================
   COPIAS (módulo de copisterías, 14-11-2026; partials/tpv_copias.php, dibujado en maquetas/copisteria-iconos.html).
   La pestaña «Copias» del TPV cambia las categorías y la rejilla por el teclado de copias, en el mismo sitio y sin
   bajar (regla 6). Lo elegido, como pidió Jesús («que se note más cuál está seleccionado»): fondo del color del
   negocio y una ✓ en la esquina; lo no elegido, con el dibujo apagado a la mitad.
   ============================================================ */
body.tn-body .tv-cat.en-copias { grid-template-rows: auto minmax(0, 1fr); }
body.tn-body .tv-cat.en-copias > .tv-cats-zona, body.tn-body .tv-cat.en-copias > .tv-migas { display: none !important; }
body.tn-body .tv-cat.en-copias .tv-rejilla-zona > :not(.tv-toast):not(.cop) { display: none !important; }
body.tn-body .cop { grid-row: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; min-height: 0; }
body.tn-body .cop[hidden] { display: none; }
body.tn-body .cop-pad, body.tn-body .cop-der { background: var(--tn-papel); border: 1px solid var(--tn-linea); border-radius: 18px; padding: 12px;
    display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; box-shadow: var(--tn-sombra); }
body.tn-body .cop-tg { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); min-width: 0; }
body.tn-body .cop-tg button { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
    padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--tn-tinta); font: 600 15px var(--tn-sans); cursor: pointer; white-space: nowrap; }
body.tn-body .cop-tg button span { overflow: hidden; text-overflow: ellipsis; }
body.tn-body .cop-ic { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; }
body.tn-body .cop-tg button:not(.on) .cop-ic { opacity: .5; }
body.tn-body .cop-tg button.on { background: var(--tn-marca); color: #fff; }
body.tn-body .cop-tg button.on::after { content: "\2713"; position: absolute; top: -5px; right: -4px; width: 18px; height: 18px; border-radius: 50%;
    background: #01B9D9; color: #fff; font: 700 11px/18px var(--tn-sans); text-align: center; box-shadow: 0 0 0 2px var(--tn-papel); }
body.tn-body .cop-tg.chico button { min-height: 38px; font-size: 13.5px; }
/* A4/A3 dice poco y «1 cara / 2 caras» más: más sitio a las caras (a 1273 se cortaba «1 c…»). */
body.tn-body .cop-dos { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; }
body.tn-body .cop-dos .cop-tg button { gap: 4px; padding: 0 4px; }
body.tn-body .cop-dos .cop-ic { width: 26px; height: 26px; }
body.tn-body .cop-cuenta { display: flex; align-items: baseline; gap: 8px; background: var(--tn-marca-suave); border-radius: 14px; padding: 4px 14px; min-width: 0; }
body.tn-body .cop-cuenta b { font: 700 30px/1.15 var(--tn-sans); color: var(--tn-marca); font-variant-numeric: tabular-nums; }
body.tn-body .cop-cuenta > span:not(.cop-tramo) { color: var(--tn-tinta); font-size: 15px; }
body.tn-body .cop-tramo { margin-left: auto; min-width: 0; font-size: 12.5px; color: var(--tn-suave); text-align: right; line-height: 1.3; }
body.tn-body .cop-teclas { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; }
body.tn-body .cop-teclas button { min-height: 34px; border: 1px solid var(--tn-linea); border-radius: 12px; background: var(--tn-papel); color: var(--tn-tinta);
    font: 600 20px var(--tn-sans); cursor: pointer; }
body.tn-body .cop-teclas button.mas { font-size: 15px; color: var(--tn-marca); }
body.tn-body .cop-teclas button:active { background: var(--tn-marca-suave); }
body.tn-body .tv-cop-f { margin: 0; }
/* En el teclado de copias, «Añadir» es lo que se pulsa siempre: a lo ancho del teclado, como el COBRAR del ticket. */
body.tn-body .cop-anadir { width: 100%; height: 50px; font-size: 16.5px; }
body.tn-body .cop-anadir:disabled { opacity: .5; cursor: default; }
body.tn-body .cop-et { font-size: 12.5px; font-weight: 600; color: var(--tn-suave); }
body.tn-body .cop-siempre { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
body.tn-body .cop-siempre button { width: 100%; min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 10px;
    border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); text-align: left; cursor: pointer; }
/* El nombre del botón, en dos renglones si hace falta («DNI por las dos caras» se cortaba). */
body.tn-body .cop-siempre b { font: 600 14px/1.2 var(--tn-sans); color: var(--tn-tinta); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.tn-body .cop-siempre em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--tn-marca); }
body.tn-body .cop-varios { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 2px dashed var(--tn-marca-linea);
    border-radius: 16px; background: var(--tn-papel); text-align: left; cursor: pointer; }
body.tn-body .cop-varios .cop-ic { width: 40px; height: 40px; }
body.tn-body .cop-varios b { display: block; font-size: 15.5px; color: var(--tn-marca); }
body.tn-body .cop-varios small { font-size: 12.5px; color: var(--tn-suave); }
body.tn-body .cop-aviso { margin: auto 0 0; padding: 8px 12px; border-radius: 12px; background: var(--tn-aviso-suave); color: #78350F; font-size: 13px; line-height: 1.4; }
body.tn-body .cop-aviso a { color: inherit; font-weight: 700; }
body.tn-body .cop-nota { margin: auto 0 0; font-size: 12.5px; color: var(--tn-suave); }
/* El cliente del ticket en la pestaña Copias: su tarifa, «Pagar con su bono» y «Vender bono». */
body.tn-body .cop-cli { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; background: var(--tn-marca-suave); }
body.tn-body .cop-cli .cop-et b { color: var(--tn-tinta); }
body.tn-body .cop-bono { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; cursor: pointer; min-height: 40px; }
body.tn-body .cop-bono input { width: 22px; height: 22px; accent-color: var(--tn-marca); flex-shrink: 0; }
body.tn-body .cop-bono small { display: block; font-weight: 400; font-size: 12.5px; color: var(--tn-suave); }
body.tn-body .cop-vbono { display: flex; gap: 6px; }
body.tn-body .cop-vbono select { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); padding: 0 8px; font: 500 14px var(--tn-sans); }
body.tn-body .cop-vbono .tn-btn { height: 42px; white-space: nowrap; }
/* «Encargos de copias» en la pestaña: un enlace con lo que hay para hoy (ámbar, regla 3) y lo listo (verde). */
body.tn-body .cop-encs { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--tn-linea); border-radius: 14px;
    background: var(--tn-papel); color: var(--tn-tinta); text-decoration: none; font-weight: 600; font-size: 14.5px; }
body.tn-body .cop-encs .tn-ic { width: 26px; height: 26px; }
body.tn-body .cop-encs > span { flex: 1; min-width: 0; }
body.tn-body .cop-encs-n { padding: 2px 8px; border-radius: 999px; background: var(--tn-aviso-suave); color: #78350F; font-size: 12.5px; white-space: nowrap; }
body.tn-body .cop-encs-n.ok { background: var(--tn-ok-suave); color: #14532D; }
body.tn-body .cop-hacer-enc { width: 100%; height: 44px; }
body.tn-body .cop-hacer-enc:disabled { opacity: .5; cursor: default; }
/* La ventana «Hacer encargo»: corta (una decisión), botones abajo a la derecha. */
body.tn-body .cop-enc-v { width: min(640px, 96vw); padding: 22px 24px; }
body.tn-body .cop-enc-f { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
body.tn-body .cop-enc-fila { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
body.tn-body .cop-enc-fila label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
body.tn-body .cop-enc-fila label small { font-weight: 400; color: var(--tn-suave); }
body.tn-body .cop-enc-fila input { height: 44px; }
body.tn-body .cop-enc-dia { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
body.tn-body .cop-enc-dia input { height: 44px; width: auto; }
body.tn-body .cop-enc-para { margin: 0; font-size: 15px; }
body.tn-body .cop-enc-preg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--tn-aviso-suave); color: #78350F; font-size: 14px; }
body.tn-body .cop-enc-preg[hidden], body.tn-body .cop-enc-err[hidden] { display: none; }
body.tn-body .cop-enc-err { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--tn-mal-suave); color: #7F1D1D; font-size: 14px; }
body.tn-body .cop-enc-bot { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 600px) { body.tn-body .cop-enc-fila { grid-template-columns: 1fr; } }
/* Imprimir desde Stoki (programa de impresión): en qué máquina, cómo va y qué hacer si se para. */
body.tn-body .cop-imp { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--tn-linea); }
body.tn-body .cop-imp[hidden], body.tn-body .cop-imp [hidden] { display: none; }
body.tn-body .cop-imp-maq { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
body.tn-body .cop-imp-maq label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
body.tn-body .cop-imp-maq select { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--tn-linea); border-radius: 9px; padding: 0 6px; font: 500 13.5px var(--tn-sans); background: var(--tn-papel); }
body.tn-body .cop-imp-est { margin: 0; font-size: 13px; color: var(--tn-tinta); min-height: 0; }
body.tn-body .cop-imp-est:empty { display: none; }
body.tn-body .cop-imp-acc { display: flex; flex-wrap: wrap; gap: 6px; }
body.tn-body .cop-imp-acc:empty { display: none; }
body.tn-body .cop-imp-acc .tn-btn { height: 40px; font-size: 13.5px; }

/* «Varios documentos»: una ventana grande; los documentos que no caben, con flechas (4 por página). */
body.tn-body .cop-v { width: min(1080px, 96vw); max-height: calc(100vh - 24px); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
body.tn-body .cop-v-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; min-height: 0; }
body.tn-body .cop-v-izq { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
body.tn-body .cop-v-cab, body.tn-body .cop-v-fila { display: grid; grid-template-columns: minmax(0, 1fr) 56px 88px 84px 70px 86px 128px 36px; gap: 8px; align-items: center; }
/* Debajo del nombre: «Ya vino el…» (azul, información) y las páginas en blanco (ámbar, aviso: regla 3). */
body.tn-body .cop-v-nom small.cop-v-ya { color: #0C447C; }
body.tn-body .cop-v-nom small.cop-v-blancas { color: #92400E; }
body.tn-body .cop-v-nohoja { text-align: center; color: var(--tn-suave); font-size: 14px; }
/* El nombre del documento (o del archivo leído) y debajo cómo va: leyendo, leído, a mano, repetido o lo que falla. */
body.tn-body .cop-v-nom { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
body.tn-body .cop-v-nom b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tn-body .cop-v-nom small { font-size: 12px; color: var(--tn-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tn-body .cop-v-fila.av .cop-v-nom small, body.tn-body .cop-v-fila.rep .cop-v-nom small { color: #92400E; font-weight: 600; }
body.tn-body .cop-v-fila.av input[data-c=pags] { border-color: #F59E0B; background: var(--tn-aviso-suave); }
body.tn-body .cop-v-fila input:disabled { background: var(--tn-fondo, #F5F7F8); color: var(--tn-suave); }
body.tn-body .cop-v-estado { margin: 0; min-height: 17px; font-size: 13px; color: var(--tn-suave); }
/* «elegir» páginas (la 13 de 40): un enlace pequeño en la línea de debajo del nombre; al tocarlo, un campo en su sitio. */
body.tn-body .cop-v-sel { border: 0; background: none; padding: 0 2px; color: var(--tn-marca); font: 600 12px var(--tn-sans); text-decoration: underline; cursor: pointer; }
body.tn-body .cop-v-selin { width: 100%; height: 40px; padding: 0 8px; border: 2px solid var(--tn-marca); border-radius: 10px; font: 600 14px var(--tn-sans); }
body.tn-body .cop-v-estado.av { color: #92400E; font-weight: 600; }
body.tn-body .cop-v-subir { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
body.tn-body .cop-v-subir .cop-ic { width: 24px; height: 24px; }
/* Al arrastrar archivos encima del TPV: la ventana se marca para soltarlos. */
body.tn-body #vCopias.encima .cop-v { outline: 4px dashed var(--tn-marca-linea); outline-offset: -8px; }
body.tn-body .cop-v-der > .cop-v-arch { padding-bottom: 6px; border-bottom: 1px solid var(--tn-linea); }
body.tn-body .cop-v-cab span { font-size: 12.5px; font-weight: 600; color: var(--tn-suave); }
body.tn-body .cop-v-filas { display: flex; flex-direction: column; gap: 6px; min-height: 194px; }
body.tn-body .cop-v-fila input { width: 100%; height: 44px; padding: 0 6px; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel);
    font: 600 17px var(--tn-sans); text-align: center; color: var(--tn-tinta); }
body.tn-body .cop-mini { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); }
body.tn-body .cop-mini button { flex: 1; height: 38px; border: 0; border-radius: 8px; background: transparent; font: 600 14.5px var(--tn-sans); color: var(--tn-tinta); cursor: pointer; }
body.tn-body .cop-mini button.on { background: var(--tn-marca); color: #fff; }
body.tn-body .cop-quitar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--tn-suave); display: grid; place-items: center; cursor: pointer; }
body.tn-body .cop-quitar svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
body.tn-body .cop-v-pie { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
/* Las flechas de los documentos, pequeñas y en la misma fila (las grandes de la rejilla no caben aquí). */
body.tn-body .cop-v-pie .tn-pag { margin-left: auto; padding: 0; gap: 8px; }
body.tn-body .cop-v-pie .tn-pag button { width: 48px; height: 44px; font-size: 22px; }
body.tn-body .cop-v-pie .tn-pag span { min-width: 0; font-size: 14px; }
body.tn-body .cop-v-pie .tn-pag[hidden] { display: none; }
body.tn-body .cop-v-ops { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--tn-linea); }
body.tn-body .cop-v-arch { display: flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
body.tn-body .cop-v-arch input { width: 20px; height: 20px; accent-color: var(--tn-marca); }
body.tn-body .cop-v-arch small { color: var(--tn-suave); font-size: 12.5px; }
body.tn-body .cop-acab { display: flex; flex-wrap: wrap; gap: 8px; }
body.tn-body .cop-acab-u { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border: 1px solid var(--tn-linea); border-radius: 14px; background: var(--tn-papel); font-size: 14px; }
body.tn-body .cop-acab-u .cop-ic { width: 26px; height: 26px; }
body.tn-body .cop-acab-u button { width: 36px; height: 36px; border: 1px solid var(--tn-linea); border-radius: 50%; background: var(--tn-papel); font: 700 18px/1 var(--tn-sans); color: var(--tn-marca); cursor: pointer; }
body.tn-body .cop-acab-u b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
body.tn-body .cop-v-der { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding-left: 18px; border-left: 1px solid var(--tn-linea); }
body.tn-body .cop-v-lineas { flex: 1; min-height: 0; overflow: hidden; }
body.tn-body .cop-v-l { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--tn-linea); font-size: 14px; }
body.tn-body .cop-v-l small { display: block; font-size: 12px; color: var(--tn-suave); }
body.tn-body .cop-v-l b { white-space: nowrap; font-variant-numeric: tabular-nums; }
body.tn-body .cop-v-vacio { margin: 8px 0; color: var(--tn-suave); font-size: 14px; }
body.tn-body .cop-v-total { display: flex; justify-content: space-between; align-items: baseline; font: 700 22px var(--tn-sans); }
body.tn-body .cop-v-coste { min-height: 16px; font-size: 12.5px; color: var(--tn-suave); }
/* Móvil y tablet de pie: una columna (ahí la página ya baja). */
@media (max-width: 900px) {
    body.tn-body .cop { grid-template-columns: 1fr; }
    body.tn-body .cop-teclas { grid-auto-rows: 52px; }
    body.tn-body .cop-v-cuerpo { grid-template-columns: 1fr; }
    body.tn-body .cop-v-der { padding-left: 0; border-left: 0; }
    body.tn-body .cop-v { overflow-y: auto; }
    body.tn-body .cop-v-cab { display: none; }
    body.tn-body .cop-v-cab, body.tn-body .cop-v-fila { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Copias 2.8.78 (Jesús, 14-11): «Elegir archivos del ordenador» dentro del recuadro de «Varios documentos»; la columna
   «Color» con «Color | B/N» en lo leído y «Todo en B/N»; y VER LAS PÁGINAS (miniaturas, la grande con la lupa). */
body.tn-body .cop-varios-z { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border: 2px dashed var(--tn-marca-linea); border-radius: 16px; background: var(--tn-papel); }
body.tn-body .cop-varios-z .cop-varios { border: 0; background: transparent; }
body.tn-body .cop-varios-z .cop-elegir-tpv { align-self: flex-start; margin: 0 14px; min-height: 44px; cursor: pointer; background: var(--tn-marca); border-color: var(--tn-marca); color: #fff; font-weight: 700; }   /* una regla de las etiquetas de la columna lo dejaba gris */
body.tn-body .cop-v-bn button { font-size: 13px; padding: 0 4px; }
/* La nota de la fila se acorta con «…» pero «ver páginas» se ve siempre (es la entrada a la vista previa). */
body.tn-body .cop-v-nom small.cop-v-sub { display: flex; align-items: baseline; gap: 4px; }
body.tn-body .cop-v-sub > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tn-body .cop-v-sub > .cop-v-sel { flex-shrink: 0; }
body.tn-body .cop-v-nom b.cop-v-ver { cursor: pointer; }
body.tn-body .cop-v-nom b.cop-v-ver:hover { text-decoration: underline; }
body.tn-body .cop-todo-bn { display: inline-flex; align-items: center; gap: 6px; }
body.tn-body .cop-todo-bn .cop-ic { width: 22px; height: 22px; }
body.tn-body .cop-todo-bn[hidden] { display: none; }
body.tn-body .cop-v-izq { position: relative; }
body.tn-body .cop-v-izq.viendo > :not(.cop-ver) { visibility: hidden; }   /* el papel de los temas es casi opaco: lo de debajo se transparentaba */
body.tn-body .cop-ver { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; background: var(--tn-papel); }
body.tn-body .cop-ver[hidden], body.tn-body .cop-ver-rej[hidden], body.tn-body .cop-ver-grande[hidden], body.tn-body .cop-ver-pie .tn-pag[hidden] { display: none; }
body.tn-body .cop-ver-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
body.tn-body .cop-ver-cab b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tn-body .cop-ver-cab small { flex-shrink: 0; font-size: 12.5px; color: var(--tn-suave); }
body.tn-body .cop-ver-rej { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, 68px); grid-auto-rows: 112px; gap: 8px; align-content: start; overflow: hidden; padding: 8px 8px 0 8px; }   /* el hueco de arriba: que la ✓ y la lupa no se corten */
body.tn-body .cop-ver-p { position: relative; }
body.tn-body .cop-ver-p > button[data-p] { position: relative; width: 68px; height: 112px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 4px;
    border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); cursor: pointer; }
body.tn-body .cop-ver-p img, body.tn-body .cop-ver-sin { display: block; width: 58px; height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--tn-linea); }
body.tn-body .cop-ver-p.col img { border: 2px solid #D85A30; }
body.tn-body .cop-ver-p span { max-width: 100%; overflow: hidden; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--tn-tinta); }
body.tn-body .cop-ver-p em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--tn-suave); }
body.tn-body .cop-ver-p em.c { color: #993C1D; }
body.tn-body .cop-ver-p.en > button[data-p] { border: 2px solid var(--tn-marca); }
body.tn-body .cop-ver-p.en > button[data-p]::after { content: '✓'; position: absolute; left: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--tn-marca); color: #fff; font: 700 12px/20px var(--tn-sans); text-align: center; }
body.tn-body .cop-ver-p:not(.en) > button[data-p] { opacity: .5; }
/* Las blancas, tachadas (una cruz encima de la miniatura). */
body.tn-body .cop-ver-p.blanca > button[data-p]::before { content: ''; position: absolute; left: 5px; top: 5px; width: 58px; height: 80px; pointer-events: none;
    background: linear-gradient(to top right, transparent calc(50% - 1px), #94A3AA calc(50% - 1px), #94A3AA calc(50% + 1px), transparent calc(50% + 1px)),
                linear-gradient(to bottom right, transparent calc(50% - 1px), #94A3AA calc(50% - 1px), #94A3AA calc(50% + 1px), transparent calc(50% + 1px)); }
body.tn-body .cop-ver-lupa { position: absolute; right: -4px; top: -6px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0;
    border: 1px solid var(--tn-linea); border-radius: 9px; background: var(--tn-papel); color: var(--tn-tinta); cursor: pointer; }
body.tn-body .cop-ver-lupa svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
body.tn-body .cop-ver-grande { flex: 1; min-height: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
body.tn-body .cop-ver-hoja { position: relative; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
body.tn-body .cop-ver-hoja img { max-width: 100%; max-height: 100%; background: #fff; border: 1px solid var(--tn-linea); }
body.tn-body .cop-ver-hoja span { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 8px; background: var(--tn-papel); font-size: 12px; color: var(--tn-suave); }
body.tn-body .cop-ver-hoja span:empty { display: none; }
body.tn-body .cop-ver-fl { height: 64px; border: 1px solid var(--tn-linea); border-radius: 12px; background: var(--tn-papel); font-size: 26px; color: var(--tn-tinta); cursor: pointer; }
body.tn-body .cop-ver-fl:disabled { opacity: .35; cursor: default; }
body.tn-body .cop-ver-gpie { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.tn-body .cop-ver-gpie b { font-size: 14px; }
body.tn-body .cop-ver-pie { display: flex; align-items: center; gap: 10px; }
body.tn-body .cop-ver-pie input { width: 140px; height: 44px; padding: 0 10px; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); font: 15px var(--tn-sans); }
body.tn-body .cop-ver-cuenta { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; line-height: 1.3; color: var(--tn-suave); }
body.tn-body .cop-ver-cuenta.av { color: #92400E; font-weight: 600; }
body.tn-body .cop-ver-pie .tn-pag { padding: 0; gap: 6px; }
body.tn-body .cop-ver-pie .tn-pag button { width: 44px; height: 44px; font-size: 22px; }
body.tn-body .cop-ver-pie .tn-pag span { min-width: 0; font-size: 13px; }
@media (max-width: 900px) { body.tn-body .cop-ver-cab small { display: none; } body.tn-body .cop-ver-pie { flex-wrap: wrap; } }

/* Con dos listas (B/N y color), una al lado de la otra con su nombre encima: en dos renglones tapaban la segunda línea
   de la cuenta a 1273×545 (la cuenta no baja: se corta). */
body.tn-body .cop-imp-maq:has(> label + label) { flex-direction: row; gap: 8px; }
body.tn-body .cop-imp-maq:has(> label + label) > label { flex: 1; min-width: 0; flex-direction: column; align-items: stretch; gap: 2px; font-size: 12px; color: var(--tn-suave); }
body.tn-body .cop-imp-maq:has(> label + label) select { flex: none; width: 100%; color: var(--tn-tinta); }
/* 2.8.79, tramos escalonados: el reparto del teclado («10 × 0,08 + 90 × 0,06 + …») como mucho en dos renglones: con
   muchos tramos apretaba el teclado (el TPV no baja). Entero, en el «title». */
body.tn-body .cop-tramo { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* 2.8.80: sin «Iguales»; el mismo archivo dos veces, en ámbar con «juntarlos». */
body.tn-body .cop-v-nom small.cop-v-rep { color: #92400E; font-weight: 600; }
/* 2.8.80: «−» y «+» en Juegos, como los acabados de abajo pero para el dedo (40 × 44); el número se sigue escribiendo. */
body.tn-body .cop-v-jg { display: flex; align-items: center; gap: 4px; min-width: 0; }
body.tn-body .cop-v-jg input { min-width: 0; flex: 1; text-align: center; }
body.tn-body .cop-v-jg button { flex: 0 0 40px; height: 44px; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); font: 600 20px var(--tn-sans); color: var(--tn-tinta); cursor: pointer; }
body.tn-body .cop-v-jg button:disabled { opacity: .35; cursor: default; }
@media (max-width: 900px) { body.tn-body .cop-v-jg { grid-column: span 2; } }

/* EL «+» DE LAS FICHAS DEL TPV, SIN UN DIBUJO POR FICHA (Jesús, 17-11: el TPV de una tienda con muchos productos tardaba).
   Cada ficha llevaba su <svg> con su trazo: con 2.500 productos, 5.000 trozos más en la página. Es el mismo «+» de
   tn_ico('mas'), pintado por CSS con el color del botón (currentColor). */
.tn-redondo.tv-mas::before { content: ''; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ===== LA FICHA DEL PRODUCTO, EN PÁGINA ENTERA (Jesús, 17-11: eligió la «profesional» de los ejemplos dibujados) =====
   partials/producto_ficha.php: arriba la barra (volver, nombre con su estado, Descartar / Guardar), que se queda fija; debajo
   dos columnas de tarjetas que bajan por dentro: a la izquierda lo que más se toca, a la derecha lo secundario. Por debajo de
   960 px de ancho, una columna (lo de la derecha, debajo). Es gestión: aquí SÍ se baja (regla 6 solo es del TPV). */
.pf { gap: 10px; }
.pf-aviso { flex-shrink: 0; margin: 0; }
/* Barra y tarjetas con el MISMO ancho (hasta 1480): a 1909 de ancho, los botones de la barra quedaban lejos de las tarjetas. */
.pf-form { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; margin: 0; width: 100%; max-width: 1480px; }
.pf-barra { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--tn-papel);
            border: 1px solid var(--tn-linea); border-radius: 14px; }
.pf-volver { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; color: var(--tn-tinta);
             border: 1px solid var(--tn-linea); background: var(--tn-papel); }
.pf-volver:hover { background: var(--tn-marca-suave); }
.pf-volver svg { width: 20px; height: 20px; }
.pf-titulo { min-width: 0; flex: 1; }
.pf-titulo small { display: block; font-size: 12.5px; color: var(--tn-suave); }
.pf-titulo h1 { margin: 0; font-family: var(--tn-sans); font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pf-titulo h1 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-titulo .tn-chip { flex-shrink: 0; font-size: 12px; }
.pf-acciones { display: flex; gap: 8px; flex-shrink: 0; }
.pf-cuerpo { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-bottom: 8px; }
.pf-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
body.tn-body .pf-card { margin: 0; padding: 16px 18px; gap: 12px; overflow: visible; }
/* Los títulos de tarjeta, como en el resto de la gestión: la letra de títulos (serif), todos iguales. */
.pf-card h2 { margin: 0; font-family: var(--tn-serif); font-size: 21px; font-weight: 600; line-height: 1.1; color: var(--tn-tinta); display: flex; align-items: baseline; gap: 8px; }
.pf-card h2 small { font-size: 12.5px; font-weight: 400; color: var(--tn-suave); }
.pf-card .form-group { margin: 0; }
.pf-card-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pf-opc { font-weight: 400; color: var(--tn-suave); }
.pf-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pf-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.pf-g3[hidden], .pf-ayuda[hidden] { display: none; }
.pf-con-unidad { display: flex; align-items: center; border: 1px solid var(--tn-linea); border-radius: 10px; background: var(--tn-papel); overflow: hidden; }
.pf-con-unidad:focus-within { outline: 2px solid var(--tn-marca); outline-offset: -1px; }
body.tn-body .pf-con-unidad input { border: 0; box-shadow: none; outline: 0; min-width: 0; flex: 1; font-size: 17px; font-weight: 600; }
.pf-con-unidad span { padding: 0 12px; font-size: 13px; color: var(--tn-suave); white-space: nowrap; }
.pf-cifras { display: flex; gap: 22px; padding: 9px 12px; border-radius: 10px; background: var(--tn-fondo, var(--tn-marca-suave)); font-size: 13px; color: var(--tn-suave); }
.pf-cifras b { margin-left: 4px; color: var(--tn-tinta); font-variant-numeric: tabular-nums; }
.pf-ayuda { margin: 0; font-size: 12.5px; color: var(--tn-suave); }
.pf-interruptor { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--tn-suave); cursor: pointer; }
/* «Compra y margen» (prv_producto_campos.php) dentro de su tarjeta: el título ya lo pone la tarjeta. */
.pf-compra .prv-compra { border: 0; margin: 0; padding: 0; }
.pf-compra .prv-compra legend { display: none; }
.pf-modulos > .grid { margin-top: 0 !important; }
/* Estado: cada opción en una fila, su explicación debajo y el interruptor a la derecha. */
.pf-op { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.pf-op small { grid-column: 1; font-size: 12.5px; font-weight: 400; color: var(--tn-suave); }
.pf-op .tn-switch { grid-column: 2; grid-row: 1 / 3; }
.pf-op + .pf-op { padding-top: 12px; border-top: 1px solid var(--tn-linea); }
/* Imagen: el botón del TPV en pequeño (se toca o se le suelta una foto) y sus botones al lado. */
.pf-imagen { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-soltar { width: 132px; cursor: pointer; transition: outline-color .15s; outline: 2px dashed transparent; outline-offset: 3px; }
.pf-soltar.encima { outline-color: var(--tn-marca); }
.pf-imagen-acc { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.pf-quitar { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.pf .pr-iconos { margin-top: 0; }
.pf .pr-iconos summary { font-size: 14px; }
.pf-fuera .btn { align-self: flex-start; }
@media (max-width: 960px) {
    .pf-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .pf-barra { flex-wrap: wrap; }
    .pf-titulo small { display: none; }
    .pf-acciones { width: 100%; }
    .pf-acciones > * { flex: 1; text-align: center; }
    .pf-g2, .pf-g3 { grid-template-columns: minmax(0, 1fr); }
    .pf-imagen { grid-template-columns: minmax(0, 1fr); }
}

/* Ajustes → Facturas: los dos textos legales (17-11, migración 305), un grupo aparte dentro de la misma tarjeta. */
.fa-legal { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--tn-linea); }
.fa-legal > strong { font-size: 15px; }
.fa-legal > strong .text-muted { font-weight: 400; font-size: 13px; }
.fa-legal .alert { margin: 0; }

/* ===== REVISIÓN «COMO UNA PERSONA», 18-11 =====
   Lo que salió al usar el programa como varios comerciantes el primer día. */
/* La «×» de la franja «Te hemos activado…»: a la derecha, sin empujar el texto. */
body.tn-body .tn-fila-aviso { position: relative; padding-right: 46px; }
body.tn-body .tn-aviso-quitar { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); margin: 0; }
body.tn-body .tn-aviso-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit;
    font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; }
body.tn-body .tn-aviso-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
/* «Para empezar» arriba de Hoy: la misma franja de Ajustes, con su aire debajo. */
body.tn-body .tn-gestion > .aj-empezar, body.tn-body main > .aj-empezar { margin-bottom: 12px; }
/* Las puertas del primer día (contraseña temporal y condiciones) con el aspecto de entrar. */
.tn-puerta .lc-puntos { margin: 0 0 12px; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--tn-tinta); }
.tn-puerta .lc-leer { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; font-size: 14px; }
.tn-puerta .lc-leer a { color: var(--tn-marca-osc); font-weight: 600; }
.tn-puerta .lc-casilla { display: flex !important; grid-template-columns: none; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.5; }
.tn-puerta .lc-casilla input, .tn-puerta .cl-verlas input { width: 20px; height: 20px !important; flex: none; margin-top: 2px; }
.tn-puerta .cl-verlas { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; font-size: 13.5px !important; }
.tn-puerta .tn-pin-err:empty { display: none; }
/* El logo de Aspecto no se sale de su recuadro (pisaba «Cambiar el logo» con uno apaisado). */
.tn-aspecto .as-logo { overflow: hidden; }
@media (max-height: 700px) and (min-width: 901px) { .tn-aspecto .as-logo img { max-height: 80px; } }
/* La caja de otro día que sigue abierta: una ventana corta, con su pregunta. */
.tv-caja-vieja { max-width: 480px; padding: 24px; }
.tv-caja-vieja h2 { margin: 0 0 8px; font-size: 20px; }
.tv-caja-vieja p { margin: 0 0 16px; color: var(--tn-suave); line-height: 1.5; }
/* «TICKET» en la cabecera oscura del ticket: salía en el color de texto normal (casi negro) sobre el marino y no se leía
   (revisión del 18-11, en una tablet). Blanco, como el icono de la bolsa. */
body.tn-body .tk-cab h3 { color: #fff; }

/* ===== CUOTAS · COBRAR VARIOS MESES (encargo «cuotas», 18-11-2026) =====
   En la ficha de Cuotas, la ventana «Cobrar varios meses»: por cada tarifa, una fila
   de botones 1 · 2 · 3 · 6 · 12 que dicen qué meses cubren y cuánto cuestan, para
   que en el mostrador se vea antes de pulsar (regla 7: el precio final a la vista). */
body.tn-body .cu-meses-tarifa { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--tn-linea); }
body.tn-body .cu-meses-cab { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
body.tn-body .cu-meses-op { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
body.tn-body .cu-meses-op .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 120px; min-height: 44px; text-align: left; }
body.tn-body .cu-meses-op .btn small { font-weight: 400; opacity: .8; white-space: nowrap; }
body.tn-body .cu-mas-meses { display: inline-block; margin-left: 8px; font-size: .9em; }

/* ===== IMPRIMIR-POR-CAJA (18-11-2026): el logo en el ticket de papel, en Ajustes → Aspecto =====
   La casilla va dentro de la tarjeta del logo (.aj-op) y debajo, los puntos tal cual los imprime la térmica, sobre «papel». */
body.tn-body .as-logo-tk { margin-top: 12px; border-top: 1px solid var(--tn-linea); }
body.tn-body .as-logo-papel { display: block; align-self: flex-start; background: #fff; border: 1px solid var(--tn-linea); border-radius: 6px; padding: 10px 14px; margin-top: 6px; max-width: 100%; }
body.tn-body .as-logo-papel img { display: block; width: 192px; max-width: 100%; height: auto; }
/* ===== AGENDA (18-11-2026): bonos que caducan, en la ficha de la clienta =====
   Le quedan sesiones y caduca en 30 días o menos: en ámbar (el color de aviso de siempre), para que las gaste a tiempo. */
body.tn-body .tn-bonos li.pronto { background: var(--tn-aviso-suave, #FCEFD9); color: var(--tn-tinta); }
body.tn-body .tn-bonos li.pronto strong { color: #92400E; }   /* el ámbar oscuro: #B45309 sobre su fondo da 4,4:1, poco */
/* ===== DEVOLVER-SIN-TICKET (18-11-2026): devolver_sin_ticket.php y el botón de la ventana «Tickets» del TPV =====
   Formulario de 720 px como mucho, en tres pasos con título; el botón del TPV a la derecha del título «Cobrados». */
body.tn-body .tvt-col h3 .tvt-sinticket { margin-left: auto; min-height: 44px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--tn-tinta); }
body.tn-body .dst > .card { max-width: 720px; }
body.tn-body .dst-paso { margin: 18px 0 10px; font-size: 15px; font-weight: 700; color: var(--tn-suave); }
body.tn-body .dst-paso:first-child { margin-top: 0; }
body.tn-body .dst-buscar { display: flex; gap: 8px; }
body.tn-body .dst-buscar input { flex: 1 1 auto; min-width: 0; min-height: 44px; }
body.tn-body .dst-resultados { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
body.tn-body .dst-resultados a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px;
    border: 1px solid var(--tn-linea); border-radius: 10px; color: var(--tn-tinta); text-decoration: none; }
body.tn-body .dst-resultados a:hover { background: var(--tn-marca-suave); }
body.tn-body .dst-resultados small { color: var(--tn-suave); margin-left: 6px; }
body.tn-body .dst-prod { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; font-size: 17px; }
body.tn-body .dst-rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
body.tn-body .dst-rejilla label, body.tn-body .dst-motivo, body.tn-body .dst-caja { display: grid; gap: 4px; font-weight: 600; }
body.tn-body .dst-motivo, body.tn-body .dst-caja { margin-top: 10px; max-width: 520px; }
body.tn-body .dst-check { display: flex; gap: 8px; align-items: center; margin-top: 10px; min-height: 40px; }
body.tn-body .dst-check input, body.tn-body .dst-forma input { width: auto; }
body.tn-body .dst-formas { display: grid; gap: 4px; }
body.tn-body .dst-forma { display: flex; gap: 8px; align-items: center; min-height: 40px; font-weight: 400; }
body.tn-body .dst-forma.apagada { opacity: .5; }
body.tn-body .dst-nota { margin: 6px 0 0; font-size: 13px; }
body.tn-body .dst-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
body.tn-body .dst-cifra { margin: 8px 0 2px; font-size: 30px; font-weight: 700; }
body.tn-body .dst-cifra small { font-size: 15px; font-weight: 600; color: var(--tn-suave); margin-left: 6px; }
body.tn-body .dst-regalo { margin: 10px 0 0; font-size: 16px; }
body.tn-body .dst-regalo b { font-size: 22px; letter-spacing: .06em; }
/* ===== CATALOGO-COMPRAS (18-11-2026): las pestañas fijas con «Más», Precios de compra en lote y los pedidos en cajas =====
   1 · «Más» lo pinta ya el servidor (tn_pestanas_mas_html): con la pestaña en la que estás dentro, el botón lleva su icono
       y su nombre, marcado como elegido, para que siempre se vea dónde estás. */
.tn-pest-mas > summary .tn-ic { width: 26px; height: 26px; flex-shrink: 0; }
.tn-pest-mas > summary span { white-space: nowrap; }
.tn-pest-mas.con-elegida > summary { box-shadow: 0 0 0 1px var(--tn-marca) inset; }
html[data-modo="tactil"] .tn-pest-mas > summary .tn-ic { width: 32px; height: 32px; }
/* 2 · Precios de compra: el campo del precio, a la derecha como las cifras, y lo que no es un precio en rojo. */
body.tn-body .pcl-tabla td.num input.pcl-c { width: 110px; text-align: right; min-height: 34px; padding: 4px 8px; }
body.tn-body .pcl-tabla input.pcl-c.mal { border-color: var(--tn-mal); box-shadow: 0 0 0 1px var(--tn-mal) inset; }
body.tn-body .pcl .cl-barra .pcl-sin { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; align-self: flex-end; min-height: 40px; }
body.tn-body .pcl .cl-barra .pcl-sin input { width: auto; }
body.tn-body .pcl .cl-cab { flex-wrap: wrap; }
body.tn-body .pcl .cl-cab .pcl-ayuda { font-size: 12.5px; }
body.tn-body .pcl .cl-cab .pcl-acc { margin-left: auto; display: flex; gap: 8px; }
body.tn-body .pcl-ventana { width: min(560px, 100%); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
body.tn-body .pcl-ventana.ancha { width: min(820px, 100%); }
body.tn-body .pcl-ventana > strong { font-family: var(--tn-serif); font-size: 22px; font-weight: 600; padding-right: 44px; }
body.tn-body .pcl-ventana p { margin: 0; }
body.tn-body .pcl-v-campos { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
body.tn-body .pcl-v-campos .form-group { margin: 0; }
body.tn-body .pcl-v-nota { font-size: 13px; margin-top: 4px !important; }
body.tn-body .pcl-v-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
body.tn-body .pcl-sub { max-height: 60vh; overflow-y: auto; }
@media (max-width: 600px) { body.tn-body .pcl-v-campos { grid-template-columns: 1fr; } body.tn-body .pcl .cl-cab .pcl-ayuda { display: none; } }
/* (catalogo-compras) «Más» va pegado a la última fija, no al otro lado de la cabecera: la zona de las pestañas mide lo que
   ellas, y lo de la derecha (acción, ayuda, Casi, hora) se queda a la derecha. En el móvil no (allí «Más» no se ve). */
@media (min-width: 901px) {
    .tn-gestion .tn-cab .tn-pest-zona:has(+ .tn-pest-mas) { flex: 0 1 auto; min-width: 0; }
    .tn-gestion .tn-cab .tn-pest-zona + .tn-pest-mas { margin-left: -10px; }
    .tn-gestion .tn-cab .tn-pest-mas + .tn-cab-der { margin-left: auto; }
}
/* (catalogo-compras) Con «Más», las pestañas no se encogen nunca: si falta sitio (el nombre largo de un proveedor como
   título), se corta el TÍTULO con «…», no una pestaña. */
@media (min-width: 901px) {
    /* El título cede primero (encoge mil veces más); solo si ya no puede, la última pestaña (nunca se sale la cabecera). */
    .tn-gestion .tn-cab .tn-pest-zona:has(+ .tn-pest-mas) { flex: 0 1 auto; }
    .tn-gestion .tn-cab:has(.tn-pest-mas) .tn-titulo { flex: 0 1000 auto; min-width: 80px; overflow: hidden; }
    .tn-gestion .tn-cab:has(.tn-pest-mas) .tn-titulo h2, .tn-gestion .tn-cab:has(.tn-pest-mas) .tn-titulo .tn-sub { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
@media (min-width: 901px) { html[data-modo="tactil"] .tn-gestion .tn-cab:has(.tn-pest-mas) .tn-titulo { min-width: 60px; } }
/* (catalogo-compras) Las de «Más», con su icono centrado al lado del nombre (fuera de .tn-pest-zona no les llegaba). */
.tn-pest-mas-lista a.tn-pest { display: flex; align-items: center; color: var(--tn-tinta); text-decoration: none; font-weight: 600; border-radius: 10px; }
.tn-pest-mas-lista a.tn-pest .tn-ic { width: 24px; height: 24px; flex-shrink: 0; }
