:root { color-scheme: light; font-family: system-ui, sans-serif; color: #172335; background: #f3f5f9; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { padding: 1.1rem max(1rem, calc((100% - 65rem) / 2)); background: #172335; color: white; display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; align-items: baseline; }
header span { color: #d5dfea; }
main { max-width: 65rem; margin: 2rem auto; padding: 0 1rem; }
h1 { font-size: clamp(1.5rem, 4vw, 2.3rem); }
h2 { font-size: 1.15rem; }
label { display: grid; gap: .35rem; align-content: start; font-weight: 600; }
input, textarea, select, button { font: inherit; border-radius: .35rem; padding: .6rem .75rem; }
input, textarea, select { min-width: 0; border: 1px solid #8896a6; background: #fff; color: inherit; }
textarea { resize: vertical; }
button { border: 1px solid #194c83; background: #194c83; color: white; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: #194c83; }
nav, #campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
form, nav { background: white; padding: 1rem; border: 1px solid #d3dbe5; border-radius: .6rem; }
#acceso { max-width: 30rem; display: grid; gap: 1rem; }
#acceso h1 { margin: 0; }
.barra, .acciones { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.barra { margin-bottom: 1rem; }
.acciones { justify-content: flex-start; margin-top: 1rem; }
#ejemplo, #salir { color: #194c83; background: white; }
#mensaje:not(:empty) { border-left: .25rem solid #194c83; background: #e5effb; padding: .75rem; white-space: pre-wrap; }
#historial { list-style: none; padding: 0; }
#historial li { background: white; padding: .75rem; border-bottom: 1px solid #d3dbe5; }
summary { cursor: pointer; white-space: pre-wrap; }
dt { font-weight: 600; }
dd { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .5rem; }
.enlace-cliente-web { font-weight: 700; }
#cliente-windows { margin-top: 1.5rem; }
#cliente-windows form { margin-top: .75rem; }
#modulos-alta { max-height: 14rem; overflow: auto; }
#modulos-alta label { display: flex; align-items: center; }
#clientes-consolidados { margin: 1.5rem 0; }
#clientes-ficha > label { max-width: 32rem; }
.consultas-tabla { overflow-x: auto; }
.consultas-tabla table { border-collapse: collapse; width: 100%; background: #fff; }
.consultas-tabla th, .consultas-tabla td { padding: .5rem .65rem; text-align: left; border-bottom: 1px solid #aaa; }
.consultas-tabla td { vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
.balance-detalle { max-height: 32rem; overflow: auto; margin: 1rem 0; }
.balance-detalle th { position: sticky; top: 0; background: #e5effb; z-index: 1; }
.balance-detalle select { min-width: 12rem; }
#filas-excel input { width: 100%; }
.flujo-procesos { display: flex; gap: 1.75rem; list-style: none; padding: .25rem; flex-wrap: wrap; align-items: stretch; }
.flujo-procesos > li { position: relative; border: 1px solid #d3dbe5; border-radius: .55rem; padding: .75rem; flex: 1 1 12rem; }
.flujo-procesos > li:not(:last-child)::after { content: '→'; position: absolute; right: -1.4rem; top: .75rem; color: #344763; }
.flujo-procesos h3 { margin-top: 0; }
.flujo-procesos .proceso-verde { background: #edf8ef; color: #124b2a; border-color: #70a984; }
.flujo-procesos .proceso-amarillo { background: #fff5d2; color: #5d4000; border-color: #b2873a; }
.flujo-procesos .proceso-rojo { background: #fceceb; color: #801d21; border-color: #cc8589; }
.flujo-procesos .proceso-gris { background: #eef1f4; color: #364354; border-color: #a6afbc; }
.proceso-form-grid { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit,minmax(min(11rem,100%),1fr)); margin-block: .7rem; }
.proceso-form-grid details { grid-column: 1 / -1; }
.grafico-pronostico { margin: .65rem 0; min-width: 0; }
.grafico-pronostico canvas { display: block; width: min(100%,35rem); height: auto; background: #fff; border: 1px solid #c9d4e2; }
.grafico-pronostico figcaption { margin-top: .3rem; }
#procesos-panel > section { margin-block: 1rem; }
#procesos-panel button { margin: .25rem .35rem .25rem 0; }
#registro-mejora:empty { display: none; }
#registro-mejora form, #registro-mejora form > details[open] { display: grid; gap: .6rem; }
#registro-mejora fieldset, #registro-mejora article { padding: .7rem; margin-block: .5rem; border: 1px solid #d3dbe5; }
#registro-mejora label:has(input[type="checkbox"]) { display: flex; align-items: baseline; }
#informe-gestion:empty { display: none; }
#informe-gestion article { margin-top: .65rem; border: 1px solid #d3dbe5; border-radius: .55rem; overflow-wrap: anywhere; }
@media (max-width: 600px) { .flujo-procesos { display: grid; } .flujo-procesos > li:not(:last-child)::after { content: '↓'; right: 1rem; top: auto; bottom: -1.5rem; } }
#filas-excel .origen-cifra { display: block; width: 100%; max-width: 12rem; margin-top: .35rem; }
#filas-excel [type="number"] { min-width: 5.5rem; }
#filas-excel [data-columna="curso"] { min-width: 9rem; }
#texto-fuente-educacion, .datos-revisados { white-space: pre-wrap; overflow-wrap: anywhere; }
#indicadores-excel meter { width: min(100%,24rem); }

.consulta-ia { margin-top: 1.75rem; padding: 1.1rem; background: #eaf2fa; border: 2px solid #4373a2; border-radius: .75rem; }
.consulta-ia h3 { margin-top: 0; }
.consulta-ia-privacidad { font-size: .9rem; color: #344763; }
.consulta-ia-ejemplos, .consulta-ia-acciones { display: flex; flex-wrap: wrap; gap: .55rem; margin: .65rem 0; }
.consulta-ia-ejemplos button, #finalizar-sin-ia, #reintentar-ia { color: #194c83; background: #fff; }
#form-consulta-ia { display: grid; gap: .65rem; padding: .85rem; }
#pregunta-ia { width: 100%; }
#estado-ia:not(:empty) { padding: .6rem .75rem; border-left: .25rem solid #4373a2; background: #fff; }
#estado-ia[data-error="true"] { border-left-color: #b13434; color: #702324; }
#historial-ia { margin: .75rem 0 0; padding-left: 1.5rem; }
#historial-ia li { margin: .65rem 0; padding: .7rem; background: #fff; border: 1px solid #d3dbe5; border-radius: .45rem; overflow-wrap: anywhere; }
#historial-ia .consulta-ia-turno { font-weight: 700; margin: 0 0 .35rem; }
#historial-ia p { white-space: pre-wrap; }

.consulta-modulo-ia { margin: 1.75rem 0; padding: 1.1rem; background: #eaf2fa; border: 2px solid #4373a2; border-radius: .75rem; }
.consulta-modulo-ia h2 { margin: 0; }
.consulta-modulo-ia p { overflow-wrap: anywhere; }
.consulta-modulo-nota { color: #344763; font-size: .92rem; }
.consulta-modulo-ejemplos, .consulta-modulo-acciones { display: flex; flex-wrap: wrap; gap: .55rem; margin: .65rem 0; }
.consulta-modulo-ejemplos button, #consulta-modulo-reintentar, #consulta-modulo-finalizar { color: #194c83; background: white; }
#consulta-modulo-form { display: grid; gap: .6rem; padding: .85rem; }
#consulta-modulo-pregunta { width: 100%; }
#consulta-modulo-estado:not(:empty) { padding: .6rem .75rem; border-left: .25rem solid #4373a2; background: #fff; white-space: pre-wrap; }
#consulta-modulo-estado[data-error="true"] { border-left-color: #b13434; color: #702324; }
#consulta-modulo-historial { margin: .75rem 0 0; padding-left: 1.5rem; }
#consulta-modulo-historial li { margin: .65rem 0; padding: .7rem; background: #fff; border: 1px solid #d3dbe5; border-radius: .45rem; overflow-wrap: anywhere; }
#consulta-modulo-historial p { margin-bottom: 0; white-space: pre-wrap; }

.documento-institucional { background: #fff; color: #171717; padding: 1.5rem; }
.documento-institucional h1, .documento-institucional h3 { margin: .35rem 0; }
.documento-institucional table { border-collapse: collapse; margin: 1.25rem 0; width: min(100%, 30rem); }
.documento-institucional th, .documento-institucional td {
  border-bottom: 1px solid #aaa; padding: .45rem .65rem; text-align: left;
}
.documento-institucional td { text-align: right; font-variant-numeric: tabular-nums; }
.documento-institucional a { color: inherit; }

@media print {
  body, header, header span, main, form, nav, #historial li, #mensaje:not(:empty) {
    background: #fff; color: #171717; border-color: #aaa;
  }
  body:has(#informe-horizonte:not([hidden])) > header,
  body:has(#informe-horizonte:not([hidden])) #piloto > :not(#resumen-openai),
  button, nav, form, .documento-institucional a, #estado-resumen, .consulta-modulo-ia { display: none !important; }
  main, .documento-institucional { margin: 0; max-width: none; padding: 0; }
  .documento-institucional tr { break-inside: avoid; }
}
