/* GC-ERP (Ground Capital) — sistema visual base
   Tinta (navegación) · Fondo frío · Verde cuenta (acciones) · cifras tabulares alineadas a la derecha. */
:root {
    --tinta: #14243A;
    --tinta-2: #1E3350;
    --tinta-texto: #C9D3DE;
    --fondo: #F3F5F2;
    --papel: #FFFFFF;
    --texto: #1E2A38;
    --texto-2: #5B6875;
    --linea: #D9DED8;
    --verde: #1F7A5A;
    --verde-oscuro: #17604A;
    --verde-suave: #E1F0E9;
    --rojo: #B2433A;
    --ambar: #C9822E;
    --foco: #2F6FD6;
    --radio: 6px;
    --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--sans); color: var(--texto); background: var(--fondo); line-height: 1.5; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
a { color: var(--verde-oscuro); }
code { font-size: .9em; background: var(--verde-suave); padding: 0 .3em; border-radius: 3px; }

.saltar { position: absolute; left: -999px; top: 0; background: var(--papel); padding: .5rem 1rem; z-index: 10; }
.saltar:focus { left: 1rem; }

/* ---------- Estructura ---------- */
.erp { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--tinta) 248px, var(--fondo) 248px); }
.lateral { background: var(--tinta); color: var(--tinta-texto); padding: 1.5rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { padding: 0 1.5rem 1.5rem; display: flex; align-items: baseline; gap: .5rem; }
.marca-nombre { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; color: #fff; letter-spacing: .01em; }
.marca-sub { font-size: .85rem; color: var(--tinta-texto); }
.area { display: flex; flex-direction: column; min-width: 0; }
.contenido { padding: 2rem 2.5rem 3rem; max-width: 1200px; width: 100%; }

/* ---------- Menú ---------- */
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-grupo { margin-bottom: .15rem; }
.menu-grupo.menu-directo + .menu-grupo:not(.menu-directo) { margin-top: .6rem; }
.menu-titulo { margin: 0 0 .25rem; padding: 0 1.5rem; font-size: .8rem; color: #8FA0B3; }
.menu-opcion { display: block; padding: .4rem 1.5rem; color: var(--tinta-texto); text-decoration: none; font-size: .95rem; border-left: 3px solid transparent; }
/* Módulos que se abren y se cierran (uno a la vez) */
.menu-modulo { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem 1.25rem .55rem 1.5rem; border: 0; border-left: 3px solid transparent;
    background: none; color: var(--tinta-texto); font: inherit; font-size: .95rem; font-weight: 500; text-align: left; cursor: pointer; }
.menu-modulo:hover { background: var(--tinta-2); color: #fff; }
.menu-modulo:focus-visible, .menu-opcion:focus-visible { outline: 2px solid #5FBF95; outline-offset: -2px; }
.menu-modulo-icono { flex: none; opacity: .85; }
.menu-modulo .menu-texto { flex: 1; }
.menu-flecha { flex: none; opacity: .6; transition: transform .15s; }
.menu-grupo.abierto > .menu-modulo { color: #fff; }
.menu-grupo.abierto > .menu-modulo .menu-flecha { transform: rotate(90deg); }
.menu-grupo:not(.menu-directo) > ul { display: none; padding: .1rem 0 .5rem; }
.menu-grupo.abierto:not(.menu-directo) > ul { display: block; }
.menu-grupo:not(.menu-directo) .menu-opcion { padding: .38rem 1.25rem .38rem calc(1.5rem + 20px + .6rem); font-size: .9rem; }
.menu-grupo.menu-directo .menu-opcion { padding: .55rem 1.25rem .55rem 1.5rem; font-weight: 500; }
.menu-grupo.menu-directo .menu-icono { display: block; opacity: .85; }
a.menu-opcion:hover { background: var(--tinta-2); color: #fff; }
.menu-opcion.activa { color: #fff; border-left-color: #5FBF95; background: var(--tinta-2); }
.menu-opcion.pendiente { color: #6F8196; cursor: default; }

/* ---------- Barra de contexto: la razón social es lo más visible ---------- */
.barra { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .9rem 2.5rem; background: var(--papel); border-bottom: 1px solid var(--linea); }
.contexto { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.contexto-etiqueta { font-size: .85rem; color: var(--texto-2); white-space: nowrap; }
.contexto-selector { display: flex; flex-direction: column; min-width: 0; }
.contexto-selector select {
    font: 600 1.15rem var(--sans); color: var(--texto); border: 1px solid transparent; border-radius: var(--radio);
    background: transparent; padding: .1rem 1.6rem .1rem .3rem; margin-left: -.3rem; max-width: 100%; cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
    background-position: right .6rem center, right .3rem center; background-size: 5px 5px; background-repeat: no-repeat;
}
.contexto-selector select:hover { border-color: var(--linea); }
.contexto-corporativo { font-size: .85rem; color: var(--texto-2); }
.usuario { display: flex; align-items: center; gap: 1rem; font-size: .9rem; color: var(--texto-2); white-space: nowrap; }
.usuario form { margin: 0; }

/* ---------- Tipografía de página ---------- */
.titulo-pagina { font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.2; margin: 0 0 1.5rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .75rem; }
.texto-apoyo { color: var(--texto-2); max-width: 65ch; }
.bloque { margin-bottom: 2.5rem; }

/* ---------- Tablas ---------- */
.tabla-envoltura { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th, .tabla td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--linea); }
.tabla thead th { font-weight: 500; color: var(--texto-2); font-size: .85rem; background: #FAFBF9; }
.tabla tbody tr:hover { background: #F8FAF8; }
.tabla tfoot th, .tabla tfoot td { border-bottom: 0; font-weight: 600; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.saldo { font-weight: 600; }
.negativo { color: var(--rojo); }
.moneda { font-size: .8rem; color: var(--texto-2); font-weight: 400; margin-left: .2rem; }
.cuenta-codigo { font-size: .8rem; color: var(--texto-2); margin-left: .4rem; }

/* ---------- Botones y formularios ---------- */
.boton-principal, .boton-secundario, .enlace { font: inherit; cursor: pointer; }
.boton-principal { background: var(--verde); color: #fff; border: 0; border-radius: var(--radio); padding: .7rem 1.4rem; font-weight: 600; }
.boton-principal:hover { background: var(--verde-oscuro); }
.boton-secundario { display: inline-block; background: var(--papel); color: var(--texto); border: 1px solid var(--linea); border-radius: var(--radio); padding: .55rem 1.1rem; text-decoration: none; }
.enlace { background: none; border: 0; padding: 0; color: var(--verde-oscuro); text-decoration: underline; }
.formulario { display: flex; flex-direction: column; gap: 1.1rem; }
.campo { display: flex; flex-direction: column; gap: .3rem; }
.campo label { font-weight: 500; font-size: .95rem; }
.campo input { font: inherit; padding: .65rem .8rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.campo input:focus { border-color: var(--verde); outline: 3px solid rgba(31, 122, 90, .25); outline-offset: 0; }
.error-campo { color: var(--rojo); font-size: .85rem; }
.error-resumen { color: var(--rojo); }
.error-resumen ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none; }
.aviso { background: #FBF1E3; border-left: 4px solid var(--ambar); padding: .75rem 1rem; border-radius: var(--radio); }

/* ---------- Acceso (login) ---------- */
.acceso { display: grid; grid-template-columns: minmax(280px, 42%) 1fr; min-height: 100vh; }
.acceso-marca { background: var(--tinta); color: var(--tinta-texto); padding: 3rem; display: flex; flex-direction: column; justify-content: flex-end; }
.acceso-marca .marca-nombre { font-size: 2.6rem; line-height: 1.1; }
.acceso-lema { max-width: 32ch; font-size: 1.05rem; margin: 1rem 0 0; }
.acceso-panel { padding: 3rem; display: flex; flex-direction: column; justify-content: center; max-width: 30rem; width: 100%; margin: 0 auto; }
.acceso-panel h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; margin: 0 0 1.5rem; }
.nota-desarrollo { margin-top: 2rem; font-size: .85rem; color: var(--texto-2); border-top: 1px solid var(--linea); padding-top: 1rem; }
.lista-clientes { display: flex; flex-direction: column; gap: .75rem; }
.cliente { display: flex; justify-content: space-between; align-items: center; text-align: left; font: inherit; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem 1.2rem; cursor: pointer; }
.cliente:hover { border-color: var(--verde); }
.cliente-nombre { font-weight: 600; }
.cliente-codigo { color: var(--texto-2); font-size: .85rem; }

/* ---------- Pantallas angostas ---------- */
@media (max-width: 860px) {
    .erp { grid-template-columns: 1fr; background: var(--fondo); }
    .lateral { position: static; height: auto; padding: 1rem 0 .5rem; }
    .menu { display: flex; flex-wrap: wrap; gap: .25rem .4rem; padding: 0 1rem; }
    .menu-grupo, .menu-grupo.menu-directo + .menu-grupo:not(.menu-directo) { margin: 0; }
    .menu-modulo, .menu-grupo.menu-directo .menu-opcion { width: auto; padding: .45rem .75rem; border: 1px solid #2E4566; border-radius: var(--radio); }
    .menu-grupo.menu-directo .menu-icono, .menu-modulo-icono { display: none; }
    .menu-grupo.abierto > .menu-modulo { background: var(--tinta-2); }
    .menu-grupo.abierto:not(.menu-directo) { order: 99; flex-basis: 100%; }
    .menu-grupo.abierto:not(.menu-directo) > .menu-modulo { width: 100%; }
    .menu-grupo:not(.menu-directo) .menu-opcion { padding-left: 1.5rem; }
    .barra { flex-direction: column; align-items: flex-start; padding: .9rem 1rem; }
    .contenido { padding: 1.5rem 1rem 2rem; }
    .acceso { grid-template-columns: 1fr; }
    .acceso-marca { padding: 2rem 1.5rem; }
    .acceso-panel { padding: 2rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Páginas de trabajo ---------- */
.encabezado-pagina { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.encabezado-pagina .titulo-pagina { margin-bottom: .4rem; }
.acciones-encabezado { display: flex; gap: .6rem; flex-wrap: wrap; }
.enlace-volver { color: var(--texto-2); font-size: .9rem; }
.boton-principal { display: inline-block; text-decoration: none; }
.boton-peligro { font: inherit; cursor: pointer; background: var(--papel); color: var(--rojo); border: 1px solid #E3B8B4; border-radius: var(--radio); padding: .55rem 1.1rem; }
.boton-peligro:hover { background: #FBEDEB; }
.mensaje { background: var(--verde-suave); border-left: 4px solid var(--verde); padding: .75rem 1rem; border-radius: var(--radio); }
.errores { background: #FBEDEB; border-left: 4px solid var(--rojo); padding: .75rem 1rem; border-radius: var(--radio); margin-bottom: 1rem; }
.errores p { margin: 0 0 .3rem; font-weight: 600; }
.errores ul { margin: 0; padding-left: 1.2rem; }
.vacio { background: var(--papel); border: 1px dashed var(--linea); border-radius: var(--radio); padding: 2rem; text-align: center; color: var(--texto-2); }
.oculto { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opcional { font-weight: 400; color: var(--texto-2); font-size: .85rem; }
.pequeno { font-size: .85rem; }

/* Estados: el color dice en qué va la requisición */
.estado { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.estado-borrador { background: #ECEFEA; color: var(--texto-2); }
.estado-espera { background: #E4ECF7; color: #2A4E86; }
.estado-atencion { background: #FBF1E3; color: #8A5517; }
.estado-ok { background: var(--verde-suave); color: var(--verde-oscuro); }
.estado-fin { background: #F4E4E2; color: var(--rojo); }
.etiqueta-urgente { margin-left: .5rem; font-size: .75rem; font-weight: 600; color: #8A5517; background: #FBF1E3; padding: .1rem .45rem; border-radius: 4px; }

/* Filtros */
.filtros { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filtros select { font: inherit; padding: .45rem .6rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.segmentos { display: inline-flex; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.segmentos a { padding: .45rem .9rem; text-decoration: none; color: var(--texto-2); }
.segmentos a.activo { background: var(--tinta); color: #fff; }

/* Captura */
.captura { display: flex; flex-direction: column; gap: 1.25rem; }
.panel { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem 1.4rem; }
.panel[hidden] { display: none; }
.panel-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.ayuda-teclas { font-size: .85rem; color: var(--texto-2); margin: 0 0 .75rem; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.25rem; margin-bottom: 1rem; }
.campo-doble { grid-column: span 2; }
.campo-ancho select { max-width: 32rem; }
.campo[hidden] { display: none; }
.campo select, .campo textarea { font: inherit; padding: .6rem .7rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); width: 100%; }
.campo textarea { resize: vertical; }
.dato-apoyo { font-size: .85rem; color: var(--texto-2); }
.dato-alerta { color: #8A5517; }
.sin-dato { color: var(--texto-2); font-style: italic; }
.tabla-captura td { padding: .25rem .35rem; }
.tabla-captura td:nth-child(2) { min-width: 16rem; }
.tabla-captura input, .tabla-captura select { font: inherit; width: 100%; padding: .45rem .5rem; border: 1px solid transparent; border-radius: 4px; background: transparent; }
.tabla-captura input:hover, .tabla-captura select:hover { border-color: var(--linea); }
.tabla-captura input:focus, .tabla-captura select:focus { border-color: var(--verde); background: #fff; outline: 2px solid rgba(31, 122, 90, .25); }
.tabla-captura input.num { text-align: right; font-variant-numeric: tabular-nums; }
.col-num { width: 2.5rem; color: var(--texto-2); text-align: center; }
.col-unidad { width: 7.5rem; } .col-cant { width: 7rem; } .col-precio { width: 9rem; } .col-desc { width: 6rem; } .col-iva { width: 10rem; }
.col-total { width: 9rem; } .col-quitar { width: 2.5rem; }
.quitar { font: inherit; font-size: 1.2rem; line-height: 1; border: 0; background: none; color: var(--texto-2); cursor: pointer; padding: .2rem .4rem; border-radius: 4px; }
.quitar:hover { color: var(--rojo); background: #FBEDEB; }
[data-agregar] { margin-top: .75rem; }
.totales { margin: 1rem 0 0 auto; max-width: 20rem; display: grid; gap: .3rem; }
.totales div { display: flex; justify-content: space-between; }
.totales dt { color: var(--texto-2); }
.totales dd { margin: 0; font-variant-numeric: tabular-nums; }
.total-final dt, .total-final dd, .total-final th, .total-final td { font-weight: 600; font-size: 1.1rem; color: var(--texto); }
.acciones-pie { display: flex; justify-content: flex-end; gap: .75rem; position: sticky; bottom: 0; background: var(--fondo); padding: .75rem 0; border-top: 1px solid var(--linea); }

/* Detalle */
.dos-columnas { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; }
.columna-lateral { display: flex; flex-direction: column; gap: 1rem; }
.ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem 1.25rem; margin: 0 0 1rem; }
.ficha dt { font-size: .8rem; color: var(--texto-2); }
.ficha dd { margin: 0; font-weight: 500; }
.cifra { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.justificacion { max-width: 75ch; }
.pago { background: #F7FAF8; border: 1px solid var(--linea); border-left: 4px solid var(--verde); border-radius: var(--radio); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.botones-decision { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.panel-decision { border-color: var(--verde); }
.historial { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.historial li { border-left: 2px solid var(--linea); padding-left: .75rem; }
.historial-que { display: block; font-weight: 500; }
.historial time { font-size: .8rem; color: var(--texto-2); }
.historial p { margin: .25rem 0 0; font-size: .9rem; }
details.panel summary { cursor: pointer; color: var(--rojo); }

/* Impresión */
.impresion { background: #fff; max-width: 60rem; margin: 0 auto; padding: 2rem; position: relative; }
.impresion-encabezado { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--tinta); margin-bottom: 1.5rem; }
.impresion-encabezado h1 { font-family: var(--serif); margin: .2rem 0 1rem; }
.impresion-empresa { margin: 0; color: var(--texto-2); }
.impresion-firmas { margin-top: 2rem; border-top: 1px solid var(--linea); padding-top: 1rem; }
.marca-agua { position: fixed; top: 40%; left: 0; right: 0; text-align: center; font-size: 6rem; font-weight: 600; color: rgba(178, 67, 58, .12); transform: rotate(-20deg); pointer-events: none; margin: 0; }
@media print { .no-imprimir { display: none; } .impresion { padding: 0; } .tabla-envoltura { border: 0; } }

@media (max-width: 1500px) {
    .dos-columnas { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .campo-doble { grid-column: auto; }
}
.tabla td:first-child a { white-space: nowrap; }

/* ---------- Adjuntos ---------- */
.campo-con-boton { display: flex; gap: .4rem; align-items: stretch; }
.campo-con-boton input { flex: 1; min-width: 0; }
.boton-clip { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; flex: none;
    background: var(--papel); color: var(--texto-2); border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; }
.boton-clip:hover { color: var(--verde-oscuro); border-color: var(--verde); background: var(--verde-suave); }
.boton-con-icono { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.lista-adjuntos { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; }
.lista-adjuntos li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .7rem;
    background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio); }
.lista-adjuntos li a { font-weight: 500; overflow-wrap: anywhere; }
.lista-adjuntos li.subiendo { color: var(--texto-2); font-style: italic; }
.boton-quitar-adjunto { margin-left: auto; background: none; border: 0; color: var(--rojo); cursor: pointer; padding: .1rem .3rem; font: inherit; }
.boton-quitar-adjunto:hover { text-decoration: underline; }
.adjuntos-detalle { margin-top: 1.25rem; }
.adjuntos-detalle h2 { font-size: 1rem; margin: 0 0 .25rem; }
@media print { .lista-adjuntos li { background: none; border: 0; padding: 0; } }

/* ---------- Razón social en la captura ---------- */
.empresa-captura { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin: -.25rem 0 1.25rem;
    padding: .7rem 1rem; background: var(--papel); border: 1px solid var(--linea); border-left: 4px solid var(--verde); border-radius: var(--radio); }
.empresa-captura-etiqueta { color: var(--texto-2); font-size: .9rem; }
.empresa-captura strong { font-size: 1.05rem; }
.empresa-captura-corp { color: var(--texto-2); }
.empresa-captura-ayuda { margin-left: auto; color: var(--texto-2); font-size: .85rem; }

/* ---------- Buscador con lista (beneficiarios, productos) ---------- */
.combo { position: relative; }
.combo input[type=text] { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.combo input[type=text]:focus { border-color: var(--verde); outline: 3px solid rgba(31, 122, 90, .25); outline-offset: 0; }
.combo-lista { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: .25rem 0; list-style: none;
    background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: 0 10px 24px rgba(20, 36, 58, .14);
    max-height: 320px; overflow-y: auto; }
.combo-lista li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; padding: .5rem .85rem; cursor: pointer; }
.combo-lista li[aria-selected=true] { background: var(--verde-suave); }
.combo-nombre { font-weight: 500; }
.combo-extra { color: var(--texto-2); font-size: .85rem; }
.combo-lista .estado { font-size: .75rem; padding: .05rem .45rem; }
.combo-accion { color: var(--verde-oscuro); font-weight: 500; border-top: 1px solid var(--linea); }
.combo-accion + .combo-accion { border-top: 0; }
.combo-vacio { color: var(--texto-2); cursor: default; font-size: .9rem; }
.combo-aviso { margin: .3rem 0 0; font-size: .9rem; }
.sugerencias-partida { right: auto; top: auto; }
input.con-producto { border-color: var(--verde) !important; background: linear-gradient(90deg, var(--verde-suave) 0 4px, var(--papel) 4px) !important; }
.mayusculas { text-transform: uppercase; }
.dato-ok { color: var(--verde-oscuro); }

/* ---------- Ficha de beneficiario (diálogo) ---------- */
dialog.dialogo-ficha { width: min(920px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 10px;
    box-shadow: 0 24px 60px rgba(20, 36, 58, .35); color: var(--texto); }
dialog.dialogo-ficha::backdrop { background: rgba(20, 36, 58, .45); }
.ficha-forma { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.ficha-encabezado { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.5rem .8rem; border-bottom: 1px solid var(--linea); }
.ficha-encabezado h2 { margin: 0; font-family: var(--serif); font-size: 1.45rem; }
.ficha-encabezado p { margin: .2rem 0 0; }
.ficha-cerrar { font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--texto-2); cursor: pointer; padding: .1rem .4rem; }
.ficha-cuerpo { overflow-y: auto; overflow-x: hidden; padding: 1rem 1.5rem; }
.ficha-cuerpo .campo { min-width: 0; }
.ficha-cuerpo .campo input, .ficha-cuerpo .campo select { width: 100%; min-width: 0; }
.ficha-seccion { border: 0; padding: 0; margin: 0 0 1.4rem; }
.ficha-seccion legend { font-weight: 600; font-size: 1.05rem; margin-bottom: .6rem; padding: 0; }
.ficha-seccion .rejilla { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.ficha-tipo { display: flex; gap: 1.5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.ficha-tipo label, .casilla { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.ficha-lista { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.ficha-lista li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .5rem .75rem; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio); }
.ficha-renglon { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr .6fr auto; gap: .6rem .8rem; align-items: end;
    padding: .7rem .75rem; margin-bottom: .5rem; background: var(--fondo); border-radius: var(--radio); }
.ficha-renglon[data-contacto] { grid-template-columns: 1.2fr 1fr 1.3fr 1fr auto auto; }
.ficha-renglon .campo label { font-size: .85rem; }
.ficha-renglon .casilla { padding-bottom: .7rem; font-size: .9rem; white-space: nowrap; }
.ficha-renglon .quitar { margin-bottom: .45rem; }
.ficha-renglon input:disabled, .ficha-seccion input:disabled { background: #EEF1EE; color: var(--texto-2); }
.dato-banco { display: block; padding: .65rem 0; font-weight: 500; }
.ficha-pie { display: flex; justify-content: flex-end; gap: .75rem; padding: .9rem 1.5rem; border-top: 1px solid var(--linea); background: var(--fondo); }
@media (max-width: 760px) {
    .ficha-renglon, .ficha-renglon[data-contacto] { grid-template-columns: 1fr 1fr; }
    .empresa-captura-ayuda { margin-left: 0; }
}
dialog.dialogo-ficha:not([open]) { display: none; }
.ficha-constancia { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; padding: .7rem .8rem;
    background: var(--verde-suave); border-radius: var(--radio); }
.ficha-constancia .dato-apoyo { flex: 1; min-width: 220px; margin: 0; }

/* ---------- Campanita de avisos (discreta) ---------- */
.avisos { position: relative; }
.avisos-boton { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
    border: 0; border-radius: 50%; background: none; color: var(--texto-2); cursor: pointer; }
.avisos-boton:hover, .avisos-boton[aria-expanded=true] { background: var(--fondo); color: var(--texto); }
.avisos-cuenta { position: absolute; top: .1rem; right: .05rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; border-radius: .6rem;
    background: var(--verde); color: #fff; font-size: .68rem; font-weight: 600; line-height: 1.05rem; text-align: center; box-shadow: 0 0 0 2px var(--papel); }
.avisos-panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40; width: min(380px, calc(100vw - 2rem)); white-space: normal;
    background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; box-shadow: 0 14px 34px rgba(20, 36, 58, .16); }
.avisos-encabezado { display: flex; justify-content: space-between; align-items: baseline; padding: .75rem 1rem .6rem; border-bottom: 1px solid var(--linea); color: var(--texto); }
.avisos-encabezado .enlace { font-size: .8rem; }
.avisos-lista { list-style: none; margin: 0; padding: .25rem 0; max-height: 420px; overflow-y: auto; }
.avisos-vacio { padding: 1rem; color: var(--texto-2); }
.aviso-item { display: flex; gap: .7rem; padding: .65rem 1rem; text-decoration: none; color: var(--texto-2); }
.aviso-item:hover { background: var(--fondo); }
.aviso-item.sin-leer { color: var(--texto); }
.aviso-item { position: relative; }
.aviso-item.sin-leer { background: #F4FAF7; }
.aviso-item.sin-leer .aviso-titulo { font-weight: 600; }
.aviso-item.sin-leer::before { content: ""; position: absolute; left: .4rem; top: 1.05rem; width: .35rem; height: .35rem; border-radius: 50%; background: var(--verde); }
.aviso-icono { flex: none; margin-top: .15rem; color: var(--texto-2); }
.aviso-icono.tipo-autorizada, .aviso-icono.tipo-pagada { color: var(--verde); }
.aviso-icono.tipo-pagoporprogramar { color: var(--foco); }
.aviso-icono.tipo-rechazada { color: var(--rojo); }
.aviso-icono.tipo-cambiossolicitados, .aviso-icono.tipo-porautorizar { color: var(--ambar); }
.aviso-cuerpo { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.aviso-titulo { font-weight: 500; font-size: .92rem; }
.aviso-mensaje { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aviso-pie { font-size: .78rem; color: var(--texto-2); }

/* ---------- Inicio: resumen de requisiciones ---------- */
.inicio-req { margin-bottom: 2rem; }
.inicio-encabezado { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.inicio-encabezado h2 { margin: 0; }
.inicio-acciones { display: flex; gap: .6rem; flex-wrap: wrap; }
.tarjetas-estado { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin: .75rem 0 1.25rem; }
.tarjeta-estado { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; text-decoration: none; color: var(--texto);
    background: var(--papel); border: 1px solid var(--linea); border-left: 4px solid var(--ambar); border-radius: var(--radio); }
.tarjeta-estado:hover { border-color: #BFC7C0; box-shadow: 0 4px 14px rgba(20, 36, 58, .08); }
.tarjeta-estado.te-ok { border-left-color: var(--verde); }
.tarjeta-estado.te-atencion { border-left-color: #D9A441; }
.tarjeta-estado.te-rechazo { border-left-color: var(--rojo); }
.tarjeta-estado.te-neutra { border-left-color: #AEB7BF; }
.te-numero { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.te-texto { color: var(--texto-2); font-size: .9rem; }
.inicio-sub { font-size: 1rem; margin: 0 0 .5rem; }
.cuenta-suave { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; margin-left: .3rem; border-radius: 1rem; background: var(--fondo);
    border: 1px solid var(--linea); font-size: .9rem; text-align: center; vertical-align: middle; }
.lista-reciente { list-style: none; margin: .5rem 0 0; padding: 0; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.lista-reciente li + li { border-top: 1px solid var(--linea); }
.lista-reciente a { display: grid; grid-template-columns: auto max-content minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; padding: .65rem 1rem;
    text-decoration: none; color: var(--texto); }
.lista-reciente a:hover { background: var(--fondo); }
.lr-folio { font-weight: 600; white-space: nowrap; }
.lr-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texto-2); }
.lr-empresa { color: var(--texto-2); font-size: .85rem; white-space: nowrap; }
.lr-total { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.inicio-req .lista-reciente a:not(:has(.estado)) { grid-template-columns: max-content minmax(0, 1fr) auto auto; }
@media (max-width: 760px) { .lista-reciente a, .inicio-req .lista-reciente a:not(:has(.estado)) { grid-template-columns: 1fr auto; } .lr-desc, .lr-empresa { display: none; } }

/* ---------- Tesorería: pagos ---------- */
.nowrap { white-space: nowrap; }
.tabla-pagos td { vertical-align: top; }
.tabla-pagos .dato-apoyo { display: block; }
.tabla-pagos .estado { margin-left: .35rem; }
.col-marca { width: 2.5rem; text-align: center !important; }
.col-marca input { width: 1.05rem; height: 1.05rem; cursor: pointer; }
.tabla-pagos tr.marcado { background: #F2F8F4; }
.concepto-corto { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 34ch; }
.importe-pago { font: inherit; width: 8.5rem; text-align: right; font-variant-numeric: tabular-nums; padding: .4rem .5rem; border: 1px solid #BFC7C0; border-radius: 4px; }
.importe-pago.importe-invalido { border-color: var(--rojo); background: #FBEDEB; }
.tabla-pagos select { font: inherit; font-size: .9rem; padding: .35rem .4rem; border: 1px solid #BFC7C0; border-radius: 4px; background: var(--papel); max-width: 16rem; }
.tabla-pagos select:disabled { color: var(--texto-2); background: #F3F5F2; }
.panel-programar { margin-top: 1.25rem; border-color: var(--verde); position: sticky; bottom: .75rem; box-shadow: 0 -4px 16px rgba(20, 36, 58, .06); }
.resumen-programar { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; flex-wrap: wrap; }
.resumen-programar p { margin: 0; }
.resumen-programar [data-resumen], .resumen-programar [data-resumen-aplicar] { margin-right: auto; font-variant-numeric: tabular-nums; }
.boton-principal:disabled { background: #9DB9AC; cursor: not-allowed; }
.grupo-cuenta { margin-bottom: 1.25rem; }
.grupo-cuenta .tabla-envoltura { margin-top: .75rem; }
.grupo-cuenta-encabezado { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.grupo-cuenta-encabezado .panel-titulo { margin: 0; }
.cifras-cuenta { display: flex; gap: 1.5rem; margin: 0; }
.cifras-cuenta dt { font-size: .8rem; color: var(--texto-2); }
.cifras-cuenta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cifras-cuenta .negativo dd { color: var(--rojo); }
.acciones-renglon { white-space: nowrap; text-align: right !important; }
.acciones-renglon form { display: inline; }
.menu-renglon { display: inline-block; position: relative; margin-left: .4rem; text-align: left; }
.menu-renglon summary { cursor: pointer; color: var(--verde-oscuro); font-size: .9rem; list-style: none; }
.menu-renglon summary::-webkit-details-marker { display: none; }
.menu-renglon[open] summary { text-decoration: underline; }
.menu-renglon-panel { position: absolute; right: 0; z-index: 5; display: flex; flex-direction: column; gap: .5rem; min-width: 15rem;
    background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: .8rem; box-shadow: 0 8px 24px rgba(20, 36, 58, .12); white-space: normal; }
.menu-renglon-panel input { font: inherit; padding: .45rem .5rem; border: 1px solid #BFC7C0; border-radius: 4px; }
.menu-renglon-panel p { margin: 0; color: var(--texto-2); }
.tarjeta-beneficiario { margin-bottom: 1rem; }
.tb-encabezado { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tb-encabezado .panel-titulo { margin-bottom: .2rem; }
.tb-encabezado p { margin: 0; }
.tb-estado { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.tb-acciones { display: flex; gap: .5rem; align-items: center; }
.tb-sub { font-size: .95rem; font-weight: 600; margin: 1.1rem 0 .5rem; color: var(--texto-2); }
.tb-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.clabe { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.lista-simple { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.lista-simple .dato-apoyo, .lista-simple .estado { margin-left: .4rem; }
@media (max-width: 760px) {
    .tb-columnas { grid-template-columns: 1fr; }
    .tb-estado { align-items: flex-start; }
    .panel-programar { position: static; }
}
.tabla-pagos th, .tabla-pagos td { padding: .6rem .7rem; }
.tabla-pagos td:nth-child(4) { min-width: 11rem; }
.tabla-pagos td:nth-child(5) { min-width: 12rem; }
.tabla-pagos .concepto-corto { max-width: 28ch; }
.tabla-pagos select { max-width: 13.5rem; }
.recientes-pagos { margin-top: 2rem; }

/* Pendientes por razón social (Tesorería) */
.pendientes-empresas { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.pe-empresa { display: flex; flex-direction: column; gap: .1rem; min-width: 11rem; padding: .55rem .8rem; border: 1px solid var(--linea);
    border-radius: var(--radio); background: var(--papel); color: var(--texto); text-decoration: none; }
.pe-empresa:hover { border-color: var(--verde); }
.pe-empresa.actual { border-color: var(--tinta); box-shadow: inset 0 -3px 0 var(--tinta); }
.pe-empresa.sin-pendientes { color: var(--texto-2); background: transparent; }
.pe-nombre { font-weight: 600; font-size: .9rem; }
.pe-cifra { font-size: .85rem; color: var(--texto-2); }
.pe-cifra strong { color: var(--texto); }
.pe-alerta { display: block; color: #8A5517; font-weight: 600; }

/* Seguimiento: dónde está la requisición y quién la tiene */
.seguimiento { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem 1.4rem 1.1rem; margin-bottom: 1.25rem; }
.sg-ahora { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.sg-ahora p { margin: 0; }
.sg-etiqueta { color: var(--texto-2); font-size: .85rem; margin-right: .2rem; }
.sg-detalle { display: inline; color: var(--texto-2); margin-left: .35rem; }
.sg-pasos { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; counter-reset: paso; }
.sg-paso { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: 0 .3rem; font-size: .85rem; }
.sg-paso::before { content: ""; position: absolute; top: .55rem; left: -50%; width: 100%; height: 2px; background: var(--linea); z-index: 0; }
.sg-paso:first-child::before { display: none; }
.sg-paso.hecho::before, .sg-paso.actual::before { background: var(--verde); }
.sg-punto { position: relative; z-index: 1; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid var(--linea); background: var(--papel); }
.sg-paso.hecho .sg-punto { background: var(--verde); border-color: var(--verde); }
.sg-paso.actual .sg-punto { border-color: var(--foco); box-shadow: 0 0 0 4px rgba(47, 111, 214, .18); background: #fff; }
.sg-paso.actual .sg-punto::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--foco); }
.sg-paso.detenido .sg-punto { background: var(--rojo); border-color: var(--rojo); }
.sg-nombre { font-weight: 600; color: var(--texto); margin-top: .2rem; }
.sg-paso.pendiente .sg-nombre { color: var(--texto-2); font-weight: 500; }
.sg-paso.actual .sg-nombre { color: var(--foco); }
.sg-cuando, .sg-nota { color: var(--texto-2); font-size: .78rem; line-height: 1.3; }
.sg-pagos { list-style: none; margin: 1rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.sg-pagos .estado { margin-right: .4rem; }
.filtro-activo { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; background: var(--verde-suave); padding: .2rem .6rem; border-radius: 999px; }
.filtro-activo a { text-decoration: none; font-weight: 600; }
@media (max-width: 760px) {
    .sg-pasos { grid-auto-flow: row; gap: .6rem; }
    .sg-paso { flex-direction: row; text-align: left; gap: .5rem; flex-wrap: wrap; }
    .sg-paso::before { display: none; }
}
@media print { .seguimiento { display: none; } }

/* Entrar como (sólo desarrollo) */
.entrar-como { display: inline-flex; align-items: center; gap: .35rem; }
.entrar-como select { font: inherit; font-size: .9rem; padding: .3rem .4rem; border: 1px dashed var(--ambar); border-radius: var(--radio); background: #FFFBF4; max-width: 15rem; }
.entrar-como-etiqueta { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #8A5517; }
.pe-resto { align-self: center; font-size: .85rem; color: var(--texto-2); padding: 0 .4rem; }
.tabla-pagos td:nth-child(5) { min-width: 10rem; }
.tabla-pagos select { max-width: 12rem; }

/* Catálogos de Tesorería */
.tabla tr.inactiva td { color: var(--texto-2); }
.tabla td > span.dato-apoyo, .tabla td > a.dato-apoyo { display: block; }
.dato-fijo { display: block; padding: .6rem 0; font-weight: 500; }
.casillas { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.formulario-cuenta .ficha-seccion { margin-top: .5rem; }
input[readonly] { background: #F3F5F2; color: var(--texto-2); }

/* Captura y consulta de movimientos */
kbd { font-family: inherit; font-size: .8rem; border: 1px solid var(--linea); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--papel); }
.saldo-captura { margin: 0 0 0 1rem; align-self: flex-end; padding-bottom: .5rem; }
.tabla-movs th { white-space: nowrap; }
.tabla-movs td { min-width: 6rem; }
.tabla-movs .cm-fecha { width: 9.5rem; } .tabla-movs .cm-sentido { width: 7rem; } .tabla-movs .cm-importe { width: 8.5rem; }
.tabla-movs td:nth-child(5) { min-width: 12rem; }
.cm-tercero-celda { min-width: 12rem; }
.cm-saldar-celda { white-space: nowrap; }
.cm-saldar-celda .dato-apoyo { display: block; color: var(--verde-oscuro); }
.pie-captura { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: .75rem; flex-wrap: wrap; }
.totales-captura { display: flex; gap: 1.5rem; margin: 0; flex-wrap: wrap; }
.totales-captura dt { font-size: .8rem; color: var(--texto-2); }
.totales-captura dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.totales-consulta { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.lista-flotante { position: absolute; z-index: 40; max-height: 16rem; overflow: auto; }
.lista-flotante li.activa { background: var(--verde-suave); }
.traspaso { margin-top: 1.5rem; }
.traspaso summary { cursor: pointer; font-weight: 600; color: var(--texto); }
.traspaso form { margin-top: 1rem; }
.campo-boton { justify-content: flex-end; }
.dialogo-saldar { border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem 1.4rem; width: min(42rem, calc(100vw - 2rem)); }
.dialogo-saldar::backdrop { background: rgba(20, 36, 58, .35); }
.dialogo-saldar:not([open]) { display: none; }
.saldar-lista { display: flex; flex-direction: column; gap: .4rem; margin: .75rem 0; max-height: 50vh; overflow: auto; }
.saldar-fila { display: grid; grid-template-columns: auto 1fr auto 8rem; gap: .75rem; align-items: center; padding: .5rem .6rem; border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; }
.saldar-fila .dato-apoyo { display: block; }
.saldar-fila input[data-imp] { font: inherit; padding: .35rem .45rem; border: 1px solid #BFC7C0; border-radius: 4px; text-align: right; }
.tabla-movimientos td { vertical-align: top; }
.tabla-movimientos tr.eliminado td { color: var(--texto-2); text-decoration: line-through; text-decoration-color: rgba(178, 67, 58, .5); }
.tabla-movimientos tr.eliminado td .estado, .tabla-movimientos tr.eliminado td .dato-apoyo { text-decoration: none; }
.filtros-movs { align-items: flex-end; }
.filtros-movs .campo input, .filtros-movs .campo select { font: inherit; padding: .45rem .6rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.tabla-movs { table-layout: fixed; min-width: 1100px; }
.tabla-movs td:nth-child(2) { min-width: 0; }
.tabla-movs td { min-width: 0; }
.tabla-movs th.cm-fecha { width: 9.2rem; } .tabla-movs th.cm-sentido { width: 6.6rem; } .tabla-movs th.cm-subtipo { width: 11rem; }
.tabla-movs th.cm-tercero { width: 13rem; } .tabla-movs th.cm-linea { width: 8.5rem; } .tabla-movs th.cm-importe { width: 8rem; }
.tabla-movs th.cm-tc { width: 6rem; } .tabla-movs th.cm-pc { width: 10.5rem; } .tabla-movs th.cm-forma { width: 9rem; } .tabla-movs th.cm-ref { width: 8rem; }
.tabla-movs th.cm-saldar { width: 8rem; } .tabla-movs th.col-quitar { width: 2.6rem; }
.tabla-movs .cm-saldar-celda { white-space: normal; }
details.traspaso summary { color: var(--texto); }

/* Usuarios y permisos */
.mensaje-destacado { font-weight: 600; }
.bloque-usuario { margin-bottom: 1.25rem; }
.lista-roles { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.lista-roles li { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--linea); border-radius: var(--radio); }
.lista-roles li .dato-apoyo { margin-left: .4rem; }
.form-alcance { border-top: 1px solid var(--linea); padding-top: .75rem; margin-top: .75rem; }
.form-alcance .campo select, .form-alcance .campo input { font: inherit; padding: .5rem .6rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.permisos-rol { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; align-items: start; }
.permisos-rol .acciones-pie { grid-column: 1 / -1; }
.grupo-permisos legend { font-weight: 600; padding: 0 .3rem; }
.permiso { display: grid; grid-template-columns: auto 1fr; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid #EEF1ED; cursor: pointer; }
.permiso:last-child { border-bottom: 0; }
.permiso .dato-apoyo { display: block; }
.permiso .estado { margin-left: .4rem; }
details.panel summary.resumen-normal { color: var(--texto); font-weight: 600; }
.enlaces-usuario { display: inline-flex; gap: .8rem; align-items: center; }
.formulario-angosto { max-width: 28rem; }
.enlace-barra { font-size: .9rem; color: var(--texto-2); }
/* Captura: cada renglón con su cuenta */
.tabla-movs { min-width: 1320px; }
.tabla-movs th.cm-cuenta { width: 12rem; }
.tabla-movs th.cm-concepto { width: 15rem; }
.totales-por-cuenta { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.saldos-captura { border-collapse: collapse; font-size: .9rem; }
.saldos-captura th { font-weight: 500; color: var(--texto-2); font-size: .8rem; text-align: left; padding: 0 .8rem .2rem 0; }
.saldos-captura td { padding: .15rem .8rem .15rem 0; font-variant-numeric: tabular-nums; }
.saldos-captura td.num, .saldos-captura th.num { text-align: right; }
.saldos-captura td:last-child { font-weight: 600; }
.saldos-captura tbody:empty::after { content: "Sin renglones aún."; color: var(--texto-2); }
/* Captura compacta: cabe en una pantalla de laptop */
.lista-flotante[hidden] { display: none !important; }
.tabla-movs { min-width: 1120px; font-size: .9rem; }
.tabla-movs th { font-size: .78rem; padding: .5rem .35rem; }
.tabla-movs td { padding: .2rem .25rem; }
.tabla-movs input, .tabla-movs select { padding: .4rem .35rem; font-size: .9rem; }
.tabla-movs th.cm-fecha { width: 8.6rem; } .tabla-movs th.cm-cuenta { width: 10rem; } .tabla-movs th.cm-sentido { width: 5.6rem; }
.tabla-movs th.cm-subtipo { width: 9.5rem; } .tabla-movs th.cm-tercero { width: 10.5rem; } .tabla-movs th.cm-concepto { width: auto; }
.tabla-movs th.cm-linea { width: 7rem; } .tabla-movs th.cm-importe { width: 7rem; } .tabla-movs th.cm-pc { width: 8.5rem; }
.tabla-movs th.cm-saldar { width: 5.2rem; } .tabla-movs th.col-quitar { width: 2rem; }
.contenido:has(.captura-movimientos) { max-width: none; }
.tabla-movs { min-width: 1060px; }
.tabla-movs th.cm-mas { width: 2.4rem; }
.cm-mas-celda { position: relative; text-align: center; }
.mas-renglon summary { list-style: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: .3rem .4rem; border-radius: 4px; color: var(--texto-2); }
.mas-renglon summary::-webkit-details-marker { display: none; }
.mas-renglon summary:hover, .mas-renglon[open] summary { background: var(--verde-suave); color: var(--verde-oscuro); }
.mas-renglon-panel { position: absolute; right: 0; z-index: 6; display: flex; flex-direction: column; gap: .6rem; width: 17rem; text-align: left;
    background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: .8rem; box-shadow: 0 8px 24px rgba(20, 36, 58, .12); }
.mas-renglon-panel label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 500; }
.indicadores { display: block; font-size: .75rem; color: var(--verde-oscuro); padding: 0 .35rem; }
/* «Viene de» / «Pasó a»: relación entre un egreso y las entradas que fondeó en otras cuentas */
.relacion-mov { display: block; font-size: .85rem; color: var(--verde-oscuro); }
.origen-fila { grid-template-columns: 1fr auto 9rem; cursor: default; }
.origen-elegir { display: flex; gap: .75rem; align-items: center; cursor: pointer; min-width: 0; }
.origen-monto { font: inherit; padding: .35rem .45rem; border: 1px solid #BFC7C0; border-radius: 4px; text-align: right; width: 100%; }
.origen-monto:disabled { background: #F3F5F3; color: #8A938C; }
.origen-monto.invalido { border-color: #B3261E; background: #FCEEEE; }
.dialogo-origen [data-origen-total] { margin: 0 0 .5rem; font-weight: 600; }
.dialogo-origen [data-origen-total].alerta { color: #B3261E; }
.origen-fila .num .dato-apoyo { display: block; }
.indicadores:empty { display: none; }
.indicadores.alerta { color: #8A5517; }
@media (min-width: 1400px) { .captura-movimientos .tabla-envoltura { overflow: visible; } }

/* Menú lateral retraíble */
.marca { position: relative; padding-right: 3rem; }
.marca-corta { display: none; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: #fff; }
.retraer-menu { position: absolute; right: .75rem; top: .1rem; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border: 1px solid #2E4566; border-radius: var(--radio); background: transparent; color: var(--tinta-texto); cursor: pointer; }
.retraer-menu:hover { background: var(--tinta-2); color: #fff; }
.retraer-menu svg { transition: transform .15s; }
.menu-opcion { display: flex; align-items: center; gap: .6rem; }
.menu-icono { display: none; flex: none; }
.erp.menu-retraido { grid-template-columns: 64px 1fr; background: linear-gradient(to right, var(--tinta) 64px, var(--fondo) 64px); }
.menu-retraido .marca { flex-direction: column; align-items: center; padding: 0 0 1rem; gap: .6rem; }
.menu-retraido .marca-nombre, .menu-retraido .marca-sub, .menu-retraido .menu-titulo, .menu-retraido .menu-texto, .menu-retraido .menu-opcion.pendiente { display: none; }
.menu-retraido .marca-corta { display: block; }
.menu-retraido .retraer-menu { position: static; }
.menu-retraido .retraer-menu svg { transform: rotate(180deg); }
.menu-retraido .menu-icono { display: block; }
.menu-retraido .menu-opcion { justify-content: center; padding: .55rem 0; }
.menu-retraido .menu-grupo { margin: 0; }
.menu-retraido .menu-grupo.menu-directo + .menu-grupo:not(.menu-directo) { margin-top: 0; }
.menu-retraido .menu-grupo:not(.menu-directo) > ul, .menu-retraido .menu-grupo.abierto:not(.menu-directo) > ul { display: none; }
.menu-retraido .menu-modulo { justify-content: center; padding: .6rem 0; }
.menu-retraido .menu-flecha { display: none; }
.menu-retraido .menu-grupo.abierto > .menu-modulo { border-left-color: #5FBF95; background: var(--tinta-2); }
.menu-retraido .menu-grupo.menu-directo .menu-opcion { padding: .6rem 0; }
.menu-retraido .contenido { max-width: 1380px; }
@media print { .lateral { display: none; } .erp, .erp.menu-retraido { grid-template-columns: 1fr; background: none; } }
.erp .contenido:has(.captura-movimientos) { max-width: none; }
@media (max-width: 860px) { .retraer-menu { display: none; } .erp.menu-retraido { grid-template-columns: 1fr; } .menu-retraido .menu-texto { display: inline; } .menu-retraido .menu-icono { display: none; } }
/* Captura: orden del cliente y búsqueda incremental */
.tabla-movs th.cm-sentido { width: 6.4rem; } .tabla-movs th.cm-cuenta { width: 10.5rem; } .tabla-movs th.cm-tercero { width: 11.5rem; }
.tabla-movs th.cm-subtipo { width: 9.5rem; } .tabla-movs th.cm-linea { width: 8.5rem; }
.cm-buscar input { text-overflow: ellipsis; }
.lista-flotante .combo-accion .combo-nombre { color: var(--verde-oscuro); font-weight: 600; }
.lista-flotante li { cursor: pointer; }
.tabla-movs { min-width: 1190px; }
.tabla-movs th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.tabla-movs th.cm-fecha { width: 8.3rem; } .tabla-movs th.cm-sentido { width: 6rem; } .tabla-movs th.cm-cuenta { width: 9.8rem; }
.tabla-movs th.cm-tercero { width: 11rem; } .tabla-movs th.cm-subtipo { width: 8.8rem; } .tabla-movs th.cm-linea { width: 7.8rem; }
.tabla-movs th.cm-importe { width: 6.8rem; }
@media (min-width: 1400px) { .captura-movimientos .tabla-envoltura { overflow-x: auto; } }
.mas-renglon[open] .mas-renglon-panel { position: fixed; }

/* Captura: razón social de la cuenta elegida, bajo el campo */
.cuenta-empresa { display: block; font-size: .72rem; color: var(--texto-2); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cuenta-empresa:empty { display: none; }

/* Movimientos: acciones a la derecha (atributo y línea · editar · eliminar) */
.acciones-mov { white-space: nowrap; text-align: right; }
.accion-mov { font: inherit; font-size: .85rem; background: none; border: 1px solid #BFC7C0; border-radius: 4px; padding: .2rem .5rem;
    color: var(--verde-oscuro); cursor: pointer; text-decoration: none; display: inline-block; margin-left: .25rem; }
.accion-mov:hover { background: var(--verde-suave); }
.menu-renglon summary.accion-mov { list-style: none; }
.accion-peligro { color: #9B2C2C; }
.dialogo-clasificar { border: none; border-radius: var(--radio); padding: 1.25rem 1.5rem; width: min(30rem, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.dialogo-clasificar::backdrop { background: rgba(14, 26, 44, .45); }
.dialogo-clasificar h2 { margin-top: 0; }
.dialogo-clasificar .campo { margin-bottom: .75rem; display: flex; flex-direction: column; gap: .25rem; }
.dialogo-clasificar select, .dialogo-clasificar input:not([type=hidden]) { font: inherit; padding: .45rem .5rem; border: 1px solid #BFC7C0; border-radius: 4px; }
.correccion-aviso { border-left: 4px solid #B7791F; background: #FFF8E6; padding: .75rem 1rem; border-radius: var(--radio); margin-bottom: 1rem; }
.correccion-aviso .campo { margin-top: .5rem; max-width: 36rem; display: flex; flex-direction: column; gap: .25rem; }
.correccion-aviso input { font: inherit; padding: .45rem .5rem; border: 1px solid #BFC7C0; border-radius: 4px; }
.cm-destino[hidden], .cm-campo[hidden] { display: none !important; }
.tabla-movs th.cm-sentido { width: 7.4rem; }
.acciones-mov { white-space: normal; min-width: 10.5rem; }
.acciones-mov .accion-mov { margin: .1rem 0 .1rem .25rem; }
.es-traspaso [data-buscar='atributo'], .es-traspaso [data-buscar='linea'] { background: transparent; }

/* Cuentas por cobrar y por pagar */
.pestanas { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--linea); }
.pestanas a { padding: .5rem .9rem; color: var(--texto-2); text-decoration: none; border-bottom: 3px solid transparent; }
.pestanas a.activa { color: var(--verde-oscuro); border-bottom-color: var(--verde); font-weight: 600; }
.ficha-papeles { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: .75rem; }
.archivo-nuevo { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.archivo-nuevo select, .archivo-nuevo input[type=file] { font: inherit; padding: .35rem .5rem; border: 1px solid #BFC7C0; border-radius: 4px; max-width: 100%; }
.lista-archivos { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .4rem; }
.lista-archivos li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
form.en-linea { display: inline; }
.agregar-archivos { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.ficha-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem 1.5rem; margin: 0; }
.ficha-datos dt { font-size: .8rem; color: var(--texto-2); }
.ficha-datos dd { margin: .15rem 0 0; }
.campo-triple { grid-column: span 3; }
@media (max-width: 760px) { .campo-triple { grid-column: auto; } }
details.peligro summary { color: #9B2C2C; cursor: pointer; }
.formulario-deuda .combo { position: relative; }

/* Movimientos del cliente o proveedor: por factura */
.vista-selector { display: inline-flex; border: 1px solid #BFC7C0; border-radius: var(--radio); overflow: hidden; margin: 0 0 1rem; }
.vista-selector a { padding: .4rem .9rem; text-decoration: none; color: var(--texto-2); }
.vista-selector a.activa { background: var(--verde-suave); color: var(--verde-oscuro); font-weight: 600; }
.tabla-por-factura .grupo-factura { border-top: 2px solid var(--linea); }
.tabla-por-factura .fila-factura td { background: #FAFBF9; }
.tabla-por-factura .fila-abono td:nth-child(2) { padding-left: 1.75rem; }
.tabla-por-factura .fila-abono td { color: var(--texto-2); }
.tabla-por-factura .fila-subtotal td { font-size: .85rem; color: var(--texto-2); text-align: right; }
.tabla-por-factura .fila-subtotal td:first-child { text-align: right; }
.tabla-por-factura tfoot td { border-top: 2px solid var(--linea); }
.aviso-credito { display: block; margin: .5rem 0 1rem; padding: .6rem .8rem; background: #FFF8E6; border-left: 4px solid #B7791F; border-radius: var(--radio); }

/* Reportes */
.tarjetas-reporte { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.tarjeta-reporte { display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem 1.2rem; background: var(--papel); border: 1px solid var(--linea);
    border-radius: var(--radio); text-decoration: none; color: inherit; }
.tarjeta-reporte:hover { border-color: var(--verde); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.tarjeta-reporte strong { color: var(--verde-oscuro); font-size: 1.05rem; }
.tarjeta-reporte span { color: var(--texto-2); font-size: .9rem; }
.barras-linea { min-width: 10rem; }
.barra-grafica { display: block; height: .45rem; border-radius: 3px; margin: .15rem 0; }
.barra-entrada { background: #2F855A; } .barra-salida { background: #DD6B20; }
.solo-imprimir { display: none; }
@media print { .solo-imprimir { display: block; } }

/* Calendario */
.calendario-barra { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.calendario-barra select { font: inherit; padding: .4rem .5rem; border: 1px solid #BFC7C0; border-radius: var(--radio); }
.calendario-mes { margin: 0; min-width: 12rem; text-align: center; font-size: 1.3rem; }
.leyenda { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--texto-2); }
.punto { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-left: .5rem; }
.punto.ev-cobro { background: #2F855A; } .punto.ev-programado { background: #2B6CB0; } .punto.ev-pago { background: #DD6B20; }
.aviso-atrasado { background: #FFF5F5; border-left: 4px solid #C53030; padding: .6rem .9rem; border-radius: var(--radio); }
.calendario { border: 1px solid var(--linea); border-radius: var(--radio); background: var(--papel); overflow: hidden; }
.cal-fila { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(7.5rem, .9fr); }
.cal-encabezado div { padding: .5rem; font-size: .8rem; color: var(--texto-2); text-align: center; background: #F7F8F6; border-bottom: 1px solid var(--linea); }
.cal-dia { min-height: 6.2rem; padding: .35rem .4rem; border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea); display: flex; flex-direction: column; gap: .2rem; }
.cal-dia.fuera { background: #FAFAF9; color: #B5BAB3; }
.cal-dia.hoy { background: #F0FFF4; box-shadow: inset 0 0 0 2px var(--verde); }
.cal-numero { font-size: .85rem; font-weight: 600; }
.cal-chips { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; }
.chip { font-size: .72rem; padding: .1rem .35rem; border-radius: 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.chip.ev-cobro { background: #2F855A; } .chip.ev-programado { background: #2B6CB0; } .chip.ev-pago { background: #DD6B20; }
.cal-semana { background: #F7F8F6; font-size: .78rem; text-align: right; }
.cal-semana strong { font-size: .85rem; }
.cal-detalle { margin-bottom: 1rem; }
.cal-detalle h3 { font-size: .95rem; margin: .8rem 0 .3rem; }
.cal-detalle ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--papel); }
.cal-detalle li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; padding: .45rem .7rem; border-bottom: 1px solid var(--linea); }
.cal-detalle li:last-child { border-bottom: 0; }
@media (max-width: 760px) {
    .cal-fila { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .cal-semana { display: none; }
    .chip { font-size: .6rem; }
    .cal-dia { min-height: 4.5rem; }
}
/* Flujo proyectado */
.tabla-flujo th[scope=row] { text-align: left; font-weight: 400; white-space: nowrap; }
.tabla-flujo .fila-titulo th { font-weight: 700; color: #fff; }
.tabla-flujo .fila-titulo.ingresos th { background: #2F855A; } .tabla-flujo .fila-titulo.egresos th { background: #C53030; }
.tabla-flujo .fila-total th, .tabla-flujo .fila-total td { font-weight: 700; }
.tabla-flujo .fila-total.ingresos td { color: #276749; } .tabla-flujo .fila-total.egresos td { color: #C53030; }
.tabla-flujo .fila-caja th, .tabla-flujo .fila-caja td { background: #EBF4FF; font-weight: 600; }
.tabla-flujo .fila-caja.final th, .tabla-flujo .fila-caja.final td { background: #1A365D; color: #fff; }
.tabla-flujo .fila-caja.final td.negativo { color: #FEB2B2; }
.grafica-flujo { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; padding: 1rem; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.gf-mes { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.gf-barras { display: flex; align-items: flex-end; gap: 3px; height: 9rem; }
.gf-barra { width: 1rem; border-radius: 3px 3px 0 0; min-height: 2px; }
.gf-barra.ingreso { background: #2F855A; } .gf-barra.egreso { background: #DD6B20; } .gf-barra.caja { background: #1A365D; } .gf-barra.caja.negativa { background: #C53030; }
.gf-etiqueta { font-size: .8rem; color: var(--texto-2); }
.gf-caja { font-size: .72rem; font-weight: 600; color: #1A365D; font-variant-numeric: tabular-nums; }
.gf-barra { width: 1.4rem; }

/* Ficha del cliente o proveedor (estilo hoja, con pestañas y estado de cuenta) */
.hoja-tercero { position: relative; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem 1.5rem 1.5rem; }
.hoja-botones { position: absolute; top: 0; right: 0; display: flex; border-left: 1px solid var(--linea); border-bottom: 1px solid var(--linea); border-bottom-left-radius: var(--radio); overflow: hidden; }
.boton-estadistica { display: flex; flex-direction: column; padding: .5rem 1rem; min-width: 8.5rem; text-decoration: none; color: inherit; border-right: 1px solid var(--linea); }
.boton-estadistica:last-child { border-right: 0; }
.boton-estadistica:hover { background: #F7F8F6; }
.be-cifra { font-weight: 600; color: var(--verde-oscuro); font-variant-numeric: tabular-nums; }
.be-texto { font-size: .8rem; color: var(--texto-2); }
.hoja-tipo { display: flex; gap: 1.25rem; margin: .75rem 0 .25rem; font-size: .9rem; color: var(--texto-2); }
.hoja-nombre { font-size: 1.9rem; margin: .1rem 0 1rem; }
.hoja-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; margin-bottom: 1.25rem; }
.hoja-datos dl { margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.hoja-datos dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; }
.hoja-datos dt { color: var(--texto-2); font-size: .9rem; }
.hoja-datos dd { margin: 0; }
.hoja-datos .renglon { display: block; }
.etiqueta { display: inline-block; background: #E6F4EA; color: var(--verde-oscuro); border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; margin-right: .25rem; }
.hoja-pestanas { display: flex; border-bottom: 1px solid var(--linea); gap: 0; flex-wrap: wrap; }
.hoja-pestanas a { padding: .55rem 1rem; text-decoration: none; color: var(--texto); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; border-radius: 4px 4px 0 0; }
.hoja-pestanas a.activa { border-color: #3B5BDB; border-bottom-color: var(--papel); background: var(--papel); font-weight: 600; }
.hoja-seccion { padding-top: 1rem; }
.hoja-acciones { display: flex; justify-content: flex-end; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.enlace-accion { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
    color: #0F766E; cursor: pointer; text-decoration: none; }
.enlace-accion:hover { text-decoration: underline; }
.enlace-accion.deshabilitado { color: #A0AEC0; cursor: not-allowed; text-decoration: none; }
.ec-titulo { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 1rem 0 .5rem; color: var(--texto); }
.ec-filtro { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding-bottom: .75rem; border-bottom: 1px solid var(--linea); }
.ec-filtro .ec-titulo { margin: 0; }
.ec-filtro label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--texto-2); }
.ec-filtro input[type=date] { font: inherit; border: 0; border-bottom: 1px solid #BFC7C0; padding: .2rem .25rem; background: transparent; }
.ec-bloque { margin-top: .5rem; }
.ec-bloque.filtrado { padding-bottom: 1rem; border-bottom: 2px solid var(--linea); margin-bottom: 1rem; }
.ec-tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ec-tabla th { text-align: left; font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--linea); color: var(--texto); }
.ec-tabla td { padding: .45rem .6rem; border-bottom: 1px solid #EEF0EC; vertical-align: top; }
.ec-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec-tabla tr.ec-factura td { font-weight: 500; }
.ec-tabla tr.ec-factura.vencida td:nth-child(3) { color: #C53030; font-weight: 600; }
.ec-tabla tr.ec-abono td { color: var(--texto-2); font-size: .86rem; background: #FCFCFB; }
.ec-tabla tr.ec-abono td:nth-child(2) { padding-left: 1.6rem; }
.ec-tabla tfoot td { font-weight: 700; border-top: 2px solid var(--linea); border-bottom: 0; }
.ec-concepto { display: block; font-size: .8rem; color: var(--texto-2); font-weight: 400; }
.ec-resumen { display: flex; justify-content: flex-end; gap: 2rem; margin-top: .5rem; padding: .5rem .75rem; border: 1px solid #3B5BDB; border-radius: 4px; width: fit-content; margin-left: auto; font-size: .92rem; }
@media (max-width: 760px) {
    .hoja-botones { position: static; border-left: 0; margin: -1.25rem -1.5rem 1rem; border-radius: 0; }
    .hoja-datos { grid-template-columns: 1fr; }
    .hoja-datos dl div { grid-template-columns: 7rem 1fr; }
}
@media print {
    .hoja-tercero { border: 0; padding: 0; }
    .hoja-datos { grid-template-columns: 1fr 1fr; }
    .ec-encabezado-impresion h2 { margin: 0 0 .25rem; }
    .ec-encabezado-impresion p { margin: 0; }
    .ec-tabla a { color: inherit; text-decoration: none; }
}

/* Captura: renglón guardado automáticamente */
.renglon-mov.guardado td { background: #F3FAF5; }
.renglon-mov.guardado input, .renglon-mov.guardado select { color: var(--texto); opacity: 1; cursor: default; }
.renglon-mov.con-error td { background: #FFF5F5; }
.renglon-ok { display: inline-block; color: #2F855A; font-weight: 700; font-size: 1.1rem; }
.estado-guardado { margin-right: auto; color: #2F855A; }

/* ---------------------------------------------------------------- Captura: compra con tarjeta de crédito */
.mas-renglon-panel [hidden] { display: none !important; }
.plan-tdc { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--linea); padding-top: .6rem; }

/* ---------------------------------------------------------------- Gastos fijos y tarjetas de crédito */
.campo[hidden], [data-solo-intereses][hidden], [data-solo-variable][hidden] { display: none !important; }
.navegacion-mes { display: flex; align-items: center; gap: .6rem; }
.navegacion-mes strong { min-width: 9rem; text-align: center; }
.opciones-radio { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: .8rem; }
.campo-con-sufijo { display: flex; align-items: center; gap: .5rem; }
.campo-con-sufijo input { width: 5rem; }
.dato-alerta { color: var(--rojo); }
.confirmar-gasto { display: inline-block; position: relative; }
.confirmar-gasto summary { cursor: pointer; list-style: none; }
.confirmar-gasto summary::-webkit-details-marker { display: none; }
.confirmar-gasto-panel { position: absolute; right: 0; z-index: 5; display: flex; flex-direction: column; gap: .6rem; width: 16rem; padding: .9rem;
    background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: 0 8px 24px rgba(20, 36, 58, .14); text-align: left; }
.confirmar-gasto-panel label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 500; }
.tarjetas-tdc { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.tarjeta-tdc { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.2rem; background: var(--papel); border: 1px solid var(--linea);
    border-top: 4px solid var(--tinta-2); border-radius: var(--radio); }
.tarjeta-tdc.inactiva { opacity: .6; }
.tarjeta-tdc header { display: flex; flex-direction: column; }
.tarjeta-tdc header a { color: var(--texto); text-decoration: none; font-size: 1.05rem; }
.tarjeta-tdc p { margin: 0; }
.tarjeta-tdc footer { display: flex; gap: .5rem; margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--linea); }
.cifras-tdc { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem 1rem; margin: 0; }
.cifras-tdc dt { font-size: .8rem; color: var(--texto-2); }
.cifras-tdc dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cifras-tdc dd.negativo { color: var(--rojo); }
.uso-credito { height: .5rem; background: #ECEFEA; border-radius: 999px; overflow: hidden; }
.uso-credito span { display: block; height: 100%; background: var(--verde); }
.uso-credito span.alto { background: var(--rojo); }
.resumen-tdc { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.resumen-tdc .panel h2, .calculado-corte h2 { margin-top: 0; }
.panel-alerta { border-color: var(--ambar); border-left: 4px solid var(--ambar); }
.avance-plan { display: inline-block; width: 4rem; height: .4rem; background: #ECEFEA; border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: .3rem; }
.avance-plan span { display: block; height: 100%; background: var(--verde); }
.renglon-previa { display: grid; grid-template-columns: 2fr 1.5fr 1.2fr 1.6fr 1fr .6fr 1fr .6fr auto; gap: .5rem; align-items: end; padding: .6rem 0;
    border-bottom: 1px solid var(--linea); }
.renglon-previa label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 500; }
.renglon-previa input, .renglon-previa select { width: 100%; min-width: 0; }
.boton-enlace { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.calculado-corte { margin-bottom: 1rem; background: #F7F9F6; }
@media (max-width: 900px) { .renglon-previa { grid-template-columns: 1fr 1fr; } }
.renglon-previa input, .renglon-previa select, .confirmar-gasto-panel input:not([type=file]) { font: inherit; font-size: .9rem; padding: .45rem .55rem;
    border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); }
.renglon-previa input[type=date] { padding: .4rem .3rem; }

.acceso-empresa { display: block; margin-top: .35rem; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-texto); }
.marca { flex-wrap: wrap; row-gap: .1rem; } .marca .marca-sub { flex-basis: 100%; }
/* Organización */
.bloque-corporativo { margin-bottom: 1.25rem; }
.bloque-corporativo h2 { margin: 0; }
.renglon-sucursal { display: grid; grid-template-columns: 1fr 2fr .7fr 3fr auto auto; gap: .5rem; align-items: end; padding: .5rem 0; border-bottom: 1px solid var(--linea); }
.renglon-sucursal label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 500; }
.renglon-sucursal input:not([type=checkbox]) { font: inherit; font-size: .9rem; padding: .45rem .55rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); min-width: 0; }
.renglon-sucursal .casilla-renglon { flex-direction: row; align-items: center; padding-bottom: .5rem; }
.casillas-columnas { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
@media (max-width: 900px) { .renglon-sucursal { grid-template-columns: 1fr 1fr; } }
.pasos-inicio { max-width: 46rem; line-height: 1.7; }
/* Compras e inventarios */
.lista-productos { z-index: 30; max-height: 18rem; overflow-y: auto; }
.lista-productos li.activo { background: var(--verde-suave); }
.tabla-partidas input, .tabla-partidas select { font: inherit; font-size: .9rem; padding: .4rem .5rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); width: 100%; min-width: 0; }
.tabla-partidas td { vertical-align: top; }
.tabla-partidas .col-num { width: 2rem; color: var(--texto-2); }
.tabla-partidas .col-cant { width: 7rem; } .tabla-partidas .col-precio { width: 8rem; } .tabla-partidas .col-imp { width: 9rem; } .tabla-partidas .col-total { width: 8rem; }
.tabla-partidas .col-prod { min-width: 16rem; }
.totales-documento { display: grid; grid-template-columns: auto auto; gap: .2rem 1.5rem; justify-content: end; margin: .75rem 0; font-variant-numeric: tabular-nums; }
.totales-documento dt { color: var(--texto-2); text-align: right; } .totales-documento dd { margin: 0; text-align: right; font-weight: 600; }
.estado-entrada { color: var(--verde-oscuro); font-weight: 600; } .estado-salida { color: var(--rojo); font-weight: 600; }
.fila-alerta td { background: #FFF8E6; }
.documento-impreso { max-width: 54rem; margin: 0 auto; background: #fff; padding: 2rem; font-size: .92rem; }
@media print { .lateral, .barra, .no-imprimir, .acciones-encabezado { display: none !important; } .erp { display: block; background: #fff; } .contenido { padding: 0; } }
.lista-simple { margin: 0; padding-left: 1.1rem; line-height: 1.8; }

/* Alta de tarjeta desde el estado de cuenta (PDF) */
.panel-estado-cuenta { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: #F7F9F6; border: 1px dashed #BFC7C0; border-radius: var(--radio); }
.panel-estado-cuenta .subtitulo { margin-top: 0; }
.avisos-estado { margin: .5rem 0 0; padding-left: 1.1rem; color: #8A5517; font-size: .9rem; }
.avisos-estado:empty { display: none; }
.renglon-previa.leido { background: #F1F7F1; }

/* Compras a meses: editar concepto y línea de negocio */
.etiqueta-linea { display: inline-block; margin-top: .2rem; padding: .05rem .5rem; border-radius: 999px; background: #E6F0E9; color: #1F5E3B; font-size: .78rem; font-weight: 500; }
.fila-edicion-plan td { background: #F7F9F6; }
.forma-plan { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr auto; gap: .6rem; align-items: end; }
.forma-plan label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 500; }
.forma-plan input, .forma-plan select { font: inherit; font-size: .9rem; padding: .45rem .55rem; border: 1px solid #BFC7C0; border-radius: var(--radio); background: var(--papel); min-width: 0; }
.acciones-forma-plan { display: flex; gap: .4rem; }
form.en-linea { display: inline; }
@media (max-width: 900px) { .forma-plan { grid-template-columns: 1fr; } }

/* Reportes financieros (estado de resultados y flujo de efectivo) */
.tabla-financiera { font-size: .82rem; }
.tabla-financiera th, .tabla-financiera td { padding: .4rem .55rem; }
.tabla-financiera tbody th { font-weight: 400; position: sticky; left: 0; background: var(--papel); min-width: 15rem; }
.tabla-financiera .fila-rubro th { padding-left: 1.4rem; color: #4A5650; }
.tabla-financiera .fila-renglon th, .tabla-financiera .fila-renglon td { font-weight: 600; border-top: 1px solid #C9D2CB; }
.tabla-financiera .fila-total th, .tabla-financiera .fila-total td { font-weight: 700; background: #F1F5F1; }
.tabla-financiera .fila-ebitda th, .tabla-financiera .fila-ebitda td { background: #E3EEE6; }
.tabla-financiera .fila-margen th, .tabla-financiera .fila-margen td { font-style: italic; color: #5B6660; }
.tabla-financiera .fila-seccion th { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; font-weight: 700; color: #5B6660; background: transparent; }
.tabla-financiera a { color: inherit; text-decoration: none; border-bottom: 1px dotted #9AA59E; }
.tabla-financiera a:hover { color: var(--verde); }
.avisos-reporte { margin: 0 0 1rem; padding: .7rem 1rem .7rem 2rem; background: #FFF6E5; border: 1px solid #F0D9A8; border-radius: var(--radio); color: #8A5517; font-size: .9rem; }
@media print { .tabla-financiera { font-size: .65rem; } .tabla-financiera tbody th { min-width: 10rem; } }
.forma-clasificar { grid-template-columns: 1.6fr 1.4fr auto; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--linea); }

/* Préstamos y aportaciones */
.resumen-prestamo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.barra-uso { display: block; width: 100%; max-width: 12rem; height: .45rem; background: #ECEFEA; border-radius: 999px; overflow: hidden; margin-bottom: .25rem; }
.barra-uso.grande { max-width: none; height: .7rem; margin: .2rem 0 .8rem; }
.barra-uso span { display: block; height: 100%; background: var(--verde); }
.barra-uso.alta span { background: #D08A1E; }
.barra-uso.llena span { background: var(--rojo); }
.celda-uso { min-width: 11rem; }
.tabla-prestamos td .dato-apoyo, .tabla td > .dato-apoyo { display: block; }
.resumen-atributos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .4rem 1.5rem; }
.resumen-atributos li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--linea); }
.forma-pago-prestamo { margin-top: 1rem; }
.opciones-radio { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: .6rem; }
.filtro-rapido { margin: -.5rem 0 1rem; font-size: .9rem; }
.boton-chico { padding: .3rem .7rem; font-size: .85rem; white-space: nowrap; }
.lista-avisos-prestamo { list-style: none; margin: 0; padding: 0; }
.lista-avisos-prestamo li { padding: .55rem 0; border-bottom: 1px solid var(--linea); display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }

/* ---------- Ajuste de pantallas (revisión de diseño 2026-10-27) ---------- */

/* ---------- Ajustes de diseño (revisión de pantallas 2026-10-27) ---------- */
/* Las páginas con tablas usan el ancho disponible en pantallas grandes (antes se quedaban en 1200px y la tabla se recortaba) */
.contenido:has(.tabla-envoltura) { max-width: 1680px; }
.menu-retraido .contenido:has(.tabla-envoltura) { max-width: 1800px; }
/* Botones, enlaces de acción y estados dentro de tablas: en un solo renglón */
.tabla .boton-secundario, .tabla .boton-principal, .tabla .accion-mov, .tabla .estado, .tabla .boton-chico { white-space: nowrap; }
.tabla td:last-child:not(.acciones-mov):has(> .boton-secundario, > .accion-mov, > form) { white-space: nowrap; width: 1%; }
/* Filtros y encabezados que se acomodan en pantallas angostas */
.filtros .campo { min-width: 0; }
.filtros select, .filtros input { max-width: 100%; }
@media (max-width: 860px) {
    .contenido { padding: 1.25rem 1rem 2rem; }
    .encabezado-pagina { flex-direction: column; }
    .acciones-encabezado { width: 100%; }
    .filtros { align-items: stretch; }
    .filtros .campo, .filtros select, .filtros input:not([type=checkbox]) { width: 100%; }
    .tabla th, .tabla td { padding: .5rem .6rem; }
    .acciones-pie { flex-wrap: wrap; }
}
/* Ninguna columna del armazón crece más que la pantalla; los fieldset no imponen su ancho mínimo */
.erp > * { min-width: 0; }
fieldset { min-width: 0; }
.rejilla > *, .ficha-seccion .campo { min-width: 0; }
.rejilla input, .rejilla select, .rejilla textarea { max-width: 100%; }
@media (max-width: 860px) {
    .barra { gap: .6rem; }
    .contexto { flex-wrap: wrap; width: 100%; }
    .contexto-selector, .contexto-selector select { max-width: 100%; width: 100%; }
    .usuario { flex-wrap: wrap; white-space: normal; gap: .4rem 1rem; width: 100%; }
    .archivo-nuevo > * { max-width: 100%; }
    .archivo-nuevo input[type=file] { width: 100%; }
}
/* Laptops (1366–1600): tablas más compactas y menos margen, para que quepan sin barra de desplazamiento */
@media (max-width: 1600px) and (min-width: 861px) {
    .contenido { padding: 1.75rem 1.75rem 2.5rem; }
    .barra { padding: .9rem 1.75rem; }
    .tabla:not(.tabla-movs) { font-size: .875rem; }
    .tabla:not(.tabla-movs) th, .tabla:not(.tabla-movs) td { padding: .55rem .6rem; }
    .tabla:not(.tabla-movs) th:first-child, .tabla:not(.tabla-movs) td:first-child { padding-left: .9rem; }
    .tabla thead th { font-size: .8rem; }
}
/* Etiqueta de vencida debajo de la fecha, no a un lado; nombres largos pueden partirse en dos renglones */
.tabla td.nowrap > .estado { display: block; width: max-content; margin-top: .25rem; }
.tabla td:first-child a:has(> strong) { white-space: normal; }
.tabla td:first-child:has(> a > strong) { min-width: 11rem; }
/* Los encabezados de columnas numéricas pueden partirse («Desc. pronto pago», «Crédito disponible»); las cifras no */
.tabla thead th.num { white-space: normal; }
.tabla-nombres td:first-child a { white-space: normal; }
.tabla-nombres td:first-child { min-width: 10rem; }
.tabla-deudas .acciones-mov { min-width: 0; white-space: nowrap; }
@media (max-width: 900px) { .forma-clasificar { grid-template-columns: 1fr; } .forma-plan select, .forma-plan input { max-width: 100%; min-width: 0; } .forma-plan > * { min-width: 0; } }
/* ---------- Reportes de análisis de Tesorería (auxiliar y concentrado) ---------- */
.aviso-suave { background: #FFF7E0; border: 1px solid #F0DCA4; border-radius: var(--radio); padding: .55rem .85rem; font-size: .9rem; margin: 0 0 1rem; }
.tabla-concentrado tbody th { text-align: left; font-weight: 400; }
.tabla-concentrado .fila-grupo th, .tabla-concentrado .fila-grupo td { background: #F6F8F5; font-weight: 600; }
.tabla-concentrado .fila-grupo th a { color: inherit; }
.tabla-concentrado .fila-sub th { padding-left: 1.8rem; color: #4A5650; }
.tabla-concentrado .fila-sub th a { color: inherit; text-decoration: none; border-bottom: 1px dotted #9AA59E; }
.tabla-concentrado tfoot th { text-align: left; }
.tabla-auxiliar .fila-saldo td { background: #F6F8F5; }
.tabla-auxiliar td .dato-apoyo, .tabla-concentrado td .dato-apoyo { display: block; }
.secciones-reporte h2 { font-size: 1.05rem; margin: 1.6rem 0 .7rem; }
.panel-peligro { border-color: #E8B4AE; }
.panel-peligro summary strong { color: var(--rojo); }

/* ---------- Estado de cuenta de un préstamo (como el de una financiera) ---------- */
.estado-cuenta-prestamo { display: flex; flex-direction: column; gap: 1.25rem; }
.ec-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.ec-nombre { margin: 0; font-family: var(--serif); font-size: 1.6rem; }
.ec-etiqueta { margin: 0; color: var(--texto-2); font-size: .9rem; }
.ec-credito { display: flex; align-items: center; gap: .6rem; }
.ec-badge { padding: .35rem .9rem; border-radius: 8px; font-weight: 600; border: 1px solid transparent; }
.ec-badge-ok { background: var(--verde-suave); color: var(--verde-oscuro); border-color: #A9D8C1; }
.ec-badge-atraso { background: #FBE7E4; color: var(--rojo); border-color: #EBB8B1; }
.ec-badge-neutro { background: #ECEFF2; color: var(--texto-2); }
.ec-tarjetas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.ec-columna { display: flex; flex-direction: column; gap: 1rem; }
.ec-tarjeta { margin: 0; }
.ec-cifra { margin: .2rem 0 .4rem; font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ec-cifra-media { margin: 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec-tarjeta-sup { padding-bottom: .9rem; border-bottom: 1px solid var(--linea); }
.ec-renglones { margin: .6rem 0 0; display: flex; flex-direction: column; gap: .45rem; }
.ec-renglones > div { display: flex; justify-content: space-between; gap: 1rem; }
.ec-renglones dt { color: var(--texto-2); }
.ec-renglones dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ec-liquidar { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--linea); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ec-liquidar .dato-apoyo { margin: 0; }
.ec-alerta { margin: .5rem 0 0; color: var(--rojo); font-weight: 500; }
.ec-tasas { margin-top: .9rem; display: grid; grid-template-columns: 1fr 1fr; background: #F1F4F6; border-radius: var(--radio); }
.ec-tasas > div { padding: .8rem; text-align: center; display: flex; flex-direction: column; gap: .2rem; }
.ec-tasas > div + div { border-left: 1px solid var(--linea); }
.ec-tasas strong { font-size: 1.2rem; }
.ec-tasas span { color: var(--texto-2); font-size: .85rem; }
.ec-avance { text-align: left; }
.ec-dona { position: relative; width: 210px; height: 210px; margin: .5rem auto; }
.ec-dona svg { width: 100%; height: 100%; }
.ec-dona circle { fill: none; stroke-width: 12; }
.ec-dona-fondo { stroke: #EEF1F4; }
.ec-dona-avance { stroke: #22B573; stroke-linecap: butt; }
.ec-dona-texto { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; }
.ec-dona-texto strong { font-size: 1.6rem; }
.ec-dona-texto a { font-size: .85rem; }
.ec-leyenda { margin: 0; text-align: center; color: var(--texto-2); font-size: .9rem; display: flex; justify-content: center; align-items: center; gap: .4rem; }
.ec-punto { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; }
.ec-punto-ok { background: #22B573; }
.ec-punto-atraso { background: var(--ambar); margin-left: 1rem; }
.tabla-amortizacion td, .tabla-amortizacion th { white-space: nowrap; }
.ec-fila-ok td { color: #1C8C5A; }
.ec-fila-ok td.num:nth-child(3), .ec-fila-ok td.num:nth-child(4), .ec-fila-ok td.num:nth-child(5) { color: var(--texto-2); }
.ec-fila-atraso td { background: #FDF1EF; }
.ec-fila-atraso td:last-child { color: var(--rojo); font-weight: 600; }
.ec-fila-vigente td { background: #F4F8FC; font-weight: 500; }
.ec-check { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin-left: .35rem;
    border: 2px solid #22B573; border-radius: 50%; color: #22B573; font-size: .7rem; font-weight: 700; }
@media (max-width: 1100px) { .ec-tarjetas { grid-template-columns: 1fr 1fr; } .ec-avance { grid-column: 1 / -1; } }
@media (max-width: 700px) { .ec-tarjetas { grid-template-columns: 1fr; } }
@media print {
    .estado-cuenta-prestamo { gap: .6rem; }
    .ec-tarjetas { grid-template-columns: repeat(3, 1fr); }
    .ec-dona { width: 150px; height: 150px; }
    .ec-fila-atraso td, .ec-fila-vigente td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .tabla-amortizacion { font-size: .8rem; }
}

/* ---------- Tableros de Inicio (operativo, dirección, deuda y créditos) ---------- */
.tb-pestanas { display: flex; flex-wrap: wrap; gap: .25rem; margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--linea); }
.tb-pestanas a { padding: .6rem 1rem; text-decoration: none; color: var(--texto-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tb-pestanas a:hover { color: var(--texto); }
.tb-pestanas a.activa { color: var(--texto); border-bottom-color: var(--verde); }
.tb-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.tb-titulos { display: flex; flex-direction: column; gap: .15rem; }
.tb-titulos .titulo-pagina { margin: 0; }
.tb-sobretitulo { font-size: .8rem; color: var(--texto-2); letter-spacing: .05em; text-transform: uppercase; }
.tb-filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.tb-filtros label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--texto-2); }
.tb-filtros select { font: inherit; font-size: .9rem; color: var(--texto); padding: .5rem .7rem; border: 1px solid #C9D0C8; border-radius: var(--radio); background: var(--papel); min-width: 11rem; }
.tb-filtros .tb-casilla { flex-direction: row; align-items: center; font-size: .9rem; color: var(--texto); padding-bottom: .55rem; }
.tb-segmentos { display: flex; border: 1px solid #C9D0C8; border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.tb-segmentos button { font: inherit; font-size: .9rem; padding: .55rem .9rem; border: 0; background: var(--papel); color: var(--texto); cursor: pointer; }
.tb-segmentos button + button { border-left: 1px solid #C9D0C8; }
.tb-segmentos button.activa { background: var(--tinta); color: #fff; }
.tb-indicadores { display: grid; gap: .75rem; margin-bottom: 1.25rem; }
.tb-seis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tb-cinco { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tb-indicador { background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0;
    text-decoration: none; color: var(--texto); }
a.tb-indicador:hover { border-color: #AFC2B6; }
.tb-ind-titulo { font-size: .82rem; color: var(--texto-2); }
.tb-ind-valor { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-ind-valor.tb-grande { font-size: 1.6rem; }
.tb-ind-detalle { font-size: .8rem; color: var(--texto-2); }
.tb-indicador.ok .tb-ind-valor { color: var(--verde); }
.tb-indicador.alerta .tb-ind-valor { color: var(--rojo); }
.tb-indicador.alerta .tb-ind-detalle { color: var(--rojo); }
.tb-indicador.aviso .tb-ind-detalle { color: #8A5517; }
.tb-columnas { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: flex-start; margin-bottom: 1.1rem; }
.tb-principal { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.tb-lateral { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
section.tb-principal, section.tb-lateral { gap: .6rem; }
.tb-panel { margin: 0 0 1.1rem; }
.tb-columnas .tb-panel { margin: 0; }
.tb-panel h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.tb-panel-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; margin-bottom: .6rem; }
.tb-panel-cab h2 { margin: 0; }
.tb-columna-cab { flex-direction: column; align-items: flex-start; }
.tb-pie { margin: .6rem 0 0; font-size: .88rem; }
.tb-dias { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .45rem; margin-bottom: .8rem; }
.tb-dia { font: inherit; text-align: left; cursor: pointer; padding: .55rem .65rem; border-radius: 8px; border: 1px solid var(--linea); background: var(--papel); color: var(--texto);
    display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tb-dia:hover { border-color: #AFC2B6; }
.tb-dia.vencido { background: #FDF1EF; border-color: #EBB8B1; }
.tb-dia.vencido .tb-dia-etiqueta { color: var(--rojo); }
.tb-dia.activa { border: 2px solid var(--tinta); padding: calc(.55rem - 1px) calc(.65rem - 1px); }
.tb-dia-etiqueta { font-size: .78rem; font-weight: 600; }
.tb-dia-total { font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-dia-cuantos { font-size: .75rem; color: var(--texto-2); }
.tb-chip { display: inline-block; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; background: #ECEFF2; color: #3D4A57; white-space: nowrap; }
.tb-chip.ok { background: var(--verde-suave); color: var(--verde-oscuro); }
.tb-chip.alerta { background: #FBE7E4; color: var(--rojo); }
.tb-chip.aviso { background: #FBF0DE; color: #8A5517; }
.tb-entra { color: var(--verde); }
.tb-barras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.tb-barras li { display: flex; flex-direction: column; gap: .25rem; }
.tb-barra-texto { display: flex; justify-content: space-between; gap: .75rem; font-size: .92rem; }
.tb-barra-texto strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-en-linea { display: inline; }
.tb-barra { display: block; height: 7px; background: #EEF1EC; border-radius: 4px; overflow: hidden; flex: 1; min-width: 60px; }
.tb-barra > span { display: block; height: 100%; background: var(--verde); }
.tb-barra.negativa > span, .tb-barra-alerta > span { background: var(--rojo); }
.tb-barra-aviso > span { background: var(--ambar); }
.tb-barra-ok > span { background: #22B573; }
.tb-barra-tinta > span { background: var(--tinta); }
.tb-barra-egreso > span { background: var(--ambar); }
.tb-total { display: flex; justify-content: space-between; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--linea); }
.tb-dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.tb-dos > div { display: flex; flex-direction: column; gap: .1rem; }
.tb-cifra { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tb-pendientes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.tb-pendientes a { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem .75rem; border-radius: var(--radio); background: #F4F7FB; color: var(--texto); text-decoration: none; }
.tb-pendientes a.alerta { background: #FDF1EF; }
.tb-pendientes a.alerta strong { color: var(--rojo); }
.tb-conclusion { margin: 0 0 .8rem; padding: .75rem .9rem; border-radius: 8px; border-left: 0; background: var(--verde-suave); font-weight: 500; }
.tb-conclusion.aviso { background: #FBF0DE; }
.tb-conclusion.alerta { background: #FDF1EF; color: #7E2A23; }
.tb-semanas .tb-col-semaforo { width: 28%; }
.tb-semaforo { display: flex; align-items: center; gap: .5rem; }
.tb-semaforo > span:last-child { font-size: .82rem; min-width: 6.5rem; }
.tb-tono-ok { color: var(--verde); }
.tb-tono-aviso { color: #8A5517; }
.tb-tono-alerta { color: var(--rojo); }
.tb-barra-ok > span { background: #22B573; }
.tb-fila-alerta td { background: #FDF6F4; }
.tb-detalle-semana > td { background: #F7F9F6; padding: .4rem .8rem .8rem; }
.tb-subtabla { font-size: .88rem; width: 100%; }
.tb-subtabla td.num { white-space: nowrap; }
.tb-decisiones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.tb-decision { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .85rem; border-radius: 8px; background: #F1F4F6; box-shadow: inset 4px 0 0 #8A96A3; }
.tb-decision span { font-size: .88rem; color: #3D4A57; }
.tb-decision a { font-size: .88rem; }
.tb-decision.alerta { background: #FDF1EF; box-shadow: inset 4px 0 0 var(--rojo); }
.tb-decision.aviso { background: #FBF4EA; box-shadow: inset 4px 0 0 var(--ambar); }
.tb-decision.ok { background: #EEF7F2; box-shadow: inset 4px 0 0 var(--verde); }
.tb-tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.tb-tres .tb-panel { margin: 0; }
.tb-meses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.tb-meses li { display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: .6rem; }
.tb-mes { font-size: .85rem; color: var(--texto-2); }
.tb-mes-barras { display: flex; flex-direction: column; gap: 3px; }
.tb-mes-neto { font-size: .82rem; font-variant-numeric: tabular-nums; text-align: right; }
.tb-leyenda { display: flex; align-items: center; gap: .35rem; margin: .7rem 0 0; }
.tb-punto { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; }
.tb-punto.ok { background: #22B573; }
.tb-punto.egreso { background: var(--ambar); margin-left: .6rem; }
.tb-lista { list-style: none; margin: 0; padding: 0; }
.tb-lista li { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid #EEF1EC; font-size: .92rem; }
.tb-lista li > span:first-child { display: flex; flex-direction: column; }
.tb-lista .num { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
@media (max-width: 1250px) { .tb-seis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tb-cinco { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tb-dias { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tb-tres { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .tb-seis, .tb-cinco { grid-template-columns: 1fr 1fr; } .tb-tres { grid-template-columns: 1fr; } .tb-dias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tb-filtros { width: 100%; } .tb-filtros label, .tb-filtros select { width: 100%; } }
.tb-barras .tb-barra, .tb-mes-barras .tb-barra { flex: none; }
.dialogo-origen [hidden] { display: none !important; }
.arrastrar-mov { display: inline-block; user-select: none; font-size: 1rem; line-height: 1; padding: .1rem .3rem; margin-right: .35rem; border: 1px solid transparent; border-radius: 4px; background: none; color: #8a958f; cursor: grab; vertical-align: middle; touch-action: none; }
.arrastrar-mov:hover, .arrastrar-mov:focus-visible { border-color: var(--linea); color: #1F6B4F; }
tr.arrastrando { opacity: .45; }
tr.soltar-antes > td { box-shadow: inset 0 3px 0 #1F6B4F; }
tr.soltar-despues > td { box-shadow: inset 0 -3px 0 #1F6B4F; }
.enlace-prestamo { font-weight: 600; white-space: nowrap; }
/* Trazabilidad del dinero */
.tz-chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #E3F1EA; color: #1F6B4F; font-size: .85rem; white-space: nowrap; }
.tz-egreso { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tz-egreso > div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tz-egreso-titulo { font-size: 1.15rem; }
.tz-egreso-importe { font-size: 1.6rem; white-space: nowrap; }
.tz-regla { margin: -.25rem 0 1rem; }
.tz-ruta { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.tz-nodo { display: flex; flex-direction: column; gap: .1rem; margin-left: calc(var(--nivel, 0) * 1.5rem); padding: .5rem .75rem; border: 1px solid var(--linea); border-left: 4px solid #1F6B4F; border-radius: var(--radio); background: #fff; position: relative; }
.tz-nodo:not(.tz-origen)::before { content: "↳"; position: absolute; left: -1.1rem; top: .5rem; color: #8A938C; }
.tz-origen { border-left-color: #B3261E; }
.tz-nodo-cuenta { font-weight: 600; }
.tz-resumenes { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-bottom: 1rem; }
.tz-resumenes h3 { font-size: .95rem; margin: 0 0 .5rem; }
.tz-llega td { background: #EEF6F1; }
.tz-de-este td { background: #FBF6E9; }
.tz-ver { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .2rem; }
.tz-ver legend { font-weight: 600; margin-bottom: .2rem; }
.aviso-base-copia { background: #FFF4D6; border-bottom: 1px solid #E8C873; color: #6B4E00; padding: .5rem 1.5rem; font-size: .95rem; }
@media print { .aviso-base-copia { display: none; } }
.cm-lado-ingreso { display: flex; flex-direction: column; gap: .25rem; margin-top: .35rem; padding: .35rem .4rem; border-left: 3px solid #1F6B4F; background: #F2F8F4; border-radius: 4px; }
.cm-lado-ingreso[hidden] { display: none !important; }
.cm-lado-titulo { font-size: .78rem; color: #4F5B53; }
.cm-lado-ingreso input:not([type=hidden]) { width: 100%; }
.tabla-clasificaciones { margin: .5rem 0; max-width: 40rem; }
.tabla-clasificaciones input:not([type=hidden]):not([type=checkbox]) { width: 100%; font: inherit; padding: .35rem .45rem; border: 1px solid #BFC7C0; border-radius: 4px; }

/* ---------- Programación de pagos (tablero) ---------- */
.contenido:has(.tablero-programacion) { max-width: 1600px; }
.tablero-programacion .miga { margin: 0 0 .25rem; font-size: .9rem; }
.tablero-programacion .titulo-pagina .estado { vertical-align: middle; margin-left: .5rem; }
.tablero-programacion .acciones-encabezado form { display: inline; margin: 0; }
.datos-programacion summary { cursor: pointer; font-weight: 600; }
.datos-programacion textarea { width: 100%; font: inherit; }
.filtros-tablero { position: sticky; top: 0; z-index: 3; background: var(--fondo); padding: .5rem 0; }
.filtros-tablero label { display: flex; flex-direction: column; font-size: .85rem; color: var(--texto-2); gap: .15rem; }
.filtros-tablero label.casilla { flex-direction: row; align-items: center; gap: .4rem; color: var(--texto); font-size: .95rem; }
.filtros-tablero input[type=search] { font: inherit; padding: .45rem .6rem; border: 1px solid #BFC7C0; border-radius: var(--radio); min-width: 16rem; }
.filtros-tablero .estado-guardado { margin-left: auto; font-size: .9rem; }
.tablero-programacion .panel-titulo { justify-content: flex-start; align-items: center; gap: 0; }
.paso { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--tinta); color: #fff; font-size: .9rem; margin-right: .4rem; }
.tarjetas-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .75rem; }
.tarjeta-resumen { border: 1px solid var(--linea); border-radius: var(--radio); padding: .75rem 1rem; background: var(--papel); }
.tarjeta-resumen h3 { margin: 0 0 .4rem; font-size: 1rem; }
.tarjeta-resumen dl { margin: 0; }
.tarjeta-resumen dl div { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.tarjeta-resumen dt { color: var(--texto-2); }
.tarjeta-resumen dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tarjeta-resumen .queda { border-top: 1px solid var(--linea); margin-top: .3rem; padding-top: .3rem; font-weight: 700; font-size: 1rem; }
.tarjeta-resumen.negativo { border-color: var(--rojo); }
.tarjeta-resumen.negativo .queda dd, td.negativo { color: var(--rojo); }
.tabla .fila-grupo th { background: var(--verde-suave); text-align: left; font-size: .9rem; }
.tabla tr.no-elegida td { color: var(--texto-2); }
.tabla-alta { max-height: 26rem; overflow-y: auto; }
.columnas-pagos { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .columnas-pagos { grid-template-columns: 1fr; } }
.columna-pagos { background: #ECEFEA; border-radius: var(--radio); padding: .5rem; min-width: 0; }
.columna-programado { background: var(--verde-suave); }
.columna-standby { background: #FBF1E3; }
.columna-pagos > header { display: flex; justify-content: space-between; align-items: baseline; padding: .25rem .4rem .5rem; }
.columna-pagos > header h3 { margin: 0; font-size: 1.05rem; }
.columna-pagos > header span { font-size: .9rem; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.columna-cuerpo { min-height: 8rem; max-height: 75vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .25rem; border-radius: var(--radio); border: 2px dashed transparent; }
.columna-cuerpo.soltar-aqui { border-color: var(--foco); background: rgba(47, 111, 214, .06); }
.columna-vacia { color: var(--texto-2); text-align: center; margin: 2rem 0; font-size: .9rem; }
.marca-soltar { height: 4px; border-radius: 2px; background: var(--foco); flex: none; }
.tarjeta-pago { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: .55rem .7rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tarjeta-pago[draggable=true] { cursor: grab; }
.tarjeta-pago.arrastrando { opacity: .45; }
.tarjeta-pago.urgente { border-left: 4px solid var(--rojo); }
.tp-cabeza { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.tp-proveedor { font: inherit; font-weight: 700; background: none; border: 0; padding: 0; color: var(--tinta); cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.tp-proveedor:hover { color: var(--verde-oscuro); }
.tp-importe { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-datos { font-size: .83rem; color: var(--texto-2); display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.tp-datos .estado { font-size: .72rem; padding: 0 .4rem; }
.tp-concepto { margin: .2rem 0 0; font-size: .88rem; }
.tp-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .6rem; margin-top: .5rem; }
.tp-campo { display: flex; flex-direction: column; font-size: .78rem; color: var(--texto-2); gap: .1rem; min-width: 0; }
.tp-campo input, .tp-campo select { font: inherit; font-size: .88rem; padding: .3rem .4rem; border: 1px solid #BFC7C0; border-radius: 4px; color: var(--texto); min-width: 0; width: 100%; }
.tp-avisos { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--rojo); font-size: .82rem; }
.tp-mover { display: block; margin-top: .35rem; text-align: right; }
.tp-mover select { font: inherit; font-size: .8rem; border: 1px solid var(--linea); border-radius: 4px; background: transparent; color: var(--texto-2); padding: .1rem .3rem; }
.dialogo-proveedor { width: min(56rem, 94vw); }
.pestanas-programacion { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--linea); margin: 1rem 0 .75rem; }
.pestanas-programacion button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: .6rem 1rem; cursor: pointer; color: var(--texto-2); font-weight: 600; }
.pestanas-programacion button:hover { color: var(--texto); }
.pestanas-programacion button[aria-selected=true] { color: var(--verde-oscuro); border-bottom-color: var(--verde); }
.cuenta-pestana { font-weight: 400; font-size: .85rem; }
.vacio-elegir { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.vacio-elegir p { margin: 0; }
.dato-falta { display: block; color: var(--rojo); font-size: .82rem; }
.tabla .fila-subtotal th, .tabla .fila-subtotal td { font-weight: 700; border-top: 1px solid var(--linea); }
.tabla tr.elegida td { background: var(--verde-suave); }
.vacio.vacio-elegir { padding: 1rem 1.25rem; text-align: left; }
.filtros-tablero [hidden] { display: none; }
.boton-enlace.peligro { color: var(--rojo); }
details.lista-empresas { display: inline; }
details.lista-empresas summary { display: inline; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
details.lista-empresas[open] { display: block; margin: .25rem 0; }
details.lista-empresas ul { margin: .25rem 0 .25rem 1.25rem; padding: 0; }
.boton-desplegar { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--texto); }
.boton-desplegar .flecha { display: inline-block; width: 1.1rem; color: var(--texto-2); }
.tabla .fila-cliente td, .tabla .fila-cliente th { background: #F6F7F4; }
.tabla .fila-cliente.elegida td { background: var(--verde-suave); }
.tabla td.sangria { padding-left: 2.2rem; }
.encabezado-datos { margin: .25rem 0 0; }
.traspaso-pendiente { border-top: 1px solid var(--linea); padding: .5rem 0; }
.traspaso-pendiente summary { cursor: pointer; list-style: none; }
.traspaso-pendiente summary::-webkit-details-marker { display: none; }
.traspaso-pendiente summary .boton-enlace { margin-left: .5rem; }
.traspaso-pendiente form { margin-top: .5rem; }
/* Tablero de lo que va a entrar */
.columna-cuerpo .grupo-empresa { margin: .4rem .2rem 0; font-size: .78rem; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .02em; }
.columna-cuerpo .grupo-cliente { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; padding: .4rem .55rem; background: var(--papel);
    border: 1px solid var(--linea); border-radius: var(--radio); }
.columna-cuerpo .grupo-cliente[draggable=true] { cursor: grab; }
.columna-cuerpo .grupo-cliente .tp-mover { margin: 0 0 0 auto; }
.columna-cuerpo .grupo-cliente.arrastrando { opacity: .45; }
.tarjeta-cobro { margin-left: .6rem; }
.columna-programado .tarjeta-cobro { margin-left: 0; }
.form-traspaso { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--linea); }

/* Al regresar de editar, la lista se queda en el renglón que se tocó y lo resalta un momento */
.tabla-movimientos tbody tr[id] { scroll-margin-top: 6rem; }
.tabla-movimientos tbody tr:target > td { animation: renglon-tocado 3s ease-out; }
@keyframes renglon-tocado { 0%, 40% { background: #fff3c4; } 100% { background: transparent; } }
.insertar-mov { display: inline-block; width: 1.3rem; text-align: center; margin-right: .15rem; border: 1px solid transparent; border-radius: 4px; color: #8a958f; font-weight: 600; text-decoration: none; line-height: 1.3rem; }
.insertar-mov:hover, .insertar-mov:focus-visible { border-color: var(--linea); color: #1F6B4F; background: #eef5f0; }

/* Importar movimientos de Excel */
.resumen-importar p { margin: .2rem 0; }
.etiqueta-aviso { background: #FBF1E3; color: #8A5517; }
.etiqueta-error { background: #FBE9E7; color: #A1301E; }
.etiqueta-ok { background: #E6F4EA; color: var(--verde-oscuro); }
.texto-error { color: #A1301E; font-size: .85rem; }
.tabla-equivalencias tr.falta td { background: #FFF6E5; }
.tabla-equivalencias select { min-width: 16rem; }
.tabla-importar tr.con-error td { background: #FDF3F1; }
.tabla-importar tr.posible-duplicado td { background: #FFF9EC; }
.tabla-importar tr.ya-cargado td { color: var(--texto-2); }
.tabla-importar td.revision-importar { min-width: 12rem; }
.acciones-importar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.tabla-desplazable { overflow-x: auto; }
.ayuda-importar { margin: .75rem 0; }
.ayuda-importar summary { cursor: pointer; color: var(--verde-oscuro); }
.beneficiario-importar { font-weight: 600; }

/* Programación · Lo que va a entrar: cliente compacto y sus facturas como árbol (viñetas con flecha) */
.columna-cuerpo .cliente-arbol { display: flex; flex-direction: column; }
.columna-cuerpo .cliente-arbol .grupo-cliente { padding: .35rem .55rem; }
.grupo-cliente .boton-desplegar:disabled { cursor: default; color: var(--texto); }
.grupo-cliente .gc-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.columna-cuerpo .cliente-arbol .grupo-cliente { flex-wrap: nowrap; align-items: baseline; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; }
.cliente-arbol .grupo-cliente .boton-desplegar { min-width: 0; overflow-wrap: anywhere; }
.grupo-cliente .gc-cuantas { grid-column: 1 / -1; display: flex; gap: .4rem; align-items: center; padding-left: 1.1rem; }
.grupo-cliente .gc-cuantas .tp-mover { margin: 0 0 0 auto; }
.grupo-cliente .gc-cuantas .tp-mover select { font-size: .78rem; padding: .1rem .3rem; }
.factura-arbol .fa-vencida, .factura-arbol .fa-vencida strong { color: #A85F0F; }
.columna-cuerpo .grupo-cliente .tp-mover { margin: 0 0 0 auto; }
.arbol-facturas { list-style: none; margin: 0 0 .3rem .95rem; padding: 0 0 0 1.25rem; }
.arbol-facturas[hidden] { display: none; }
.factura-arbol { position: relative; margin: .3rem 0 0; padding: .3rem .5rem; background: var(--papel); border: 1px solid var(--linea); border-radius: 6px; font-size: .88rem; }
.factura-arbol[draggable=true] { cursor: grab; }
.factura-arbol.arrastrando { opacity: .45; }
/* línea vertical (llega hasta la mitad en la última) y rama horizontal con punta de flecha */
.factura-arbol::before { content: ""; position: absolute; left: -1.25rem; top: -.4rem; bottom: -.05rem; border-left: 2px solid #1F6B4F; }
.factura-arbol:last-child::before { bottom: calc(50% - 1px); }
.factura-arbol::after { content: ""; position: absolute; left: -1.25rem; top: calc(50% - 1px); width: .95rem; border-top: 2px solid #1F6B4F; }
.factura-arbol .fa-linea::before { content: ""; position: absolute; left: -.38rem; top: calc(50% - .32rem); border-left: .38rem solid #1F6B4F; border-top: .32rem solid transparent; border-bottom: .32rem solid transparent; }
.factura-arbol .fa-linea { display: flex; align-items: baseline; gap: .5rem; }
.factura-arbol .fa-folio { font-weight: 700; }
.factura-arbol .fa-importe { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.factura-arbol .fa-datos { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; color: var(--texto-2); font-size: .8rem; }
.factura-arbol .fa-datos strong { color: var(--texto); font-weight: 600; }
.factura-arbol .fa-concepto { flex-basis: 100%; }
.factura-arbol .tp-mover { margin: 0 0 0 auto; }
.factura-arbol .tp-mover select { font-size: .78rem; padding: .1rem .3rem; }
.factura-arbol.vencida { border-left: 3px solid #C77C1E; }
