/* SoftPanel SV — estilos del panel */

:root {
    --azul: #155494;
    --azul-osc: #0f3f70;
    --turquesa: #20a6a4;
    --tinta: #12283f;
    --apagado: #5b6b7c;
    --papel: #f3f5f8;
    --superficie: #ffffff;
    --superficie-2: #f8fafb;
    --linea: #dfe5eb;
    --rojo: #c0392b;
    --rojo-bg: #fdecea;
    --ambar: #a86200;
    --ambar-bg: #fdf3e1;
    --verde: #1d8656;
    --verde-bg: #e6f5ee;
    --gris-bg: #eef1f4;
    --wa: #1c9c55;
    --sombra: 0 1px 2px rgba(18, 40, 63, .06), 0 4px 16px rgba(18, 40, 63, .05);
    --r-ctrl: 7px;
    --r-bloque: 12px;
    --fuente: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color-scheme: light;
}
:root[data-tema="oscuro"] {
    --tinta: #e3eaf2;
    --apagado: #93a3b5;
    --papel: #0e1824;
    --superficie: #152230;
    --superficie-2: #1a2938;
    --linea: #263a4e;
    --rojo: #f07a6b;
    --rojo-bg: #3a1f1f;
    --ambar: #f0b45a;
    --ambar-bg: #382c17;
    --verde: #5cc996;
    --verde-bg: #173226;
    --gris-bg: #1f2e3e;
    --azul: #5b9be0;
    --azul-osc: #7fb1ea;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 15px/1.5 var(--fuente);
    color: var(--tinta);
    background: var(--papel);
    font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--azul); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--turquesa); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .55rem 1rem; border-radius: var(--r-ctrl); border: 1px solid transparent;
    font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn i { font-size: .9em; }
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: var(--azul-osc); }
:root[data-tema="oscuro"] .btn-primario { background: #2a6db3; }
:root[data-tema="oscuro"] .btn-primario:hover { background: #347bc4; }
.btn-suave { background: var(--superficie); border-color: var(--linea); color: var(--tinta); }
.btn-suave:hover { border-color: var(--apagado); }
.btn-peligro { background: #c0392b; color: #fff; }
.btn-peligro:hover { background: #a32f23; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #157f44; }
.btn-renovar { background: var(--turquesa); color: #fff; }
.btn-renovar:hover { background: #188886; }
.btn-bloque { width: 100%; padding: .75rem; font-size: 1rem; }
.btn-texto {
    background: none; border: 0; padding: .35rem 0; cursor: pointer; color: var(--apagado);
    display: inline-flex; align-items: center; gap: .6em; font-size: .87rem; text-align: left;
}
.btn-texto:hover { color: var(--tinta); }

/* ── Campos ────────────────────────────────────────────────────────────── */
.campo { display: block; margin-bottom: .9rem; }
.campo > span:first-child { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.campo em { font-style: normal; font-weight: 400; color: var(--apagado); }
.campo input, .campo select, .campo textarea {
    width: 100%; padding: .55rem .7rem; border: 1px solid var(--linea); border-radius: var(--r-ctrl);
    background: var(--superficie); min-height: 2.5rem;
}
.campo textarea { resize: vertical; min-height: 4.5rem; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none; border-color: var(--turquesa); box-shadow: 0 0 0 3px rgba(32, 166, 164, .18);
}
.campo input:user-invalid { border-color: var(--rojo); }
.ayuda { display: block; font-size: .8rem; color: var(--apagado); margin-top: .3rem; }
.con-boton { position: relative; display: block; }
.con-boton input { padding-right: 2.6rem; }
.ver-clave { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .4rem; color: var(--apagado); cursor: pointer; }
.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.rejilla-2.compacta { gap: .75rem; }

.aviso { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-ctrl); font-size: .9rem; margin: 0 0 1rem; }
.aviso-danger { background: var(--rojo-bg); color: var(--rojo); }
.aviso-info, .aviso-success { background: var(--verde-bg); color: var(--verde); }
.aviso-warning { background: var(--ambar-bg); color: var(--ambar); }
.aviso i { margin-top: .2rem; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.pagina-login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login {
    width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr;
    background: var(--superficie); border-radius: 16px; overflow: hidden; box-shadow: var(--sombra);
    border: 1px solid var(--linea);
}
.login-marca { background: var(--azul); color: #fff; padding: 2.75rem 2.5rem; }
:root[data-tema="oscuro"] .login-marca { background: #123a63; }
.login-logo { width: 120px; height: auto; background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 1.75rem; }
.login-marca h1 { font-size: 1.7rem; font-weight: 700; }
.login-marca p { color: rgba(255, 255, 255, .78); margin: .6rem 0 2rem; max-width: 30ch; }
.login-sistemas { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .9rem; }
.login-sistemas li { display: flex; align-items: center; gap: .65rem; }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.login-form { padding: 2.75rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }

/* ── Estructura del panel ──────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.lateral {
    background: var(--superficie); border-right: 1px solid var(--linea);
    padding: 1.25rem .9rem; display: flex; flex-direction: column; gap: 1.5rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--tinta); font-weight: 700; font-size: 1.05rem; padding: 0 .5rem; }
.marca img { width: 46px; height: auto; }
:root[data-tema="oscuro"] .marca img { background: #fff; border-radius: 6px; padding: 2px 3px; }

.sistemas { display: flex; flex-direction: column; gap: 2px; }
.sistema {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: var(--r-ctrl);
    color: var(--tinta); text-decoration: none; font-size: .9rem; font-weight: 500; position: relative;
}
.sistema i { width: 1.5rem; height: 1.5rem; border-radius: 6px; display: grid; place-items: center; font-size: .75rem; color: var(--c); background: var(--cbg, var(--gris-bg)); flex-shrink: 0; }
:root[data-tema="oscuro"] .sistema i { background: var(--gris-bg); }
.sistema-nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sistema-n { color: var(--apagado); font-size: .82rem; }
.sistema-alerta { background: var(--rojo); color: #fff; font-size: .7rem; font-weight: 700; min-width: 1.25rem; padding: 0 .35rem; border-radius: 10px; text-align: center; line-height: 1.25rem; }
:root[data-tema="oscuro"] .sistema-alerta { color: #1b0d0b; }
.sistema:hover { background: var(--superficie-2); }
.sistema.activo { background: var(--gris-bg); font-weight: 650; }
.sistema.activo::before { content: ''; position: absolute; left: -.9rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.sistema.sin-clientes .sistema-nombre { color: var(--apagado); }

.cuenta { margin-top: auto; display: flex; flex-direction: column; gap: .15rem; padding: 1rem .5rem 0; border-top: 1px solid var(--linea); }
.cuenta-usuario { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.cuenta-usuario i { color: var(--apagado); font-size: 1.1rem; }
.cuenta form { margin: 0; }

.principal { padding: 2rem clamp(1rem, 3vw, 2.75rem) 4rem; max-width: 1280px; width: 100%; }

/* ── Encabezado ────────────────────────────────────────────────────────── */
.encabezado { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.75rem; }
.hoy { margin: 0 0 .35rem; color: var(--apagado); font-size: .9rem; }
.encabezado h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 650; letter-spacing: -.015em; max-width: 34ch; }
.subtitulo { margin: .45rem 0 0; color: var(--apagado); }
.subtitulo strong { color: var(--tinta); }

/* ── Para cobrar ───────────────────────────────────────────────────────── */
.cobros { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-bloque); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--sombra); }
.cobros h2 { font-size: 1rem; margin-bottom: .6rem; }
.cobros-lista { list-style: none; margin: 0; padding: 0; }
.cobro { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--linea); }
.cobro:first-child { border-top: 0; }
.cobro-marca { align-self: stretch; border-radius: 2px; background: var(--c); }
.cobro-info strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cobro-detalle { display: flex; gap: .75rem; font-size: .85rem; color: var(--apagado); }
.estado-vencido .cobro-estado { color: var(--rojo); font-weight: 600; }
.estado-por_vencer .cobro-estado { color: var(--ambar); font-weight: 600; }
.cobro-monto { font-weight: 650; }
.cobro-acciones { display: flex; gap: .45rem; }
.cobro-acciones .btn { padding: .42rem .8rem; font-size: .84rem; }
.ver-todos { margin-top: .4rem; color: var(--azul); }

/* ── Cifras ────────────────────────────────────────────────────────────── */
.cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 2rem; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.cifras > div { padding: 1rem 1.25rem 1rem 0; }
.cifras > div + div { padding-left: 1.25rem; border-left: 1px solid var(--linea); }
.cifras dt { font-size: .82rem; color: var(--apagado); }
.cifras dd { margin: .2rem 0 0; font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; }
.cifras small { font-size: .78rem; font-weight: 500; color: var(--apagado); }

/* ── Clientes ──────────────────────────────────────────────────────────── */
.clientes-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.clientes-cabecera h2 { font-size: 1.2rem; display: flex; align-items: center; gap: .55rem; }
.contador { font-size: .8rem; font-weight: 600; background: var(--gris-bg); color: var(--apagado); padding: .1rem .5rem; border-radius: 10px; }
.herramientas { display: flex; gap: .6rem; flex-wrap: wrap; }
.buscar { position: relative; display: flex; align-items: center; }
.buscar i { position: absolute; left: .75rem; color: var(--apagado); font-size: .85rem; pointer-events: none; }
.buscar input { width: min(320px, 70vw); padding: .55rem 2.2rem .55rem 2.2rem; border: 1px solid var(--linea); border-radius: var(--r-ctrl); background: var(--superficie); }
.buscar input:focus { outline: none; border-color: var(--turquesa); box-shadow: 0 0 0 3px rgba(32, 166, 164, .18); }
.buscar kbd { position: absolute; right: .6rem; font: 600 .72rem var(--fuente); color: var(--apagado); border: 1px solid var(--linea); border-radius: 4px; padding: 0 .35rem; }
.buscar input:focus + kbd, .buscar input:not(:placeholder-shown) + kbd { display: none; }

.filtros-estado { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip {
    border: 1px solid var(--linea); background: var(--superficie); border-radius: 999px; padding: .32rem .8rem;
    font-size: .84rem; font-weight: 500; cursor: pointer; color: var(--tinta); display: inline-flex; gap: .45rem; align-items: center;
}
.chip span { color: var(--apagado); font-weight: 600; }
.chip:hover { border-color: var(--apagado); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--superficie); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.chip-vencido span { color: var(--rojo); }
.chip-por_vencer span { color: var(--ambar); }

.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-bloque); overflow: hidden; box-shadow: var(--sombra); }
.tabla th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--apagado); padding: .7rem 1rem; background: var(--superficie-2); border-bottom: 1px solid var(--linea); }
.tabla td { padding: .85rem 1rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: var(--superficie-2); }
.tabla .num { text-align: right; }
.col-periodo { width: 30%; }
.col-acciones { width: 1%; }

.cliente-nombre { font-weight: 600; }
.cliente-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .8rem; margin-top: .25rem; font-size: .82rem; color: var(--apagado); }
.etiqueta-sistema { display: inline-flex; align-items: center; gap: .35rem; color: var(--c); font-weight: 600; }
.etiqueta-sistema i { font-size: .72rem; }
:root[data-tema="oscuro"] .etiqueta-sistema { filter: brightness(1.45); }
.cliente-url { color: var(--apagado); text-decoration: none; }
a.cliente-url:hover { color: var(--azul); text-decoration: underline; }
.cliente-tel i { font-size: .7rem; margin-right: .3rem; }
.cliente-notas { font-size: .8rem; color: var(--apagado); margin-top: .3rem; }
.cliente-notas i { margin-right: .4rem; font-size: .72rem; }

/* La barra del periodo: cuánto del año pagado ya se usó */
.periodo-texto { display: flex; justify-content: space-between; gap: .75rem; font-size: .82rem; margin-bottom: .4rem; }
.periodo-estado { font-weight: 600; white-space: nowrap; }
.periodo-texto { flex-wrap: wrap; }
.icono-hueco { pointer-events: none; }
.periodo-fechas { color: var(--apagado); white-space: nowrap; }
.barra { height: 6px; border-radius: 3px; background: var(--gris-bg); overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: 3px; background: var(--turquesa); }
.estado-por_vencer .barra span { background: #e0a030; }
.estado-por_vencer .periodo-estado { color: var(--ambar); }
.estado-vencido .barra { background: var(--rojo-bg); }
.estado-vencido .barra span { background: var(--rojo); }
.estado-vencido .periodo-estado { color: var(--rojo); }
.estado-suspendido .barra span { background: var(--apagado); opacity: .45; }
.estado-suspendido .periodo-estado { color: var(--apagado); }
.estado-suspendido .cliente-nombre { color: var(--apagado); }

.col-monto { font-weight: 600; white-space: nowrap; }
.col-monto small { display: block; font-weight: 400; font-size: .78rem; color: var(--apagado); }

.acciones { display: flex; gap: .25rem; justify-content: flex-end; }
.icono {
    width: 2rem; height: 2rem; display: inline-grid; place-items: center; border-radius: var(--r-ctrl);
    border: 1px solid transparent; background: none; color: var(--apagado); cursor: pointer; font-size: .85rem; text-decoration: none;
}
.icono:hover { background: var(--gris-bg); color: var(--tinta); }
.icono-renovar { color: var(--turquesa); border-color: var(--linea); }
.icono-renovar:hover { background: var(--turquesa); color: #fff; }
.icono-wa { color: var(--wa); }
.icono-borrar:hover { background: var(--rojo-bg); color: var(--rojo); }

.vacio, .vacio-filtro { background: var(--superficie); border: 1px dashed var(--linea); border-radius: var(--r-bloque); padding: 2.5rem 1.5rem; text-align: center; color: var(--apagado); }
.vacio p { margin: 0 0 .4rem; }
.vacio strong { color: var(--tinta); }
.vacio .btn { margin-top: 1rem; }
.vacio-filtro { margin-top: 1rem; padding: 1.5rem; }
.vacio-filtro .btn-texto { color: var(--azul); }

/* ── Diálogos ──────────────────────────────────────────────────────────── */
.dialogo {
    border: 0; padding: 0; border-radius: 14px; width: min(520px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem);
    background: var(--superficie); color: var(--tinta); box-shadow: 0 20px 60px rgba(10, 25, 40, .3); overflow: auto;
}
.dialogo-ancho { width: min(860px, calc(100vw - 1.5rem)); }
.dialogo-chico { width: min(420px, calc(100vw - 1.5rem)); }
.dialogo::backdrop { background: rgba(10, 22, 36, .5); }
.dialogo[open] { animation: aparecer .16s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }
.dialogo form { margin: 0; }
.dialogo header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--linea); }
.dialogo header h2 { font-size: 1.1rem; }
.dialogo .cerrar { background: none; border: 0; color: var(--apagado); font-size: 1.05rem; cursor: pointer; padding: .3rem .45rem; border-radius: 6px; }
.dialogo .cerrar:hover { background: var(--gris-bg); color: var(--tinta); }
.dialogo-cuerpo { padding: 1.25rem 1.4rem .5rem; }
.dialogo footer { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--linea); background: var(--superficie-2); }
.dialogo-sujeto { margin: 0 0 1rem; font-weight: 600; }
.dialogo-sujeto small { display: block; font-weight: 400; color: var(--apagado); }

