/* Facturas La Esperanza · Liquid Glass con los colores aprobados en el mood board (25-nov-2026). */
:root {
  --fondo: #E9F0F7;
  --tinta: #0E1E2E;
  --tenue: #33475B;
  --tenue2: #22384D;
  --azul: #006FBA;
  --azul-osc: #005A97;
  --azul-f: rgba(0, 111, 186, 0.12);
  --verde: #009889;
  --verde-osc: #00695F;
  --verde-f: rgba(0, 152, 137, 0.14);
  --rojo: #9A1E17;
  --rojo-b: #B4231B;
  --rojo-f: rgba(180, 35, 27, 0.12);
  --ambar: #8A4B00;
  --ambar-b: #C96E00;
  --ambar-f: rgba(201, 110, 0, 0.15);
  --morado: #5B3DB0;
  --morado-f: rgba(108, 75, 194, 0.13);
  --barra-ant: #9CC3E4;
  --equipo: #E39A3B;
  --vidrio: rgba(255, 255, 255, 0.56);
  --vidrio-fuerte: rgba(255, 255, 255, 0.82);
  --vidrio-borde: rgba(255, 255, 255, 0.8);
  --sombra: 0 10px 28px rgba(16, 42, 67, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --sombra-modal: 0 30px 80px rgba(16, 42, 67, 0.28);
  --linea: rgba(14, 30, 46, 0.08);
  --linea-fuerte: rgba(14, 30, 46, 0.25);
  --campo: rgba(255, 255, 255, 0.88);
  --campo-borde: rgba(16, 42, 67, 0.14);
  --gris-f: rgba(118, 118, 128, 0.12);
  --m1: #8CC0EA; --m2: #7FD3C7; --m3: #B9D4F1;
  --radio: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0A141F;
    --tinta: #E8EEF5;
    --tenue: #A9B8C8;
    --tenue2: #C9D4DF;
    --azul: #3D9BE0;
    --azul-osc: #7DBDF0;
    --azul-f: rgba(61, 155, 224, 0.18);
    --verde: #2BB8A6;
    --verde-osc: #4FD1BF;
    --verde-f: rgba(43, 184, 166, 0.18);
    --rojo: #FF9187;
    --rojo-b: #F2675C;
    --rojo-f: rgba(242, 103, 92, 0.16);
    --ambar: #F5B062;
    --ambar-b: #E39A3B;
    --ambar-f: rgba(227, 154, 59, 0.18);
    --morado: #B9A5F2;
    --morado-f: rgba(185, 165, 242, 0.16);
    --barra-ant: #3C5B78;
    --vidrio: rgba(24, 37, 52, 0.58);
    --vidrio-fuerte: rgba(28, 42, 58, 0.92);
    --vidrio-borde: rgba(255, 255, 255, 0.09);
    --sombra: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --sombra-modal: 0 30px 80px rgba(0, 0, 0, 0.55);
    --linea: rgba(255, 255, 255, 0.08);
    --linea-fuerte: rgba(255, 255, 255, 0.22);
    --campo: rgba(255, 255, 255, 0.07);
    --campo-borde: rgba(255, 255, 255, 0.14);
    --gris-f: rgba(255, 255, 255, 0.08);
    --m1: #1D4E7A; --m2: #11564F; --m3: #22374F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--fondo); color: var(--tinta);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--azul-osc); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(0, 111, 186, 0.45); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.tenue { color: var(--tenue); }
.chica { font-size: 13px; }
.mini { font-size: 12px; }
.fuerte { font-weight: 700; }
.rojo { color: var(--rojo); }
.ambar { color: var(--ambar); }
.verde { color: var(--verde-osc); }
.etiqueta { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tenue); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fondo con manchas de color */
.fondo { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.mancha { position: absolute; border-radius: 50%; }
.mancha.m1 { left: -10%; top: -8%; width: 46%; height: 36rem; background: var(--m1); opacity: .5; filter: blur(110px); }
.mancha.m2 { left: 62%; top: 22%; width: 44%; height: 36rem; background: var(--m2); opacity: .42; filter: blur(120px); }
.mancha.m3 { left: 10%; top: 62%; width: 40%; height: 30rem; background: var(--m3); opacity: .6; filter: blur(110px); }

.vidrio {
  background: var(--vidrio);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--vidrio-borde);
  box-shadow: var(--sombra);
  border-radius: var(--radio);
}
.tarjeta { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tarjeta-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tarjeta-cab > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 13px; border: 1px solid var(--vidrio-borde); background: var(--vidrio-fuerte); font-weight: 700;
  cursor: pointer; white-space: nowrap; color: var(--tinta); transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--campo); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primario { background: var(--azul); color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(0, 111, 186, 0.28); }
.btn.primario:hover { background: var(--azul-osc); }
.btn.exito { background: var(--verde-osc); color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(0, 105, 95, 0.26); }
.btn.peligro { color: var(--rojo); }
.btn.chico { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.icono { width: 42px; padding: 0; }
.btn.icono.chico { width: 34px; }
.enlace { background: none; border: 0; color: var(--azul-osc); font-weight: 700; cursor: pointer; padding: 0; text-align: left; }
.enlace:hover { text-decoration: underline; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
svg.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Campos */
.campo, input[type=text], input[type=search], input[type=password], input[type=date], input[type=month], input[type=number], input:not([type]), select, textarea {
  min-height: 42px; border-radius: 12px; border: 1px solid var(--campo-borde); background: var(--campo); padding: 0 12px; min-width: 0; color: var(--tinta);
}
textarea { padding: 10px 12px; min-height: 84px; resize: vertical; width: 100%; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0, 111, 186, 0.18); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--tenue2); min-width: 0; }
label.f > span.ayuda { font-weight: 500; color: var(--tenue); }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--azul); flex: none; }

