
/* =====================================================
   BOLETAS CyF | DISEÑO GENERAL
   Ciclo escolar 2026-2027
   ===================================================== */

:root {
    --navy: #183153;
    --blue: #245b86;
    --blue-light: #eaf2f9;
    --gold: #d5a84f;
    --bg: #f3f6fa;
    --white: #ffffff;
    --text: #253246;
    --muted: #718096;
    --border: #e0e6ee;
    --success: #17643b;
    --danger: #a32828;
    --radius: 13px;
    --shadow: 0 4px 16px rgba(24,49,83,.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* =====================================================
   BARRA SUPERIOR
   ===================================================== */

.topbar {
    min-height: 78px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    gap: 18px;
    position: relative;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand strong {
    display: block;
    color: var(--navy);
    font-size: 17px;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--navy);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 22px;
    border: 3px solid var(--gold);
    margin: 0 auto 16px;
}

.brand-mark.mini {
    width: 43px;
    height: 43px;
    font-size: 16px;
    border-radius: 12px;
    margin: 0;
}

.userbox {
    font-size: 13px;
    color: var(--muted);
}

.userbox a {
    color: var(--blue);
    font-weight: 700;
    margin-left: 12px;
    text-decoration: none;
}

/* =====================================================
   ESTRUCTURA PRINCIPAL
   ===================================================== */

.layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    min-height: calc(100vh - 78px);
}

.sidebar {
    background: var(--navy);
    padding: 24px 13px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar a {
    padding: 13px 15px;
    color: #d8e2ef;
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    transition: .2s ease;
}

.sidebar a:hover,
.sidebar a.active {
    background: #2d4a70;
    color: white;
}

.content {
    padding: 30px;
    max-width: 1550px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

/* =====================================================
   ENCABEZADOS
   ===================================================== */

h1 {
    margin: 0 0 15px;
    color: var(--navy);
    font-size: 28px;
    line-height: 1.3;
}

h2 {
    color: var(--navy);
    margin: 0 0 17px;
    font-size: 20px;
}

h3 {
    color: var(--navy);
    font-size: 16px;
    margin: 22px 0 12px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--gold);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

/* =====================================================
   TARJETAS Y ESTADÍSTICAS
   ===================================================== */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat b {
    display: block;
    color: var(--navy);
    font-size: 30px;
    margin-top: 10px;
}

/* =====================================================
   BOTONES
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: white;
    border: 0;
    border-radius: 9px;
    padding: 12px 18px;
    min-height: 42px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: .2s ease;
}

.btn:hover {
    background: var(--navy);
    transform: translateY(-1px);
}

.full {
    width: 100%;
    margin-top: 18px;
}

button {
    font-family: inherit;
}

/* =====================================================
   FORMULARIOS
   ===================================================== */

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    font-weight: 650;
    color: #42526a;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #d7dee8;
    border-radius: 9px;
    font: inherit;
    font-weight: 400;
    color: var(--text);
    background: white;
    transition: border-color .2s, box-shadow .2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36,91,134,.12);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-form .wide {
    grid-column: 1 / -1;
}

.grid-form button {
    justify-self: start;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(170px, 1fr) auto;
    align-items: end;
    gap: 17px;
}

.filter-form label {
    min-width: 0;
}

.stack-form {
    max-width: 500px;
    display: grid;
    gap: 16px;
}

/* =====================================================
   MENSAJES
   ===================================================== */

.notice {
    padding: 13px 16px;
    border-radius: 9px;
    margin: 12px 0 20px;
    font-size: 14px;
}

.success {
    background: #e8f7ee;
    color: var(--success);
}

.error {
    background: #fff0f0;
    color: var(--danger);
}

.warning {
    background: #fff7e3;
    color: #815b0c;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
}

/* =====================================================
   TABLAS GENERALES
   ===================================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 18px 0;
    background: white;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    background: white;
}

th,
td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background: #f1f5f9;
    color: #40516a;
    font-size: 12px;
    font-weight: 750;
}

td {
    line-height: 1.5;
}

tbody tr:hover {
    background: #f8fbfe;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   CAPTURA DE CALIFICACIONES
   ===================================================== */

.content .card:has(.table-wrap) {
    overflow: hidden;
}

.table-wrap table {
    min-width: 900px;
}

/* Encabezados de captura */

.table-wrap th {
    padding: 15px 13px;
    background: #edf3f8;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: .35px;
    font-size: 11px;
    border-bottom: 2px solid #dce5ee;
}

/* Celdas de captura */

.table-wrap td {
    padding: 15px 13px;
    vertical-align: middle;
}

/* Calificaciones */

.table-wrap input[type="number"] {
    min-width: 75px;
    max-width: 110px;
    min-height: 43px;
    text-align: center;
    font-size: 16px;
    font-weight: 750;
    color: var(--navy);
    border-radius: 9px;
}

/* Selectores de comentarios */

.table-wrap select {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 9px;
    background-color: white;
    cursor: pointer;
}

/* Comentarios largos */

.table-wrap td select {
    white-space: normal;
}

.table-wrap textarea {
    min-height: 85px;
    line-height: 1.5;
    font-size: 13px;
}

/* Información secundaria */

.table-wrap small {
    display: inline-block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

/* Separación entre controles */

.table-wrap label {
    gap: 7px;
    margin-bottom: 8px;
}

/* Botones de guardar */

.content button[type="submit"] {
    margin-top: 8px;
}

/* =====================================================
   LOGIN
   ===================================================== */

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #edf3f9, #f8f5ed);
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 12px 35px rgba(24,49,83,.10);
}

.login-card h1 {
    text-align: center;
    font-size: 25px;
}

.login-card .muted {
    text-align: center;
}

.login-card form {
    display: grid;
    gap: 12px;
    margin-top: 26px;
}

.login-card label {
    margin-top: 3px;
}

.login-card .small {
    text-align: center;
    margin-top: 22px;
}

/* =====================================================
   BOLETAS E INFORMES
   ===================================================== */

.report {
    background: white;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 18px;
}

.report-head {
    display: flex;
    gap: 18px;
    align-items: center;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 18px;
}

.report-head .seal {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--navy);
    border: 3px solid var(--gold);
    color: white;
    font-weight: 800;
    font-size: 21px;
}

.report-head h2 {
    margin: 0 0 7px;
    font-size: 17px;
}

.report-head h3 {
    margin: 0 0 5px;
}

.report-head p {
    font-size: 12px;
    margin: 0;
    color: var(--muted);
}

.student-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 18px 0;
    font-size: 12px;
}

