:root {
    --marca: #1e3a5f;
    --marca-oscuro: #142a46;
    --marca-claro: #e8eef6;
    --oro: #c9a227;
    --oro-oscuro: #a8861c;
    --fondo: #f4f6f9;
    --borde: #e2e8f0;
    --texto-suave: #64748b;
}

body { background: var(--fondo); font-size: .925rem; }
.bg-marca { background: var(--marca) !important; }
.text-oro { color: var(--oro) !important; }
.btn-marca { background: var(--marca); border-color: var(--marca); color: #fff; }
.btn-marca:hover, .btn-marca:focus { background: var(--marca-oscuro); border-color: var(--marca-oscuro); color: #fff; }
.btn-oro { background: var(--oro); border-color: var(--oro); color: #1b1b1b; font-weight: 600; }
.btn-oro:hover, .btn-oro:focus { background: var(--oro-oscuro); border-color: var(--oro-oscuro); color: #fff; }
.buscador { width: min(420px, 40vw); }
.aviso-demo { background: #fff7e0; color: #7a5b00; font-size: .8rem; padding: .3rem 1rem; border-bottom: 1px solid #f1e2b3; }

/* ------------------------------------------------ Menú lateral */
.sidebar { width: 230px; min-height: calc(100vh - 48px); background: #fff; border-right: 1px solid var(--borde); }
@media (min-width: 992px) { .sidebar { flex: 0 0 230px; width: 230px; position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; } }
.sidebar .nav-link { color: #334155; padding: .45rem 1rem; display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: #f1f5f9; }
.sidebar .nav-link.active { background: var(--marca-claro); color: var(--marca); border-left-color: var(--oro); font-weight: 600; }
.sidebar .nav-titulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); padding: .9rem 1rem .25rem; }
.contenido { min-width: 0; }

/* ------------------------------------------------ Login */
.bg-login { background: linear-gradient(135deg, var(--marca) 0%, #0b1a2c 100%); }
.login-card { width: 100%; max-width: 380px; border: 0; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--marca-claro); color: var(--marca); display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; }

/* ------------------------------------------------ Indicadores y tablas */
.kpi { border: 1px solid var(--borde); border-radius: .6rem; background: #fff; padding: 1rem; height: 100%; }
.kpi .valor { font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .etiqueta { color: var(--texto-suave); font-size: .8rem; }
.kpi.rojo .valor { color: #b91c1c; }
.kpi.verde .valor { color: #15803d; }
.card { border-color: var(--borde); }
.card-header { background: #fff; font-weight: 600; }
.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); font-weight: 600; background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila-link { cursor: pointer; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; letter-spacing: .02em; }
.dato small { display: block; color: var(--texto-suave); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.progreso { height: 8px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.progreso > div { height: 100%; background: #16a34a; }
.tr-vencida td { background: #fef2f2 !important; }
.tr-pagada td { color: var(--texto-suave); }

/* ------------------------------------------------ Documentos imprimibles (contrato, recibo, estado de cuenta) */
.hoja { background: #fff; max-width: 820px; margin: 1.5rem auto; padding: 2.5rem 3rem; box-shadow: 0 4px 20px rgba(15, 23, 42, .08); font-family: Georgia, 'Times New Roman', serif; font-size: 12pt; line-height: 1.55; color: #111; }
.hoja h1 { font-size: 14pt; text-align: center; font-weight: 700; margin-bottom: 1.25rem; text-transform: uppercase; }
.hoja p { text-align: justify; margin-bottom: .8rem; }
.hoja .membrete { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; border-bottom: 2px solid var(--marca); padding-bottom: .6rem; margin-bottom: 1.25rem; font-family: 'Segoe UI', Arial, sans-serif; font-size: 10pt; }
.hoja .membrete img { max-height: 60px; max-width: 200px; }
.hoja table.cronograma, .hoja table.detalle { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: 10.5pt; font-family: 'Segoe UI', Arial, sans-serif; }
.hoja table.cronograma th, .hoja table.cronograma td, .hoja table.detalle th, .hoja table.detalle td { border: 1px solid #cbd5e1; padding: .3rem .5rem; }
.hoja table.cronograma th, .hoja table.detalle th { background: #f1f5f9; text-align: left; }
.hoja tr.total td { font-weight: 700; background: #f8fafc; }
.hoja .firmas { display: flex; justify-content: space-around; margin-top: 4.5rem; text-align: center; font-size: 10.5pt; gap: 2rem; }
.hoja .firmas div { border-top: 1px solid #111; padding-top: .35rem; min-width: 230px; }
.barra-imprimir { max-width: 820px; margin: 1rem auto 0; display: flex; gap: .5rem; justify-content: flex-end; }
.recibo { max-width: 560px; font-family: 'Segoe UI', Arial, sans-serif; font-size: 10.5pt; }
.recibo .monto-grande { font-size: 20pt; font-weight: 700; text-align: center; border: 2px solid var(--marca); border-radius: .5rem; padding: .5rem; margin: .75rem 0; }
@media print {
    body { background: #fff; }
    .barra-imprimir, .no-imprimir { display: none !important; }
    .hoja { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    @page { margin: 2cm; }
}