/* Segmentado */
.segmentos { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; border-radius: 14px; background: var(--gris-f); }
.segmentos button, .segmentos a {
  border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--tenue2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.segmentos .seg-op { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--tenue2); cursor: pointer; display: inline-flex; align-items: center; }
.segmentos input:focus-visible + .seg-op { outline: 3px solid rgba(0, 111, 186, 0.45); outline-offset: 1px; }
.segmentos [aria-pressed=true], .segmentos [aria-current=page] { background: var(--vidrio-fuerte); color: var(--tinta); font-weight: 700; box-shadow: 0 2px 6px rgba(16, 42, 67, 0.14); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: var(--gris-f); color: var(--tenue2); }
.chip.pagada { background: var(--verde-f); color: var(--verde-osc); }
.chip.vencida { background: var(--rojo-f); color: var(--rojo); }
.chip.hoy, .chip.por-vencer { background: var(--ambar-f); color: var(--ambar); }
.chip.parcial { background: var(--morado-f); color: var(--morado); }
.chip.pendiente { background: var(--azul-f); color: var(--azul-osc); }
.chip.fuera { background: var(--gris-f); color: var(--tenue); text-decoration: line-through; }
.chip.admin { background: var(--azul-f); color: var(--azul-osc); }
.chip.pagos { background: var(--verde-f); color: var(--verde-osc); }
.chip.consulta { background: var(--gris-f); color: var(--tenue2); }
.chip.enviado { background: var(--verde-f); color: var(--verde-osc); }
.chip.simulado { background: var(--gris-f); color: var(--tenue2); }
.chip.error { background: var(--rojo-f); color: var(--rojo); }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 4px var(--verde-f); flex: none; }
.punto.mal { background: var(--rojo-b); box-shadow: 0 0 0 4px var(--rojo-f); }
.punto.viejo { background: var(--ambar-b); box-shadow: 0 0 0 4px var(--ambar-f); }