.selector-sistema { border: 0; padding: 0; margin: 0 0 .9rem; display: grid; gap: .4rem; }
.selector-sistema legend { font-size: .82rem; font-weight: 600; margin-bottom: .3rem; padding: 0; }
.selector-sistema label { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border: 1px solid var(--linea); border-radius: var(--r-ctrl); cursor: pointer; }
.selector-sistema input { position: absolute; opacity: 0; pointer-events: none; }
.selector-sistema i { width: 1.9rem; height: 1.9rem; border-radius: 7px; display: grid; place-items: center; color: var(--c); background: var(--cbg); flex-shrink: 0; font-size: .85rem; }
:root[data-tema="oscuro"] .selector-sistema i { background: var(--gris-bg); }
.selector-sistema strong { display: block; font-size: .87rem; font-weight: 600; }
.selector-sistema small { color: var(--apagado); font-size: .77rem; }
.selector-sistema label:hover { border-color: var(--apagado); }
.selector-sistema label:has(input:checked) { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); background: var(--cbg); }
:root[data-tema="oscuro"] .selector-sistema label:has(input:checked) { background: var(--superficie-2); }
.selector-sistema label:has(input:focus-visible) { outline: 2px solid var(--turquesa); outline-offset: 2px; }

.historial { list-style: none; margin: 0 0 1rem; padding: 0; }
.historial li { display: grid; grid-template-columns: 1fr auto auto; gap: .9rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--linea); }
.historial li:first-child { border-top: 0; }
.historial .h-periodo { font-size: .85rem; color: var(--apagado); }
.historial .h-monto { font-weight: 650; }

