/* BLVNK ORDER: negro, blanco y verde lima */
:root {
  --marca: #0B0B0F;
  --lima: #C8F24A;
  --lima-suave: #EEFBC9;
  --fondo: #F4F5F7;
  --superficie: #FFFFFF;
  --superficie-2: #F9FAFB;
  --texto: #14161B;
  --suave: #667085;
  --borde: #E4E7EC;
  --primario: #0B0B0F;
  --primario-texto: #FFFFFF;
  --primario-hover: #2A2D35;
  --foco: #7A9A12;
  --ok: #067647; --ok-fondo: #ECFDF3;
  --aviso: #93370D; --aviso-fondo: #FFFAEB;
  --error: #B42318; --error-fondo: #FEF3F2;
  --info: #175CD3; --info-fondo: #EFF8FF;
  --cebra: #F6F7F9; --cebra-hover: #F1F8DC;
  --pill-aviso: #FCE38A; --pill-aviso-texto: #5C3D00;
  --pill-ok: #1E9E5A; --pill-info: #4C8DF6; --pill-error: #D92D20;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-alta: 0 12px 32px rgba(16, 24, 40, .18);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0E1014; --superficie: #171A20; --superficie-2: #1C2027; --texto: #E8EAED;
    --suave: #98A2B3; --borde: #2A2F38; --primario: #C8F24A; --primario-texto: #0B0B0F;
    --primario-hover: #D8FA72; --foco: #C8F24A; --lima-suave: #26301A;
    --ok: #47CD89; --ok-fondo: #0F2A1E; --aviso: #FDB022; --aviso-fondo: #2B2111;
    --error: #F97066; --error-fondo: #2D1513; --info: #84CAFF; --info-fondo: #112338;
    --cebra: #1B1F26; --cebra-hover: #222A18;
    --pill-aviso: #F5C84B; --pill-aviso-texto: #2B1D00;
    --sombra: none; --sombra-alta: 0 12px 32px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: .98rem; margin: 0 0 .75rem; }