/* Entrar */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.tarjeta-entrar { width: min(420px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.tarjeta-entrar img { height: 46px; width: auto; align-self: flex-start; }
.error { color: var(--rojo); font-weight: 600; font-size: 14px; }

/* Barra superior */
.marco { max-width: 1320px; margin: 0 auto; padding: 18px 24px 110px; display: flex; flex-direction: column; gap: 20px; }
.barra { position: sticky; top: 10px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; border-radius: 22px; }
.barra .logo { height: 32px; width: auto; display: block; }
.menu { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 520px; }
.menu a {
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--tenue2); border-radius: 12px; padding: 0 12px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.menu a:hover { background: var(--gris-f); }
.menu a[aria-current=page] { color: #fff; background: var(--azul); font-weight: 700; }
.insignia { font-size: 12px; font-weight: 800; color: var(--ambar); background: var(--ambar-f); border-radius: 999px; padding: 2px 8px; }
.menu a[aria-current=page] .insignia { color: #fff; background: rgba(255, 255, 255, 0.24); }
.buscador { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 42px; border-radius: 14px; background: var(--campo); border: 1px solid var(--vidrio-borde); }
.buscador input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 0; min-height: 40px; box-shadow: none !important; }
.buscador kbd { font: 700 12px/1 inherit; color: var(--tenue); background: var(--gris-f); border-radius: 6px; padding: 4px 6px; }
.lectura { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--tenue2); }
.lectura .btn { min-height: 38px; width: 38px; border-radius: 12px; }
.usuario-btn { border: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--azul); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer; flex: none; }
.cinta-prueba { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--ambar-f); color: var(--ambar); font-weight: 700; font-size: 14px; border: 1px solid var(--vidrio-borde); }

/* Menú de usuario */
.menu-usuario { position: absolute; right: 14px; top: 64px; width: 260px; padding: 10px; display: flex; flex-direction: column; gap: 2px; z-index: 30; background: var(--vidrio-fuerte); }
.menu-usuario .quien { padding: 8px 10px 10px; border-bottom: 1px solid var(--linea); margin-bottom: 4px; }
.menu-usuario a, .menu-usuario button { text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--tinta); cursor: pointer; text-decoration: none; display: flex; gap: 8px; align-items: center; }
.menu-usuario a:hover, .menu-usuario button:hover { background: var(--gris-f); text-decoration: none; }

/* Encabezado de página */
.cabeza { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cabeza > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cabeza .sub { font-size: 14px; font-weight: 600; color: var(--tenue); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--tinta); border-radius: 22px; }
a.kpi:hover { text-decoration: none; transform: translateY(-1px); }
.kpi .valor { font-size: 29px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .pie { font-size: 13px; color: var(--tenue); }
.kpi.rojo .etiqueta, .kpi.rojo .valor { color: var(--rojo); }
.kpi.ambar .etiqueta { color: var(--ambar); }
.kpi.verde .etiqueta { color: var(--verde-osc); }

.rejilla { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.rejilla.dos { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
@media (max-width: 960px) { .rejilla.dos { grid-template-columns: minmax(0, 1fr); } }

/* Gráficas */
.leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; font-weight: 600; color: var(--tenue2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.graf { position: relative; height: 240px; margin-left: 48px; border-bottom: 1px solid var(--linea-fuerte); display: flex; align-items: flex-end; gap: 1%; }
.graf .guia { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--linea-fuerte); opacity: .5; }
.graf .eje { position: absolute; left: -48px; font-size: 12px; color: var(--tenue); transform: translateY(50%); }
.graf .grupo { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.graf .barra-v { width: 40%; border-radius: 6px 6px 2px 2px; min-height: 0; transition: height .4s ease; }
.graf .grupo:hover .barra-v { filter: brightness(1.08); }
.graf .apilada { width: 62%; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; }
.graf .apilada span { border-radius: 6px 6px 2px 2px; display: block; }
.etiquetas-x { margin-left: 48px; display: flex; gap: 1%; }
.etiquetas-x span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--tenue); min-width: 0; overflow: visible; white-space: nowrap; }
.consejo { position: fixed; z-index: 60; pointer-events: none; padding: 8px 10px; border-radius: 10px; font-size: 13px; background: var(--vidrio-fuerte); border: 1px solid var(--vidrio-borde); box-shadow: var(--sombra-modal); max-width: 260px; }
.semanas-graf { height: 190px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--linea-fuerte); }
.semanas-graf .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.semanas-graf .col b { text-align: center; font-size: 12px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.semanas-graf .col span { border-radius: 6px 6px 2px 2px; display: block; }
.semanas-x { display: flex; gap: 14px; }
.semanas-x span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--tenue); }

