:root {
    --bg: #f2f5f9;
    --bg-deep: #e8eef7;
    --surface: #ffffff;
    --surface-soft: #f6f8fc;
    --text: #1e2e48;
    --text-soft: #4e607a;
    --muted: #63738b;
    --border: #dbe3ef;
    --border-strong: #bac8dc;
    --primary: #205bb5;
    --primary-dark: #174487;
    --primary-soft: #eaf1fc;
    --sky: #0284c7;
    --sky-soft: #e6f5ff;
    --success: #0f9f6e;
    --success-soft: #e5f8f0;
    --danger: #dc3545;
    --danger-soft: #fdecee;
    --amber: #c27a06;
    --amber-soft: #fff5df;
    --dark: #153568;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(23, 32, 52, 0.05);
    --shadow: 0 10px 30px -12px rgba(23, 32, 52, 0.14);
    --shadow-lg: 0 24px 60px -24px rgba(23, 32, 52, 0.24);
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding-top: 34px;
    padding-bottom: 64px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #153568;
    border-bottom: 3px solid #3574c9;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 74px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    color: #fff;
    background: var(--primary);
    box-shadow: none;
}

.brand-mark svg {
    width: 23px;
    height: 23px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-text strong {
    font-size: 16px;
    letter-spacing: -0.01em;
}

.brand-text small {
    color: var(--muted);
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--text-soft);
    font-weight: 600;
    font-size: 13.5px;
    transition: background 0.18s ease, color 0.18s ease;
}

.main-nav > a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.main-nav > a.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.main-nav .nav-api svg {
    width: 14px;
    height: 14px;
}

.main-nav .nav-cta {
    margin-left: 8px;
    color: #fff;
}

