:root {
    --color-primary: #0b2a4a;
    --color-primary-light: #184a7d;
    --color-accent: #1e90ff;
    --color-bg: #f4f6fb;
    --color-sidebar: #071829;
    --color-sidebar-active: #102846;
    --color-sidebar-hover: #0f2139;
    --color-border-soft: #e1e5f0;
    --surface-raised: #ffffff;
    --surface-muted: #f8fafc;
    --text-strong: #0f172a;
    --text-muted: #64748b;
    --focus-ring: rgba(37, 99, 235, .14);
}

/* --------- Base --------- */

html, body {
    height: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--color-bg);
    color: #1d2433;
}

/* Suavizar cards */
.card {
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Tablas */
.table {
    border-color: var(--color-border-soft);
    font-size: 0.9rem;
}
.table > :not(caption) > * > * {
    padding-top: .65rem;
    padding-bottom: .65rem;
}
.table thead th {
    background: #f0f3fb;
    border-bottom-width: 1px;
    font-weight: 600;
    color: #4b5563;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border: none;
    box-shadow: 0 8px 20px rgba(11, 42, 74, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.5);
}
.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline-primary:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Formularios */
.form-control, .form-select {
    min-height: 2.75rem;
    border-radius: .72rem;
    border-color: #cbd5e1;
    background-color: #fff;
    color: #0f172a;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 .22rem var(--focus-ring);
}
.form-control::placeholder { color: #94a3b8; }
.form-control[readonly], .form-select:disabled {
    background-color: #f1f5f9;
    color: #475569;
}
.form-control-sm, .form-select-sm { min-height: 2.15rem; border-radius: .58rem; }
textarea.form-control { min-height: auto; }

/* --------- Sistema visual compartido para formularios --------- */
.app-page-header {
    position: relative;
    gap: 1rem;
    padding: .3rem .15rem .85rem;
    border-bottom: 1px solid #e2e8f0;
}
.app-page-header::after {
    content: '';
    position: absolute;
    left: .15rem;
    bottom: -1px;
    width: 3.5rem;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
}
.app-page-header .page-title {
    color: var(--text-strong);
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    font-weight: 780;
    letter-spacing: -.035em;
}
.app-page-header .text-muted { color: var(--text-muted) !important; }
.app-page-header > .btn,
.app-page-header > div:last-child .btn {
    min-height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border-radius: .72rem;
}

.app-form-card {
    overflow: visible;
    border: 1px solid #dbe3ee;
    border-radius: 1.05rem;
    background: var(--surface-raised);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .075);
}
.app-form-card::before {
    content: '';
    display: block;
    height: 4px;
    margin: -1px -1px 0;
    border-radius: 1.05rem 1.05rem 0 0;
    background: linear-gradient(90deg, #0b2a4a, #2563eb 55%, #38bdf8);
}
.app-form-card > .card-body { padding: clamp(1.15rem, 2.4vw, 2rem); }

.app-form {
    display: grid;
    gap: 1rem;
}
.app-form > .row {
    margin: 0;
    padding: 1rem 1rem .1rem;
    border: 1px solid #e5eaf1;
    border-radius: .9rem;
    background: linear-gradient(180deg, #fbfdff, #f8fafc);
}
.app-form > h4,
.app-form > h5,
.app-form > h6 {
    margin: .4rem 0 -.25rem;
    color: var(--text-strong);
    font-weight: 750;
    letter-spacing: -.015em;
}
.app-form .form-label {
    margin-bottom: .42rem;
    color: #334155;
    font-size: .79rem;
    font-weight: 700;
    letter-spacing: .012em;
}
.app-form .row > [class*="col-"] {
    display: flex;
    min-width: 0;
    flex-direction: column;
}
.app-form .row > [class*="col-"] > .form-label {
    display: flex;
    min-height: 2.25rem;
    align-items: flex-end;
}
.app-form .row > [class*="col-"] > .form-control,
.app-form .row > [class*="col-"] > .form-select {
    margin-top: auto;
}
.app-form .form-text,
.app-form small.text-muted {
    margin-top: .42rem;
    color: #64748b !important;
    font-size: .72rem;
    line-height: 1.45;
}
.app-form .form-check:not(.form-check-inline) {
    min-height: 2.75rem;
    padding: .65rem .8rem .65rem 2.45rem;
    border: 1px solid #dbe3ee;
    border-radius: .72rem;
    background: #f8fafc;
}
.app-form .form-check-input { margin-top: .18rem; }
.app-form .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}
.app-form .alert { border: 1px solid currentColor; border-radius: .8rem; }
.app-form > button[type="submit"],
.app-form > .d-flex:last-child .btn,
.app-form > .form-action-bar .btn {
    min-height: 2.75rem;
    padding-inline: 1.25rem;
    border-radius: .72rem;
    font-weight: 700;
}
.app-form .table-responsive {
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    background: #fff;
}
.app-form .table { margin-bottom: 0; }
.app-form-card .nav-tabs {
    gap: .35rem;
    padding: .3rem;
    border: 0;
    border-radius: .82rem;
    background: #eef2f7;
}
.app-form-card .nav-tabs .nav-link {
    color: #64748b;
    border: 0;
    border-radius: .62rem;
    font-size: .82rem;
    font-weight: 700;
}
.app-form-card .nav-tabs .nav-link.active {
    color: #1d4ed8;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .08);
}

/* Formularios de filtros y modales comparten la misma calidad visual. */
.card form[method="get"] .form-label,
.modal .form-label {
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
}
.app-main-inner .card-body > form:not(.app-form) > .row {
    margin-inline: 0;
    padding: .9rem .9rem 0;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #f8fafc;
}
.app-main-inner .card-body > form:not(.app-form) > .row + .row { margin-top: .85rem; }
.app-main-inner form:not(.app-form) .form-label {
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
}
.modal-content {
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, .8);
    border-radius: 1rem;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
}
.modal-header, .modal-footer { background: #f8fafc; border-color: #e2e8f0; }
.modal-title { color: #0f172a; font-weight: 760; letter-spacing: -.02em; }

/* --------- Finanzas --------- */
.finance-page { --fin-navy:#09294b; --fin-blue:#2563eb; --fin-ink:#172554; --fin-line:#dce5f0; }
.finance-hero { display:flex; align-items:center; justify-content:space-between; gap:1.25rem; padding:1.45rem 1.6rem; border-radius:1.15rem; color:#fff; background:radial-gradient(circle at 92% 16%, rgba(56,189,248,.34), transparent 28%),linear-gradient(118deg,#071d38,#0d3b70 61%,#145ca2); box-shadow:0 22px 42px rgba(8,42,76,.22); }
.finance-eyebrow { color:#5b7392; font-size:.7rem; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.finance-hero .finance-eyebrow { color:#a5dcff; }.finance-hero h3 { margin:.25rem 0 .25rem; font-size:1.8rem; font-weight:800; letter-spacing:-.035em; }.finance-hero p { margin:0; color:#d5e8fb; font-size:.88rem; }.finance-hero-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.55rem; }.finance-hero .btn-primary { background:#fff; color:#103d6d; box-shadow:none; }.finance-hero .btn-light { color:#123e6e; }
.finance-overview { display:grid; grid-template-columns:1.25fr repeat(3,1fr); gap:1rem; }.finance-balance-card,.finance-metric-card { min-height:126px; border:1px solid #e0e8f2; border-radius:1rem; background:#fff; box-shadow:0 12px 25px rgba(15,23,42,.055); }.finance-balance-card { padding:1.2rem 1.3rem; background:linear-gradient(135deg,#0a315d,#185697); color:#fff; border-color:transparent; }.finance-card-label { color:#6b7c93; font-size:.75rem; font-weight:750; letter-spacing:.035em; }.finance-balance-card .finance-card-label { color:#cfe6ff; }.finance-balance-value { margin:.25rem 0; font-size:1.72rem; font-weight:820; letter-spacing:-.045em; }.finance-card-help { color:#d5e8fb; font-size:.78rem; }.finance-metric-card { display:flex; align-items:center; gap:.75rem; padding:1rem; }.finance-metric-card strong { display:block; margin-top:.12rem; color:#132f53; font-size:1.05rem; }.finance-metric-card small { display:block; margin-top:.3rem; color:#718198; font-size:.75rem; }.finance-metric-icon { width:42px; height:42px; display:grid; place-items:center; flex:0 0 auto; border-radius:.82rem; font-size:1.18rem; }.finance-metric-icon.success { background:#e9f9ef;color:#168451; }.finance-metric-icon.danger { background:#fff0f0;color:#d44545; }.finance-metric-icon.warning { background:#fff7df;color:#b77900; }
.finance-cash-strip { display:grid; grid-template-columns:repeat(4,1fr); overflow:hidden; border:1px solid #e2eaf3; border-radius:.95rem; background:#fff; box-shadow:0 9px 22px rgba(15,23,42,.035); }.finance-cash-strip > div { padding:.85rem 1.1rem; border-right:1px solid #e7edf5; }.finance-cash-strip > div:last-child{border-right:0}.finance-cash-strip span{display:block;color:#718198;font-size:.73rem;font-weight:700}.finance-cash-strip strong{display:block;margin-top:.2rem;color:#16385f;font-size:1.04rem}
.finance-page > .row .card,.finance-create-card,.finance-filter-card,.finance-ledger-card { border-color:#dce5f0; box-shadow:0 12px 28px rgba(15,23,42,.055); }.finance-page > .row .card-body,.finance-create-card .card-body,.finance-filter-card .card-body,.finance-ledger-card .card-body { padding:1.2rem; }.finance-page > .row .card h5{font-weight:780;color:#17365c}.finance-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }.finance-section-heading h5{margin:.12rem 0 0;color:#17365c;font-weight:800;letter-spacing:-.02em}.finance-section-heading > span{padding:.35rem .55rem;border-radius:999px;background:#f1f5f9;color:#617187;font-size:.73rem;white-space:nowrap}.finance-filter-form{padding:.9rem!important;background:#f8fbff!important;border-color:#e0e9f3!important}.finance-filter-form .form-label{font-size:.73rem!important}.finance-ledger-card .table-responsive{border:1px solid #e0e8f1;border-radius:.85rem}.finance-ledger-table thead th{background:#f3f7fc;color:#52657b;font-size:.7rem;letter-spacing:.045em;text-transform:uppercase;white-space:nowrap}.finance-ledger-table tbody tr{transition:background .15s ease}.finance-ledger-table tbody tr:hover{background:#f8fbff}.finance-ledger-table td{vertical-align:middle}.finance-ledger-table .badge{padding:.42rem .58rem;border-radius:999px;font-size:.7rem}.finance-reconcile-switch{display:flex;align-items:center;min-height:3rem;padding:.75rem 1rem;border:1px solid #dce5f0;border-radius:.75rem;background:#f8fbff}.finance-reconcile-switch .form-check-input{float:none;margin:0 .65rem 0 0;flex:0 0 auto}.finance-reconcile-switch .form-check-label{margin:0;line-height:1.3}.finance-create-card form{padding:.95rem!important;background:#f8fbff!important;border-color:#e0e8f1!important}
.finance-reconcile-switch .form-check-label::after{content:"Marca solo si ya verificaste el pago; en transferencias sin confirmar queda pendiente de conciliación.";display:block;margin-top:.2rem;color:#64748b;font-size:.79rem;font-weight:400;line-height:1.35}
.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 2rem)}.modal-dialog-scrollable .modal-body{overflow-y:auto}
#inscriptionChargeModal .modal-dialog{height:calc(100% - 2rem)}
#inscriptionChargeModal .modal-content{height:100%;max-height:100%;display:flex}
#inscriptionChargeModal .modal-content>form{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}
#inscriptionChargeModal .modal-body{flex:1 1 auto;min-height:0;overflow-y:auto}
.academic-filter-card{padding:1.05rem 1.15rem 1.15rem;border:1px solid #dce7f5;border-radius:1rem;background:linear-gradient(115deg,#fbfdff 0%,#fff 58%);box-shadow:0 8px 22px rgba(15,46,80,.07)}
.academic-filter-heading{display:flex;align-items:center;gap:.7rem;margin-bottom:1rem;color:#183a63}.academic-filter-heading>div:last-child{display:flex;align-items:baseline;gap:.55rem;flex-wrap:wrap}.academic-filter-heading strong{font-size:1.06rem;letter-spacing:-.01em}.academic-filter-heading span{color:#6c7e95;font-size:.84rem}.academic-filter-mark{display:grid;place-items:center;width:2.35rem;height:2.35rem;border-radius:.72rem;background:#eaf2ff;color:#1d5fe9}
.academic-filter-form{display:grid;grid-template-columns:1fr 1.5fr 1.1fr 2fr .8fr;grid-template-areas:"cycle period modality career rvoe" "search search search search action";gap:.75rem .8rem;align-items:end}.academic-filter-cycle{grid-area:cycle}.academic-filter-period{grid-area:period}.academic-filter-modality{grid-area:modality}.academic-filter-career{grid-area:career}.academic-filter-rvoe{grid-area:rvoe}.academic-filter-search{grid-area:search}.academic-filter-submit{grid-area:action}.academic-filter-field label{display:block;margin:0 0 .32rem;color:#334761;font-size:.76rem;font-weight:750}.academic-filter-field .form-control,.academic-filter-field .form-select{min-height:2.72rem;border-color:#cbd9e9;background-color:#fff}.academic-filter-field .form-control:focus,.academic-filter-field .form-select:focus{border-color:#79a9fb;box-shadow:0 0 0 .2rem rgba(37,99,235,.1)}.academic-filter-submit{display:flex;align-items:flex-end;gap:.55rem}.academic-filter-submit .btn{min-height:2.72rem;font-weight:700;white-space:nowrap}.academic-filter-clear{color:#63758d;font-size:.76rem;font-weight:650;white-space:nowrap;text-decoration:none}.academic-filter-clear:hover{color:#1d5fe9;text-decoration:underline}
.academic-filter-rvoe[hidden]{display:none!important}
@media(max-width:1199.98px){.academic-filter-form{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-areas:"cycle cycle period period modality modality" "career career career rvoe rvoe rvoe" "search search search search action action"}}
@media(max-width:767.98px){.academic-filter-form{grid-template-columns:1fr;grid-template-areas:"cycle" "period" "modality" "career" "rvoe" "search" "action"}.academic-filter-heading>div:last-child{display:block}.academic-filter-heading span{display:block;margin-top:.15rem}.academic-filter-submit{align-items:center}.academic-filter-clear{margin-left:auto}}
@media (max-width:1199.98px){.finance-overview{grid-template-columns:repeat(2,1fr)}.finance-balance-card{grid-column:span 2}.finance-cash-strip{grid-template-columns:repeat(2,1fr)}.finance-cash-strip>div:nth-child(2){border-right:0}.finance-cash-strip>div:nth-child(-n+2){border-bottom:1px solid #e7edf5}}
@media (max-width:767.98px){.finance-hero{align-items:flex-start;flex-direction:column;padding:1.2rem}.finance-hero-actions{justify-content:flex-start}.finance-overview{grid-template-columns:1fr}.finance-balance-card{grid-column:auto}.finance-cash-strip{grid-template-columns:1fr}.finance-cash-strip>div{border-right:0;border-bottom:1px solid #e7edf5}.finance-cash-strip>div:last-child{border-bottom:0}.finance-section-heading{align-items:flex-start;flex-direction:column}.finance-section-heading>span{white-space:normal}.finance-ledger-table{min-width:1000px}}

@media (max-width: 767.98px) {
    .app-page-header { align-items: flex-start !important; flex-direction: column; }
    .app-page-header > .btn, .app-page-header > div:last-child { width: 100%; }
    .app-page-header > div:last-child { display: flex; flex-wrap: wrap; }
    .app-form-card > .card-body { padding: 1rem; }
    .app-form > .row { padding: .85rem .75rem 0; }
    .app-form .row > [class*="col-"] > .form-label { min-height: auto; }
}

/* --------- Layout principal (sidebar + topbar) --------- */

body.layout-app {
    background: radial-gradient(circle at top left, #1b325a 0, #020617 40%, #020617 100%);
}

.layout-shell {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
}

/* Sidebar */

.app-sidebar {
    width: 250px;
    flex: 0 0 250px;
    position: sticky;
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    background: radial-gradient(circle at top left, #102a43 0, var(--color-sidebar) 45%, #010713 100%);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}
.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 -.35rem;
    padding: 0 .35rem .7rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, .58) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(96, 165, 250, .52); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(147, 197, 253, .76); }
.mobile-menu-toggle,
.sidebar-mobile-backdrop { display: none; }

.app-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1.2rem;
    padding: .9rem;
    border-radius: 1.1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 58%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 18px 34px rgba(2, 8, 23, 0.28);
}
.app-brand img {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.42);
}
.app-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.1;
}
.app-brand-sub {
    font-size: .74rem;
    color: rgba(226, 232, 240, .72);
}

.sidebar-section-title {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(226, 232, 240, .78);
    margin: 0;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
}

.sidebar-nav {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.sidebar-section-collapsible {
    margin-top: .75rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        rgba(5, 17, 33, 0.62);
    box-shadow: 0 12px 28px rgba(1, 7, 19, 0.22);
    overflow: hidden;
}

.sidebar-section-collapsible:first-of-type {
    margin-top: 0;
}

.sidebar-section-collapsible[open] {
    border-color: rgba(96, 165, 250, 0.26);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(5, 17, 33, 0.78);
    box-shadow:
        0 18px 36px rgba(1, 7, 19, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sidebar-section-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    cursor: pointer;
    padding: .9rem 1rem;
    user-select: none;
    outline: none;
}

.sidebar-section-toggle::-webkit-details-marker {
    display: none;
}

.sidebar-section-toggle::marker {
    content: "";
}

.sidebar-section-toggle:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.6);
}

.sidebar-section-meta,
.sidebar-section-actions {
    display: flex;
    align-items: center;
}

.sidebar-section-meta {
    gap: .75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-section-actions {
    gap: .55rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.sidebar-section-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .8rem;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(34, 197, 94, 0.16)),
        rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #dbeafe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-section-icon i {
    font-size: .92rem;
}

.sidebar-section-badge {
    display: none;
    min-width: 1.8rem;
    height: 1.6rem;
    padding: 0 .35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: rgba(226, 232, 240, 0.82);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.sidebar-section-collapsible[open] .sidebar-section-badge {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(59, 130, 246, 0.22));
    border-color: rgba(96, 165, 250, 0.22);
    color: #eff6ff;
}

.sidebar-section-chevron {
    color: rgba(226, 232, 240, .55);
    font-size: .82rem;
    transition: transform .18s ease, color .18s ease;
}

.sidebar-section-collapsible[open] .sidebar-section-chevron {
    transform: rotate(180deg);
    color: rgba(255, 255, 255, .78);
}

.sidebar-section-toggle:hover .sidebar-section-title,
.sidebar-section-toggle:hover .sidebar-section-chevron,
.sidebar-section-toggle:hover .sidebar-section-badge {
    color: rgba(255, 255, 255, .82);
}

.sidebar-section-body {
    padding: 0 .55rem .6rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .68rem .8rem;
    border-radius: .82rem;
    color: #e5e7eb;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    opacity: .86;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}

.sidebar-link .icon {
    width: 1.1rem;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    background: rgba(15, 33, 57, 0.92);
    border-color: rgba(96, 165, 250, 0.1);
    transform: translateX(2px);
    opacity: 1;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    border-color: rgba(147, 197, 253, 0.24);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.44);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    color: rgba(226, 232, 240, 0.92);
}

.sidebar-footer .text-muted {
    color: rgba(148, 163, 184, 0.72) !important;
}

/* Contenedor principal */

.app-main {
    flex: 1;
    min-width: 0;
    background: radial-gradient(circle at top left, #1f2937 0, #020617 55%);
    padding: 1.6rem 1.8rem;
    overflow: auto;
}

.app-main-inner {
    background: #f7f8fc;
    border-radius: 1.2rem;
    min-height: calc(100vh - 3.2rem);
    padding: 1.5rem 1.8rem 1.6rem;
}

/* Topbar dentro del main */

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.app-topbar-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #1f2937;
}
.app-user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    background: #0b1120;
    color: #e5e7eb;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
}
.app-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e40af, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* --------- Login --------- */

.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1e293b 0, #020617 50%);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border-radius: 1.3rem;
    background: radial-gradient(circle at top left, #1f2937 0, #020617 60%);
    padding: 2.4rem 2.2rem 2rem;
    color: #e5e7eb;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.85);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.auth-logo img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .9);
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .2rem;
}
.auth-subtitle {
    text-align: center;
    font-size: .8rem;
    color: rgba(226, 232, 240, .7);
    margin-bottom: 1.3rem;
}

.auth-card .form-control {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}
.auth-card .form-control::placeholder {
    color: #6b7280;
}
.auth-card .form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.4);
}

.auth-footer {
    margin-top: 1.1rem;
    font-size: .75rem;
    text-align: center;
    color: rgba(148, 163, 184, .9);
}

/* Pequeños ajustes */
.badge-soft {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
    border-radius: 999px;
    padding: .15rem .55rem;
    font-size: .7rem;
}

@media (max-width: 991.98px) {
    body.sidebar-mobile-open { overflow: hidden; }
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        height: 100dvh;
        z-index: 1060;
        width: min(86vw, 320px);
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 22px 0 55px rgba(2, 6, 23, .42);
    }
    body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
    .sidebar-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(2, 6, 23, .58);
        border: 0;
        backdrop-filter: blur(2px);
    }
    body.sidebar-mobile-open .sidebar-mobile-backdrop { display: block; }
    .app-main { width: 100%; padding: .7rem; }
    .app-main-inner { min-height: calc(100vh - 1.4rem); padding: 1rem; border-radius: 1rem; }
    .app-topbar { gap: .6rem; margin-bottom: 1rem; }
    .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
        flex: 0 0 auto;
        width: 2.55rem;
        height: 2.55rem;
        padding: 0;
        color: #0f172a;
        background: #fff;
        border: 1px solid #dbe3ee;
        border-radius: .72rem;
    }
    .mobile-menu-toggle i { font-size: 1.25rem; }
    .app-topbar-title { flex: 1 1 auto; min-width: 0; font-size: .9rem; font-weight: 700; }
    .app-topbar > .mx-3 { margin-inline: 0 !important; }
    .app-user-chip { padding: .3rem; }
    .app-user-chip > span, .app-user-chip > a { display: none; }
}

@media (max-width: 575.98px) {
    .app-topbar > .mx-3 { display: none; }
    .app-topbar-title { display: none; }
    .app-main { padding: 0; }
    .app-main-inner { min-height: 100vh; padding: .85rem; border-radius: 0; }
}

/* Validacion de CURP: diferencia formato local de confirmacion oficial. */
.curp-validation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .7rem;
    margin-top: .55rem;
}
.curp-validation-button {
    border-radius: .65rem;
    font-weight: 700;
}
.curp-official-button {
    border: 1px solid #dbe3ef;
    border-radius: .65rem;
    color: #334155;
    font-weight: 700;
}
.curp-validation-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .75rem;
    font-weight: 750;
}
.curp-validation-status.is-renapo_validated { background: #dcfce7; color: #166534; }
.curp-validation-status.is-format_valid { background: #dbeafe; color: #1d4ed8; }
.curp-validation-status.is-invalid,
.curp-validation-status.is-not_found { background: #fee2e2; color: #991b1b; }
.curp-validation-status.is-provider_unavailable,
.curp-validation-status.is-rate_limited { background: #fef3c7; color: #92400e; }
.curp-validation-status.is-checking { background: #dbeafe; color: #1d4ed8; }
.curp-validation-status.is-copied { background: #ecfeff; color: #0e7490; }
.curp-official-link { color: #1d4ed8; font-size: .76rem; font-weight: 700; }

/* --------- Estudio de planes académicos --------- */
.eyebrow { color: #64748b; font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.plan-page-header .page-title { font-size: clamp(1.35rem, 2vw, 1.85rem); font-weight: 750; letter-spacing: -.025em; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .3rem .65rem; font-size: .72rem; font-weight: 700; }
.status-warning { color: #92400e; background: #fef3c7; }
.status-ready { color: #166534; background: #dcfce7; }
.plan-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.plan-step { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; color: #475569; background: rgba(255,255,255,.7); border: 1px solid #e2e8f0; border-radius: .85rem; text-decoration: none; transition: .15s ease; }
.plan-step:hover { color: #0f172a; border-color: #bfdbfe; transform: translateY(-1px); }
.plan-step.active { color: #0b2a4a; background: #fff; border-color: #93c5fd; box-shadow: 0 8px 22px rgba(15,23,42,.07); }
.plan-step-number { display: grid; place-items: center; flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #e2e8f0; font-size: .78rem; font-weight: 800; }
.plan-step.active .plan-step-number { color: #fff; background: #1d4ed8; }
.plan-step strong, .plan-step small { display: block; }
.plan-step strong { font-size: .84rem; }
.plan-step small { margin-top: .1rem; color: #94a3b8; font-size: .69rem; }
.plan-workspace { display: grid; gap: 1rem; }
.form-section { padding: 1.25rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; box-shadow: 0 5px 18px rgba(15,23,42,.045); }
.form-section-heading { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.15rem; }
.form-section-heading h2 { margin: 0; color: #0f172a; font-size: 1rem; font-weight: 750; }
.form-section-heading p { margin: .15rem 0 0; color: #64748b; font-size: .79rem; }
.section-icon { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; color: #1d4ed8; background: #eff6ff; border-radius: .75rem; }
.required { color: #dc2626; }
.form-action-bar { position: sticky; z-index: 5; bottom: .75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: #64748b; background: rgba(255,255,255,.94); border: 1px solid #dbe3ee; border-radius: .9rem; box-shadow: 0 14px 35px rgba(15,23,42,.14); backdrop-filter: blur(10px); font-size: .78rem; }
.context-note { display: flex; gap: .8rem; margin-bottom: 1rem; padding: 1rem 1.15rem; color: #1e3a5f; background: #eef6ff; border: 1px solid #bfdbfe; border-radius: .9rem; }
.context-note i { color: #2563eb; font-size: 1.2rem; }
.context-note strong, .context-note span { display: block; }
.context-note span { margin-top: .2rem; font-size: .82rem; }
.add-version-panel summary, .import-panel summary { cursor: pointer; color: #1d4ed8; font-weight: 700; list-style: none; }
.add-version-panel summary::-webkit-details-marker, .import-panel summary::-webkit-details-marker { display: none; }
.curriculum-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.15rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; }
.curriculum-toolbar > div:first-child { min-width: min(100%, 320px); }
.curriculum-metrics { display: flex; gap: .55rem; flex-wrap: wrap; }
.curriculum-metrics span { padding: .45rem .7rem; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .65rem; font-size: .75rem; }
.curriculum-metrics strong { color: #0f172a; }
.activation-panel { display: grid; gap: .85rem; margin-bottom: 1rem; padding: 1rem 1.15rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; }
.status-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.status-track span { display: flex; align-items: center; gap: .4rem; color: #94a3b8; font-size: .74rem; font-weight: 700; }
.status-track span::after { content: ''; flex: 1; height: 2px; margin-left: .25rem; background: #e2e8f0; }
.status-track span:last-child::after { display: none; }
.status-track span.reached { color: #2563eb; }
.status-track span.reached::after { background: #93c5fd; }
.activation-copy { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .8rem; border-top: 1px solid #eef2f7; }
.activation-copy strong { color: #0f172a; }
.activation-copy p { margin: .2rem 0 0; color: #64748b; font-size: .79rem; }
.activation-copy details { max-width: 420px; color: #92400e; font-size: .78rem; }
.activation-copy details summary { cursor: pointer; font-weight: 700; }
.activation-copy details ul { margin: .5rem 0 0; padding-left: 1.15rem; }
.status-activa { border-color: #86efac; background: #f0fdf4; }
.plan-workspace fieldset { display: contents; min-width: 0; padding: 0; border: 0; }
.semester-panel { overflow: hidden; background: #fff; border: 1px solid #e2e8f0; border-radius: .9rem; }
.semester-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; cursor: pointer; list-style: none; }
.semester-panel > summary::-webkit-details-marker { display: none; }
.semester-panel > summary > span { display: flex; align-items: center; gap: .65rem; }
.semester-number { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; color: #1d4ed8; background: #eff6ff; border-radius: .55rem; font-size: .75rem; font-weight: 800; }
.semester-count { color: #64748b; font-size: .75rem; font-weight: 500; }
.semester-actions { display: flex; align-items: center; gap: .7rem; }
.semester-panel[open] .semester-count i { transform: rotate(180deg); }
.curriculum-table thead th { white-space: nowrap; font-size: .71rem; letter-spacing: .025em; text-transform: uppercase; }
.curriculum-table td:first-child { min-width: 280px; }
.curriculum-table td:first-child strong, .curriculum-table td:first-child span { display: block; }
.curriculum-table td:first-child span { margin-top: .12rem; color: #475569; font-size: .8rem; }
.curriculum-table .remove-existing-subject { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border-radius: .55rem; }
.curriculum-row-actions { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; }
.curriculum-row-actions .save-curriculum-row { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; border-radius: .55rem; }
.curriculum-subject-row { transition: opacity .15s ease, background-color .15s ease; }
.curriculum-subject-row.subject-marked-remove { opacity: .62; background: #fff7f7; }
.curriculum-subject-row.subject-marked-remove td:not(:last-child) select,
.curriculum-subject-row.subject-marked-remove td:not(:last-child) input:not(.removal-value) { pointer-events: none; }
.curriculum-table td:first-child .removal-label { width: max-content; margin-top: .3rem; padding: .12rem .4rem; color: #991b1b; background: #fee2e2; border-radius: 999px; font-size: .65rem; font-weight: 700; }
.empty-semester td { padding: 1.2rem !important; color: #94a3b8; text-align: center; }
.pending-curriculum-row > td { background: #f0f7ff; border-color: #bfdbfe; }
.pending-curriculum-row td:first-child strong,
.pending-curriculum-row td:first-child span { display: block; }
.pending-row-badge { width: max-content; margin-top: .25rem; padding: .12rem .4rem; color: #1d4ed8 !important; background: #dbeafe; border-radius: 999px; font-size: .62rem !important; font-weight: 750; }
.curriculum-dirty-bar { position: fixed; z-index: 1040; right: 2rem; bottom: 1.25rem; display: flex; align-items: center; gap: 1rem; padding: .7rem .8rem .7rem 1rem; color: #78350f; background: #fffbeb; border: 1px solid #fbbf24; border-radius: .85rem; box-shadow: 0 16px 38px rgba(15,23,42,.2); font-size: .76rem; }
.curriculum-dirty-bar[hidden] { display: none; }
.subject-modal { overflow: hidden; border: 0; border-radius: 1.1rem; box-shadow: 0 30px 80px rgba(15,23,42,.28); }
.subject-modal .modal-header { padding: 1.1rem 1.25rem; background: #f8fafc; border-bottom-color: #e2e8f0; }
.subject-modal .modal-body { padding: 1.25rem; }
.subject-modal .modal-footer { padding: .85rem 1.25rem; background: #f8fafc; }
.subject-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: 1.15rem; padding: .3rem; background: #eef2f7; border-radius: .75rem; }
.subject-mode-switch button { padding: .62rem .8rem; color: #64748b; background: transparent; border: 0; border-radius: .55rem; font-size: .82rem; font-weight: 700; }
.subject-mode-switch button.active { color: #1d4ed8; background: #fff; box-shadow: 0 3px 10px rgba(15,23,42,.08); }
.subject-search-results { display: grid; gap: .35rem; max-height: 270px; margin-top: .8rem; overflow-y: auto; }
.subject-search-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 110px; padding: 1rem; color: #94a3b8; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: .75rem; text-align: center; font-size: .79rem; }
.subject-search-placeholder i { margin-bottom: .35rem; font-size: 1.25rem; }
.subject-result { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: .75rem; width: 100%; padding: .65rem .75rem; text-align: left; background: #fff; border: 1px solid #e2e8f0; border-radius: .7rem; transition: .12s ease; }
.subject-result:hover, .subject-result:focus { background: #eff6ff; border-color: #93c5fd; outline: 0; }
.subject-result-code { color: #1d4ed8; font-size: .76rem; font-weight: 800; }
.subject-result strong, .subject-result small { display: block; }
.subject-result strong { color: #0f172a; font-size: .81rem; }
.subject-result small { margin-top: .12rem; color: #94a3b8; font-size: .68rem; }
.subject-result > i { color: #94a3b8; }
.selected-subject { display: flex; align-items: center; gap: .65rem; margin-top: .8rem; padding: .75rem .85rem; color: #166534; background: #f0fdf4; border: 1px solid #86efac; border-radius: .75rem; }
.selected-subject > i { font-size: 1.15rem; }
.selected-subject strong, .selected-subject small { display: block; }
.selected-subject small { color: #4d7c5b; font-size: .7rem; }
.subject-modal-subtitle { margin-bottom: .8rem; color: #0f172a; font-size: .9rem; font-weight: 750; }
.academic-load-grid { display: grid; grid-template-columns: 1.25fr 1.25fr .8fr 1.05fr .8fr; align-items: end; gap: .75rem; }
.academic-load-grid > div { min-width: 0; }
.academic-load-grid .form-label { display: block; min-height: 1.25rem; margin-bottom: .45rem; white-space: nowrap; }
.academic-load-grid .form-control,
.academic-load-grid .form-select { min-height: 42px; }
.empty-state { padding: 4rem 1rem; background: #fff; border: 1px dashed #cbd5e1; border-radius: 1rem; text-align: center; }
.empty-state > i { color: #94a3b8; font-size: 2.2rem; }
.empty-state h2 { margin: .8rem 0 .35rem; font-size: 1.15rem; }
.empty-state p { color: #64748b; }
@media (max-width: 900px) {
    .plan-steps { grid-template-columns: 1fr; }
    .plan-step small { display: none; }
    .curriculum-toolbar, .form-action-bar { align-items: stretch; flex-direction: column; }
    .activation-copy { align-items: stretch; flex-direction: column; }
    .status-track { grid-template-columns: 1fr 1fr; }
    .semester-actions .btn { display: none; }
    .curriculum-dirty-bar { right: 1rem; bottom: 1rem; left: 1rem; justify-content: space-between; }
    .academic-load-grid { grid-template-columns: 1fr 1fr; }
    .academic-load-grid > div:last-child { grid-column: 1 / -1; }
    .academic-load-grid .form-label { white-space: normal; }
}
@media (max-width: 575.98px) {
    .academic-load-grid { grid-template-columns: 1fr; }
    .academic-load-grid > div:last-child { grid-column: auto; }
}

/* Contenedor especial para la pantalla de login dentro del layout */
.login-wrapper {
    min-height: calc(100vh - 3rem); /* alto casi completo dentro del main */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tarjeta de login (ya la teníamos, por si acaso la ajusto un poco) */
.auth-card {
    width: 100%;
    max-width: 430px;
    border-radius: 1.3rem;
    background: radial-gradient(circle at top left, #1f2937 0, #020617 60%);
    padding: 2.4rem 2.2rem 2rem;
    color: #e5e7eb;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.85);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.auth-logo img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .9);
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .2rem;
}
.auth-subtitle {
    text-align: center;
    font-size: .8rem;
    color: rgba(226, 232, 240, .7);
    margin-bottom: 1.3rem;
}

.auth-card .form-control {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}
.auth-card .form-control::placeholder {
    color: #6b7280;
}
.auth-card .form-control:focus {
    border-color: #1e90ff;
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.4);
}

.auth-footer {
    margin-top: 1.1rem;
    font-size: .75rem;
    text-align: center;
    color: rgba(148, 163, 184, .9);
}

/* Encabezado de página dentro del main */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title-block {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111827;
}

.page-subtitle {
    font-size: .85rem;
    color: #6b7280;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Card de listado principal */
.list-card {
    border-radius: 0.9rem;
    border: 1px solid rgba(15,23,42,0.06);
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

/* Barra de búsqueda arriba de las tablas */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.1rem 0.2rem;
}

.list-search {
    max-width: 380px;
    flex: 1;
}

.list-search .input-group-text {
    background: transparent;
    border-right: 0;
    color: #9ca3af;
}

.list-search .form-control {
    border-left: 0;
}

/* Ajustes tablas */
.table-list {
    margin-bottom: 0;
    font-size: .9rem;
}
.table-list thead th {
    background: #f3f4ff;
    font-weight: 600;
    color: #4b5563;
    border-bottom-width: 1px;
}
.table-list tbody tr:hover {
    background: #f9fafb;
}

/* Badge suave para estatus o info */
.badge-soft {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    padding: .15rem .55rem;
    font-size: .7rem;
    font-weight: 500;
}

/* Expediente de alumno: captura compacta por etapas */
.student-form { max-width: 1380px; margin: 0 auto; }
.student-record-strip {
    display: grid; grid-template-columns: .8fr 1.1fr 1.5fr; gap: 1px;
    overflow: hidden; border: 1px solid #dbe4ef; border-radius: 1rem; background: #dbe4ef;
}
.student-record-strip > div { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem; background: #fff; }
.student-record-strip span { color: #64748b; font-size: .72rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.student-record-strip strong { overflow: hidden; color: #0f172a; text-overflow: ellipsis; white-space: nowrap; }
.student-stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.student-step {
    position: relative; display: grid; grid-template-columns: 2.35rem 1fr; grid-template-rows: auto auto;
    column-gap: .75rem; min-width: 0; padding: .85rem 1rem; border: 1px solid #dbe4ef; border-radius: 1rem;
    background: #fff; color: #475569; text-align: left; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.student-step:hover { border-color: #93c5fd; transform: translateY(-1px); }
.student-step > span {
    display: grid; grid-row: 1 / 3; place-items: center; width: 2.35rem; height: 2.35rem;
    border-radius: .8rem; background: #eef2f7; color: #475569; font-weight: 800;
}
.student-step strong { align-self: end; color: #334155; font-size: .92rem; }
.student-step small { align-self: start; overflow: hidden; color: #94a3b8; text-overflow: ellipsis; white-space: nowrap; }
.student-step.active { border-color: #60a5fa; box-shadow: 0 10px 26px rgba(37, 99, 235, .11); }
.student-step.active > span { background: linear-gradient(135deg, #1d4ed8, #38bdf8); color: #fff; }
.student-step.active strong { color: #0f3f70; }
.student-step.complete > span { background: #dcfce7; color: #15803d; }
.student-form-card { overflow: visible; margin-bottom: 5.5rem; }
.student-form-card > .card-body { padding: clamp(1rem, 2vw, 1.6rem); }
.student-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.25rem; }
.student-panel-heading h4 { margin: .15rem 0 0; color: #0f172a; font-size: 1.2rem; font-weight: 800; }
.student-panel-heading > p { max-width: 430px; margin: .2rem 0 0; color: #64748b; font-size: .84rem; text-align: right; }
.student-kicker { color: #2563eb; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.student-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.student-fields .field { display: flex; flex-direction: column; min-width: 0; }
.student-fields .form-label { min-height: auto; margin-bottom: .35rem; color: #334155; font-size: .8rem; font-weight: 750; }
.student-fields .form-control, .student-fields .form-select { min-height: 43px; }
.student-fields .form-text { margin-top: .3rem; font-size: .72rem; }
.student-fields .col-span-2 { grid-column: span 2; }
.student-fields .col-span-3 { grid-column: span 3; }
.student-fields .col-span-4 { grid-column: span 4; }
.student-fields .col-span-6 { grid-column: span 6; }
.student-fields .col-span-8 { grid-column: span 8; }
.student-fields .col-span-12 { grid-column: 1 / -1; }
.student-subsection { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid #e2e8f0; }
.student-subsection-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.student-subsection-title h5 { margin: 0 0 .15rem; color: #1e293b; font-size: .95rem; font-weight: 800; }
.student-subsection-title p { margin: 0; color: #64748b; font-size: .78rem; }
.compact-select { width: min(220px, 100%); }
.address-origin-row { padding: .8rem 1rem; border: 1px solid #dbeafe; border-radius: .9rem; background: #f8fbff; }
.student-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.student-contact-card { padding: 1rem; border: 1px solid #dbe4ef; border-radius: 1rem; background: #fbfdff; }
.student-contact-card h5 { margin: 0 0 .9rem; color: #0f3f70; font-size: .98rem; font-weight: 800; }
.student-form-actions {
    position: fixed; z-index: 1020; right: 1.5rem; bottom: 1rem; left: calc(var(--sidebar-width, 252px) + 1.5rem);
    display: flex; align-items: center; gap: 1rem; max-width: 1380px; margin: 0 auto; padding: .75rem .9rem;
    border: 1px solid rgba(203, 213, 225, .9); border-radius: 1rem; background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 45px rgba(15, 23, 42, .16); backdrop-filter: blur(14px);
}
.student-progress-copy { display: flex; align-items: center; gap: .55rem; }
.student-progress-copy strong { color: #0f172a; }
.student-progress-copy span { padding: .2rem .5rem; border-radius: 999px; background: #eff6ff; color: #2563eb; font-size: .75rem; font-weight: 750; }

@media (max-width: 991.98px) {
    .student-form-actions { left: 1rem; right: 1rem; }
    .student-fields .col-span-2, .student-fields .col-span-3 { grid-column: span 4; }
    .student-fields .col-span-4 { grid-column: span 6; }
    .student-contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .student-page-header { align-items: stretch !important; flex-direction: column; }
    .student-record-strip { grid-template-columns: 1fr; }
    .student-stepper { gap: .4rem; }
    .student-step { display: flex; justify-content: center; padding: .55rem; }
    .student-step > span { width: 2rem; height: 2rem; }
    .student-step strong, .student-step small { display: none; }
    .student-panel-heading, .student-subsection-title { align-items: stretch; flex-direction: column; }
    .student-panel-heading > p { text-align: left; }
    .compact-select { width: 100%; }
    .student-fields .col-span-2, .student-fields .col-span-3, .student-fields .col-span-4,
    .student-fields .col-span-6, .student-fields .col-span-8 { grid-column: span 6; }
}
@media (max-width: 575.98px) {
    .student-fields { grid-template-columns: 1fr; }
    .student-fields .col-span-2, .student-fields .col-span-3, .student-fields .col-span-4,
    .student-fields .col-span-6, .student-fields .col-span-8, .student-fields .col-span-12 { grid-column: 1; }
    .student-form-actions { bottom: .5rem; padding: .65rem; }
    .student-progress-copy { display: none; }
    .student-form-actions .d-flex { width: 100%; }
    .student-form-actions .btn { flex: 1; }
}

/* Inscripción: captura a ancho completo y operaciones posteriores. */
.admission-operations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.admission-operation-card { height: 100%; border: 1px solid #e2e8f0; border-radius: 1rem; }
.admission-address-panel {
    padding: 1rem 1.1rem;
    border: 1px solid #dbe3ee;
    border-radius: 1rem;
    background: #f8fafc;
}
.admission-country-control { width: min(100%, 220px); }

@media (max-width: 991.98px) {
    .admission-operations-grid { grid-template-columns: 1fr; }
}

