/* Reclamación CAV — encima de Bootstrap 5.3 (modo claro y oscuro con data-bs-theme). */

:root { --ancho-lateral: 240px; --alto-inferior: 62px; }
[data-bs-theme="dark"] { --bs-body-bg: #12161c; --fondo-tarjeta: #1b2129; --fondo-cabecera: #232b35; }
[data-bs-theme="light"] { --bs-body-bg: #f3f5f8; --fondo-tarjeta: #ffffff; --fondo-cabecera: #eaf0f7; }

body { font-size: 0.95rem; }

/* ---------- Estructura: menú lateral, barra superior y barra inferior ---------- */
.lateral { position: fixed; inset: 0 auto 0 0; width: var(--ancho-lateral); background: var(--fondo-tarjeta);
    border-right: 1px solid var(--bs-border-color); padding: 1rem .75rem; z-index: 1030; }
.lateral .marca { font-weight: 700; font-size: 1.1rem; color: var(--bs-body-color); text-decoration: none; padding: .25rem .75rem 1rem; }
.lateral .marca i { color: var(--bs-primary); }
.lateral .nav-link { color: var(--bs-body-color); border-radius: .5rem; padding: .55rem .75rem; margin-bottom: 2px; }
.lateral .nav-link i { width: 1.4rem; display: inline-block; color: var(--bs-secondary-color); }
.lateral .nav-link:hover { background: var(--bs-tertiary-bg); }
.lateral .nav-link.active { background: var(--bs-primary); color: #fff; }
.lateral .nav-link.active i { color: #fff; }
.pie-lateral { border-top: 1px solid var(--bs-border-color); padding: .75rem .5rem 0; }

.superior { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
    backdrop-filter: blur(6px); border-bottom: 1px solid var(--bs-border-color); padding: .5rem 1rem; }
[data-bs-theme="dark"] .icono-claro, [data-bs-theme="light"] .icono-oscuro { display: none; }

.contenido { min-height: 100vh; }
@media (min-width: 992px) { body.con-menu .contenido { margin-left: var(--ancho-lateral); } }
main { max-width: 1280px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
main.sin-menu { max-width: 420px; }
@media (max-width: 991.98px) { body.con-menu main { padding-bottom: calc(var(--alto-inferior) + 1.5rem); } }

.inferior { position: fixed; inset: auto 0 0 0; height: var(--alto-inferior); display: flex; z-index: 1030;
    background: var(--fondo-tarjeta); border-top: 1px solid var(--bs-border-color); padding-bottom: env(safe-area-inset-bottom); }
.inferior a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: var(--bs-secondary-color); font-size: .72rem; }
.inferior a i { font-size: 1.3rem; }
.inferior a.active { color: var(--bs-primary); }

/* ---------- Títulos y textos ---------- */
h1 { font-size: 1.45rem; font-weight: 700; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 .6rem; color: var(--bs-primary-text-emphasis); }
.nota { color: var(--bs-secondary-color); font-size: .85rem; }

/* ---------- Tarjetas ---------- */
.tarjeta { background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); border-radius: .75rem;
    padding: 1rem 1.15rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.cifra { background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .8rem 1rem;
    color: var(--bs-secondary-color); font-size: .85rem; }
.cifra b { display: block; font-size: 1.35rem; margin-top: .2rem; color: var(--bs-body-color); }
.login { margin-top: 12vh; }

/* ---------- Tablas ---------- */
table.datos { width: 100%; border-collapse: collapse; }
table.datos th, table.datos td { padding: .45rem .6rem; border-bottom: 1px solid var(--bs-border-color); text-align: left; vertical-align: middle; }
table.datos th { background: var(--fondo-cabecera); font-weight: 600; white-space: nowrap; font-size: .85rem; }
table.datos tr:hover td { background: color-mix(in srgb, var(--bs-primary) 5%, transparent); }
table.datos td.n, table.datos th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.datos tr.total td { font-weight: 700; border-top: 2px solid var(--bs-border-color); background: var(--fondo-cabecera); }
.positivo { color: var(--bs-danger-text-emphasis); font-weight: 600; }
.negativo { color: var(--bs-success-text-emphasis); font-weight: 600; }

/* ---------- Botones (las vistas usan .boton y <button>) ---------- */
.botones { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; align-items: center; }
.boton, main button:not(.btn):not(.btn-close) {
    display: inline-flex; align-items: center; gap: .35rem; background: var(--bs-primary); color: #fff;
    border: 1px solid var(--bs-primary); border-radius: .5rem; padding: .45rem .9rem; font-size: .9rem;
    cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.3; }
.boton:hover, main button:not(.btn):not(.btn-close):hover { filter: brightness(1.1); color: #fff; }
.boton.sec, main button.sec { background: transparent; color: var(--bs-primary-text-emphasis); border-color: var(--bs-primary-border-subtle); }
.boton.sec:hover, main button.sec:hover { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.boton.peligro, main button.peligro { background: var(--bs-danger); border-color: var(--bs-danger); }
.boton.peq, main button.peq { padding: .2rem .55rem; font-size: .8rem; }
form.enlinea { display: inline; }

/* ---------- Formularios ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem 1rem; }
.campo label { display: block; font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .25rem; }
.campo input, .campo select, .campo textarea, table input {
    width: 100%; padding: .4rem .6rem; font-size: .95rem; font-family: inherit; color: var(--bs-body-color);
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .45rem; }
.campo select { appearance: auto; }
.campo input:focus, .campo select:focus, .campo textarea:focus, table input:focus {
    outline: 0; border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25); }
.campo input[readonly], table input[readonly] { opacity: .7; }
.columnas { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pegado { position: sticky; top: 4.25rem; }
@media (max-width: 991.98px) { .columnas { grid-template-columns: 1fr; } .pegado { position: static; } }

/* ---------- Etiquetas de estado ---------- */
.estado { display: inline-block; font-size: .75rem; padding: .15rem .55rem; border-radius: 1rem;
    background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border: 1px solid var(--bs-warning-border-subtle); }
.estado.revisado { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: var(--bs-success-border-subtle); }

.cabecera-impresion td { padding: .1rem 1rem .1rem 0; }
.solo-impresion { display: none; }

/* ---------- Impresión (siempre en claro, sin menús) ---------- */
/* ---------- Rejilla del cuadrante ---------- */
.cuadricula-caja { overflow: auto; max-height: 75vh; }
.cuadricula { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.cuadricula th, .cuadricula td { border-bottom: 1px solid var(--bs-border-color); border-right: 1px solid var(--bs-border-color); padding: 2px; }
.cuadricula thead th { position: sticky; top: 0; background: var(--fondo-cabecera); z-index: 2; text-align: center; font-weight: 600; line-height: 1.1; }
.cuadricula .fija { position: sticky; background: var(--fondo-tarjeta); z-index: 1; }
.cuadricula thead .fija { z-index: 3; background: var(--fondo-cabecera); }
.cuadricula .f1 { left: 0; width: 230px; min-width: 230px; }
.cuadricula .f1 .form-control, .cuadricula .f1 .form-select { width: 222px; }
.cuadricula .f1 .form-control, .cuadricula .f1 .form-select { font-size: .78rem; padding: .1rem .35rem; margin-bottom: 2px; }
.cuadricula select.sin { border-color: var(--bs-warning); }
.cuadricula th.dia { min-width: 40px; }
.cuadricula th.domingo { color: var(--bs-danger); }
.cuadricula th.festivo { box-shadow: inset 0 -3px 0 var(--bs-warning); }
.cuadricula td.dia-c { padding: 1px; }
.cuadricula td.res { text-align: center; min-width: 38px; font-variant-numeric: tabular-nums; }
.cuadricula th.res { min-width: 38px; font-size: .72rem; }
input.celda { width: 38px; height: 26px; text-align: center; font-weight: 700; font-size: .78rem; text-transform: uppercase;
    border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--bs-body-color); padding: 0; }
input.celda:focus { outline: 2px solid var(--bs-primary); }
input.celda.duda { border: 2px solid var(--bs-danger); }
input.celda.mala { background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(220,53,69,.35) 4px 6px); }
.k-e  { background: #3d3d3d !important; color: #f0d58a !important; }
.k-v  { background: #2e8b47 !important; color: #fff !important; }
.k-bm { background: #f3d6dc !important; color: #222 !important; }
.k-lm { background: #f5e04a !important; color: #222 !important; }
.k-sm { background: #5b8fd6 !important; color: #fff !important; }
.k-m  { background: #f3e2a4 !important; color: #222 !important; }
.k-a  { background: #f2c4b0 !important; color: #222 !important; }
input.celda.h4 { background-image: linear-gradient(to top right, transparent 47%, currentColor 48%, currentColor 52%, transparent 53%); }
.celda-muestra { display: inline-block; min-width: 2.2rem; text-align: center; font-weight: 700; border-radius: 3px;
    border: 1px solid var(--bs-border-color); padding: 0 .2rem; }
.celda-muestra.duda { border: 2px solid var(--bs-danger); }
.celda-muestra.k-t4h { background-image: linear-gradient(to top right, transparent 47%, currentColor 48%, currentColor 52%, transparent 53%); }

@media print {
    @page { size: A4; margin: 15mm; }
    body { font-size: 10.5pt; background: #fff !important; }
    .lateral, .superior, .inferior, .offcanvas, .botones, .alert, .no-imprimir { display: none !important; }
    body.con-menu .contenido { margin-left: 0 !important; }
    main { max-width: none; padding: 0 !important; }
    .tarjeta { border: 0; box-shadow: none; padding: 0; margin-bottom: 6mm; background: #fff; }
    .columnas { display: block; }
    .solo-impresion { display: block; }
    table.datos th { background: #e9ecef !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table.datos th, table.datos td { border: 1px solid #999; padding: 2px 5px; }
    .positivo, .negativo { color: #000; }
}
