/* ContaPiloto · Professional User
   Diseño sencillo, con buen contraste y foco visible para uso con teclado y lector de pantalla. */
:root {
    --verde: #1f7a2e;
    --verde-oscuro: #145220;
    --gris: #f3f5f3;
    --borde: #c9d1c9;
    --texto: #1b1f1b;
    --rojo: #a4161a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; color: var(--texto); background: #fff; line-height: 1.5; }
a { color: var(--verde-oscuro); }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }

.saltar { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.saltar:focus { left: 1rem; }

.encabezado { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
              padding: .75rem 1.5rem; background: var(--verde); color: #fff; }
.marca { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
.logo { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
        background: #fff; color: var(--verde); font-weight: 700; }
.sesion { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.boton-enlace { background: none; border: 1px solid #fff; color: #fff; padding: .2rem .7rem; border-radius: 4px; cursor: pointer; }
.boton-enlace { font: inherit; font-size: .95rem; line-height: normal; }
a.boton-enlace { text-decoration: none; display: inline-block; }
.boton-enlace:focus-visible { outline: 3px solid #ffd54f; outline-offset: 2px; }

.menu { background: var(--gris); border-bottom: 1px solid var(--borde); }
.menu ul { list-style: none; margin: 0; padding: 0 1.5rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.menu a { display: inline-block; padding: .6rem 0; font-weight: 600; text-decoration: none; }
.menu a:hover { text-decoration: underline; }

main { padding: 1.25rem 1.5rem 3rem; max-width: 1200px; }
h1 { font-size: 1.6rem; margin-top: .5rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }

.aviso { padding: .75rem 1rem; border-radius: 4px; margin-bottom: 1rem; border-left: 5px solid; }
.aviso.exito { background: #e8f5e9; border-color: var(--verde); }
.aviso.error { background: #fdecea; border-color: var(--rojo); }
.aviso.importante { background: #fff8e1; border-color: #f0a500; }

.formulario { background: var(--gris); border: 1px solid var(--borde); border-radius: 6px; padding: 1rem; margin: 1rem 0; }
.formulario.angosto { max-width: 420px; }
.formulario.en-linea, form.en-linea { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
form.en-linea { background: none; border: 0; padding: 0; margin: 0 .25rem 0 0; }
.fila-campos { display: flex; flex-wrap: wrap; gap: 1rem; }
/* Los filtros que no usa el reporte elegido se ocultan con el atributo hidden */
[hidden] { display: none !important; }
.campo { display: flex; flex-direction: column; margin-bottom: .75rem; min-width: 180px; }
.campo.ancho { flex: 1; min-width: 260px; }
.campo.casilla { flex-direction: row; align-items: center; gap: .5rem; }
label { font-weight: 600; }
input, select { font: inherit; padding: .4rem .5rem; border: 1px solid #8a948a; border-radius: 4px; background: #fff; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
input.token { width: 100%; font-family: Consolas, monospace; }

button, .boton { font: inherit; font-weight: 600; background: var(--verde); color: #fff; border: 0; border-radius: 4px;
                 padding: .45rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .boton:hover { background: var(--verde-oscuro); }
button.peligro { background: var(--rojo); }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
caption { text-align: left; font-weight: 600; padding: .4rem 0; }
th, td { border: 1px solid var(--borde); padding: .35rem .5rem; text-align: left; vertical-align: top; }
thead th { background: var(--gris); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.agrupacion td { font-weight: 600; background: #fafbfa; }
tr.total td, tr.total th { font-weight: 700; background: var(--gris); }
.nivel-2 { padding-left: 1.5rem; } .nivel-3 { padding-left: 3rem; } .nivel-4 { padding-left: 4.5rem; }
.nivel-5, .nivel-6 { padding-left: 6rem; }
table.lineas input { width: 100%; min-width: 90px; }

dl.datos { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
dl.datos dt { font-weight: 600; }
dl.datos dd { margin: 0; }

.pie { border-top: 1px solid var(--borde); padding: 1rem 1.5rem; color: #555; font-size: .9rem; }



fieldset { border: 1px solid var(--borde); border-radius: 4px; padding: .5rem 1rem; }
legend { font-weight: 600; padding: 0 .3rem; }
small { color: #444; }

/* Texto solo para lectores de pantalla */
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Indicador mientras se procesa una acción */
html.cargando, html.cargando * { cursor: progress !important; }
html.cargando main { opacity: .7; transition: opacity .15s; }

/* ---- Portal: filtro, indicadores y gráficos ---- */
.filtro .lista-casillas { max-height: 14rem; overflow-y: auto; min-width: 280px; }
.filtro .lista-casillas .campo { margin-bottom: .2rem; }
.botones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.resumen-filtro { color: #333; }
.indicadores { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.indicador { border: 1px solid var(--borde); border-radius: 6px; padding: .6rem .8rem; background: #fcfcfb; }
.indicador p { margin: 0; }
.indicador-nombre { font-weight: 600; color: #333; }
.indicador-valor { font-size: 1.4rem; font-weight: 700; }
.indicador-comparado { font-size: .9rem; color: #52514e; }
.bloque-grafico { margin-top: 1.5rem; }
.grafico { position: relative; height: 320px; max-width: 1100px; }
.grafico.alto { height: 460px; }
details { margin: .5rem 0 1rem; }
summary { cursor: pointer; font-weight: 600; color: var(--verde-oscuro); }
table.estado th[scope=row] { font-weight: normal; }
table.estado tr.total th[scope=row] { font-weight: 700; }

@media print {
    .encabezado, .menu, .pie, form, .saltar, summary { display: none !important; }
    main { padding: 0; max-width: none; }
    details > *:not(summary) { display: block; }
    .grafico { height: 260px; page-break-inside: avoid; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; }
}

/* ---- Detalle desplegado de un monto ---- */
a.monto { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
a.monto:hover { color: var(--verde); text-decoration-style: solid; }
tr.abierta > td, tr.abierta > th { background: #e6f2e7; font-weight: 600; }
tr.fila-detalle > td { padding: .5rem 1rem 1rem; background: #fbfdfb; border-left: 4px solid var(--verde); }
.detalle-movimientos h3 { margin: .25rem 0; font-size: 1.05rem; }
.detalle-movimientos table { font-size: .95rem; }