a { color: inherit; }
.cargando { padding: 2rem; color: var(--suave); }
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estructura ---------- */
.marco { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral { background: var(--marca); color: #C9CDD4; padding: 1rem .75rem; display: flex; flex-direction: column;
  gap: .15rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem 1.25rem; color: #fff; text-decoration: none; }
.logo img { width: 34px; height: 34px; }
.logo b { font-weight: 800; letter-spacing: .06em; font-size: 1.05rem; }
.logo span { font-weight: 300; letter-spacing: .2em; font-size: 1.05rem; margin-left: .3rem; }
.grupo { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #6B7280; padding: 1rem .75rem .35rem; }
.lateral a.nav { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #C9CDD4;
  padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
.lateral a.nav:hover { background: #1A1C23; color: #fff; }
.lateral a.nav.activo { background: var(--lima); color: #0B0B0F; }
.lateral .empresa { margin-top: auto; padding: .9rem .75rem; border-top: 1px solid #22252D; font-size: .85rem; }
.lateral .empresa strong { color: #fff; display: block; }
.lateral .empresa button { margin-top: .6rem; background: transparent; border: 1px solid #2E323B; color: #C9CDD4;
  width: 100%; display: flex; gap: .5rem; align-items: center; justify-content: center; }
.lateral .empresa button:hover { border-color: #5A606C; color: #fff; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.superior { height: 60px; background: var(--superficie); border-bottom: 1px solid var(--borde); display: flex;
  align-items: center; justify-content: space-between; padding: 0 2rem; position: sticky; top: 0; z-index: 5; gap: 1rem; }
.miga { color: var(--suave); font-size: .9rem; display: flex; gap: .4rem; align-items: center; }
.miga strong { color: var(--texto); font-weight: 600; }
.superior .rapido { display: flex; gap: .5rem; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--lima); color: #0B0B0F; display: grid;
  place-items: center; font-weight: 700; font-size: .85rem; text-transform: uppercase; }
.contenido { padding: 1.75rem 2rem 3rem; max-width: 1560px; width: 100%; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cabecera p { margin: .3rem 0 0; color: var(--suave); }
.periodo { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.periodo select { width: auto; }

/* ---------- Tarjetas e indicadores ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.25rem 1.35rem; box-shadow: var(--sombra); margin-bottom: 1.1rem; }
.tarjeta.sin-relleno { padding: 0; overflow: hidden; }
.tarjeta-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.tarjeta-cab h3 { margin: 0; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.cifra { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.1rem 1.25rem; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: .25rem; }
.cifra .cab { display: flex; justify-content: space-between; align-items: center; color: var(--suave); font-size: .85rem; }
.cifra .cab .ico-caja { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--lima-suave); color: var(--texto); }
.cifra strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin-top: .3rem; }
.cifra small { color: var(--suave); }
.accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.acceso-rapido { display: flex; gap: .85rem; align-items: center; padding: 1rem 1.1rem; background: var(--superficie);
  border: 1px solid var(--borde); border-radius: var(--radio); text-decoration: none; color: var(--texto); box-shadow: var(--sombra); }
.acceso-rapido:hover { border-color: var(--texto); }
.acceso-rapido .ico-caja { width: 40px; height: 40px; border-radius: 10px; background: var(--marca); color: var(--lima);
  display: grid; place-items: center; }
.acceso-rapido strong { display: block; }
.acceso-rapido small { color: var(--suave); }
.dos-columnas { display: grid; grid-template-columns: 2fr 1fr; gap: 1.1rem; }
.estado-lista { display: flex; flex-direction: column; gap: .75rem; }
.estado-item { display: flex; gap: .75rem; align-items: flex-start; }
.estado-item .punto { width: 10px; height: 10px; border-radius: 50%; margin-top: .35rem; flex: none; }
.punto.ok { background: var(--ok); } .punto.aviso { background: var(--aviso); } .punto.error { background: var(--error); }
.estado-item small { color: var(--suave); display: block; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
th { font-size: .74rem; color: var(--suave); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  background: var(--superficie-2); }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: var(--superficie-2); }
.vacio { color: var(--suave); padding: 2.5rem 1rem; text-align: center; }
.tabla-movil { overflow-x: auto; }
.tarjeta > .tabla-movil table { margin: -.25rem 0; }
.buscador { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.buscador svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--suave); }
.buscador input { padding-left: 2.1rem; }

/* ---------- Botones y formularios ---------- */
button, .boton { font: inherit; font-weight: 500; border: 1px solid var(--borde); background: var(--superficie);
  color: var(--texto); padding: .55rem .95rem; border-radius: 8px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .45rem; line-height: 1.2; }
button:hover, .boton:hover { border-color: var(--suave); }
button.primario, .boton.primario { background: var(--primario); border-color: var(--primario); color: var(--primario-texto); }
button.primario:hover, .boton.primario:hover { background: var(--primario-hover); }
button.lima, .boton.lima { background: var(--lima); border-color: var(--lima); color: #0B0B0F; }
button.peligro { color: var(--error); border-color: var(--error); background: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.mini { padding: .3rem .6rem; font-size: .85rem; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
label { display: block; font-size: .84rem; color: var(--suave); margin-bottom: .3rem; font-weight: 500; }
input, select, textarea { font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--borde);
  border-radius: 8px; background: var(--superficie); color: var(--texto); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }
input[readonly] { background: var(--superficie-2); color: var(--suave); }
input[type=checkbox] { width: auto; margin-right: .5rem; accent-color: var(--marca); }
.check { display: flex; align-items: center; color: var(--texto); font-size: .95rem; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem 1.1rem; }
.rejilla .ancho { grid-column: 1 / -1; }
.campo { min-width: 0; }
details summary { cursor: pointer; }

.lineas-edit th { background: transparent; }
.lineas-edit td { padding: .4rem .3rem; border-bottom: 0; }
.lineas-edit input, .lineas-edit select { padding: .45rem .5rem; }
.col-desc { min-width: 200px; }
.col-num { width: 90px; min-width: 80px; }
.col-op { min-width: 210px; }
.col-sel { min-width: 82px; }

.etiqueta { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .2rem .55rem;
  border-radius: 999px; background: var(--superficie-2); border: 1px solid var(--borde); white-space: nowrap; }
.etiqueta.ok { background: var(--ok-fondo); color: var(--ok); border-color: transparent; }
.etiqueta.aviso { background: var(--aviso-fondo); color: var(--aviso); border-color: transparent; }
.etiqueta.error { background: var(--error-fondo); color: var(--error); border-color: transparent; }
.etiqueta.info { background: var(--info-fondo); color: var(--info); border-color: transparent; }

.mensaje { padding: .8rem 1rem; border-radius: 8px; margin: .75rem 0; border: 1px solid transparent; }
.mensaje.ok { background: var(--ok-fondo); color: var(--ok); }
.mensaje.aviso { background: var(--aviso-fondo); color: var(--aviso); }
.mensaje.error { background: var(--error-fondo); color: var(--error); }
.mensaje.info { background: var(--info-fondo); color: var(--info); }
.mensaje ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.resumen { display: flex; flex-direction: column; gap: .35rem; max-width: 380px; margin-left: auto; }
.resumen div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.resumen .total { font-weight: 700; border-top: 1px solid var(--borde); padding-top: .45rem; font-size: 1.05rem; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; }
.suave { color: var(--suave); }
.clave-recuperacion { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; padding: 1rem; background: var(--superficie-2);
  border: 1px dashed var(--borde); border-radius: 8px; text-align: center; letter-spacing: .03em; user-select: all; }
.codigos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem 1rem; }

/* ---------- Acceso ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr); }
.acceso .lado-marca { background: var(--marca); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.acceso .lado-marca .logo { padding: 0; }
.acceso .lado-marca h2 { font-size: 2rem; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.02em; max-width: 420px; }
.acceso .lado-marca h2 em { color: var(--lima); font-style: normal; }
.acceso .lado-marca ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; color: #C9CDD4; }
.acceso .lado-marca li { display: flex; gap: .6rem; align-items: center; }
.acceso .lado-marca li svg { color: var(--lima); }
.acceso .lado-marca small { color: #6B7280; }
.acceso .lado-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.acceso .lado-form > div { width: 100%; max-width: 420px; }
.acceso.ancho .lado-form > div { max-width: 680px; }
.acceso .lado-form h1 { margin-bottom: .4rem; }
.acceso .lado-form > div > p { color: var(--suave); margin-top: 0; }

/* ---------- Modal y avisos ---------- */
.velo { position: fixed; inset: 0; background: rgba(11, 11, 15, .55); display: grid; place-items: center; padding: 1rem; z-index: 10; }
.modal { background: var(--superficie); border-radius: 14px; padding: 1.5rem; max-width: 560px; width: 100%;
  box-shadow: var(--sombra-alta); max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-top: 0; }
#avisos { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 20; }
.toast { background: var(--marca); color: #fff; padding: .75rem 1rem; border-radius: 8px; max-width: 380px;
  box-shadow: var(--sombra-alta); border-left: 4px solid var(--lima); }
.toast.error { border-left-color: #F97066; }

/* ---------- Tiendas, API y planes ---------- */
.fila-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
.fila-form input { flex: 1 1 220px; }
pre.codigo { background: var(--superficie-2); border: 1px solid var(--borde); border-radius: 8px; padding: .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; overflow-x: auto; white-space: pre; }
.clave-api { background: var(--lima-suave); padding: .7rem; border-radius: 8px; user-select: all; }
.planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin: .75rem 0; }
.plan { border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem; display: flex; flex-direction: column; gap: .35rem; }
.plan.actual { border-color: var(--lima); box-shadow: 0 0 0 2px var(--lima-suave); }
.plan .precio { font-size: 1.15rem; font-weight: 700; }
.plan small { color: var(--suave); }
.menu-movil { display: none; font-size: 1.3rem; padding: .3rem .7rem; }

/* ---------- Operaciones (tanda 5) ---------- */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--borde); }
.firma-img { max-width: 320px; width: 100%; background: #fff; border: 1px solid var(--borde); border-radius: 8px; }
.lienzo-firma { width: 100%; max-width: 600px; aspect-ratio: 5 / 2; background: #fff; border: 1px dashed var(--borde);
  border-radius: 8px; touch-action: none; display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem;
  display: flex; flex-direction: column; gap: .25rem; }
.kpi strong { font-size: 1.4rem; }
.kpi small { color: var(--suave); }
.kpi.negativo strong, td.negativo { color: var(--error); }
.fichar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.fichar h2 { margin: .2rem 0; }
.botones-fichar { display: flex; gap: .5rem; flex-wrap: wrap; }
.botones-fichar button { font-size: 1.05rem; padding: .8rem 1.4rem; }
.fichar label.check { flex-basis: 100%; }
tr.tachado td { text-decoration: line-through; color: var(--suave); }
.texto-largo { white-space: pre-wrap; }

/* ---------- Móvil ---------- */
@media (max-width: 960px) { .dos-columnas { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .marco { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: .6rem; gap: .25rem; }
  .lateral a.nav { display: none; }
  .lateral.abierto a.nav { display: flex; width: 100%; }
  .menu-movil { display: inline-block; margin-right: .5rem; }
  .superior .miga span { display: none; }
  .superior .rapido .boton.lima { padding: .4rem .6rem; font-size: .85rem; }
  .lateral .grupo, .lateral .empresa { display: none; }
  .logo { padding: .25rem .5rem; width: 100%; }
  .lateral a.nav { padding: .45rem .6rem; font-size: .9rem; }
  .superior { padding: 0 1rem; }
  .contenido { padding: 1.25rem 1rem 2.5rem; }
  .acceso { grid-template-columns: 1fr; }
  .acceso .lado-marca { padding: 1.5rem; }
  .acceso .lado-marca h2, .acceso .lado-marca ul { display: none; }
}
.barras { display: grid; grid-template-columns: repeat(12, 1fr); gap: .5rem; height: 180px; align-items: end; margin: 1rem 0 1.5rem; }
.barra-mes { display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; }
.barra-mes small { color: var(--suave); font-size: .75rem; }
.barra-par { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.barra { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; }
.barra.actual, .punto-leyenda.actual { background: var(--primario); }
.barra.anterior, .punto-leyenda.anterior { background: var(--borde); }
.leyenda { display: flex; align-items: center; gap: .4rem; color: var(--suave); font-size: .85rem; margin-top: .75rem; }
.punto-leyenda { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.consejo { display: flex; gap: .75rem; align-items: flex-start; background: var(--lima-suave); border: 1px solid var(--lima);
  border-radius: var(--radio); padding: .8rem 1rem; margin-bottom: 1.1rem; color: var(--texto); }
.consejo-ico { font-size: 1.2rem; line-height: 1.2; }
.consejo > div:nth-child(2) { flex: 1; }
.consejo-acciones { display: flex; gap: .4rem; flex-wrap: wrap; }
button.enlace { background: transparent; border-color: transparent; text-decoration: underline; color: var(--suave); }
.marcas { display: inline-flex; gap: .3rem; align-items: center; margin-left: .4rem; }
.estrella { color: #E0A100; font-size: 1rem; }
.mini-etq { font-size: .68rem; padding: .05rem .4rem; }
.anotacion h3 { display: flex; align-items: center; gap: .4rem; }
.logo-caja { border: 1px dashed var(--borde); border-radius: 8px; padding: .6rem; margin-bottom: .5rem; min-height: 60px; display: grid; place-items: center; }
.logo-vista { max-height: 70px; max-width: 220px; }

/* ---------- Detalle de documentos de STEL Order ---------- */
.modal.ancho { max-width: 980px; }
td.ref { white-space: nowrap; font-size: .82rem; color: var(--suave); }
.detalle-stel { margin-top: 1rem; }
.detalle-stel td .texto-largo { font-size: .82rem; }
tr.grupo td { background: var(--superficie-2); }
td.concepto { min-width: 240px; }

/* ---------- Tablas de listado: filas alternas, cabecera marcada y estados en color ---------- */
thead th { background: var(--superficie-2); color: var(--texto); font-size: .8rem; font-weight: 700;
  text-transform: none; letter-spacing: 0; border-bottom: 2px solid var(--borde); }
table:not(.filtrada) tbody tr:nth-child(even) td, table.filtrada tbody tr.alt td { background: var(--cebra); }
thead tr.filtros th { background: var(--superficie); padding: .45rem .5rem; border-bottom: 1px solid var(--borde); }
thead tr.filtros input, thead tr.filtros select { padding: .38rem .55rem; font-size: .82rem; background: var(--superficie-2);
  border-color: transparent; min-width: 90px; }
thead tr.filtros input:focus, thead tr.filtros select:focus { background: var(--superficie); border-color: var(--foco); }
thead tr.filtros.activos input:not(:placeholder-shown), thead tr.filtros.activos select:has(option:checked:not([value=""])) {
  background: var(--lima-suave); border-color: var(--foco); }
tr.clic:hover td, tr.clic:nth-child(even):hover td, tr.clic.alt:hover td { background: var(--cebra-hover); }
td.fuerte { font-weight: 700; }
td.n.fuerte { font-weight: 700; }
td .etiqueta { justify-content: center; min-width: 9.5rem; padding: .32rem .8rem; border-radius: 6px;
  font-size: .8rem; font-weight: 700; border: 0; }
td .etiqueta.aviso { background: var(--pill-aviso); color: var(--pill-aviso-texto); }
td .etiqueta.ok { background: var(--pill-ok); color: #fff; }
td .etiqueta.info { background: var(--pill-info); color: #fff; }
td .etiqueta.error { background: var(--pill-error); color: #fff; }
.lineas-edit tbody tr:nth-child(even) td, tr.grupo td { background: transparent; }
tr.grupo td { background: var(--superficie-2) !important; }

/* ---------- Listados completos: selección, orden, páginas y totales ---------- */
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
th.sel, td.sel { width: 38px; padding-left: .9rem; padding-right: .2rem; cursor: pointer; }
th.sel input, td.sel input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
th.ordenable { cursor: pointer; user-select: none; white-space: nowrap; }
th.ordenable:hover { color: var(--foco); }
th .flecha { margin-left: .3rem; font-size: .75rem; color: var(--suave); opacity: .55; }
th .flecha.activa { opacity: 1; color: var(--foco); }
tbody tr.seleccionada td, tbody tr.seleccionada.alt td { background: var(--lima-suave) !important; }
.barra-seleccion { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .6rem .9rem; background: var(--marca); color: #fff; border-radius: var(--radio) var(--radio) 0 0; }
.barra-seleccion strong { margin-right: .5rem; }
.barra-seleccion button { background: #22252D; color: #fff; border-color: #3A3E48; display: inline-flex; gap: .4rem; align-items: center; }
.barra-seleccion button.primario { background: var(--lima); color: #0B0B0F; border-color: var(--lima); }
.barra-seleccion button.enlace { background: transparent; border: 0; text-decoration: underline; color: #C9CDD4; margin-left: auto; }
tfoot tr.totales td { font-weight: 800; border-top: 2px solid var(--borde); border-bottom: 0; background: var(--superficie-2);
  font-variant-numeric: tabular-nums; }
.pie-tabla { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .7rem .9rem; color: var(--suave);
  font-size: .85rem; border-top: 1px solid var(--borde); }
.pie-tabla .hueco { flex: 1; }
.pie-tabla select { width: auto; padding: .3rem .5rem; font-size: .82rem; }
.paginador { display: flex; align-items: center; gap: .35rem; }
.paginador span { padding: 0 .4rem; color: var(--texto); }
.num-doc { font-weight: 600; font-variant-numeric: tabular-nums; }
.origen { margin-left: .4rem; font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: .08rem .35rem; border-radius: 4px;
  background: var(--superficie-2); color: var(--suave); border: 1px solid var(--borde); vertical-align: middle; }
.origen.r { color: var(--aviso); border-color: currentColor; }
td.titulo-doc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--suave); }
td.icono-celda { text-align: center; width: 70px; }
.enviada { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--info-fondo); color: var(--info); }
.enviada svg.ico { width: 16px; height: 16px; }
td.pendiente { color: var(--aviso); }
.margen { display: inline-flex; align-items: center; gap: .45rem; min-width: 92px; justify-content: flex-end; }
.margen .barra { display: inline-block; height: 6px; border-radius: 3px; max-width: 46px; background: currentColor; opacity: .8; }
.margen b { min-width: 3.4em; text-align: right; }
.margen.alta { color: var(--pill-ok); } .margen.media { color: #B7791F; } .margen.baja { color: var(--pill-error); }
.cifras-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.cifras-mini > div { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .75rem 1rem; }
.cifras-mini span { display: block; font-size: .78rem; color: var(--suave); }
.cifras-mini strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cifras-mini strong.aviso { color: var(--aviso); } .cifras-mini strong.error { color: var(--error); }
details.plegable > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .5rem; list-style: none; }
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable[open] > summary { margin-bottom: 1rem; }
.pista { font-size: .8rem; }
td.nombre { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.titulo-doc { max-width: 220px; }
table.listado td, table.listado th { padding: .6rem .7rem; }
table.listado td { white-space: nowrap; }
table.listado td, table.listado th { padding: .55rem .55rem; }
table.listado td .etiqueta { min-width: 7.6rem; padding: .3rem .6rem; }
table.listado thead tr.filtros input, table.listado thead tr.filtros select { min-width: 0; width: 100%; max-width: 160px; }
table.listado td.nombre { max-width: 210px; }
table.listado td.titulo-doc { max-width: 180px; }
table.listado td.icono-celda { width: 56px; }
table.listado th { white-space: nowrap; }
table.listado td.titulo-doc { max-width: 150px; }
table.listado td.nombre { max-width: 190px; }
table.listado td.icono-celda { width: 74px; }
table.listado thead tr.filtros select { min-width: 66px; }
button.icono-solo { padding: .2rem .45rem; color: var(--suave); }
/* ---------- Duplicar como… ---------- */
.rejilla-duplicar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .75rem; }
.grupo-duplicar { display: flex; flex-direction: column; gap: .45rem; }
.grupo-duplicar h3 { margin: 0 0 .2rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
button.opcion-duplicar { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; padding: .6rem .8rem; }
button.opcion-duplicar span { font-size: .76rem; font-weight: 400; }
button.opcion-duplicar:hover { border-color: var(--foco); background: var(--lima-suave); }
@media (max-width: 560px) { .rejilla-duplicar { grid-template-columns: 1fr; } }
td.con-iva { color: var(--suave); }
/* ---------- Face ID / Touch ID ---------- */
.acceso-biometrico { margin-top: 1rem; }
.acceso-biometrico .separador { display: flex; align-items: center; gap: .75rem; color: var(--suave); font-size: .82rem; margin: .5rem 0 1rem; }
.acceso-biometrico .separador::before, .acceso-biometrico .separador::after { content: ""; flex: 1; border-top: 1px solid var(--borde); }
button.boton-biometrico { width: 100%; display: flex; justify-content: center; align-items: center; gap: .55rem; padding: .75rem 1rem;
  font-weight: 700; background: var(--superficie); border: 1px solid var(--borde); }
button.boton-biometrico svg.ico { width: 22px; height: 22px; }
button.boton-biometrico:hover { border-color: var(--foco); }
@media (max-width: 820px) {
  .acceso { grid-template-rows: auto 1fr; align-content: start; }
  .acceso .lado-marca { padding: 1.1rem 1.25rem; min-height: 0; }
  .acceso .lado-marca > :not(.logo) { display: none; }
  .acceso .lado-form { padding-top: 1.5rem; align-items: flex-start; }
}
