:root {
    --azul: #0345bf;
    --azul-oscuro: #023a9f;
    --azul-texto: #003aa6;
    --verde: #138522;
    --morado: #4312a8;
    --gris-fondo: #f5f6f8;
    --gris-inhabil: #eeeeee;
    --gris-borde: #dfe3e8;
    --texto: #111827;
    --blanco: #ffffff;
    --fuente: 'Inter', Arial, sans-serif;
    --sombra: 0 2px 8px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: #f7f8fa;
    color: var(--texto);
    font-family: var(--fuente);
    line-height: 1.35;
}
button, input { font: inherit; }
.contenedor { width: min(1360px, calc(100% - 48px)); margin: 0 auto; }

.barra-marca {
    height: 92px;
    background: var(--blanco);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #edf0f4;
}
.marca-contenido { display: flex; align-items: center; height: 100%; }
.marca-contenido img { width: 365px; max-width: 100%; height: auto; display: block; }

.barra-titulo {
    background: var(--azul);
    color: var(--blanco);
    padding: 18px 0 19px;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.15);
}
.barra-titulo h1 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.85rem);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.contenido-principal { padding: 14px 0 26px; }
.panel {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    box-shadow: var(--sombra);
}

.formulario-panel { padding: 17px 28px; }
.formulario {
    display: grid;
    grid-template-columns: auto 265px auto;
    align-items: center;
    justify-content: start;
    gap: 28px;
}
.formulario label { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.formulario input {
    width: 100%;
    height: 43px;
    padding: 8px 14px;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    background: #fff;
    color: #111;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.formulario input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(3,69,191,.12); }
.boton-calcular {
    height: 43px;
    min-width: 165px;
    padding: 0 22px;
    border: 0;
    border-radius: 5px;
    background: var(--azul);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(3,69,191,.24);
    transition: background .2s, transform .2s;
}
.boton-calcular:hover { background: var(--azul-oscuro); transform: translateY(-1px); }
.icono-boton { margin-right: 9px; font-size: 1.1rem; }
.alerta-error { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #efb4b4; background: #fff2f2; color: #a71616; border-radius: 6px; font-weight: 600; }

.resumen-panel {
    margin-top: 13px;
    padding: 16px 10px 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.resumen-item { text-align: center; padding: 0 22px; position: relative; }
.resumen-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: #e2e5ea;
}
.resumen-item h2 { margin: 0 0 7px; font-size: 1rem; font-weight: 800; }
.resumen-admision h2, .resumen-admision .fecha-principal { color: var(--azul-texto); }
.resumen-entrega h2, .resumen-entrega .fecha-principal { color: var(--verde); }
.resumen-prorroga h2, .resumen-prorroga .fecha-principal { color: var(--morado); }
.fecha-principal { display: flex; justify-content: center; align-items: center; gap: 9px; font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.fecha-principal span { font-size: 1.35rem; }
.resumen-item p { margin: 4px 0 0; font-size: .95rem; color: #222; }

.detalle-panel { margin-top: 13px; padding: 10px 14px 16px; }
.detalle-panel > h2 { margin: 0 0 8px 10px; color: var(--azul-texto); font-size: 1.05rem; font-weight: 800; }
.detalle-panel > h2 span { font-weight: 700; }
.tabla-contenedor { overflow-x: auto; border: 1px solid #d7dce3; border-radius: 5px; }
table { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 5px 12px; border-right: 1px solid #d7dce3; border-bottom: 1px solid #d7dce3; text-align: center; font-size: .88rem; line-height: 1.1; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th {
    background: var(--azul);
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    padding-top: 6px;
    padding-bottom: 6px;
    position: sticky;
    top: 0;
    z-index: 2;
}
th:nth-child(1) { width: 11%; }
th:nth-child(2) { width: 16%; }
th:nth-child(3) { width: 18%; }
th:nth-child(4) { width: 15%; }
th:nth-child(5) { width: 40%; }
td:last-child { text-align: left; }
.fila-habil { background: #fff; }
.fila-inhabil { background: var(--gris-inhabil); }
.fila-habil:hover { background: #f7fbff; }
.fila-inhabil:hover { background: #e6e6e6; }
.numero-dia { font-weight: 800; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 70px; padding: 2px 8px; border-radius: 6px; color: #fff; font-size: .78rem; font-weight: 800; line-height: 1.1; }
.badge-habil { background: var(--verde); }
.badge-habil span { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 5px; border-radius: 50%; background: #fff; color: var(--verde); font-size: .65rem; }
.badge-inhabil { background: #9ca3af; }

.nota-informativa {
    margin-top: 12px;
    min-height: 47px;
    padding: 11px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #d7e8ff;
    border-radius: 6px;
    background: #eaf4ff;
    color: #003da6;
}
.nota-icono { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: #1476e8; color: #fff; font-size: .8rem; font-weight: 800; }
.nota-informativa p { margin: 0; font-size: .9rem; }

@media (max-width: 900px) {
    .contenedor { width: min(100% - 24px, 1360px); }
    .barra-marca { height: 78px; }
    .marca-contenido img { width: 300px; }
    .formulario { grid-template-columns: 1fr; gap: 11px; }
    .formulario label { white-space: normal; }
    .boton-calcular { width: 100%; }
    .resumen-panel { grid-template-columns: 1fr; padding: 6px 16px; }
    .resumen-item { padding: 15px 10px; }
    .resumen-item:not(:last-child)::after { top: auto; left: 15%; right: 15%; bottom: 0; width: auto; height: 1px; }
}

@media (max-width: 560px) {
    .barra-marca { height: 70px; }
    .marca-contenido { justify-content: center; }
    .marca-contenido img { width: 270px; }
    .barra-titulo { padding: 14px 0; }
    .barra-titulo h1 { font-size: 1.55rem; }
    .formulario-panel { padding: 16px; }
    .fecha-principal { font-size: 1.35rem; }
    .detalle-panel { padding: 10px 8px 12px; }
    .detalle-panel > h2 { margin-left: 4px; font-size: .95rem; }
    .nota-informativa { align-items: flex-start; }
}

@media print {
    body { background: #fff; }
    .barra-marca, .barra-titulo, .boton-calcular { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .formulario-panel { display: none; }
    .contenido-principal { padding-top: 0; }
    .panel, .nota-informativa { box-shadow: none; }
    .fila-inhabil, th, .badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
