:root {
    --mat-primary: #492A93;
    --mat-primary-dark: #3a2274;
    --mat-primary-soft: #f1edfa;
    --mat-yellow: #FACC15;
    --mat-yellow-soft: #fff8d9;
    --mat-blue-soft: #ABC0EC;
    --mat-bg: #EFF2F5;
    --mat-text: #2d3436;
    --mat-muted: #667085;
    --mat-border: #dfe4ec;
    --mat-radius: 12px;
    --mat-shadow: 0 6px 22px rgba(45, 52, 54, .07);
}

* { box-sizing: border-box; }

body.matriculas-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--mat-bg);
    color: var(--mat-text);
    font-family: "Nunito", sans-serif;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6, .btn, .form-label, .navbar-brand, .nav-link {
    font-family: "Comfortaa", sans-serif;
}

.matriculas-header { position: sticky; top: 0; z-index: 1030; }
.matriculas-header .navbar {
    min-height: 72px;
    padding: .4rem 0;
    background: linear-gradient(110deg, rgba(250, 204, 21, .94), rgba(250, 204, 21, .72)), url('../img/navbarbg.png') center/cover;
    box-shadow: 0 3px 16px rgba(45, 52, 54, .12);
}

.matriculas-header .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--mat-primary);
    padding: .2rem 0;
}
.matriculas-header .navbar-brand img { width: 48px; height: 48px; object-fit: contain; }
.matriculas-header .navbar-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.matriculas-header .navbar-brand strong { font-size: .95rem; }
.matriculas-header .navbar-brand small { margin-top: .22rem; font: 600 .72rem "Nunito", sans-serif; letter-spacing: .03em; }
.matriculas-header .navbar-toggler { border: 1px solid var(--mat-primary); padding: .45rem .6rem; }
.matriculas-header .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23492A93' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
.matriculas-header .nav-link { color: var(--mat-primary) !important; font-size: .78rem; font-weight: 700; padding: .55rem .7rem !important; border-radius: 8px; }
.matriculas-header .nav-link:hover, .matriculas-header .nav-link:focus { background: rgba(73, 42, 147, .11); }
.matriculas-header .nav-link i { margin-right: .25rem; }
.matriculas-header .nav-link-action { background: var(--mat-primary); color: #fff !important; }
.matriculas-header .nav-link-action:hover { background: var(--mat-primary-dark); color: #fff !important; }
.matriculas-header .nav-link-logout { font-family: "Nunito", sans-serif; font-weight: 600; }

.matriculas-main { flex: 1; padding: 2.5rem 0 4rem; }
.matriculas-page { width: min(100% - 2rem, 1100px); margin: 0 auto; }
.matriculas-page--narrow { max-width: 850px; }
.page-heading { margin-bottom: 1.75rem; }
.page-heading h1 { color: var(--mat-primary); font-size: clamp(1.45rem, 3vw, 2rem); margin-bottom: .4rem; }
.page-heading p { max-width: 720px; color: var(--mat-muted); margin: 0; }
.eyebrow { color: var(--mat-primary); font: 700 .73rem "Comfortaa", sans-serif; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .45rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--mat-primary); font-weight: 700; margin-bottom: .9rem; }
.back-link:hover { color: var(--mat-primary-dark); text-decoration: underline; }

.matriculas-shell .card { border: 1px solid var(--mat-border) !important; border-radius: var(--mat-radius) !important; box-shadow: var(--mat-shadow) !important; overflow: hidden; }
.matriculas-shell .card-body { padding: clamp(1.25rem, 3vw, 2rem); }
.matriculas-shell .card-footer { border-top: 1px solid var(--mat-border) !important; background: #fff !important; padding: 1rem clamp(1.25rem, 3vw, 2rem) !important; }
.matriculas-shell .card h2 { color: var(--mat-primary); font-size: 1.05rem; }
.matriculas-shell .table-responsive { border-radius: var(--mat-radius); }
.matriculas-shell .table { --bs-table-bg: #fff; color: var(--mat-text); }
.matriculas-shell .table thead th { background: var(--mat-primary); color: #fff; border: 0; font: 700 .72rem "Comfortaa", sans-serif; letter-spacing: .03em; padding: .85rem 1rem; white-space: nowrap; }
.matriculas-shell .table td { padding: .9rem 1rem; border-color: var(--mat-border); }
.matriculas-shell .table-hover tbody tr:hover { --bs-table-hover-bg: var(--mat-primary-soft); }
.matriculas-shell dt { color: var(--mat-muted); font-weight: 700; }
.matriculas-shell dd { color: var(--mat-text); }

.matriculas-shell .form-label { color: #3d4451; font-size: .8rem; font-weight: 700; margin-bottom: .4rem; }
.matriculas-shell .form-control, .matriculas-shell .form-select {
    min-height: 44px;
    border: 1px solid var(--mat-border);
    border-radius: 8px;
    color: var(--mat-text);
    background-color: #fff;
    padding: .62rem .8rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.matriculas-shell .form-control::placeholder { color: #98a2b3; }
.matriculas-shell .form-control:focus, .matriculas-shell .form-select:focus {
    border-color: var(--mat-primary);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, .32);
}
.matriculas-shell .form-check-input { border-color: #aab3c2; }
.matriculas-shell .form-check-input:checked { background-color: var(--mat-primary); border-color: var(--mat-primary); }
.matriculas-shell .form-check-input:focus { box-shadow: 0 0 0 3px rgba(250, 204, 21, .32); }
.matriculas-shell input[type="radio"]:not(.form-check-input), .matriculas-shell input[type="checkbox"]:not(.form-check-input) { accent-color: var(--mat-primary); width: 1rem; height: 1rem; margin-right: .25rem; }
.matriculas-shell .form-text { color: var(--mat-muted); }
.matriculas-shell .row.g-3 { --bs-gutter-y: 1.25rem; }

.matriculas-shell .btn { border-radius: 8px; font-size: .78rem; font-weight: 700; padding: .62rem 1rem; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.matriculas-shell .btn:hover { transform: translateY(-1px); }
.matriculas-shell .btn-primary { background: var(--mat-primary); border-color: var(--mat-primary); box-shadow: 0 3px 10px rgba(73, 42, 147, .16); }
.matriculas-shell .btn-primary:hover, .matriculas-shell .btn-primary:focus { background: var(--mat-primary-dark); border-color: var(--mat-primary-dark); }
.matriculas-shell .btn-outline-primary { color: var(--mat-primary); border-color: var(--mat-primary); }
.matriculas-shell .btn-outline-primary:hover, .matriculas-shell .btn-outline-primary:focus { color: #fff; background: var(--mat-primary); }
.matriculas-shell .btn-outline-secondary { color: #566070; border-color: #aeb7c5; }
.matriculas-shell .btn-outline-secondary:hover { color: var(--mat-text); background: var(--mat-yellow-soft); border-color: #d6ad08; }
.matriculas-shell .btn-outline-danger { color: #b42318; border-color: #e2a9a4; }
.matriculas-shell .btn-outline-danger:hover { color: #fff; background: #b42318; border-color: #b42318; }

.matriculas-shell .alert { border: 0; border-left: 4px solid currentColor; border-radius: 8px; box-shadow: 0 2px 8px rgba(45, 52, 54, .04); font-size: .9rem; }
.matriculas-shell .alert-warning { color: #806500; background: var(--mat-yellow-soft); }
.matriculas-shell .alert-success { color: #176b43; background: #e8f6ef; }
.matriculas-shell .alert-danger, .matriculas-shell .alert-error { color: #a62b24; background: #fcebea; }
.matriculas-shell .badge { border-radius: 999px; font-weight: 700; padding: .45rem .7rem; }

.form-section { border: 1px solid var(--mat-border) !important; border-radius: 8px; background: #fbfcfe; padding: 1.15rem; }
.form-section h3 { color: var(--mat-primary); font-size: .9rem; }
.form-section .form-control, .form-section .form-select { background: #fff; }
.matriculas-shell form > section.card { margin-bottom: 1.25rem !important; }
.matriculas-shell form > section.card h2 { border-left: 3px solid var(--mat-yellow); padding-left: .75rem; }
.matriculas-shell .border.rounded { border-color: var(--mat-border) !important; background: #fbfcfe; }

.matriculas-footer { padding: 1rem 0; color: var(--mat-muted); background: #fff; border-top: 1px solid var(--mat-border); font-size: .75rem; }

@media (max-width: 991.98px) {
    .matriculas-header .navbar-collapse { padding: .7rem 0 .35rem; }
    .matriculas-header .nav-link { margin-top: .15rem; }
}
@media (max-width: 767.98px) {
    .matriculas-main { padding-top: 1.5rem; }
    .matriculas-page { width: min(100% - 1.25rem, 1100px); }
    .page-heading .btn, .page-heading + .btn { width: 100%; }
    .matriculas-shell .card-body { padding: 1.15rem; }
    .matriculas-shell .card-footer { padding: 1rem 1.15rem !important; }
    .matriculas-footer .container { justify-content: center !important; text-align: center; }
    .matriculas-list .card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .matriculas-list .card-footer .btn {
        width: 100%;
    }
}