.report table {
    margin-bottom: 20px;
}

.signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin: 50px 25px 20px;
    text-align: center;
    font-size: 12px;
}

.signatures div {
    border-top: 1px solid #333;
    padding-top: 9px;
}

.print-actions {
    text-align: right;
    margin: 18px 0;
}

/* =====================================================
   TABLETAS
   ===================================================== */

@media (max-width: 1000px) {

    .layout {
        grid-template-columns: 195px minmax(0, 1fr);
    }

    .content {
        padding: 22px;
    }

    .filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .filter-form button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* =====================================================
   MÓVILES
   ===================================================== */

@media (max-width: 800px) {

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        gap: 6px;
    }

    .sidebar a {
        white-space: nowrap;
        padding: 11px 13px;
    }

    .content {
        padding: 16px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .grid-form .wide {
        grid-column: auto;
    }

    .topbar {
        padding: 12px;
    }

    .brand small {
        display: none;
    }

    .userbox {
        font-size: 11px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-form button {
        grid-column: auto;
        width: 100%;
    }

    .report {
        padding: 15px;
    }

    .report-head h2 {
        font-size: 14px;
    }

    .table-wrap table {
        min-width: 900px;
    }
}

@media (max-width: 520px) {

    h1 {
        font-size: 23px;
    }

    h2 {
        font-size: 18px;
    }

    .card {
        padding: 16px;
    }

    .login-card {
        padding: 23px;
    }

    .signatures {
        gap: 25px;
        margin: 35px 5px 15px;
    }
}

/* =====================================================
   IMPRESIÓN DE BOLETAS
   ===================================================== */

@media print {

    body {
        background: white;
    }

    .topbar,
    .sidebar,
    .content > h1,
    .content > .card,
    .content > .notice,
    .print-actions,
    footer {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .report {
        border: 0;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }

    .report table {
        font-size: 10px;
    }

    .report th,
    .report td {
        padding: 7px;
    }

    .report-head {
        break-after: avoid;
    }

    .report h3 {
        break-after: avoid;
    }

    .signatures {
        break-inside: avoid;
    }
}