.main-nav .nav-cta:hover {
    color: #fff;
    background: var(--primary-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: none;
}

.btn:active {
    transform: translateY(0);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    color: #fff;
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: #bfc8da;
    background: var(--surface);
}

.btn-outline {
    color: var(--primary);
    background: transparent;
    border-color: rgba(32, 91, 181, 0.35);
}

.btn-outline:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.btn-ghost {
    color: var(--text-soft);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.btn-dark {
    color: #fff;
    background: var(--dark);
}

.btn-dark:hover {
    color: #fff;
    background: #0f1626;
}

.btn-sm {
    padding: 8px 13px;
    font-size: 12.5px;
    border-radius: 8px;
}

/* Flash */
.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 550;
    animation: slide-in 0.25s ease;
}

.flash-success {
    color: #067a53;
    background: var(--success-soft);
    border-color: #b9ecd8;
}

.flash-error {
    color: #a91e2c;
    background: var(--danger-soft);
    border-color: #f6c8ce;
}

.flash-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.flash-icon svg {
    width: 18px;
    height: 18px;
}

.flash > span:nth-child(2) {
    flex: 1;
}

.flash-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    opacity: 0.55;
    cursor: pointer;
    padding: 0 2px;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overview */
.eyebrow { display: inline-block; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 6px 0 24px; }
.overview-heading h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; margin: 9px 0; font-weight: 650; }
.overview-heading p { color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.session-note { display: flex; align-items: baseline; gap: 10px; margin-bottom: 24px; padding: 11px 14px; background: #eaf0f9; border-left: 3px solid #4779ba; border-radius: 0 5px 5px 0; font-size: 12px; color: #385579; }
.session-note > span { font-family: Georgia, serif; font-weight: bold; }
.academic-average > strong { display: block; font-size: 30px; color: var(--primary); font-variant-numeric: tabular-nums; }
.academic-average > strong small { font-size: 14px; color: var(--muted); font-weight: 400; }
.academic-average p { margin: 5px 0 0; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.icon-indigo { color: var(--primary); background: var(--primary-soft); }
.icon-sky { color: var(--sky); background: var(--sky-soft); }
.icon-emerald { color: var(--success); background: var(--success-soft); }
.icon-amber { color: var(--amber); background: var(--amber-soft); }

.stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-label {
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.stat-note {
    color: var(--muted);
    font-size: 11.5px;
}

/* Cards and tables */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
}

.card-header h2 {
    font-size: 16px;
    letter-spacing: -0.01em;
}

.card-header p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
}

.link-arrow::after {
    content: "\2192";
    transition: transform 0.16s ease;
}

.link-arrow:hover::after {
    transform: translateX(3px);
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    padding: 10px 16px;
    text-align: left;
    color: var(--muted);
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #f3f7fd;
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
}

.person > div {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.person strong {
    font-size: 13.5px;
    font-weight: 650;
}

.person small {
    color: var(--muted);
    font-size: 11.5px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.course-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    max-width: 230px;
}

.course-code {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.grade {
    display: inline-grid;
    place-items: center;
    min-width: 50px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.grade-high { color: #067a53; background: var(--success-soft); }
.grade-mid { color: #a86100; background: var(--amber-soft); }
.grade-low { color: #b02a37; background: var(--danger-soft); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success { color: #067a53; background: var(--success-soft); }
.badge-danger { color: #b02a37; background: var(--danger-soft); }
.badge-neutral { color: var(--text-soft); background: #eef1f7; }

.badge-neutral::before {
    display: none;
}

.sidebar-stack {
    display: grid;
    gap: 20px;
}

.course-list {
    padding: 0 22px 20px;
    display: grid;
    gap: 16px;
}

.course-row-head,
.course-row-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.course-row-head span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.course-row-head strong {
    font-size: 12px;
    color: var(--text-soft);
}

.course-row-foot {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.progress {
    height: 6px;
    margin-top: 7px;
    border-radius: 999px;
    background: #e8eef7;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #3975c6;
}

.api-card {
    position: relative;
    color: #e8edf9;
    background: var(--dark);
    border-color: rgba(255, 255, 255, 0.08);
    padding: 22px;
}

.api-card h2 {
    margin-top: 10px;
    font-size: 17px;
    color: #fff;
}

.api-card p {
    margin-top: 5px;
    color: rgba(232, 237, 249, 0.72);
    font-size: 12.5px;
}

.api-tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    color: #d0e1fc;
    background: rgba(208, 225, 252, 0.12);
    border: 1px solid rgba(208, 225, 252, 0.18);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.api-card code {
    display: block;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #e0ebfc;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 11.5px;
    overflow-x: auto;
}

.api-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.api-actions .link-arrow {
    color: #d0e1fc;
}

.api-actions .link-arrow:hover {
    color: #fff;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 24px;
    text-align: center;
}

.empty-state h3 {
    font-size: 16px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
    max-width: 420px;
    margin-bottom: 8px;
}

.empty-state.compact {
    padding: 26px 22px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 6px;
    border-radius: 18px;
    color: var(--primary);
    background: var(--primary-soft);
}

.empty-icon svg {
    width: 26px;
    height: 26px;
}

/* Page headers and lists */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.page-header h1 {
    font-size: 29px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-header p {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 13.5px;
    max-width: 640px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #fcfdff;
}

.toolbar-wrap {
    flex-wrap: wrap;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 520px;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-form input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 91, 181, 0.12);
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--muted);
    pointer-events: none;
}

.search-icon svg {
    width: 15px;
    height: 15px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-form .search-form {
    min-width: 240px;
}

.filter-form select {
    padding: 9px 30px 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background-color: var(--surface);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.filter-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 91, 181, 0.12);
}

.result-count {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
}

.mono {
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 12px;
    color: var(--text-soft);
}

.contact-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    font-size: 12.5px;
}

.contact-cell small {
    color: var(--muted);
    font-size: 11px;
}

.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11.5px;
    font-weight: 700;
}

.text-right {
    text-align: right;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.muted { color: var(--muted); }

.data-table td .btn + .btn {
    margin-left: 4px;
}

.metric-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.metric {
    flex: 1;
    min-width: 128px;
    display: flex;
    flex-direction: column;
    padding: 4px 14px;
    border-right: 1px solid var(--border);
}

.metric:last-child {
    border-right: 0;
}

.metric-label {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric strong {
    font-size: 21px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(32, 91, 181, 0.25);
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
}

.period-pill {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 7px;
    color: var(--text-soft);
    background: #f0f3fa;
    border: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
}

.grade-stack {
    display: inline-flex;
    gap: 4px;
}

.grade-stack span {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    padding: 4px 5px;
    border-radius: 6px;
    background: #f2f5f9;
    border: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--text-soft);
}

/* Forms */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr);
    gap: 20px;
    align-items: start;
}

.form-card {
    padding: 6px 26px 24px;
}

.form-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: 0;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.section-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.form-section-head h2 {
    font-size: 15.5px;
    letter-spacing: -0.01em;
}

.form-section-head p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text);
}

.required {
    color: var(--danger);
}

.field input,
.field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder {
    color: #a3adc0;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 91, 181, 0.12);
}

.field input:invalid:not(:placeholder-shown) {
    border-color: #eda9b1;
}

.field select {
    padding-right: 34px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b879c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.field-hint {
    color: var(--muted);
    font-size: 11.5px;
}

.field-hint a {
    font-weight: 650;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 22px;
}

.info-card {
    padding: 22px;
}

.info-card h2 {
    font-size: 14.5px;
    margin-bottom: 12px;
}

.info-card p {
    color: var(--text-soft);
    font-size: 12.5px;
    margin-bottom: 12px;
}

.muted-card {
    background: #eef3fb;
}

.check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.check-list li {
    position: relative;
    padding-left: 25px;
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.45;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230f9f6e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}

.average-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 11px;
    background: var(--surface-soft);
}

.average-preview > div:first-child {
    display: flex;
    flex-direction: column;
}

.average-preview span {
    font-size: 12.5px;
    font-weight: 650;
}

.average-preview small {
    color: var(--muted);
    font-size: 11px;
}

.average-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.average-result strong {
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* Error page */
.error-page {
    position: relative;
    max-width: 620px;
    margin: 40px auto;
    padding: 48px 40px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.error-page::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: 260px;
    background: radial-gradient(circle, rgba(32, 91, 181, 0.16), transparent 68%);
}

.error-code {
    position: relative;
    font-size: clamp(84px, 16vw, 130px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    color: var(--primary);
}

.error-page .eyebrow {
    position: relative;
    margin-top: 14px;
}

.error-page h1 {
    position: relative;
    margin-top: 16px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.error-page > p {
    position: relative;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13.5px;
}

.error-actions {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
}

.error-hint {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.error-hint a {
    font-weight: 650;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    color: var(--muted);
    font-size: 11.5px;
}

.footer-inner > div:first-child {
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}

.footer-inner strong {
    color: var(--text-soft);
    font-size: 12.5px;
}

.footer-meta {
    display: flex;
    gap: 16px;
    white-space: nowrap;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .form-layout {
        grid-template-columns: minmax(0, 1fr);
    }

}

@media (max-width: 860px) {


    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        position: relative;
        min-height: 66px;
    }

    .brand-text small {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 10px 16px 16px;
        background: #153568;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 18px 28px -20px rgba(23, 32, 52, 0.4);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav > a {
        padding: 11px 12px;
    }

    .main-nav .nav-cta {
        margin-left: 0;
        margin-top: 6px;
    }

    .main-content {
        padding-top: 24px;
        padding-bottom: 44px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
        gap: 10px;
    }

    .stat-value {
        font-size: 23px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 4px 18px 20px;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: none;
    }

    .filter-form {
        align-items: stretch;
    }

    .filter-form .search-form {
        min-width: 100%;
    }

    .filter-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .average-preview {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .metric {
        border-right: 0;
        min-width: 100px;
        flex-basis: 40%;
    }

    .error-page {
        margin: 12px auto;
        padding: 36px 22px;
    }
}

@media (max-width: 520px) {

    .hero-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-actions {
        flex-direction: column-reverse;
    }

    .page-actions .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .error-actions {
        flex-direction: column;
    }



    .data-table td,
    .data-table th {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 760px) {
    .overview-heading { flex-direction: column; align-items: flex-start; gap: 18px; }
    .overview-heading .hero-actions { width: 100%; }
    .overview-heading .btn { flex: 1; }
}

/* Colores institucionales del encabezado y navegación */
.site-header .brand,
.site-header .brand:hover { color: #fff; }
.site-header .brand-text small { color: #d0def2; }
.site-header .brand-mark { background: #fff; color: #153568; border-radius: 6px; }
.site-header .main-nav > a { color: #e3ecfa; }
.site-header .main-nav > a:hover { background: #244a7e; color: #fff; }
.site-header .main-nav > a.is-active { background: #fff; color: #153568; }
.site-header .main-nav .nav-cta { background: #fff; color: #174487; border-color: #fff; }
.site-header .main-nav .nav-cta:hover { background: #eaf1fc; color: #153568; }
.site-header .nav-toggle { background: transparent; border-color: #6c87ae; }
.site-header .nav-toggle span { background: #fff; }

.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; min-width: 155px; }
.data-table td .row-actions .btn { margin: 0; }
.btn-danger-outline { color: #b02a37; background: #fff; border-color: #ecc2c7; }
.btn-danger-outline:hover { color: #92222d; background: var(--danger-soft); border-color: #d99099; }
.btn-danger { color: #fff; background: #b02a37; }
.btn-danger:hover { color: #fff; background: #92222d; }
.deletion-card { max-width: 640px; margin: 24px auto; padding: 28px; }
.deletion-card h1 { font-size: 26px; margin: 10px 0 18px; }
.deletion-card .deletion-record { font-size: 16px; font-weight: 600; color: var(--text); padding-bottom: 18px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }

/* Acceso al sistema */
.login-card { max-width: 430px; margin: 40px auto; padding: 32px; border-top: 4px solid var(--primary); }
.login-heading h1 { font-size: 28px; margin: 10px 0; letter-spacing: -.025em; }
.login-heading p { color: var(--text-soft); font-size: 14px; }
.login-form { display: grid; gap: 18px; margin-top: 26px; }
.login-form .btn { margin-top: 6px; min-height: 44px; }
.login-credentials { display: grid; gap: 6px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 12px; }
.login-credentials > strong { color: var(--text); }
.logout-form { margin: 0; }
.site-header .logout-button { background: transparent; border-color: #6c87ae; color: #fff; }
.site-header .logout-button:hover { background: #244a7e; }
@media (min-width: 761px) { .main-nav { gap: 3px; } .main-nav > a { padding-left: 9px; padding-right: 9px; } }
@media (max-width: 760px) { .logout-button { width: 100%; margin-top: 6px; } .login-card { margin: 16px auto; padding: 24px; } }

/* Distribución fluida: escritorio amplio, portátil, tablet y teléfono. */
.container { max-width: 1680px; width: 94%; padding-left: 24px; padding-right: 24px; }
.main-content { min-width: 0; }
.header-inner { gap: 18px; }
.page-header > div:first-child, .overview-heading > div:first-child { min-width: 0; }
.dashboard-grid > *, .form-layout > * { min-width: 0; }
.person > div, .contact-cell { min-width: 0; overflow-wrap: anywhere; }
.row-actions { display: grid; grid-template-columns: repeat(2, max-content); justify-content: end; gap: 8px; min-width: max-content; }
.registration-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td { padding-top: 16px; padding-bottom: 16px; }
.auth-page .main-content { display: flex; flex-direction: column; justify-content: center; align-items: center; padding-top: 32px; padding-bottom: 32px; }
.auth-page .flash-stack { width: min(100%, 480px); }
.login-card { width: 100%; max-width: 480px; margin: 0; padding: 36px; }
.login-form .field input { min-height: 46px; font-size: 16px; }
.login-form .btn { min-height: 46px; }
.login-credentials > span { line-height: 1.8; }
@media (min-width: 1600px) {
    .main-content { padding-top: 42px; padding-bottom: 56px; }
    .data-table { font-size: 14px; }
    .data-table td { padding: 18px 20px; }
    .data-table th { padding: 12px 20px; }
    .person strong, .contact-cell { font-size: 14px; }
    .row-actions { display: flex; flex-wrap: nowrap; }
    .dashboard-grid { grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); }
    .form-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .header-inner { position: relative; min-height: 74px; }
    .nav-toggle { display: flex; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; background: #153568; border-bottom: 1px solid #6c87ae; }
    .main-nav.is-open { display: flex; }
    .main-nav > a { padding: 12px; }
    .main-nav .nav-cta { margin: 6px 0 0; }
    .logout-button { width: 100%; margin-top: 8px; min-height: 44px; }
}
@media (max-width: 1100px) {
    .container { width: 100%; }
    .page-header { flex-wrap: wrap; }
    .page-actions { flex-shrink: 0; }
    .table-wrap { max-width: 100%; }
    .filter-form, .search-form { min-width: 0; }
    .search-form input[type="search"] { min-width: 0; }
}
@media (max-width: 700px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .main-content { padding-top: 24px; padding-bottom: 32px; }
    .header-inner { min-height: 66px; }
    .page-header h1 { font-size: 26px; }
    .page-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .page-actions .btn, .row-actions .btn, .form-actions .btn { min-height: 44px; }
    .table-toolbar { padding: 16px; gap: 12px; }
    .table-toolbar .search-form { width: 100%; flex-wrap: wrap; }
    .search-form input[type="search"] { flex: 1; min-width: 0; font-size: 16px; min-height: 44px; }
    .search-form .btn, .filter-form .btn, .filter-form select { min-height: 44px; }
    .filter-form { width: 100%; }
    .filter-form > select { flex: 1; min-width: 0; }
    .responsive-table, .responsive-table tbody { display: block; width: 100%; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .responsive-table tbody tr { display: block; padding: 16px; border-bottom: 1px solid var(--border-strong); }
    .responsive-table tbody tr:last-child { border-bottom: 0; }
    .responsive-table td { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr); align-items: start; gap: 12px; padding: 9px 0; border: 0; text-align: left; overflow-wrap: anywhere; }
    .responsive-table td::before { content: attr(data-label); color: var(--text-soft); font-size: 12px; font-weight: 600; padding-top: 2px; }
    .responsive-table td:first-child { display: block; padding: 0 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
    .responsive-table td:first-child::before { display: none; }
    .responsive-table td:last-child { border-bottom: 0; }
    .responsive-table td > .grade, .responsive-table td > .badge, .responsive-table td > .count-pill, .responsive-table td > .period-pill { justify-self: start; }
    .responsive-table .course-name { max-width: none; }
    .responsive-table .row-actions { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
    .responsive-table td[data-label="Acciones"] { display: block; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border); }
    .responsive-table td[data-label="Acciones"]::before { display: none; }
    .row-actions .btn { white-space: normal; font-size: 12px; }
    .field input, .field select { font-size: 16px; min-height: 44px; }
    .form-layout { gap: 16px; }
    .card-header { flex-wrap: wrap; }
    .login-card { padding: 26px 22px; }
    .auth-page .main-content { padding-top: 24px; padding-bottom: 24px; }
    .footer-meta { white-space: normal; }
    .session-note { font-size: 12px; }
}
@media (max-width: 380px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .login-card { padding: 22px 18px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; min-height: 44px; }
    .responsive-table td { grid-template-columns: 85px minmax(0, 1fr); gap: 8px; }
    .grade-stack { flex-wrap: wrap; }
}

/* Login compacto, centrado incluso al reutilizar la plantilla en el hosting. */
.main-content:has(> .login-card) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 26px;
}
.auth-page .flash-stack { width: min(100%, 400px); }
.login-heading h1 { font-size: 25px; margin: 8px 0; }
.login-heading p { font-size: 13px; line-height: 1.5; }
.login-form { gap: 14px; margin-top: 20px; }
.login-form .field input { min-height: 42px; padding: 9px 11px; }
.login-form .btn { min-height: 42px; margin-top: 2px; }
.login-credentials { margin-top: 18px; padding-top: 14px; gap: 4px; }
@media (max-width: 480px) {
    .login-card { max-width: 360px; padding: 22px; }
}
@media (max-width: 380px) {
    .login-card { padding: 20px 18px; }
}