/* ── Aviso flotante ────────────────────────────────────────────────────── */
.toast {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; max-width: min(440px, calc(100vw - 2.5rem));
    display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 10px;
    background: var(--tinta); color: var(--superficie); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: .9rem;
    animation: aparecer .2s ease-out;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #4fd1a0; }
.toast-danger::before { background: #ff7a6b; }
.toast-warning::before { background: #f5b84c; }
.toast a { color: inherit; font-weight: 700; white-space: nowrap; }
.toast .cerrar { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: .2rem; }

/* ── Migración ─────────────────────────────────────────────────────────── */
.pagina-simple { display: grid; place-items: start center; padding: 3rem 1rem; }
.migracion { max-width: 640px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-bloque); padding: 2rem; }
.migracion h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.migracion ul { list-style: none; padding: 0; margin: 1.25rem 0 1.5rem; }
.migracion li { padding: .55rem 0; border-top: 1px solid var(--linea); display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.migracion li span { color: var(--apagado); text-align: right; }
.paso-nuevo span { color: var(--verde) !important; }
.paso-error span { color: var(--rojo) !important; }

/* ── Responsivo ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cifras > div:nth-child(3) { padding-left: 0; border-left: 0; }
    .cifras > div:nth-child(n+3) { border-top: 1px solid var(--linea); }
}
@media (max-width: 900px) {
    .app { display: block; }
    .lateral { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--linea); padding: .85rem 1rem; gap: .75rem; display: grid; grid-template-columns: 1fr auto; }
    .sistemas { grid-column: 1 / -1; grid-row: 2; flex-direction: row; overflow-x: auto; gap: .35rem; scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; }
    .sistema { flex-shrink: 0; border: 1px solid var(--linea); padding: .4rem .65rem; }
    .sistema.activo { border-color: var(--c); }
    .sistema.activo::before { display: none; }
    .sistema-nombre { overflow: visible; }
    .cuenta { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; flex-direction: row; align-items: center; gap: .9rem; }
    .cuenta-usuario, .cuenta .btn-texto > :not(i) { display: none; }
    .cuenta .btn-texto { font-size: 1rem; }
    .cuenta .btn-texto i { font-size: 1rem; }
    .principal { padding-top: 1.5rem; }
    .encabezado { flex-direction: column; align-items: stretch; }
    .dialogo-ancho .rejilla-2:not(.compacta) { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 760px) {
    .login { grid-template-columns: 1fr; }
    .login-marca { padding: 1.75rem; }
    .login-marca p, .login-sistemas { display: none; }
    .login-logo { margin-bottom: 1rem; }
    .login-form { padding: 1.75rem; }

    .cobro { grid-template-columns: 4px minmax(0, 1fr) auto; }
    .cobro-acciones { grid-column: 2 / -1; }
    .cobro-acciones .btn { flex: 1; }

    .tabla, .tabla tbody { display: block; background: none; border: 0; box-shadow: none; }
    .tabla thead { display: none; }
    .tabla tr {
        display: grid; grid-template-columns: 1fr auto; gap: .6rem 1rem; padding: .9rem 1rem; margin-bottom: .6rem;
        background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-bloque);
    }
    .tabla td { display: block; padding: 0; border: 0; }
    .tabla tbody tr:hover td { background: none; }
    .col-cliente { grid-column: 1; }
    .col-monto { grid-column: 2; grid-row: 1; }
    .col-periodo { grid-column: 1 / -1; width: auto; }
    .col-acciones { grid-column: 1 / -1; width: auto; border-top: 1px solid var(--linea) !important; padding-top: .5rem !important; }
    .acciones { justify-content: space-between; }
    .icono { width: 2.5rem; height: 2.5rem; font-size: .95rem; }
    .buscar, .buscar input { width: 100%; }
    .herramientas { width: 100%; }
    .herramientas .btn { flex: 1; }
    .buscar { flex: 1 1 100%; }
    .buscar kbd { display: none; }
    .rejilla-2.compacta { grid-template-columns: 1fr; gap: 0; }
    .dialogo { max-height: calc(100vh - 1rem); }
    .dialogo footer .btn { flex: 1; }
}
@media (max-width: 520px) {
    .cifras { grid-template-columns: 1fr 1fr; }
    .cifras dd { font-size: 1.2rem; }
}
