/* Pincho Facturación — hoja de estilos
   Colores de la marca: el azul y el naranja de la pantalla de bienvenida del programa.
   Letra: Barlow, de la familia DIN, como los informes y facturas que imprime el programa. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-sc-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-sc-700.woff2") format("woff2"); }

:root {
  --tinta: #16294f;        /* azul Pincho */
  --tinta-2: #24407a;
  --naranja: #f29f2e;      /* naranja Pincho */
  --verde: #1f7a4d;
  --papel: #ffffff;
  --niebla: #eef1f6;
  --linea: #d8dde7;
  --texto: #1b2232;
  --texto-2: #535d71;
  --sombra-captura: 0 2px 4px rgba(22, 41, 79, .08), 0 24px 60px -12px rgba(22, 41, 79, .35);
  --ancho: 1200px;
  --titulos: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;
  --cuerpo: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papel: #0f1729;
    --niebla: #16203a;
    --linea: #2a3654;
    --texto: #e6eaf3;
    --texto-2: #a6b0c5;
    --verde: #3aa874;
    --sombra-captura: 0 24px 60px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--papel); color: var(--texto);
  font-family: var(--cuerpo); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--titulos); line-height: 1.08; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; color: var(--tinta); }
h3 { font-size: 1.35rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { h2 { color: var(--texto); } }
p { margin: 0 0 1em; }
.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 24px; }
.entradilla { font-size: 1.15rem; color: var(--texto-2); max-width: 62ch; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 8px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--cuerpo); text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.boton-principal { background: var(--tinta); color: #fff; }
.boton-principal:hover { background: var(--tinta-2); }
.boton-naranja { background: var(--naranja); color: #1d1300; }
.boton-naranja:hover { background: #f7b04f; }
.enlace { font-weight: 600; color: var(--tinta); text-underline-offset: 4px; }
@media (prefers-color-scheme: dark) {
  .boton-principal { background: var(--naranja); color: #1d1300; }
  .boton-principal:hover { background: #f7b04f; }
  .enlace { color: var(--texto); }
}

/* ---------- Aviso de desarrollo ---------- */
.aviso-desarrollo { background: #fdf0dc; color: #5c3600; font-size: .95rem; text-align: center; padding: 9px 24px; }
.aviso-desarrollo a { font-weight: 600; }
@media (prefers-color-scheme: dark) { .aviso-desarrollo { background: #3a2a10; color: #f6d9ae; } }

/* ---------- Barra superior ---------- */
.barra { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--papel) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.barra.con-linea { border-bottom-color: var(--linea); }
.barra .contenedor { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; position: relative; }
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--tinta); }
.marca img { width: 42px; height: 42px; }
.marca span { font-family: var(--titulos); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) { .marca { color: var(--texto); } }
.menu { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.menu a:not(.boton) { text-decoration: none; font-weight: 500; color: var(--texto-2); }
.menu a:not(.boton):hover { color: var(--texto); }
.menu .boton { padding: 10px 18px; }
.boton-menu { display: none; background: none; border: 1px solid var(--linea); border-radius: 8px; width: 44px; height: 44px; color: var(--texto); cursor: pointer; }
.boton-menu svg { width: 22px; height: 22px; }

/* ---------- Portada ---------- */
.portada { padding: 72px 0 0; position: relative; isolation: isolate; }
.portada::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: linear-gradient(125deg, #1a406c, #091626); z-index: -1; }
.portada-texto { max-width: 820px; }
.portada h1 { font-size: clamp(2.6rem, 6.2vw, 4.5rem); font-weight: 700; color: var(--tinta); margin-bottom: 24px; }
@media (prefers-color-scheme: dark) { .portada h1 { color: var(--texto); } }
.portada .entradilla { margin-bottom: 32px; }
.portada .acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.garantias { display: flex; flex-wrap: wrap; gap: 8px 26px; list-style: none; padding: 0; margin: 30px 0 0; font-size: .98rem; color: var(--texto-2); }
.garantias li { position: relative; padding-left: 26px; }
.garantias li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--verde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/11px no-repeat;
}

.escaparate { margin-top: 56px; }
.escaparate-cabecera { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.en-directo { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: .95rem; font-weight: 500; color: var(--texto-2); }
.en-directo .punto { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--naranja); }
.en-directo .punto::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--naranja); animation: latido 2s ease-out infinite; }
@keyframes latido { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.interruptor { display: inline-flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--texto-2); }
.interruptor-botones { display: inline-flex; background: var(--niebla); border: 1px solid var(--linea); border-radius: 999px; padding: 3px; }
.interruptor button {
  border: 0; background: transparent; color: var(--texto-2); font: 600 .9rem/1 var(--cuerpo);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.interruptor button[aria-pressed="true"] { background: var(--tinta); color: #fff; }
@media (prefers-color-scheme: dark) { .interruptor button[aria-pressed="true"] { background: var(--naranja); color: #1d1300; } }
.ventana { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--sombra-captura); background: #f4f4f4; }
.escaparate .ventana { aspect-ratio: 2880 / 1548; animation: subir .9s cubic-bezier(.2, .7, .2, 1) both .1s; }
.escaparate .ventana img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .35s ease; }
.ventana img.apagada { opacity: 0; }
@keyframes subir { from { opacity: 0; transform: translateY(28px); } }
.pie-captura { color: #b9c4dc; font-size: .9rem; margin: 14px 0 0; padding-bottom: 56px; max-width: 90ch; }

/* ---------- La pantalla de Inicio en directo (recreación del programa) ----------
   Hecha a partir de UcInicio.cs y de las capturas del programa: barra lateral, menú de arriba, pestaña Inicio,
   cabecera, seis tarjetas, gráfico, listas y atajos. Letra Segoe UI, la del programa en Windows. */
.app {
  --bloque: #ffffff; --tarjeta: #f5f6f8; --bloque-texto: #1b2232; --bloque-gris: #6b7385; --bloque-linea: #e3e7ee; --rejilla: #eef1f5;
  --pestana-fondo: #e6e9ef; --serie-ant: #aab2bd; --serie-act: #1f3864; --bien: #2e7d32; --mal: #c62828; --resalte: #2f80d1;
  position: relative; margin: 0; border-radius: 12px; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 62px minmax(0, 1fr);
  background: #0d1d33; color: #fff; box-shadow: var(--sombra-captura);
  font: 400 13px/1.35 "Segoe UI", system-ui, -apple-system, sans-serif;
  animation: subir .9s cubic-bezier(.2, .7, .2, 1) both .1s;
}
.app[data-tema="oscuro"] {
  --bloque: #1c2230; --tarjeta: #232a39; --bloque-texto: #e8ebf2; --bloque-gris: #9aa3b5; --bloque-linea: #2e3546; --rejilla: #262d3c;
  --pestana-fondo: #2a3141; --serie-ant: #5c6576; --serie-act: #4f9bf0; --bien: #62c46e; --mal: #ff7b7b; --resalte: #4f9bf0;
}
.app .fondo-vivo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.app button { font: inherit; color: inherit; }
.app img { display: block; }

/* Barra lateral */
.app-lateral { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 10px 0 12px; background: linear-gradient(rgba(255,255,255,.1), rgba(255,255,255,.04)); border-right: 1px solid rgba(255,255,255,.08); }
.app-lateral img { width: 30px; height: auto; }
.app-lateral .lat-logo { width: 46px; margin-bottom: 4px; }
.app-lateral .lat-salir { width: 32px; margin-top: auto; }

/* Menú de arriba con Maestros desplegable */
.app-principal { min-width: 0; display: flex; flex-direction: column; }
.app-menu { position: relative; z-index: 3; display: flex; align-items: stretch; height: 36px; padding-left: 4px; }
.menu-sup { flex: 1; display: flex; min-width: 0; background: rgba(8, 18, 36, .42); }
.app .menu-op {
  flex: 1; display: grid; place-items: center; min-width: 0; padding: 0 6px; border: 0; background: none; position: relative;
  font-weight: 600; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; color: #fff;
}
.menu-op + .menu-op::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: rgba(255,255,255,.14); }
button.menu-op { cursor: pointer; transition: background .15s; }
button.menu-op::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #4a9be8; transform: scaleX(0); transition: transform .2s ease; }
button.menu-op:hover, button.menu-op[aria-expanded="true"] { background: rgba(255,255,255,.1); }
button.menu-op:hover::after, button.menu-op[aria-expanded="true"]::after { transform: scaleX(1); }
.menu-buscar { display: grid; place-items: center; width: 44px; background: rgba(8, 18, 36, .42); }
.menu-buscar svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.app-ventana { display: flex; }
.app-ventana i { width: 40px; position: relative; }
.app-ventana i::before, .app-ventana i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; transform: translate(-50%, -50%); }
.app-ventana i:nth-child(1)::before { border-top: 1px solid rgba(255,255,255,.85); }
.app-ventana i:nth-child(2)::before { height: 9px; width: 9px; border: 1px solid rgba(255,255,255,.85); }
.app-ventana i:nth-child(3)::before, .app-ventana i:nth-child(3)::after { height: 1px; background: rgba(255,255,255,.85); }
.app-ventana i:nth-child(3)::before { transform: translate(-50%, -50%) rotate(45deg); }
.app-ventana i:nth-child(3)::after { transform: translate(-50%, -50%) rotate(-45deg); }
.megamenu {
  position: absolute; top: 38px; left: 4px; width: min(380px, calc(100% - 8px)); padding: 6px 8px; border-radius: 10px;
  background: #0b1c2f; box-shadow: 0 18px 40px -10px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
}
.megamenu.abierto { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .18s ease; }
.mega-fila { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 0; }
.mega-fila + .mega-fila { border-top: 1px solid rgba(255,255,255,.12); }
.mega-op { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 5px; border-radius: 6px; font-size: 11.5px; line-height: 1.2; text-align: center; color: #fff; }
.mega-op:hover { background: rgba(255,255,255,.08); }
.mega-op img { height: 30px; width: auto; max-width: 40px; object-fit: contain; transition: transform .15s ease; }
.mega-op:hover img { transform: scale(1.12); }

/* Pestaña Inicio */
.app-pestanas { display: flex; align-items: flex-end; height: 30px; padding: 0 10px 0 12px; }
.pestana-inicio { display: inline-flex; align-items: center; gap: 6px; width: 120px; height: 24px; padding: 0 10px; border-radius: 4px 4px 0 0; background: #fff; color: #1b2232; font-size: 12px; box-shadow: inset 0 2px 0 #2f80d1; }
.pestana-inicio svg { width: 17px; height: 17px; fill: #1f6fd1; }
.app-pestanas i { margin-left: auto; width: 7px; height: 7px; margin-bottom: 9px; border-right: 1.5px solid rgba(255,255,255,.7); border-bottom: 1.5px solid rgba(255,255,255,.7); transform: rotate(45deg); }

.app-inicio { display: grid; gap: 9px; padding: 4px 12px 14px 12px; min-width: 0; }
.inicio-cabecera {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 5px 12px 5px 6px; border-radius: 10px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
}
.ejercicio { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 4px 12px 4px 4px; border-radius: 8px; background: rgba(235, 242, 252, .95); color: #1b2232; }
.ejercicio img { width: 46px; height: 34px; border-radius: 5px; }
.ejercicio b { font-weight: 600; font-size: 15px; }
.ejercicio .flecha { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.ejercicio .izq { border-right: 8px solid #1f6fd1; }
.ejercicio .der { border-left: 8px solid #1f6fd1; }
.saludo { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; font-weight: 300; font-size: 17px; color: #e9f0fb; }
.saludo i { font-style: normal; opacity: .7; }
.hora { display: inline-flex; align-items: center; gap: 5px; }
.hora img { width: 16px; height: 16px; }
.saludo-extra { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.tiempo { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.tiempo img { width: 24px; height: auto; }
.refran { display: inline-flex; align-items: center; gap: 1px; min-width: 0; font-style: italic; font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,.88); }
.refran [data-refran-texto] { overflow: hidden; text-overflow: ellipsis; transition: opacity .25s ease, transform .25s ease; }
.refran [data-refran-texto].cambiando { opacity: 0; transform: translateY(-4px); }
.refran button { border: 0; background: none; padding: 0 6px; font-size: 16px; line-height: 1; cursor: pointer; opacity: .75; font-style: normal; }
.refran button:hover { opacity: 1; }
.usuario { display: flex; align-items: center; gap: 10px; flex: none; text-align: right; }
.usuario b { display: block; font-weight: 600; font-size: 13.5px; letter-spacing: .02em; }
.usuario small { display: block; font-size: 11px; color: rgba(255,255,255,.75); }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, #f7b04f, #e07b1a); color: #fff; font-weight: 600; font-size: 17px; border: 2px solid #fff; }

/* Seis tarjetas en dos filas */
.tarjetas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tarjeta {
  position: relative; display: flex; flex-direction: column; min-height: 68px; padding: 6px 10px 6px 17px; border-radius: 8px; overflow: hidden;
  background: var(--tarjeta); color: var(--bloque-texto); transition: transform .2s ease, box-shadow .2s ease;
}
.tarjeta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--acento); }
.tarjeta:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(0,0,0,.6); }
.t-titulo { color: var(--bloque-gris); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-valor { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 1px 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-detalle { font-size: 10.5px; color: var(--bloque-gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-detalle.bien { color: var(--bien); }
.t-detalle.mal { color: var(--mal); }

/* Gráfico y listas */
.zona { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 9px; height: 262px; }
.bloque { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 8px; overflow: hidden; background: var(--bloque); color: var(--bloque-texto); }
.grafico { overflow: visible; position: relative; }
.grafico-cabecera { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 7px 0 12px; }
.grafico-titulo { font-size: 13px; white-space: nowrap; }
.tipo-boton { margin-left: auto; display: grid; place-items: center; width: 28px; height: 24px; border: 1px solid var(--bloque-linea); border-radius: 5px; background: var(--bloque); cursor: pointer; }
.tipo-boton:hover, .tipo-boton[aria-expanded="true"] { border-color: var(--resalte); }
.tipo-boton svg { width: 16px; height: 16px; }
.tipo-menu {
  position: absolute; z-index: 4; right: 7px; top: 34px; margin: 0; padding: 4px; list-style: none; min-width: 160px; border-radius: 6px;
  background: var(--bloque); color: var(--bloque-texto); box-shadow: 0 10px 30px -8px rgba(0,0,0,.45), 0 0 0 1px var(--bloque-linea);
}
.tipo-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px 6px 8px; border: 0; border-radius: 4px; background: none; font-size: 13px; text-align: left; cursor: pointer; }
.tipo-menu button::before { content: ""; width: 14px; text-align: center; }
.tipo-menu button[aria-checked="true"]::before { content: "✓"; color: var(--resalte); font-weight: 700; }
.tipo-menu button:hover { background: var(--rejilla); }
.grafico-lienzo { position: relative; flex: 1; min-height: 0; margin: 4px 10px 8px; border: 1px solid var(--bloque-linea); display: flex; }
.leyenda { position: absolute; top: 6px; right: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--bloque-gris); }
.leyenda i { width: 10px; height: 10px; }
.leyenda i.ant { background: var(--serie-ant); }
.leyenda i.act { background: var(--serie-act); margin-left: 6px; }
.grafico-svg { flex: 1; width: 100%; min-height: 0; display: block; overflow: visible; }
.grafico-svg text { fill: var(--bloque-gris); font-size: 10px; font-family: inherit; }
.grafico-svg .rejilla { stroke: var(--rejilla); stroke-width: 1; }
.grafico-svg .barra { transform-box: fill-box; transform-origin: 50% 100%; transition: opacity .15s; }
.grafico-svg .barra:hover, .grafico-svg .punto:hover { opacity: .75; }
.grafico-svg .s-ant { fill: var(--serie-ant); }
.grafico-svg .s-act { fill: var(--serie-act); }
.grafico-svg .linea { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.grafico-svg .linea.s-ant { stroke: var(--serie-ant); }
.grafico-svg .linea.s-act { stroke: var(--serie-act); }
.grafico-svg .area { opacity: .35; stroke: none; transform-box: fill-box; transform-origin: 50% 100%; }
.grafico-svg .punto { stroke: var(--bloque); stroke-width: 1.5; }
.grafico-svg.animar .barra { animation: crecer .75s cubic-bezier(.2, .8, .25, 1) both; animation-delay: calc(var(--i) * 40ms); }
.grafico-svg.animar .linea { stroke-dasharray: 1; animation: trazar 1.1s ease-out both; }
.grafico-svg.animar .area { animation: crecer .9s cubic-bezier(.2, .8, .25, 1) both; }
.grafico-svg.animar .punto { animation: asomar .3s ease-out both; animation-delay: calc(.25s + var(--i) * 70ms); }
@keyframes crecer { from { transform: scaleY(0); } }
@keyframes trazar { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes asomar { from { opacity: 0; } }

.listas-cabecera { display: flex; align-items: flex-end; gap: 2px; padding: 5px 4px 0 6px; border-bottom: 1px solid var(--bloque-linea); }
.listas-pestanas { flex: 1; display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.listas-pestanas::-webkit-scrollbar { display: none; }
.listas-pestanas button { flex: none; border: 0; padding: 6px 9px 5px; border-radius: 4px 4px 0 0; background: var(--pestana-fondo); font-size: 11.5px; color: var(--bloque-texto); cursor: pointer; white-space: nowrap; }
.listas-pestanas button[aria-selected="true"] { background: var(--bloque); box-shadow: inset 0 2px 0 var(--resalte), 0 0 0 1px var(--bloque-linea); font-weight: 600; }
.listas-flecha { flex: none; border: 0; background: none; width: 18px; padding: 0 0 6px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--bloque-gris); }
.listas-flecha:hover { color: var(--bloque-texto); }
.lista-caja { flex: 1; overflow: hidden; }
.lista { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.lista th { text-align: left; font-weight: 400; color: var(--bloque-texto); padding: 6px 5px; border-bottom: 1px solid var(--bloque-linea); white-space: nowrap; }
.lista td { padding: 5px 5px; border-bottom: 1px solid var(--bloque-linea); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.lista th + th, .lista td + td { border-left: 1px solid var(--bloque-linea); }
.lista th:first-child, .lista td:first-child { padding-left: 9px; }
.lista td:last-child, .lista th:last-child { padding-right: 9px; }
.lista .num { text-align: right; }
.lista tr.rojo td { color: var(--mal); }
.lista tbody tr:hover td { background: var(--rejilla); }
.lista .pct { position: relative; }
.lista .pct i { position: absolute; left: 5px; top: 4px; bottom: 4px; width: var(--p); max-width: calc(100% - 10px); border-radius: 2px; background: linear-gradient(90deg, #5b9bd5, rgba(91, 155, 213, .12)); animation: llenar 1s cubic-bezier(.2, .8, .25, 1) both .15s; }
@keyframes llenar { from { width: 0; } }
.lista .pct span { position: relative; }
.lista[data-tabla="vencidos"] th:nth-child(2) { width: 62px; }
.lista[data-tabla="vencidos"] th:nth-child(3) { width: 78px; }
.lista[data-tabla="vencidos"] th:nth-child(4) { width: 34px; }
.lista[data-tabla="vencidos"] th:nth-child(5) { width: 68px; }
.lista[data-tabla="clientes"] th:nth-child(2) { width: 58px; }
.lista[data-tabla="clientes"] th:nth-child(3) { width: 80px; }
.lista[data-tabla="clientes"] th:nth-child(4) { width: 82px; }
.lista[data-tabla="semana"] th:nth-child(1) { width: 80px; }
.lista[data-tabla="semana"] th:nth-child(2) { width: 54px; }
.lista[data-tabla="semana"] th:nth-child(4) { width: 76px; }
.lista[data-tabla="presupuestos"] th:nth-child(1) { width: 76px; }
.lista[data-tabla="presupuestos"] th:nth-child(2) { width: 78px; }
.lista[data-tabla="presupuestos"] th:nth-child(4) { width: 70px; }
.lista[data-tabla="presupuestos"] th:nth-child(5) { width: 34px; }
.lista[data-tabla="stock"] th:nth-child(1) { width: 56px; }
.lista[data-tabla="stock"] th:nth-child(3), .lista[data-tabla="stock"] th:nth-child(4) { width: 58px; }

/* Atajos (los mosaicos del programa) e «Importes con IVA» */
.pie-inicio { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.atajos { display: flex; flex-wrap: wrap; gap: 9px; }
.atajo { position: relative; display: block; width: 84px; border-radius: 7px; overflow: hidden; box-shadow: 0 8px 16px -8px rgba(0,0,0,.7); transition: transform .18s ease, box-shadow .18s ease; user-select: none; }
.atajo img { width: 100%; height: auto; -webkit-user-drag: none; }
.atajo::after { content: ""; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -70%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent); transform: skewX(-18deg); transition: left .6s ease; pointer-events: none; }
.atajo:hover { transform: translateY(-3px); box-shadow: 0 14px 22px -10px rgba(0,0,0,.8); }
.atajo:hover::after { left: 140%; }
.atajo.pulsado { transform: scale(.95); transition-duration: .06s; }
.opciones-inicio { display: flex; align-items: center; gap: 10px; flex: none; padding: 5px 5px 5px 12px; border-radius: 8px; background: rgba(15, 30, 55, .55); border: 1px solid rgba(255,255,255,.18); }
.opciones-inicio label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; font-size: 12px; }
.opciones-inicio input { width: 14px; height: 14px; accent-color: #388ceb; margin: 0; cursor: pointer; }
.actualizar { display: grid; place-items: center; width: 28px; height: 26px; border: 0; border-radius: 5px; background: #fff; cursor: pointer; }
.actualizar:hover { background: #eaf6ea; }
.actualizar svg { width: 18px; height: 18px; fill: none; stroke: #1f9a3a; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.actualizar.girando svg { animation: girar .7s cubic-bezier(.3, .7, .3, 1); }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Secciones ---------- */
.seccion { padding: 104px 0; }
.seccion-niebla { background: var(--niebla); }
.cabecera { max-width: 760px; margin-bottom: 48px; }
.cabecera h2 { margin-bottom: 16px; }

/* ---------- Qué incluye: como las líneas de una factura ---------- */
.lineas-factura { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.lineas-factura thead th {
  text-align: left; font: 600 .95rem/1 var(--cuerpo); color: var(--texto-2);
  padding: 0 16px 14px; border-bottom: 2px solid var(--tinta);
}
@media (prefers-color-scheme: dark) { .lineas-factura thead th { border-bottom-color: var(--naranja); } }
.lineas-factura td { padding: 20px 16px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.lineas-factura td:first-child { width: 32%; font-family: var(--titulos); font-weight: 600; font-size: 1.25rem; line-height: 1.25; color: var(--tinta); }
@media (prefers-color-scheme: dark) { .lineas-factura td:first-child { color: var(--texto); } }
.lineas-factura td:last-child { color: var(--texto-2); }
.total-factura {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 28px; background: var(--tinta); color: #fff; border-radius: 6px; padding: 22px 28px;
}
.total-factura span { font-weight: 600; letter-spacing: .02em; }
.total-factura strong { font-family: var(--titulos); font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--naranja); font-weight: 700; }
.total-factura [data-contar] { display: inline-block; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .total-factura { background: #0a1120; border: 1px solid var(--linea); } }

/* ---------- Pantallas reales ---------- */
.pestanas { display: flex; gap: 6px; border-bottom: 1px solid var(--linea); margin-bottom: 28px; overflow-x: auto; }
.pestana {
  border: 0; background: none; font: 600 1rem/1 var(--cuerpo); color: var(--texto-2); cursor: pointer;
  padding: 14px 18px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.pestana[aria-selected="true"] { color: var(--texto); border-bottom-color: var(--naranja); }
.panel { display: none; margin: 0; }
.panel.activo { display: block; }
.panel figcaption { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; margin-top: 28px; }
.panel figcaption h3 { color: var(--tinta); }
@media (prefers-color-scheme: dark) { .panel figcaption h3 { color: var(--texto); } }
.panel figcaption p { color: var(--texto-2); margin: 0; }
.panel a { display: block; }
.nota { font-size: .9rem; color: var(--texto-2); margin: 18px 0 0; }

/* ---------- VERI*FACTU ---------- */
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.marcas { list-style: none; padding: 0; margin: 28px 0 0; }
.marcas li { padding: 14px 0 14px 34px; border-top: 1px solid var(--linea); position: relative; }
.marcas li::before {
  content: ""; position: absolute; left: 0; top: 18px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--verde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/13px no-repeat;
}
.papel-factura {
  background: #fff; color: #1b2232; border-radius: 4px; padding: 34px 34px 28px; font-size: .95rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 30px 60px -20px rgba(22, 41, 79, .35); transform: rotate(-1.2deg);
  max-width: 480px; margin-left: auto; position: relative;
}
.sello {
  position: absolute; right: 130px; top: 40px; z-index: 1; padding: 7px 12px; border: 3px solid var(--verde); border-radius: 8px;
  color: var(--verde); font: 700 1rem/1.1 var(--titulos); text-transform: uppercase; letter-spacing: .03em; text-align: center;
  background: rgba(255, 255, 255, .85); transform: rotate(-9deg); pointer-events: none;
}
.js .papel-factura:not(.visto) .qr i:not(.b) { opacity: 0; }
.js .papel-factura:not(.visto) .sello { opacity: 0; }
.papel-factura.visto .qr i:not(.b) { animation: pixel .2s ease-out both; animation-delay: calc(var(--n) * 10ms); }
.papel-factura.visto .sello { animation: sellar .5s cubic-bezier(.3, 1.6, .5, 1) both 1.1s; }
@keyframes pixel { from { opacity: 0; transform: scale(.2); } }
@keyframes sellar { from { opacity: 0; transform: rotate(-24deg) scale(2.2); } to { opacity: 1; transform: rotate(-9deg) scale(1); } }
.papel-factura header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid #16294f; margin-bottom: 14px; }
.papel-factura .tipo { font-family: var(--titulos); font-weight: 700; font-size: 1.5rem; color: #16294f; line-height: 1; }
.papel-factura .datos { color: #535d71; font-size: .88rem; margin-top: 6px; line-height: 1.45; }
.papel-factura table { width: 100%; border-collapse: collapse; }
.papel-factura td { padding: 7px 0; border-bottom: 1px solid #e7eaf0; }
.papel-factura td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.papel-factura .total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.papel-factura .total b { background: #16294f; color: #fff; padding: 8px 14px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.papel-factura .total b em { font-style: normal; color: #f29f2e; margin-left: 8px; }
.papel-factura .vf { font-size: .8rem; color: #535d71; line-height: 1.35; }
.qr { width: 84px; height: 84px; flex: none; display: grid; grid-template-columns: repeat(9, 1fr); gap: 1px; padding: 5px; border: 1px solid #d8dde7; background: #fff; }
.qr i { background: #1b2232; }
.qr i.b { background: transparent; }

/* ---------- Cómo empezar (es una secuencia, por eso va numerada) ---------- */
.pasos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: paso; position: relative; }
.pasos::before { content: ""; position: absolute; top: 22px; left: 23px; right: calc((100% - 96px) / 4 - 23px); height: 2px; background: var(--linea); transform-origin: left center; transition: transform 1.5s cubic-bezier(.45, 0, .25, 1) .15s; }
.js .pasos:not(.visto)::before { transform: scaleX(0); }
.pasos li { position: relative; counter-increment: paso; }
.pasos li::before {
  content: counter(paso); position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--niebla); border: 2px solid var(--tinta); color: var(--tinta); font: 700 1.2rem/1 var(--titulos); margin-bottom: 20px;
}
@media (prefers-color-scheme: dark) { .pasos li::before { border-color: var(--naranja); color: var(--naranja); } }
.pasos li::before { transition: background-color .3s ease, color .3s ease; }
.pasos.visto li::before { background: var(--tinta); color: #fff; animation: encender .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.pasos.visto li:nth-child(1)::before { transition-delay: .15s; animation-delay: .15s; }
.pasos.visto li:nth-child(2)::before { transition-delay: .6s; animation-delay: .6s; }
.pasos.visto li:nth-child(3)::before { transition-delay: 1.05s; animation-delay: 1.05s; }
.pasos.visto li:nth-child(4)::before { transition-delay: 1.5s; animation-delay: 1.5s; }
@keyframes encender { 50% { transform: scale(1.18); } }
@media (prefers-color-scheme: dark) { .pasos.visto li::before { background: var(--naranja); color: #1d1300; } }
.pasos h3 { margin-bottom: 8px; }
.pasos p { color: var(--texto-2); margin: 0; font-size: 1rem; }

/* ---------- Familia Pincho ---------- */
.familia { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; padding: 0; margin: 0; font-size: 1.1rem; }
.familia a { color: var(--texto-2); text-underline-offset: 4px; }
.familia a:hover { color: var(--texto); }
.familia .actual { font-weight: 600; color: var(--texto); }

/* ---------- Preguntas ---------- */
.preguntas { max-width: 860px; border-top: 1px solid var(--linea); }
details { border-bottom: 1px solid var(--linea); }
summary { cursor: pointer; list-style: none; padding: 22px 0; display: flex; justify-content: space-between; gap: 20px; font-weight: 600; font-size: 1.1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 10px; height: 10px; margin: 6px 4px 0 0; border-right: 2px solid var(--texto-2); border-bottom: 2px solid var(--texto-2); transform: rotate(45deg); transition: transform .2s ease; }
details[open] summary::after { transform: rotate(-135deg); margin-top: 12px; }
details p { color: var(--texto-2); max-width: 70ch; padding-bottom: 8px; }

/* ---------- Contacto ---------- */
.contacto { background: var(--tinta); color: #fff; position: relative; isolation: isolate; overflow: hidden; }
.contacto .fondo-vivo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.contacto h2 { color: #fff; margin-bottom: 16px; }
.contacto .entradilla { color: #c3cde3; }
.contacto a { color: #fff; }
@media (prefers-color-scheme: dark) { .contacto { background: #0a1120; } }
.datos-contacto { margin-top: 28px; font-size: 1.05rem; }
.datos-contacto a { font-weight: 600; }
.formulario { display: grid; gap: 16px; }
.formulario label { display: grid; gap: 6px; font-size: .95rem; color: #c3cde3; }
.formulario input, .formulario select, .formulario textarea {
  font: 400 1rem/1.4 var(--cuerpo); padding: 12px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: #fff;
}
.formulario select option { color: #1b2232; }
.formulario input:focus, .formulario select:focus, .formulario textarea:focus { outline: 2px solid var(--naranja); outline-offset: 1px; border-color: transparent; }
.formulario .fila { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.formulario .letra-pequena { font-size: .85rem; color: #9fadc9; margin: 0; }

/* ---------- Pie ---------- */
.pie { padding: 36px 0; font-size: .95rem; color: var(--texto-2); border-top: 1px solid var(--linea); }
.pie .contenedor { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.pie nav { display: flex; flex-wrap: wrap; gap: 24px; }
.pie a { text-decoration: none; }
.pie a:hover { color: var(--texto); text-decoration: underline; }

/* ---------- Páginas legales ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 64px 24px 96px; }
.legal h1 { font-size: 2.6rem; color: var(--tinta); margin-bottom: 24px; }
.legal h2 { font-size: 1.5rem; margin: 2em 0 .5em; }
.legal .pendiente { background: #fdf0dc; color: #5c3600; padding: 1px 6px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .legal h1 { color: var(--texto); } }

/* ---------- La pantalla en directo en pantallas más pequeñas ---------- */
@media (max-width: 1140px) {
  .saludo-extra { display: none; }
  .atajo { width: 76px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 50px minmax(0, 1fr); }
  .app-lateral { gap: 12px; }
  .app-lateral img { width: 26px; }
  .app-lateral .lat-logo { width: 38px; }
  .app .menu-op { font-size: 11px; letter-spacing: 0; }
  .ejercicio img { display: none; }
  .tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zona { grid-template-columns: 1fr; height: auto; }
  .grafico { height: 250px; }
  .lista-caja { max-height: 230px; }
  .pie-inicio { flex-direction: column; align-items: stretch; }
  .opciones-inicio { justify-content: space-between; }
}
@media (max-width: 620px) {
  .app { grid-template-columns: minmax(0, 1fr); font-size: 12px; border-radius: 10px; }
  .app-lateral { display: none; }
  .app .menu-op:nth-child(n+3) { display: none; }
  .menu-buscar { width: 36px; }
  .app-ventana i { width: 30px; }
  .app-inicio { padding: 4px 8px 10px; gap: 8px; }
  .inicio-cabecera { gap: 8px; padding: 5px 8px 5px 5px; }
  .ejercicio { padding: 4px 8px; gap: 6px; }
  .ejercicio b { font-size: 13px; }
  .saludo { flex-direction: column; align-items: flex-start; gap: 0; font-size: 14px; }
  .saludo > i { display: none; }
  .saludo [data-fecha] { font-size: 12px; }
  .hora { display: none; }
  .usuario > span:first-child { display: none; }
  .avatar { width: 34px; height: 34px; font-size: 15px; }
  .tarjetas { gap: 6px; }
  .tarjeta { min-height: 0; padding: 6px 8px 6px 14px; }
  .tarjeta::before { width: 6px; }
  .t-valor { font-size: 16px; }
  .t-titulo, .t-detalle { white-space: normal; }
  .grafico { height: 260px; }
  .lista .ocultable { display: none; }
  .atajos { gap: 7px; }
  .atajo { width: calc((100% - 21px) / 4); }
  .megamenu { left: 4px; width: calc(100% - 8px); }
  .mega-op { font-size: 10.5px; }
}

/* ---------- Pantallas medianas y móviles ---------- */
@media (max-width: 960px) {
  .boton-menu { display: inline-grid; place-items: center; }
  .menu {
    display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--papel); border-bottom: 1px solid var(--linea); padding: 8px 24px 20px;
  }
  .menu.abierto { display: flex; }
  .menu a:not(.boton) { display: block; padding: 14px 0; border-bottom: 1px solid var(--linea); }
  .menu .boton { margin-top: 16px; width: 100%; }
  .dos-columnas { grid-template-columns: 1fr; gap: 48px; }
  .papel-factura { margin: 0 auto; }
  .pasos { grid-template-columns: 1fr 1fr; }
  .pasos::before { display: none; }
  .panel figcaption { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .seccion { padding: 72px 0; }
  .portada { padding-top: 48px; }
  .escaparate { margin-top: 40px; }
  .escaparate-cabecera { justify-content: flex-start; }
  .lineas-factura thead { display: none; }
  .lineas-factura tr { display: block; border-bottom: 1px solid var(--linea); padding: 16px 0; }
  .lineas-factura td { display: block; border: 0; padding: 0; width: auto !important; }
  .lineas-factura td:first-child { margin-bottom: 6px; }
  .pasos { grid-template-columns: 1fr; }
  .formulario .fila { grid-template-columns: 1fr; }
  .papel-factura { padding: 24px 20px; transform: none; }
  .sello { top: auto; bottom: -30px; right: 14px; font-size: .9rem; }
  #verifactu .dos-columnas { padding-bottom: 24px; }
  .qr { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .escaparate .ventana, .app { animation: none; }
  .ventana img { transition: none; }
  .en-directo .punto::after { animation: none; display: none; }
  .lista .pct i { animation: none; }
  .atajo::after { display: none; }
  .megamenu { transition: none; }
  .pasos::before, .pasos li::before { transition: none; }
  .pasos.visto li::before { animation: none; }
}