.barras-h { display: flex; flex-direction: column; gap: 8px; }
.barra-h { display: flex; flex-direction: column; gap: 4px; padding: 3px 0; text-decoration: none; color: var(--tinta); }
a.barra-h:hover { text-decoration: none; }
a.barra-h:hover b { color: var(--azul-osc); }
.barra-h .fila { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.barra-h .pista { height: 8px; border-radius: 999px; background: var(--azul-f); overflow: hidden; display: block; }
.barra-h .pista span { display: block; height: 100%; background: var(--azul); border-radius: 999px; }
.barra-h.equipo .pista { background: var(--ambar-f); }
.barra-h.equipo .pista span { background: var(--ambar-b); }
.barra-h.verde .pista span { background: var(--verde); }
.barra-h.rojo .pista span { background: var(--rojo-b); }
.barra-h.doble .pista { position: relative; }
.barra-h.doble .pista .ant { position: absolute; inset: 0 auto 0 0; background: var(--barra-ant); }
.barra-h.doble .pista .act { position: relative; }

/* Listas de facturas */
.lista { display: flex; flex-direction: column; }
.renglon { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linea); min-width: 0; }
.renglon:last-child { border-bottom: 0; }
.renglon .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.renglon .txt b { font-size: 14px; }
.renglon .txt span { font-size: 12px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.renglon .monto { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.renglon.clic { cursor: pointer; border-radius: 10px; }
.renglon.clic:hover { background: var(--gris-f); }
.aviso-revisar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 20px; border-radius: 22px; background: var(--ambar-f); border: 1px solid var(--vidrio-borde); color: var(--tinta); text-decoration: none; }
.aviso-revisar:hover { text-decoration: none; filter: brightness(1.02); }
.nota-fuente { font-size: 13px; color: var(--tenue); }

/* Tabla de facturas */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tabla-env { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tenue); padding: 8px 10px; border-bottom: 1px solid var(--linea-fuerte); white-space: nowrap; }
.tabla td { padding: 10px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: var(--gris-f); }
.tabla tr.sel td { background: var(--azul-f); }
.tabla td.der, .tabla th.der { text-align: right; }
.tabla td { white-space: nowrap; }
.tabla .concepto { max-width: 340px; overflow: hidden; text-overflow: ellipsis; color: var(--tenue2); }
@media (max-width: 1100px) { .tabla .concepto { max-width: 200px; } }
.tabla input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--azul); }
.tarjetas-fact { display: none; flex-direction: column; gap: 10px; }
.tarjeta-fact { padding: 14px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.tarjeta-fact .arriba { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tarjeta-fact .concepto { font-size: 13px; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-fact input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--azul); vertical-align: -5px; margin: 0 6px 0 0; }
.mas { align-self: center; }
.seleccion { position: sticky; bottom: 16px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 20px; background: var(--vidrio-fuerte); }

/* Detalle */
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.datos div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.datos dd, .datos .v { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.obs { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--tenue2); background: var(--gris-f); border-radius: 12px; padding: 10px 12px; }
.historia { display: flex; flex-direction: column; gap: 8px; }
.historia .h { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 3px solid var(--azul-f); }
.historia .h.deshecho { opacity: .55; }
.historia .h small { color: var(--tenue); }

/* Revisar */
.revision { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.revision .grav { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.revision.cifras .grav { color: var(--rojo); }
.revision.avisos .grav { color: var(--ambar); }
.revision.orden .grav { color: var(--tenue); }
.revision.espera { border-style: dashed; }
.subrev { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 4px; border-top: 1px solid var(--linea); }
.subrev.espera h3::after { content: " · en espera"; color: var(--ambar); font-weight: 700; }

/* Usuarios / bitácora */
.persona { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.persona:last-child { border-bottom: 0; }
.persona .ini { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--azul-f); color: var(--azul-osc); flex: none; }
.persona .quien { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.persona.inactivo { opacity: .6; }
.mov { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.mov:last-child { border-bottom: 0; }
.mov .cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mov .detalle { font-size: 13px; color: var(--tenue); overflow-wrap: anywhere; }
.mov.deshecho .cuerpo > b { text-decoration: line-through; opacity: .6; }
.roles td, .roles th { font-size: 13px; }

/* Modal */
dialog.modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border-radius: 26px; color: var(--tinta); background: var(--vidrio-fuerte); border: 1px solid var(--vidrio-borde); box-shadow: var(--sombra-modal); overflow: hidden; }
dialog.modal.ancho { width: min(940px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 20, 31, 0.36); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-env { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; border-bottom: 1px solid var(--linea); }
.modal-cab > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.modal-cuerpo { padding: 16px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-pie { padding: 12px 22px 18px; border-top: 1px solid var(--linea); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.modal-pie .izq { margin-right: auto; font-size: 13px; color: var(--tenue); max-width: 420px; }
.vista-previa { font-size: 13px; padding: 12px 14px; border-radius: 14px; background: var(--azul-f); color: var(--tenue2); }
.vista-previa b { color: var(--tinta); }
.archivo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.archivo input[type=file] { font-size: 13px; max-width: 100%; }

/* Avisos (toast) */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100vw - 24px)); }
.toast .t { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 16px; background: #0E1E2E; color: #fff; box-shadow: var(--sombra-modal); font-size: 14px; font-weight: 600; width: 100%; }
.toast .t.mal { background: #7A1712; }
.toast .t span { flex: 1; min-width: 0; }
.toast .t button { background: rgba(255, 255, 255, 0.16); color: #fff; border: 0; border-radius: 10px; min-height: 34px; padding: 0 12px; font-weight: 700; cursor: pointer; }

.cargando { padding: 40px; text-align: center; color: var(--tenue); }
.vacio { padding: 24px; text-align: center; color: var(--tenue); }
.esqueleto { height: 120px; border-radius: 22px; background: linear-gradient(90deg, var(--gris-f), var(--vidrio), var(--gris-f)); background-size: 200% 100%; animation: brillo 1.4s infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

/* Barra de pestañas del celular */
.pestanas-cel { display: none; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 27px; }
  .marco { padding: 10px 12px 110px; gap: 16px; }
  .barra { top: 6px; padding: 8px 10px; gap: 8px; border-radius: 18px; }
  .barra .logo { height: 26px; }
  .menu { display: none; }
  .buscador { order: 5; flex-basis: 100%; }
  .buscador kbd { display: none; }
  .lectura .texto { display: none; }
  .barra-der { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .valor { font-size: 21px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .filtros select { flex: 1 1 150px; }
  .tarjeta { padding: 16px; }
  .rejilla { grid-template-columns: minmax(0, 1fr); }
  .graf { height: 180px; margin-left: 38px; }
  .graf .eje { left: -38px; font-size: 11px; }
  .etiquetas-x { margin-left: 38px; }
  .etiquetas-x span { font-size: 10px; }
  .tabla-env.facturas { display: none; }
  .tarjetas-fact { display: flex; }
  .pestanas-cel {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40;
    padding: 6px; border-radius: 22px; justify-content: space-around;
  }
  .pestanas-cel a, .pestanas-cel button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px;
    font-size: 11px; font-weight: 700; color: var(--tenue2); text-decoration: none; border: 0; background: none; cursor: pointer; position: relative;
  }
  .pestanas-cel [aria-current=page] { color: var(--azul-osc); background: var(--azul-f); }
  .pestanas-cel .insignia { position: absolute; top: 0; right: 14%; padding: 1px 6px; font-size: 10px; }
  .pestanas-cel svg { width: 22px; height: 22px; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .modal-env { max-height: 92vh; }
  .seleccion { bottom: 86px; }
  .toast { bottom: 92px; }
  .menu-usuario { right: 8px; top: 56px; }
}
@media (min-width: 761px) { .barra-der { display: flex; align-items: center; gap: 10px; } }
@media (min-width: 761px) and (max-width: 1180px) {
  .barra { position: relative; top: 0; }
  .menu a { padding: 0 10px; }
  .lectura .texto { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .fondo, .barra, .pestanas-cel, .toast, .seleccion { display: none !important; }
  .vidrio { background: #fff; box-shadow: none; border: 1px solid #ddd; backdrop-filter: none; }
}

@media (min-width: 761px) { .solo-cel { display: none !important; } }
