:root {
    --color-primary: #14b8a6;
    --color-primary-dark: #0b6b63;
    --color-accent-gold: #f5b400;
    --color-accent-orange: #f97316;
    --color-dark: #0f2e2e;
    --color-bg: #f4f6fa;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-text-secondary: #64748b;
    --color-border: #d9e2ec;
    --color-dark-bg: #081a1f;
    --color-dark-card: #10252b;
    --primary: var(--color-primary);
    --primary-dark: var(--color-primary-dark);
    --secondary: var(--color-primary-dark);
    --brand-ink: var(--color-dark);
    --accent: var(--color-accent-gold);
    --accent-warm: var(--color-accent-orange);
    --success: #059669;
    --danger: #dc2626;
    --warning: var(--color-accent-orange);
    --info: #0891b2;
    --bg: var(--color-bg);
    --surface: var(--color-card);
    --surface-soft: #e9f8f6;
    --text: var(--color-text);
    --text-gray: var(--color-text-secondary);
    --border: var(--color-border);
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --radius-lg: 8px;
    --radius-md: 8px;
    --sidebar-width: 280px;
    --scrollbar-track: #dff3f1;
    --scrollbar-thumb: #14b8a6;
    --scrollbar-thumb-hover: #0f8f83;
    --scrollbar-thumb-active: #f5b400;
}

/* Contacto visible desde el acceso y la cabecera principal. */
.login-primary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.login-primary-row .login-brand {
    min-width: 0;
    margin-bottom: 0;
}

.login-contact-button,
.top-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 15px;
    color: #062f2d;
    background: #f7c948;
    border: 1px solid #e2ad17;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(247, 201, 72, 0.34), 0 0 0 3px rgba(20, 184, 166, 0.12);
    font-weight: 900;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-contact-button:hover,
.top-contact-link:hover {
    color: #062f2d;
    background: #ffdc6a;
    box-shadow: 0 10px 28px rgba(247, 201, 72, 0.46), 0 0 0 4px rgba(20, 184, 166, 0.18);
    transform: translateY(-1px);
}

.top-contact-link {
    min-height: 40px;
    padding: 9px 13px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body .top-contact-link {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
    }

    body .top-contact-link span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .login-primary-row {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 22px;
    }

    .login-contact-button {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 0.86rem;
    }
}

@media (max-width: 420px) {
    .login-primary-row {
        align-items: stretch;
        flex-direction: column;
    }

    .login-contact-button {
        align-self: flex-start;
    }
}

/* Superadmin: cifras aisladas por institucion. */
.superadmin-institutions-section {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

.section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.section-heading-row h2,
.section-heading-row p {
    margin: 0;
}

.superadmin-institution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.superadmin-institution-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.superadmin-institution-card > header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.superadmin-institution-card h3,
.superadmin-institution-card header span {
    margin: 0;
}

.superadmin-institution-card header div > span {
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 800;
}

.institution-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #ffffff;
    background: var(--primary-dark);
    border-radius: 8px;
}

.institution-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.institution-metrics > div {
    min-width: 0;
    padding: 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.institution-metrics dt {
    color: var(--text-gray);
    font-size: 0.68rem;
    font-weight: 800;
}

.institution-metrics dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 900;
}

@media (max-width: 720px) {
    .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .superadmin-institution-grid {
        grid-template-columns: 1fr;
    }

    .institution-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

html[data-theme="dark"],
html.dark-mode,
body.dark-mode {
    --bg: var(--color-dark-bg);
    --surface: var(--color-dark-card);
    --surface-soft: #17343b;
    --text: #f8fafc;
    --text-gray: #b7c7cc;
    --border: #28444b;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
    --scrollbar-track: #0b242a;
    --scrollbar-thumb: #2dd4bf;
    --scrollbar-thumb-hover: #5eead4;
    --scrollbar-thumb-active: #f7c948;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html.theme-is-changing *,
html.theme-is-changing *::before,
html.theme-is-changing *::after {
    transition-property: background-color, color, border-color, box-shadow, fill, stroke;
    transition-duration: 0.28s;
    transition-timing-function: ease-in-out;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.34s;
    animation-timing-function: ease-in-out;
}

::view-transition-old(root) {
    animation-name: novaclass-theme-out;
}

::view-transition-new(root) {
    animation-name: novaclass-theme-in;
}

@keyframes novaclass-theme-out {
    to { opacity: 0.25; filter: brightness(0.72) saturate(0.78); }
}

@keyframes novaclass-theme-in {
    from { opacity: 0.28; filter: brightness(0.76) saturate(0.82); }
}

@media (prefers-reduced-motion: reduce) {
    html.theme-is-changing *,
    html.theme-is-changing *::before,
    html.theme-is-changing *::after,
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.dashboard-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 22px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 20;
}

.nav-logo,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
}

.brand-logo {
    display: block;
    max-width: 100%;
    object-fit: contain;
}

.brand-logo-full {
    width: 180px;
    height: 104px;
}

.brand-logo-icon {
    display: none;
    width: 42px;
    height: 42px;
}

html[data-theme="dark"] .brand-logo-full,
html.dark-mode .brand-logo-full,
body.dark-mode .brand-logo-full {
    filter:
        drop-shadow(1px 0 0 rgba(255, 255, 255, 0.78))
        drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.78))
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.78))
        drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.78));
}

.login-brand .brand-logo-full {
    width: 220px;
    height: 127px;
}

.landing-nav .brand-logo-full,
.auth-visual .brand-logo-full {
    width: 180px;
    height: 104px;
}

.nav-list {
    display: grid;
    gap: 6px;
    overflow-y: auto;
    padding-right: 2px;
}

.nav-link,
.theme-toggle {
    width: 100%;
    border: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    color: var(--text-gray);
    background: transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.nav-link:hover,
.theme-toggle:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #ffffff;
}

.nav-link i,
.theme-toggle i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.logout-link {
    color: var(--danger);
}

.main-view {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 32px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 26px;
}

.top-header h1 {
    font-size: 2rem;
    line-height: 1.1;
}

.top-header p {
    color: var(--text-gray);
    margin-top: 4px;
}

.school-year-select {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-gray);
    font-size: 0.82rem;
    font-weight: 800;
}

.school-year-select select {
    width: auto;
    min-width: 120px;
    padding: 5px 8px;
    border: 0;
    background: var(--surface-soft);
    color: var(--text);
}

.eyebrow {
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.public-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.top-notification {
    position: relative;
}

.top-notification span {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 99px;
    background: var(--danger);
    border: 2px solid var(--surface);
}

.top-profile-link {
    text-decoration: none;
}

.top-logout {
    color: var(--danger);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
}

.user-badge strong,
.user-badge span {
    display: block;
}

.user-badge span {
    color: var(--text-gray);
    font-size: 0.82rem;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.avatar-large {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
}

.stats-container,
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.card-stat,
.widget,
.content-card,
.table-container,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-stat {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-stat small {
    color: var(--text-gray);
    font-weight: 700;
}

.card-stat .value,
.card .value {
    font-size: 1.8rem;
    font-weight: 800;
}

.icon-box {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
}

.bg-blue { background: #2563eb; }
.bg-purple { background: #7c3aed; }
.bg-orange { background: #f59e0b; }
.bg-green { background: #10b981; }
.bg-cyan { background: #06b6d4; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
    gap: 18px;
}

.dashboard-grid-wide {
    grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
}

.widget,
.content-card,
.table-container,
.card {
    padding: 20px;
}

.narrow-card {
    max-width: 760px;
}

.widget-title,
.table-header-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 800;
}

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

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.quick-action,
.btn-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--surface-soft);
    color: var(--primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 800;
}

.activity-list {
    display: grid;
    gap: 10px;
}

.activity-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item span {
    color: var(--text-gray);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    flex: 0 0 auto;
}

.calendar-day,
.profile-summary,
.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.calendar-day {
    justify-content: center;
    flex-direction: column;
    min-height: 150px;
    background: var(--surface-soft);
    border-radius: var(--radius-md);
}

.calendar-day strong {
    font-size: 3rem;
    line-height: 1;
    color: var(--primary);
}

.profile-summary {
    flex-direction: column;
    text-align: center;
}

.profile-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-span {
    grid-column: 1 / -1;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    padding: 12px 13px;
    outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-small {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 800;
}

.badge-info {
    background: #ccfbf1;
    color: #0b6b63;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.search-box {
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.search-box i {
    color: var(--text-gray);
}

.search-box input {
    border: 0;
    box-shadow: none;
    padding-left: 0;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

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

.modern-table th {
    background: var(--surface-soft);
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.modern-table tr:hover td {
    background: rgba(37, 99, 235, 0.04);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.filter-bar,
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar select {
    width: auto;
    min-width: 160px;
}

.row-actions form {
    margin: 0;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-weight: 800;
}

.check-row input {
    width: auto;
}

.password-reset-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.class-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.class-card-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.class-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 12px;
}

.class-card h3 {
    font-size: 1.15rem;
}

.class-card p {
    color: var(--text-gray);
}

.class-code {
    width: max-content;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    font-weight: 800;
    font-size: 0.78rem;
}

.class-blue { border-left-color: #2563eb; }
.class-green { border-left-color: #059669; }
.class-orange { border-left-color: #f59e0b; }
.class-purple { border-left-color: #7c3aed; }
.class-cyan { border-left-color: #0891b2; }
.class-red { border-left-color: #dc2626; }

.teacher-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.teacher-tabs a {
    padding: 9px 12px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 800;
}

.teacher-tabs a.active {
    background: var(--primary);
    color: #ffffff;
}

.teacher-scale,
.option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.teacher-scale span {
    min-width: 46px;
    padding: 9px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--primary);
    text-align: center;
    font-weight: 900;
}

.weekly-schedule {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: auto;
}

.schedule-day {
    min-width: 150px;
    display: grid;
    align-content: start;
    gap: 10px;
}

.schedule-day h3 {
    padding: 9px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    font-size: 0.95rem;
}

.schedule-block {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid var(--border);
}

.schedule-block span,
.schedule-block small {
    color: var(--text-gray);
}

.pagination-lite {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    color: var(--text-gray);
    font-weight: 800;
}

/* --- Responsividad NovaClass --- */
img,
video,
canvas {
    max-width: 100%;
}

.table-container,
.matrix-wrapper,
.gradebook-wrapper,
.table-responsive-xl,
.mail-panel {
    max-width: 100%;
    overflow-x: auto;
}

.modern-table,
.matrix-table,
.gradebook-table {
    min-width: 760px;
}

.top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-toolbar,
.gradebook-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .dashboard-grid-wide,
    .calendar-page-grid,
    .mail-layout {
        grid-template-columns: 1fr;
    }

    .weekly-schedule {
        grid-template-columns: repeat(4, minmax(170px, 1fr));
    }

    .class-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .top-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .student-hero,
    .role-hero,
    .professor-dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-id-card {
        align-items: flex-start;
    }

    .student-highlight {
        width: 100%;
    }

    .filter-bar,
    .task-actions,
    .mail-actions,
    .table-header-tools {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar select,
    .filter-bar .btn,
    .task-actions .btn,
    .mail-actions .btn,
    .search-box {
        width: 100%;
        min-width: 0;
    }

    .weekly-schedule {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        overflow-x: hidden;
    }

    .main-view {
        padding: 16px;
    }

    .top-header h1,
    .student-id-card h2,
    .role-hero h2 {
        font-size: 1.45rem;
    }

    .stats-container,
    .card-grid,
    .quick-grid,
    .class-card-grid,
    .placeholder-mini-grid {
        grid-template-columns: 1fr;
    }

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

    .student-id-card,
    .profile-head,
    .module-head,
    .calendar-page-head,
    .behavior-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .module-head,
    .behavior-item {
        display: flex;
    }

    .user-badge {
        min-width: 0;
    }

    .user-badge div:first-child {
        min-width: 0;
    }

    .user-badge strong,
    .user-badge span,
    .nav-link span,
    .quick-action span,
    .btn {
        overflow-wrap: anywhere;
    }

    .icon-button {
        flex: 0 0 auto;
    }

    .teacher-tabs {
        flex-direction: column;
    }

    .teacher-tabs a {
        width: 100%;
    }

    .calendar-board {
        grid-template-columns: repeat(7, minmax(38px, 1fr));
        gap: 5px;
    }

    .calendar-cell {
        min-height: 68px;
        padding: 6px;
    }

    .calendar-tag {
        font-size: 0.62rem;
        padding: 3px 5px;
    }

    .weekly-schedule {
        grid-template-columns: 1fr;
    }

    .modern-table th,
    .modern-table td {
        padding: 10px;
    }

    .matrix-table th {
        white-space: normal;
    }

    .sticky-col {
        min-width: 170px;
    }
}

.teacher-notebook-matrix {
    width: auto !important;
    min-width: 0 !important;
    table-layout: fixed;
}

.teacher-notebook-matrix .sticky-col {
    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;
}

.teacher-notebook-matrix thead .activity-head {
    position: relative;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 88px !important;
    min-height: 88px !important;
    padding: 5px !important;
    overflow: hidden;
    border-radius: 0 !important;
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}

.teacher-notebook-matrix thead .activity-head::before {
    content: none !important;
}

.teacher-notebook-matrix thead .activity-head-button {
    display: flex !important;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    padding: 3px 3px 22px !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 2px;
    overflow: hidden;
    text-align: left;
}

.teacher-notebook-matrix thead .activity-head .category-chip {
    display: none !important;
}

.teacher-notebook-matrix thead .activity-head strong,
.teacher-notebook-matrix thead .activity-head small {
    display: -webkit-box !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
}

.teacher-notebook-matrix thead .activity-head strong {
    min-height: 0 !important;
    font-size: 0.59rem !important;
    -webkit-line-clamp: 3;
}

.teacher-notebook-matrix thead .activity-head small {
    font-size: 0.5rem !important;
    opacity: 0.82;
    -webkit-line-clamp: 1;
}

.teacher-notebook-matrix .notebook-column-edit {
    position: absolute;
    right: 5px;
    bottom: 5px;
    z-index: 2;
    width: 21px;
    height: 21px;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.56rem;
}

.teacher-notebook-matrix .promedio-header {
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 88px !important;
    min-height: 88px !important;
}

.teacher-notebook-matrix tbody td {
    height: 34px;
    padding: 2px 4px !important;
}

.teacher-notebook-matrix tbody .sticky-col {
    padding: 4px 9px !important;
}

.teacher-notebook-matrix tbody .sticky-col strong {
    font-size: 0.68rem;
    line-height: 1.1;
}

.teacher-notebook-matrix tbody .sticky-col span {
    display: none;
}

.teacher-notebook-matrix .input-nota {
    width: 58px !important;
    min-width: 58px !important;
    height: 28px !important;
    margin: 0 auto;
    padding: 2px !important;
    border-color: transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
    font-size: 0.7rem !important;
    font-weight: 900;
    appearance: textfield;
}

.teacher-notebook-matrix td.is-editing {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)) !important;
}

.teacher-notebook-matrix td.is-editing .input-nota {
    border-color: var(--primary) !important;
    background: var(--surface) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent) !important;
}

.teacher-notebook-matrix thead th.is-editing {
    box-shadow: inset 0 -4px 0 #f8cf4a;
}

.teacher-notebook-matrix .input-nota.grade-low,
html[data-theme="dark"] .teacher-notebook-matrix .input-nota.grade-low {
    color: #ef3340 !important;
}

.teacher-notebook-matrix .input-nota.grade-mid,
html[data-theme="dark"] .teacher-notebook-matrix .input-nota.grade-mid {
    color: #d99205 !important;
}

.teacher-notebook-matrix .input-nota.grade-high,
html[data-theme="dark"] .teacher-notebook-matrix .input-nota.grade-high {
    color: #0f9f72 !important;
}

html[data-theme="dark"] .teacher-notebook-matrix .input-nota.grade-mid,
body.dark-mode .teacher-notebook-matrix .input-nota.grade-mid {
    color: #ffd166 !important;
}

html[data-theme="dark"] .teacher-notebook-matrix .input-nota.grade-high,
body.dark-mode .teacher-notebook-matrix .input-nota.grade-high {
    color: #67efc2 !important;
}

.teacher-slot-add {
    padding: 0;
    cursor: pointer;
}

.activity-modal-period {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.activity-modal-period > span:first-child {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 7px;
    color: var(--primary);
    background: var(--primary-soft);
}

.activity-modal-period small,
.activity-modal-period strong {
    display: block;
}

.activity-modal-period small {
    color: var(--text-gray);
    font-size: 0.7rem;
}

.activity-modal-period strong {
    margin-top: 2px;
    font-size: 0.82rem;
}

@media (max-width: 720px) {
    .teacher-notebook-matrix .sticky-col {
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
    }

    .activity-modal-period {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .activity-modal-period .grade-scale-note {
        grid-column: 2;
    }
}

@media (max-width: 480px) {
    .main-view {
        padding: 12px;
    }

    .sidebar {
        padding: 12px;
    }

    .top-actions {
        gap: 8px;
    }

    .icon-button {
        width: 38px;
        height: 38px;
    }

    .avatar-xl {
        width: 64px;
        height: 64px;
        font-size: 1.55rem;
    }

    .card-stat,
    .widget,
    .content-card,
    .table-container,
    .card,
    .class-card {
        padding: 14px;
    }

    .btn,
    input,
    select,
    textarea {
        padding: 10px 11px;
    }

    .school-year-select {
        width: 100%;
        justify-content: space-between;
    }

    .school-year-select select {
        min-width: 0;
    }
}

.search-box > i {
    cursor: pointer;
    transition: color 0.16s ease, transform 0.16s ease;
}

.search-box > i:hover,
.search-box:focus-within > i {
    color: var(--primary);
    transform: scale(1.06);
}

.device-settings-panel {
    scroll-margin-top: 18px;
}

.device-settings-head {
    align-items: center;
}

.device-settings-head > div:nth-child(2) {
    flex: 1 1 auto;
}

.settings-section-label {
    display: block;
    margin-bottom: 2px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.device-close-others {
    margin-left: auto;
}

.device-session-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.device-session {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.device-session.is-revoked {
    opacity: 0.66;
}

.device-session-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 1.05rem;
}

.device-session-copy {
    min-width: 0;
}

.device-session-copy > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.device-session-copy strong,
.device-session-copy span,
.device-session-copy small {
    display: block;
}

.device-session-copy strong {
    overflow-wrap: anywhere;
}

.device-session-copy > span,
.device-session-copy small {
    margin-top: 3px;
    color: var(--text-gray);
    font-size: 0.78rem;
}

.badge-muted {
    color: var(--text-gray);
    background: var(--surface-muted);
}

.device-session-close {
    color: var(--danger);
}

@media (max-width: 720px) {
    .device-settings-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .device-close-others {
        width: 100%;
        margin-left: 54px;
    }

    .device-session {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 10px;
    }

    .device-session-icon {
        width: 38px;
        height: 38px;
    }
}

/* --- Limites visuales de parciales desplegados --- */
.teacher-idukay-grid .ledger-partial.is-expanded {
    border-right: 3px solid color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
    border-left: 3px solid color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
}

.teacher-idukay-grid .ledger-insumo-row .ledger-partial-boundary-start.is-expanded,
.teacher-idukay-grid tbody .ledger-period-summary.is-expanded-partial {
    border-left: 3px solid color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
}

.teacher-idukay-grid .ledger-partial-boundary-end.is-expanded {
    border-right: 3px solid color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
}

html[data-theme="dark"] .teacher-idukay-grid .ledger-partial.is-expanded,
html[data-theme="dark"] .teacher-idukay-grid .ledger-insumo-row .ledger-partial-boundary-start.is-expanded,
html[data-theme="dark"] .teacher-idukay-grid tbody .ledger-period-summary.is-expanded-partial,
html[data-theme="dark"] .teacher-idukay-grid .ledger-partial-boundary-end.is-expanded,
body.dark-mode .teacher-idukay-grid .ledger-partial.is-expanded,
body.dark-mode .teacher-idukay-grid .ledger-insumo-row .ledger-partial-boundary-start.is-expanded,
body.dark-mode .teacher-idukay-grid tbody .ledger-period-summary.is-expanded-partial,
body.dark-mode .teacher-idukay-grid .ledger-partial-boundary-end.is-expanded {
    border-color: #32c7ba !important;
}

/* --- Navegacion profesional: sidebar colapsable y topbar --- */
:root {
    --sidebar-collapsed-width: 86px;
    --topbar-height: 82px;
}

.dashboard-layout {
    background: var(--bg);
}

.sidebar,
.main-view {
    transition: width 0.24s ease, margin-left 0.24s ease, transform 0.24s ease;
}

.sidebar {
    overflow-x: hidden;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-collapse-button {
    flex: 0 0 auto;
}

.top-header {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 14px 0 18px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    backdrop-filter: blur(14px);
}

.top-title-area {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-title-copy {
    min-width: 0;
}

.breadcrumb-lite {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 800;
}

.breadcrumb-lite a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-lite span:last-child,
.top-title-copy h1,
.top-title-copy p {
    overflow-wrap: anywhere;
}

.top-year-select {
    margin-top: 0;
}

.top-notification,
.top-message {
    position: relative;
}

.top-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--danger);
    border: 2px solid var(--surface);
}

.account-menu {
    position: relative;
}

.account-menu .user-badge {
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.account-chevron {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.account-dropdown {
    min-width: 210px;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: none;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.account-menu.is-open .account-dropdown {
    display: grid;
    gap: 4px;
}

.account-dropdown a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.account-dropdown a:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.account-dropdown .account-logout {
    color: var(--danger);
}

.nav-link,
.theme-toggle,
.nav-group-title,
.icon-button,
.user-badge {
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.theme-toggle:hover,
.icon-button:hover,
.user-badge:hover {
    transform: translateY(-1px);
}

html.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed-width);
}

html.sidebar-collapsed .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

html.sidebar-collapsed .nav-logo span:not(.logo-mark),
html.sidebar-collapsed .nav-group-title span,
html.sidebar-collapsed .nav-group-title i,
html.sidebar-collapsed .nav-link span,
html.sidebar-collapsed .theme-toggle span,
html.sidebar-collapsed .logout-link span {
    display: none;
}

html.sidebar-collapsed .sidebar-head,
html.sidebar-collapsed .nav-link,
html.sidebar-collapsed .theme-toggle {
    justify-content: center;
}

html.sidebar-collapsed .sidebar-collapse-button {
    display: none;
}

html.sidebar-collapsed .nav-group-title {
    min-height: 8px;
    padding: 6px 0;
    justify-content: center;
}

html.sidebar-collapsed .nav-group-title::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--border);
}

html.sidebar-collapsed .nav-group.is-collapsed .nav-group-items {
    display: grid;
}

.sidebar-overlay {
    display: none;
    border: 0;
    position: fixed;
    inset: 0;
    z-index: 18;
    background: rgba(15, 23, 42, 0.42);
}

@media (max-width: 1060px) {
    html:not(.sidebar-collapsed) {
        --sidebar-width: 240px;
    }

    html.sidebar-collapsed {
        --sidebar-width: var(--sidebar-collapsed-width);
    }

    html:not(.sidebar-collapsed) .nav-logo span:not(.logo-mark),
    html:not(.sidebar-collapsed) .nav-link span,
    html:not(.sidebar-collapsed) .theme-toggle span {
        display: inline;
    }
}

@media (max-width: 720px) {
    :root,
    html.sidebar-collapsed {
        --sidebar-width: 0px;
    }

    .dashboard-layout {
        display: block;
    }

    .sidebar {
        width: min(310px, 86vw);
        height: 100vh;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        transform: translateX(-104%);
        align-items: stretch;
        padding: 18px;
        box-shadow: var(--shadow);
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-mobile-open .sidebar-overlay {
        display: block;
    }

    html.sidebar-collapsed .nav-logo span:not(.logo-mark),
    html.sidebar-collapsed .nav-group-title span,
    html.sidebar-collapsed .nav-group-title i,
    html.sidebar-collapsed .nav-link span,
    html.sidebar-collapsed .theme-toggle span,
    html.sidebar-collapsed .logout-link span {
        display: inline;
    }

    html.sidebar-collapsed .sidebar-head,
    html.sidebar-collapsed .nav-link,
    html.sidebar-collapsed .theme-toggle {
        justify-content: flex-start;
    }

    html.sidebar-collapsed .sidebar-collapse-button {
        display: inline-flex;
    }

    html.sidebar-collapsed .nav-group-title::before {
        display: none;
    }

    .main-view {
        width: 100%;
        margin-left: 0;
    }

    .top-header {
        position: sticky;
        padding-top: 10px;
    }

    .top-title-area,
    .top-actions {
        width: 100%;
    }

    .account-menu,
    .account-menu .user-badge {
        width: 100%;
    }

    .account-dropdown {
        width: 100%;
        position: static;
        margin-top: 8px;
    }

    .top-year-select {
        order: 10;
    }
}

/* --- Fix funcional del boton hamburguesa --- */
.sidebar-toggle {
    display: inline-flex;
}

body.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar {
    width: 80px;
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-collapsed .main-view,
html.sidebar-collapsed .main-view,
body.sidebar-collapsed .main-content,
html.sidebar-collapsed .main-content {
    width: calc(100% - 80px);
    margin-left: 80px;
}

body.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .theme-toggle span,
body.sidebar-collapsed .sidebar .logout-link span,
body.sidebar-collapsed .sidebar .nav-group-title span,
body.sidebar-collapsed .sidebar .nav-group-title i,
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .section-title,
html.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
html.sidebar-collapsed .sidebar .nav-link span,
html.sidebar-collapsed .sidebar .theme-toggle span,
html.sidebar-collapsed .sidebar .logout-link span,
html.sidebar-collapsed .sidebar .nav-group-title span,
html.sidebar-collapsed .sidebar .nav-group-title i,
html.sidebar-collapsed .sidebar .brand-text,
html.sidebar-collapsed .sidebar .nav-text,
html.sidebar-collapsed .sidebar .section-title {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-link,
body.sidebar-collapsed .sidebar .theme-toggle,
body.sidebar-collapsed .sidebar .sidebar-head,
html.sidebar-collapsed .sidebar .nav-link,
html.sidebar-collapsed .sidebar .theme-toggle,
html.sidebar-collapsed .sidebar .sidebar-head {
    justify-content: center;
}

body.sidebar-collapsed .sidebar .sidebar-collapse-button,
html.sidebar-collapsed .sidebar .sidebar-collapse-button {
    display: none;
}

@media (max-width: 720px) {
    body.sidebar-collapsed .main-view,
    html.sidebar-collapsed .main-view,
    body.sidebar-collapsed .main-content,
    html.sidebar-collapsed .main-content {
        width: 100%;
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed .sidebar {
        width: min(310px, 86vw);
        padding: 18px;
    }

    body.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .theme-toggle span,
    body.sidebar-collapsed .sidebar .logout-link span,
    body.sidebar-collapsed .sidebar .nav-group-title span,
    body.sidebar-collapsed .sidebar .nav-group-title i,
    html.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
    html.sidebar-collapsed .sidebar .nav-link span,
    html.sidebar-collapsed .sidebar .theme-toggle span,
    html.sidebar-collapsed .sidebar .logout-link span,
    html.sidebar-collapsed .sidebar .nav-group-title span,
    html.sidebar-collapsed .sidebar .nav-group-title i {
        display: inline;
    }

    body.sidebar-collapsed .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .theme-toggle,
    body.sidebar-collapsed .sidebar .sidebar-head,
    html.sidebar-collapsed .sidebar .nav-link,
    html.sidebar-collapsed .sidebar .theme-toggle,
    html.sidebar-collapsed .sidebar .sidebar-head {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar .sidebar-collapse-button,
    html.sidebar-collapsed .sidebar .sidebar-collapse-button {
        display: inline-flex;
    }
}

/* Ajustes finales de densidad y modales de cuaderno. */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 76px;
    --topbar-height: 68px;
    --content-gap: 18px;
    --card-padding: 20px;
    --control-height: 42px;
}

body {
    font-size: 14px;
}

.main-view {
    padding: 22px;
}

.top-header {
    min-height: var(--topbar-height);
    margin-bottom: 18px;
    padding: 14px 18px;
}

.top-header h1 {
    font-size: 1.55rem;
}

.content-card,
.table-container,
.matrix-form,
.module-head,
.chart-card {
    padding: var(--card-padding);
}

.dashboard-grid,
.stats-container,
.calendar-page-grid {
    gap: var(--content-gap);
}

.form-group input,
.form-group select,
.search-box input,
.filter-bar select {
    min-height: var(--control-height);
}

.btn {
    min-height: var(--control-height);
}

.sidebar {
    width: var(--sidebar-width);
    padding: 18px;
    gap: 14px;
}

body.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-view,
html.sidebar-collapsed .main-view,
body.sidebar-collapsed .main-content,
html.sidebar-collapsed .main-content {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

.admin-users-layout.dashboard-grid-wide {
    grid-template-columns: minmax(300px, 0.42fr) minmax(560px, 1.58fr);
    align-items: start;
}

.admin-users-layout .table-container {
    min-width: 0;
}

.activity-head {
    min-width: 136px;
    padding: 0;
    vertical-align: top;
}

.activity-head-button {
    width: 100%;
    min-height: 84px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.activity-head-button:hover,
.activity-head-button:focus-visible {
    background: var(--surface-soft);
    outline: none;
}

.activity-head-button strong,
.activity-head-button small {
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matrix-add-head,
.matrix-add-spacer {
    width: 58px;
    min-width: 58px;
    text-align: center;
}

.matrix-add-button {
    margin: 0 auto;
}

.option-stack {
    display: grid;
    gap: 8px;
}

body.modal-open {
    overflow: hidden;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.54);
}

.app-modal.is-open {
    display: flex;
}

.modal-dialog {
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.modal-dialog-wide {
    width: min(900px, 100%);
}

.modal-dialog-small {
    width: min(500px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    margin: 2px 0 0;
    font-size: 1.25rem;
}

.modal-body {
    overflow: auto;
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

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

.detail-grid div,
.detail-description {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.detail-grid span,
.detail-description span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-gray);
    font-size: 0.78rem;
}

.detail-description {
    margin-top: 12px;
}

.detail-description p {
    margin: 0;
    line-height: 1.55;
}

@media (max-width: 920px) {
    .admin-users-layout.dashboard-grid-wide {
        grid-template-columns: 1fr;
    }

    .main-view {
        padding: 18px;
    }

    .top-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .main-view,
    .main-content {
        padding: 14px;
    }

    .content-card,
    .table-container,
    .matrix-form,
    .module-head,
    .chart-card {
        padding: 16px;
    }

    .table-header-tools,
    .row-actions,
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .row-actions .btn,
    .filter-bar .btn,
    .filter-bar select {
        width: 100%;
    }

    .app-modal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-dialog,
    .modal-dialog-wide,
    .modal-dialog-small {
        width: 100%;
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }

    .modal-body,
    .modal-head {
        padding: 16px;
    }

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

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* Modulo de comportamiento y seguimiento: estilos internos, sin cambios globales. */
.behavior-workspace {
    display: grid;
    gap: 16px;
}

.behavior-workspace-head,
.behavior-filters,
.behavior-student-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.behavior-workspace-head {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.behavior-filters {
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.behavior-filters .search-box {
    flex: 1;
    min-width: 220px;
}

.behavior-filters select,
.behavior-filters input[type="date"] {
    min-height: var(--control-height);
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.behavior-split {
    display: grid;
    grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
    gap: 16px;
    min-height: 520px;
}

.behavior-student-list,
.behavior-detail-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.behavior-student-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 68vh;
    overflow: auto;
    padding: 10px;
}

.behavior-student-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.behavior-student-card:hover,
.behavior-student-card.is-active {
    border-color: var(--primary);
    background: var(--surface-soft);
}

.student-avatar-mini {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-weight: 800;
}

.student-card-main {
    min-width: 0;
}

.student-card-main strong,
.student-card-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-card-main small {
    color: var(--text-gray);
}

.student-counters {
    display: flex;
    gap: 4px;
}

.mini-count {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.mini-count.positive {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
}

.mini-count.warning {
    background: rgba(217, 119, 6, 0.14);
    color: var(--warning);
}

.mini-count.featured {
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent);
}

.behavior-detail-panel {
    padding: 16px;
}

.behavior-student-summary {
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.behavior-student-summary h3 {
    margin: 2px 0 6px;
    font-size: 1.25rem;
}

.behavior-summary-counts {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 8px;
}

.behavior-summary-counts span {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-gray);
    font-size: 0.8rem;
}

.behavior-summary-counts strong {
    display: block;
    color: var(--text);
    font-size: 1.25rem;
}

.behavior-history {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.observation-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--surface);
}

.observation-card-head,
.observation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.observation-card p {
    margin: 0;
    line-height: 1.55;
}

.observation-actions {
    color: var(--text-gray);
}

.observation-meta {
    color: var(--text-gray);
    font-size: 0.82rem;
}

.tone-positivo {
    border-left-color: var(--success);
}

.tone-seguimiento {
    border-left-color: var(--info);
}

.tone-advertencia {
    border-left-color: var(--warning);
}

.tone-destacado {
    border-left-color: var(--accent);
}

.tone-neutro {
    border-left-color: var(--primary);
}

@media (max-width: 920px) {
    .behavior-workspace-head,
    .behavior-filters,
    .behavior-student-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .behavior-split {
        grid-template-columns: 1fr;
    }

    .behavior-student-list {
        max-height: 340px;
    }

    .behavior-summary-counts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .behavior-summary-counts {
        grid-template-columns: 1fr;
    }

    .behavior-student-card {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .student-counters {
        grid-column: 2;
    }
}

/* Actividades, materiales y entregas */
.activity-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding: 20px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: 7px;
}

.activity-detail-hero h2,
.activity-detail-hero p {
    margin: 0;
}

.activity-detail-hero p:not(.eyebrow) {
    margin-top: 8px;
    color: var(--text-gray);
    line-height: 1.55;
}

.activity-detail-meta {
    display: grid;
    min-width: min(100%, 290px);
    gap: 8px;
}

.activity-detail-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 0.82rem;
}

.activity-detail-meta i {
    width: 18px;
    color: var(--primary);
    text-align: center;
}

.attachment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    align-items: start;
    gap: 16px;
}

.attachment-main-column {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.attachment-section {
    min-width: 0;
    padding: 18px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.attachment-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.attachment-section-head h2,
.attachment-section-head p {
    margin: 0;
}

.attachment-list,
.submission-list,
.attachment-upload-form {
    display: grid;
    gap: 10px;
}

.attachment-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 9px 11px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.attachment-row:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
}

.attachment-row > i:first-child {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
}

.attachment-row > i:last-child {
    color: var(--primary);
}

.attachment-row span,
.attachment-row strong,
.attachment-row small {
    display: block;
    min-width: 0;
}

.attachment-row strong {
    overflow: hidden;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-row small {
    margin-top: 2px;
    color: var(--text-gray);
}

.attachment-upload-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.attachment-upload-form label,
.activity-attachment-options label {
    color: var(--text);
    font-weight: 700;
}

.attachment-upload-form input[type="file"],
.activity-attachment-options input[type="file"] {
    width: 100%;
    padding: 9px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px dashed color-mix(in srgb, var(--primary) 55%, var(--border));
    border-radius: 6px;
}

.attachment-upload-form small,
.activity-attachment-options small {
    color: var(--text-gray);
}

.attachment-upload-form .btn {
    width: fit-content;
}

.activity-attachment-options {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 7px;
}

.submission-list article {
    display: grid;
    gap: 4px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.submission-list article:last-child {
    border-bottom: 0;
}

.submission-list span,
.submission-list small {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.submission-list a {
    margin-top: 4px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 900px) {
    .attachment-layout {
        grid-template-columns: 1fr;
    }

    .activity-detail-hero {
        flex-direction: column;
    }

    .activity-detail-meta {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .activity-detail-hero,
    .attachment-section {
        padding: 14px;
    }

    .attachment-upload-form .btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Panel flotante de notificaciones --- */
.notification-menu {
    position: relative;
    flex: 0 0 auto;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 45;
    width: min(400px, calc(100vw - 24px));
    display: none;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.notification-menu.is-open .notification-dropdown {
    display: block;
}

.notification-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-head strong,
.notification-dropdown-head span {
    display: block;
}

.notification-dropdown-head strong {
    color: var(--text);
    font-size: 0.78rem;
}

.notification-dropdown-head span {
    margin-top: 2px;
    color: var(--text-gray);
    font-size: 0.61rem;
}

.notification-dropdown-head a {
    color: var(--primary);
    font-size: 0.66rem;
    font-weight: 800;
    text-decoration: none;
}

.notification-dropdown-list {
    max-height: min(430px, calc(100vh - 190px));
    overflow-y: auto;
}

.notification-dropdown-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 8px;
    align-items: start;
    gap: 9px;
    min-height: 66px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-item:hover {
    background: var(--surface-soft);
}

.notification-dropdown-item.is-unread {
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.notification-dropdown-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border-radius: 6px;
}

.notification-dropdown-item > span:nth-child(2) {
    min-width: 0;
}

.notification-dropdown-item strong,
.notification-dropdown-item small,
.notification-dropdown-item time {
    display: block;
}

.notification-dropdown-item strong {
    color: var(--text);
    font-size: 0.7rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.notification-dropdown-item small {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--text-gray);
    font-size: 0.63rem;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notification-dropdown-item time {
    margin-top: 4px;
    color: var(--text-gray);
    font-size: 0.57rem;
}

.notification-unread-mark {
    margin-top: 4px;
    color: transparent;
    font-size: 0.42rem;
}

.notification-dropdown-item.is-unread .notification-unread-mark {
    color: var(--primary);
}

.notification-dropdown-empty {
    min-height: 170px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 0.7rem;
}

.notification-dropdown-empty i {
    color: var(--primary);
    font-size: 1.7rem;
}

.notification-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
}

.notification-dropdown-footer button,
.notification-dropdown-footer a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--primary);
    background: transparent;
    border: 0;
    font-size: 0.62rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 680px) {
    .notification-dropdown {
        position: fixed;
        top: 58px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: calc(100vh - 68px);
    }

    .notification-dropdown-list {
        max-height: calc(100vh - 185px);
    }
}

/* --- Entrada de reportes docentes --- */
.report-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 14px;
    margin-bottom: 14px;
    align-items: stretch;
}

.report-course-browser,
.report-ranking {
    min-width: 0;
}

.report-level-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin: 12px 0;
    background: var(--surface-soft);
    border-radius: 7px;
}

.report-level-tabs button {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 9px;
    color: var(--text-gray);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.report-level-tabs button.is-active {
    color: #fff;
    background: var(--primary);
}

.report-level-tabs button span {
    min-width: 22px;
    padding: 2px 6px;
    color: inherit;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 10px;
    font-size: 0.59rem;
}

.report-level-panel {
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.report-level-panel.is-active {
    display: block;
}

.report-level-panel > a {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 7px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.report-level-panel > a:hover,
.report-level-panel > a.is-selected {
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.report-course-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 11%, var(--surface));
    border-radius: 6px;
}

.report-level-panel > a > span:nth-child(2) {
    min-width: 0;
}

.report-level-panel strong,
.report-level-panel small {
    display: block;
}

.report-level-panel strong {
    color: var(--text);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.report-level-panel small {
    margin-top: 2px;
    color: var(--text-gray);
    font-size: 0.59rem;
}

.report-level-panel > a > span:nth-child(3) {
    text-align: right;
}

.report-level-panel > a > i {
    color: var(--text-gray);
    font-size: 0.61rem;
}

.report-ranking {
    padding: 14px;
}

.report-ranking-tabs,
.report-performance-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 10px 0;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.report-ranking-tabs button,
.report-performance-tabs a {
    min-width: 0;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 8px;
    color: var(--text-gray);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.report-ranking-tabs button.is-active,
.report-performance-tabs a.is-active {
    color: #fff;
    background: var(--primary);
}

.report-ranking-list {
    display: none;
    max-height: 385px;
    overflow-y: auto;
}

.report-ranking-list.is-active {
    display: block;
}

.report-ranking-list > article {
    min-width: 0;
    display: grid;
    grid-template-columns: 24px 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px 2px;
    border-bottom: 1px solid var(--border);
}

.report-ranking-list > article:last-child {
    border-bottom: 0;
}

.report-rank-number {
    color: var(--text-gray);
    font-size: 0.67rem;
    font-weight: 850;
    text-align: center;
}

.report-ranking-list .student-table-avatar {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

.report-ranking-list > article > span:nth-child(3) {
    min-width: 0;
}

.report-ranking-list strong,
.report-ranking-list small {
    display: block;
}

.report-ranking-list > article > span:nth-child(3) strong {
    color: var(--text);
    font-size: 0.67rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-ranking-list small {
    color: var(--text-gray);
    font-size: 0.58rem;
}

.report-ranking-list > article > strong {
    font-size: 0.78rem;
}

@media (max-width: 1050px) {
    .report-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .report-level-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .report-level-panel > a {
        grid-template-columns: 34px minmax(0, 1fr) auto;
    }

    .report-level-panel > a > i {
        display: none;
    }
}

/* --- Cabecera compacta en tablet y celular --- */
@media (max-width: 900px) {
    .top-header {
        min-height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 12px;
        padding: 8px 10px;
    }

    .top-title-area {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        gap: 8px;
    }

    .top-title-copy {
        min-width: 0;
    }

    .top-title-copy h1 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-title-copy p,
    .breadcrumb-lite {
        display: none;
    }

    .top-actions {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .top-year-select {
        display: none;
    }

    .top-header .icon-button,
    .top-header .sidebar-toggle-button {
        width: 36px;
        min-width: 36px;
        height: 36px;
        border-radius: 6px;
    }

    .account-menu,
    .account-menu .user-badge {
        width: auto;
    }

    .account-menu .user-badge {
        gap: 5px;
        min-height: 36px;
        padding: 3px 5px;
        border-radius: 6px;
    }

    .account-menu .user-badge > div:first-child,
    .account-chevron {
        display: none;
    }

    .account-menu .avatar {
        width: 28px;
        height: 28px;
        border-radius: 5px;
    }

    .account-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        width: 230px;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .main-view,
    .main-content {
        padding: 8px;
    }

    .top-header {
        top: 0;
        margin-right: -2px;
        margin-left: -2px;
        padding: 7px 8px;
    }

    .top-title-copy h1 {
        max-width: 135px;
        font-size: 0.96rem;
    }

    .top-header .icon-button,
    .top-header .sidebar-toggle-button {
        width: 34px;
        min-width: 34px;
        height: 34px;
    }

    .top-actions {
        gap: 4px;
    }

    .account-menu .user-badge {
        min-height: 34px;
    }

    .role-hero,
    .student-hero,
    .professor-dashboard-hero {
        gap: 10px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .role-hero h2,
    .student-id-card h2 {
        font-size: 1.2rem;
    }

    .role-hero p:not(.eyebrow) {
        font-size: 0.72rem;
    }
}

/* Matriz academica: encabezados solidos por tipo de insumo. */
.academic-matrix-table {
    --matrix-head-gap: var(--surface);
}

.academic-matrix-table thead .activity-head,
.academic-matrix-table thead .promedio-header,
.academic-matrix-table thead .matrix-add-head {
    --insumo-bg: #7c3aed;
    --insumo-bg-hover: #6d28d9;
    position: relative;
    min-height: 86px;
    overflow: hidden;
    color: #ffffff !important;
    background: var(--insumo-bg) !important;
    border-right: 4px solid var(--matrix-head-gap) !important;
    border-bottom: 4px solid var(--matrix-head-gap) !important;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    isolation: isolate;
}

.academic-matrix-table thead .activity-head::before,
.academic-matrix-table thead .promedio-header::before,
.academic-matrix-table thead .matrix-add-head::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--insumo-bg);
}

.academic-matrix-table thead .activity-head:hover,
.academic-matrix-table thead .promedio-header:hover,
.academic-matrix-table thead .matrix-add-head:hover,
.academic-matrix-table thead .activity-head:focus-within {
    background: var(--insumo-bg-hover) !important;
}

.academic-matrix-table thead .activity-head:hover::before,
.academic-matrix-table thead .promedio-header:hover::before,
.academic-matrix-table thead .matrix-add-head:hover::before,
.academic-matrix-table thead .activity-head:focus-within::before {
    background: var(--insumo-bg-hover);
}

.academic-matrix-table thead .activity-head strong,
.academic-matrix-table thead .activity-head small,
.academic-matrix-table thead .promedio-header,
.academic-matrix-table thead .matrix-add-head,
.academic-matrix-table thead .activity-head-button {
    color: #ffffff !important;
}

.academic-matrix-table thead .activity-head small {
    opacity: 0.92;
}

.academic-matrix-table thead .activity-head-button {
    min-height: 86px;
    background: transparent !important;
}

.academic-matrix-table thead .activity-head-button:hover,
.academic-matrix-table thead .activity-head-button:focus-visible {
    background: transparent !important;
}

.academic-matrix-table thead .category-chip {
    color: #ffffff !important;
    background: rgba(15, 23, 42, 0.22) !important;
    border: 1px solid rgba(255, 255, 255, 0.46);
}

.academic-matrix-table thead .matrix-add-button {
    color: #ffffff !important;
    background: rgba(15, 23, 42, 0.18);
}

.academic-matrix-table thead .matrix-add-button:hover,
.academic-matrix-table thead .matrix-add-button:focus-visible {
    background: rgba(15, 23, 42, 0.28);
}

.academic-matrix-table thead .insumo-tarea {
    --insumo-bg: #6d28d9;
    --insumo-bg-hover: #5b21b6;
}

.academic-matrix-table thead .insumo-actividad,
.academic-matrix-table thead .insumo-actividad-individual,
.academic-matrix-table thead .insumo-actividad-grupal {
    --insumo-bg: #8b5cf6;
    --insumo-bg-hover: #7c3aed;
}

.academic-matrix-table thead .insumo-leccion,
.academic-matrix-table thead .insumo-leccion-escrita {
    --insumo-bg: #2563eb;
    --insumo-bg-hover: #1d4ed8;
}

.academic-matrix-table thead .insumo-evaluacion,
.academic-matrix-table thead .insumo-proyecto {
    --insumo-bg: #0f766e;
    --insumo-bg-hover: #0d665f;
}

.academic-matrix-table thead .insumo-examen {
    --insumo-bg: #dc2626;
    --insumo-bg-hover: #b91c1c;
}

.academic-matrix-table thead .insumo-recuperacion {
    --insumo-bg: #ea580c;
    --insumo-bg-hover: #c2410c;
}

.academic-matrix-table thead .promedio-header {
    --insumo-bg: #64748b;
    --insumo-bg-hover: #475569;
    min-width: 112px;
    text-align: center;
    font-weight: 900;
}

.academic-matrix-table thead .matrix-add-head {
    --insumo-bg: #0f766e;
    --insumo-bg-hover: #0d665f;
}

html[data-theme="dark"] .academic-matrix-table,
body.dark-mode .academic-matrix-table {
    --matrix-head-gap: #101827;
}

/* Modulo academico: insumos, porcentajes y calificaciones. */
.academic-config-layout {
    align-items: flex-start;
}

.academic-filter-card {
    align-items: stretch;
    margin-bottom: 16px;
}

.academic-filter-card .filter-bar {
    width: 100%;
}

.academic-matrix-form .table-header-tools {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 12px 0;
    background: var(--bg);
}

.academic-matrix-table {
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.academic-matrix-table th,
.academic-matrix-table td {
    vertical-align: middle;
}

.academic-matrix-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 6;
    min-width: 210px;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}

.academic-matrix-table thead .sticky-col {
    z-index: 9;
}

.activity-head {
    min-width: 132px;
    max-width: 168px;
    padding: 10px 8px;
    white-space: normal;
}

.activity-head strong,
.activity-head small {
    display: block;
}

.activity-head strong {
    margin-top: 5px;
    font-size: 0.82rem;
    line-height: 1.2;
}

.activity-head small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

.category-chip {
    display: inline-flex;
    max-width: 100%;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 0.66rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.academic-matrix-table tbody tr:nth-child(even) td {
    background: var(--surface-soft);
}

.academic-matrix-table .input-nota {
    width: 76px;
    min-width: 76px;
    text-align: center;
    font-weight: 800;
}

.promedio-celda {
    font-weight: 900;
    text-align: center;
}

.grade-mid {
    color: var(--info) !important;
}

.input-nota.grade-low {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.input-nota.grade-high {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.subject-cell strong,
.subject-cell span {
    display: block;
}

.subject-cell span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}

.student-activity-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.student-activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.student-activity-item strong {
    white-space: nowrap;
}

.mail-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-soft);
    font-weight: 800;
    text-decoration: none;
}

.mail-tabs a.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

@media (max-width: 720px) {
    .academic-filter-card .filter-bar,
    .academic-matrix-form .table-header-tools,
    .academic-matrix-form .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .academic-matrix-table .sticky-col {
        min-width: 170px;
    }
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.table-responsive-xl {
    max-width: 100%;
    overflow-x: auto;
}

.empty-state {
    color: var(--text-gray);
    text-align: center;
    padding: 28px !important;
}

.filtro-oculto {
    display: none;
}

.nota {
    font-weight: 800;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    display: inline-block;
}

.nota-alta,
.nota-verde {
    background: #dcfce7;
    color: #166534;
}

.nota-baja,
.nota-roja {
    background: #fee2e2;
    color: #991b1b;
}

.nota-amarilla {
    background: #fef3c7;
    color: #92400e;
}

.matrix-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.matrix-form {
    padding-bottom: 82px;
}

.matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 9;
    min-width: 210px;
    background: var(--surface) !important;
    border-right: 1px solid var(--border);
}

.matrix-table thead .sticky-col {
    z-index: 12;
    background: var(--surface-soft) !important;
}

.sticky-col span {
    display: block;
    color: var(--text-gray);
    font-size: 0.78rem;
}

.input-nota {
    width: 72px;
    padding: 8px;
    text-align: center;
    font-weight: 800;
    background: var(--surface-soft);
}

.promedio-header,
.promedio-celda {
    font-weight: 800;
    color: var(--primary);
    background: var(--surface-soft);
}

.btn-save-all {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(5, 150, 105, 0.28);
    cursor: pointer;
    font-weight: 800;
}

.public-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.2), transparent 34%),
        linear-gradient(135deg, #ecfdf9 0%, #f4f6fa 52%, #fff8df 100%);
}

html[data-theme="dark"] .public-page,
.dark-mode.public-page {
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 34%),
        linear-gradient(135deg, #081a1f 0%, #10252b 58%, #16302f 100%);
}

.landing-nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-nav nav {
    display: flex;
    gap: 16px;
}

.landing-nav a {
    text-decoration: none;
    font-weight: 800;
}

.landing-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 50px;
}

.landing-hero {
    min-height: 70vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
    gap: 36px;
    align-items: center;
}

.hero-copy h1 {
    margin: 8px 0 14px;
    font-size: 4rem;
    line-height: 1;
}

.hero-copy p {
    color: var(--text-gray);
    max-width: 620px;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-panel {
    display: grid;
    gap: 14px;
}

.hero-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
}

.dark-mode .hero-card {
    background: rgba(23, 34, 53, 0.82);
}

.hero-card-main {
    min-height: 220px;
}

.mini-chart {
    height: 110px;
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: auto;
}

.mini-chart span {
    flex: 1;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.landing-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.landing-strip article {
    position: relative;
    overflow: hidden;
    padding: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(219, 227, 239, 0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.landing-strip article::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}

.landing-strip article:nth-child(2)::before { background: #0ea5e9; }
.landing-strip article:nth-child(3)::before { background: #f5b400; }
.landing-strip article:nth-child(4)::before { background: #f26b4f; }

.landing-strip article i { color: var(--primary-dark); }
.landing-strip article:nth-child(2) i { color: #037ca8; }
.landing-strip article:nth-child(3) i { color: #b87700; }
.landing-strip article:nth-child(4) i { color: #c74432; }

html[data-theme="dark"] .landing-strip article,
body.dark-mode .landing-strip article {
    color: #f5fbfb;
    background: rgba(17, 47, 54, 0.94);
    border-color: rgba(117, 173, 180, 0.28);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .landing-strip article i,
body.dark-mode .landing-strip article i { color: #5eead4; }
html[data-theme="dark"] .landing-strip article:nth-child(2) i,
body.dark-mode .landing-strip article:nth-child(2) i { color: #7dd3fc; }
html[data-theme="dark"] .landing-strip article:nth-child(3) i,
body.dark-mode .landing-strip article:nth-child(3) i { color: #f8cf57; }
html[data-theme="dark"] .landing-strip article:nth-child(4) i,
body.dark-mode .landing-strip article:nth-child(4) i { color: #ff9c88; }

.auth-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
}

.auth-visual {
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.auth-visual h1 {
    max-width: 620px;
    font-size: 3rem;
    line-height: 1.05;
}

.auth-visual p {
    max-width: 520px;
    color: var(--text-gray);
}

.auth-card {
    margin: 34px;
    align-self: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-card-wide {
    max-height: calc(100vh - 68px);
    overflow-y: auto;
}

.auth-header {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-header p,
.auth-links {
    color: var(--text-gray);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-weight: 800;
}

.role-field.is-hidden {
    display: none;
}

.recovery-link {
    display: grid;
    gap: 8px;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    word-break: break-all;
}

@media (max-width: 1060px) {
    :root {
        --sidebar-width: 84px;
    }

    .sidebar {
        padding: 16px 10px;
        align-items: center;
    }

    .nav-logo span:not(.logo-mark),
    .nav-link span,
    .theme-toggle span {
        display: none;
    }

    .nav-link,
    .theme-toggle {
        justify-content: center;
    }

    .dashboard-grid,
    .dashboard-grid-wide,
    .landing-hero,
    .auth-screen {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        padding-bottom: 0;
    }
}

@media (max-width: 720px) {
    :root {
        --sidebar-width: 0px;
    }

    .dashboard-layout {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        align-items: stretch;
    }

    .nav-logo span:not(.logo-mark),
    .nav-link span,
    .theme-toggle span {
        display: inline;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }

    .nav-link,
    .theme-toggle {
        justify-content: flex-start;
    }

    .main-view {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }

    .top-header,
    .table-header-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-badge {
        width: 100%;
        justify-content: space-between;
    }

    .two-columns,
    .landing-strip {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .auth-visual {
        margin: 18px;
        padding: 22px;
    }

    .auth-visual h1,
    .hero-copy h1 {
        font-size: 2.45rem;
    }

    .search-box {
        width: 100%;
        min-width: 0;
    }
}

/* --- Navegacion escolar por grupos --- */
.nav-group {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
}

.nav-group-title {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 8px 12px 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.nav-group-title i {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.nav-group.is-collapsed .nav-group-title i {
    transform: rotate(-90deg);
}

.nav-group-items {
    display: grid;
    gap: 5px;
}

.nav-group.is-collapsed .nav-group-items {
    display: none;
}

.nav-subheading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 34px;
    padding: 6px 11px;
    color: var(--text-gray);
    font-size: 0.74rem;
    font-weight: 750;
}

.nav-subheading i {
    width: 18px;
    color: var(--primary);
    text-align: center;
}

.nav-link.nav-link-nested {
    position: relative;
    padding-left: 38px;
}

.nav-link.nav-link-nested::before {
    content: "";
    position: absolute;
    left: 20px;
    width: 10px;
    height: 1px;
    background: var(--border-strong);
}

html.sidebar-collapsed .nav-subheading {
    display: none;
}

/* --- Login moderno dividido --- */
.login-modern-page {
    overflow-x: hidden;
}

.login-modern {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
    gap: 28px;
    padding: 28px;
}

.login-card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    margin-bottom: 28px;
}

.login-card-panel .auth-header h1 {
    font-size: 2.35rem;
    line-height: 1.05;
}

.login-visual-panel {
    position: relative;
    min-height: calc(100vh - 56px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 46, 46, 0.96), rgba(11, 107, 99, 0.9), rgba(20, 184, 166, 0.82), rgba(245, 180, 0, 0.72)),
        linear-gradient(45deg, #0f2e2e, #14b8a6);
    background-size: 260% 260%;
    animation: loginGradient 13s ease-in-out infinite;
}

@keyframes loginGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-visual-panel::before,
.login-visual-panel::after {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    height: 180px;
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(-6deg);
}

.login-visual-panel::before {
    top: 8%;
}

.login-visual-panel::after {
    bottom: 4%;
    transform: rotate(5deg);
}

.visual-orbit {
    position: absolute;
    width: 46%;
    height: 70px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    transform: rotate(-18deg);
}

.visual-orbit-one {
    top: 70px;
    right: 42px;
}

.visual-orbit-two {
    bottom: 110px;
    left: 38px;
    transform: rotate(18deg);
}

.school-visual-card {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(16px);
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.school-visual-card h2 {
    margin: 14px 0 10px;
    font-size: 2.5rem;
    line-height: 1.05;
}

.school-visual-card p {
    color: rgba(255, 255, 255, 0.86);
}

.visual-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 24px;
}

.visual-metrics article {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    gap: 2px;
}

.visual-metrics strong {
    font-size: 1.5rem;
}

.visual-metrics span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
}

.visual-tags article {
    align-items: center;
    grid-template-columns: auto 1fr;
}

.visual-tags i {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.floating-note {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
}

.note-a { top: 18%; left: 8%; }
.note-b { right: 10%; top: 24%; }
.note-c { right: 12%; bottom: 18%; }

/* --- Registro --- */
.register-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 1fr);
    gap: 22px;
    padding: 28px;
}

.register-hero {
    background: linear-gradient(135deg, rgba(15, 46, 46, 0.96), rgba(11, 107, 99, 0.9), rgba(20, 184, 166, 0.82));
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    overflow: hidden;
}

.register-hero .brand {
    color: #ffffff;
}

.register-hero h1 {
    font-size: 3rem;
    line-height: 1;
}

.register-hero p {
    color: rgba(255, 255, 255, 0.86);
}

.alert-info-soft {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
}

/* --- Landing preview --- */
.nova-hero {
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
}

.landing-dashboard-preview {
    min-height: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px;
    display: grid;
    align-content: center;
    gap: 16px;
    transform: rotate(1deg);
}

.preview-top {
    display: flex;
    gap: 8px;
}

.preview-top span {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary);
}

.preview-top span:nth-child(2) {
    background: var(--success);
}

.preview-top span:nth-child(3) {
    background: var(--accent);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.preview-grid article {
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    padding: 14px;
    display: grid;
    gap: 4px;
}

.preview-grid i {
    color: var(--primary);
}

.preview-grid strong {
    font-size: 1.55rem;
}

.preview-grid small {
    color: var(--text-gray);
    font-weight: 800;
}

.preview-line {
    width: 74%;
    height: 14px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.preview-line.wide {
    width: 100%;
}

.preview-line.short {
    width: 48%;
}

/* --- Dashboard por rol --- */
.student-hero,
.role-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 58%),
        var(--surface);
}

.professor-hero {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.16), transparent 58%),
        var(--surface);
}

.admin-hero {
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.16), transparent 58%),
        var(--surface);
}

.parent-hero {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.16), transparent 58%),
        var(--surface);
}

.student-id-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-xl {
    width: 82px;
    height: 82px;
    font-size: 2rem;
}

.student-id-card h2,
.role-hero h2 {
    font-size: 2rem;
    line-height: 1.1;
}

.student-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.student-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    font-weight: 800;
    font-size: 0.82rem;
}

.student-highlight {
    min-width: 190px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    display: grid;
    gap: 4px;
}

.student-highlight strong {
    font-size: 2.2rem;
    line-height: 1;
}

.student-highlight small,
.student-highlight span {
    color: rgba(255, 255, 255, 0.82);
}

.role-card-blue { border-top: 4px solid #2563eb; }
.role-card-green { border-top: 4px solid #10b981; }
.role-card-orange { border-top: 4px solid #f59e0b; }
.role-card-purple { border-top: 4px solid #7c3aed; }

.student-actions .quick-action:nth-child(1) { color: #2563eb; }
.student-actions .quick-action:nth-child(2) { color: #059669; }
.student-actions .quick-action:nth-child(3) { color: #d97706; }
.student-actions .quick-action:nth-child(4) { color: #7c3aed; }
.student-actions .quick-action:nth-child(5) { color: #0891b2; }
.student-actions .quick-action:nth-child(6) { color: #db2777; }

.mini-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.calendar-grid span {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    font-weight: 800;
}

.calendar-grid .today {
    background: var(--primary);
    color: #ffffff;
}

.inline-link {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.notice-item {
    display: grid;
    gap: 3px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.notice-item:last-child {
    border-bottom: 0;
}

.notice-item span,
.soft-empty {
    color: var(--text-gray);
}

.soft-empty {
    padding: 18px;
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    font-weight: 700;
}

/* --- Placeholders --- */
.placeholder-shell {
    min-height: 55vh;
    display: grid;
    gap: 16px;
    align-content: start;
}

.placeholder-card {
    width: min(760px, 100%);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
}

.placeholder-mini-grid {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.mini-module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
    display: grid;
    gap: 6px;
}

.mini-module-card i {
    color: var(--primary);
    font-size: 1.2rem;
}

.mini-module-card span {
    color: var(--text-gray);
    font-size: 0.88rem;
}

/* --- Calendario visual --- */
.calendar-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

.calendar-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.calendar-page-head h2 {
    font-size: 2rem;
}

.calendar-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(70px, 1fr));
    gap: 8px;
}

.calendar-weekday {
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-cell {
    min-height: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-cell.is-today {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.muted-cell {
    background: var(--surface-soft);
    opacity: 0.55;
}

.calendar-tag {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.tag-green {
    background: #dcfce7;
    color: #166534;
}

.tag-orange {
    background: #fef3c7;
    color: #92400e;
}

.tag-blue {
    background: #dbeafe;
    color: #1e40af;
}

.tag-purple {
    background: #ede9fe;
    color: #5b21b6;
}

.calendar-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.calendar-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Notificaciones y módulos reales --- */
.notification-list {
    display: grid;
    gap: 12px;
}

.notification-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.notification-item.is-unread {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent), var(--surface);
}

.notification-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--surface-soft);
}

.notification-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.notification-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-card,
.student-child-card {
    display: grid;
    gap: 12px;
}

/* --- Cuaderno de notas y asistencia --- */
.gradebook-tools,
.task-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.gradebook-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.gradebook-table {
    min-width: 1030px;
    table-layout: fixed;
}

.gradebook-table tbody tr:nth-child(even) td {
    background: rgba(37, 99, 235, 0.03);
}

.gradebook-table thead th { text-align: center; }

.subject-head,
.subject-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface) !important;
    font-weight: 800;
}

.gradebook-table .subject-head,
.gradebook-table .subject-cell {
    width: 250px;
    min-width: 250px;
}

.gradebook-table .subject-head {
    z-index: 8;
    padding: 12px 14px;
    text-align: left;
    vertical-align: bottom;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.gradebook-angle-head {
    --grade-head-bg: #16a34a;
    --grade-head-hover: #15803d;
    position: relative;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 94px;
    padding: 0 !important;
    overflow: hidden;
    color: #ffffff !important;
    background: var(--grade-head-bg) !important;
    clip-path: polygon(27px 0, 100% 0, 100% 100%, 0 100%, 0 27px);
    border-right: 2px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
    transition: background-color 160ms ease;
}

.gradebook-head-actions th {
    height: 22px;
    padding: 0 3px !important;
    text-align: center;
    vertical-align: middle;
    background: color-mix(in srgb, var(--surface) 94%, var(--primary)) !important;
    border-right: 2px solid var(--surface);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}

.gradebook-head-detail-button {
    display: inline-grid;
    width: 18px;
    height: 18px;
    padding: 0;
    place-items: center;
    color: #1785cf;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.66rem;
}

.gradebook-head-detail-button:hover,
.gradebook-head-detail-button:focus-visible,
.gradebook-head-detail-button.is-active {
    color: #ffffff;
    background: #1785cf;
    box-shadow: 0 0 0 2px color-mix(in srgb, #1785cf 20%, transparent);
}

.gradebook-insumo-heads th {
    height: 88px;
    padding: 0 !important;
    vertical-align: bottom;
    background: color-mix(in srgb, #eef8f8 86%, var(--surface)) !important;
    border-right: 2px solid var(--surface);
    border-bottom: 1px solid var(--border);
}

.gradebook-top-detail-pad {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    padding: 0 !important;
    background: color-mix(in srgb, var(--surface) 96%, var(--primary)) !important;
    border-right: 2px solid var(--surface);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}

.gradebook-insumo-spacer {
    background: transparent !important;
    border: 0 !important;
}

.gradebook-insumo-head {
    position: relative;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    overflow: hidden;
    color: #ffffff !important;
    background: #7b66ad !important;
    clip-path: polygon(27px 0, 100% 0, 100% 100%, 0 100%, 0 27px);
    border-right: 2px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head {
    background: #7b66ad !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head.insumo-type-tarea {
    background: #7e5bb7 !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head.insumo-type-actividad-individual {
    background: #6f5ab3 !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head.insumo-type-actividad-grupal {
    background: #5d62b7 !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head.insumo-type-leccion {
    background: #7554a8 !important;
}

.gradebook-insumo-heads th.gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    background: #8b5fbf !important;
}

.gradebook-insumo-head span {
    position: absolute;
    left: 12px;
    bottom: 8px;
    width: 118px;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 900;
    line-height: 0.95;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: left bottom;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.22);
}

.is-insumo-detail {
    display: none;
}

.is-insumo-detail.is-expanded {
    display: table-cell;
}

.gradebook-angle-head:hover {
    background: var(--grade-head-hover) !important;
}

.gradebook-angle-head span {
    position: absolute;
    left: 12px;
    bottom: 8px;
    width: 92px;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 0.95;
    text-align: left;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: left bottom;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.22);
}

.gradebook-head-average {
    --grade-head-bg: #64748b;
    --grade-head-hover: #475569;
}

.gradebook-head-trimester {
    --grade-head-bg: #1683c7;
    --grade-head-hover: #116da8;
}

.gradebook-head-partial {
    --grade-head-bg: #68a35b;
    --grade-head-hover: #568a4b;
}

.gradebook-head-exam {
    --grade-head-bg: #e56f5b;
    --grade-head-hover: #ce5846;
}

.period-head {
    text-align: center !important;
    color: #ffffff !important;
}

.period-one { background: #2563eb !important; }
.period-two { background: #0f766e !important; }
.period-three { background: #7c3aed !important; }
.avg-head { background: #f59e0b !important; color: #ffffff !important; }
.gradebook-score-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 9px 4px !important;
    text-align: center;
    font-weight: 900;
    white-space: nowrap;
}

.gradebook-trimester-score {
    background: color-mix(in srgb, #1683c7 7%, var(--surface)) !important;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: inline-grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    color: var(--text-gray);
    background: transparent;
    border: 0;
    border-radius: 6px;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--primary);
    background: var(--primary-soft);
}

.password-change-layout {
    display: grid;
    max-width: 680px;
    margin: 0 auto;
}

.password-change-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.password-change-heading h2,
.password-change-heading p,
.temporary-password-alert p {
    margin: 0;
}

.security-icon {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 8px;
}

.temporary-password-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0;
    padding: 14px;
    color: var(--text);
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 8px;
}

.temporary-password-alert code {
    padding: 8px 10px;
    color: #ffffff;
    background: var(--color-dark, #0f2e2e);
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

html[data-theme="dark"] .gradebook-angle-head,
body.dark-mode .gradebook-angle-head {
    border-right-color: var(--surface) !important;
    border-bottom-color: var(--surface) !important;
}

@media (max-width: 720px) {
    .gradebook-table .subject-head,
    .gradebook-table .subject-cell {
        width: 190px;
        min-width: 190px;
    }

    .temporary-password-alert {
        align-items: stretch;
        flex-direction: column;
    }

    .temporary-password-alert code {
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

.gradebook-score-cell.grade-low,
.activity-score.grade-low {
    color: #991b1b !important;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
}

.gradebook-score-cell.grade-mid,
.activity-score.grade-mid {
    color: #1d4ed8 !important;
}

.gradebook-score-cell.grade-high,
.activity-score.grade-high {
    color: #047857 !important;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 8px;
}

.score-empty {
    color: var(--text-gray);
    font-weight: 700;
}

.gradebook-detail-toggle {
    margin-top: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.gradebook-detail-row {
    display: none;
}

.gradebook-detail-row.is-open {
    display: table-row;
}

.gradebook-detail-row td {
    background: var(--surface) !important;
}

.gradebook-detail-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.gradebook-period-detail {
    display: grid;
    gap: 8px;
}

.gradebook-period-detail h3 {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.88rem;
}

.gradebook-activity-grid {
    display: grid;
    gap: 8px;
}

.gradebook-activity-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 120px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.gradebook-activity-row strong,
.gradebook-activity-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gradebook-activity-row span {
    color: var(--text-gray);
    font-size: 0.82rem;
}

.activity-period,
.activity-score {
    text-align: center;
}

.activity-score {
    padding: 6px 8px;
}
.grade-low,
.grade-low-text { color: var(--danger) !important; font-weight: 900; }
.grade-high { color: var(--success) !important; font-weight: 900; }

.student-gradebook-matrix {
    max-width: 100%;
    background: var(--surface);
}

.student-notes-table {
    min-width: 1020px;
    border-collapse: separate;
    border-spacing: 0;
}

.student-notes-table tbody tr.gradebook-subject-row:nth-child(4n + 1) td {
    background: color-mix(in srgb, #94a3b8 10%, var(--surface)) !important;
}

.student-notes-table .subject-head {
    height: 94px;
    vertical-align: bottom;
}

.student-notes-table .subject-head > span {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 800;
}

.student-notes-table thead .gradebook-angle-head {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 94px;
}

.student-notes-table thead .gradebook-insumo-head,
.student-notes-table thead .gradebook-top-detail-pad {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
}

.student-notes-table thead .gradebook-insumo-head {
    height: 88px;
    color: #ffffff !important;
    background: #6f55b5 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-tarea {
    background: #7a4fc7 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-individual {
    background: #6d5bd0 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-grupal {
    background: #5067c7 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-leccion {
    background: #8a55b5 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    background: #9a5bc5 !important;
}

.student-notes-table thead .gradebook-insumo-head span {
    color: #ffffff !important;
    font-size: 0.6rem;
    letter-spacing: 0;
}

.table-filter-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    width: min(260px, 100%);
    padding: 7px 10px;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.table-filter-mini:hover,
.table-filter-mini:focus-visible {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.student-notes-table .subject-cell {
    display: grid;
    gap: 4px;
    align-items: center;
    min-width: 286px;
    padding: 10px 12px !important;
}

.student-notes-table .subject-cell strong,
.student-notes-table .subject-cell small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-notes-table .subject-cell small {
    color: var(--text-gray);
    font-size: 0.74rem;
}

.subject-detail-button {
    display: inline-grid;
    width: 26px;
    height: 26px;
    padding: 0;
    place-items: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 6px;
    cursor: pointer;
}

.subject-detail-button:hover,
.subject-detail-button:focus-visible {
    color: #ffffff;
    background: var(--primary);
}

.student-notes-table .gradebook-score-cell {
    position: relative;
    height: 40px;
    padding: 5px !important;
    border-right: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    background-clip: padding-box;
}

.student-notes-table .gradebook-score-cell.grade-low,
.student-notes-table .gradebook-score-cell.grade-mid,
.student-notes-table .gradebook-score-cell.grade-high {
    background: color-mix(in srgb, var(--surface) 92%, var(--surface-soft)) !important;
    border-radius: 0;
}

.student-notes-table .gradebook-trimester-score.grade-low,
.student-notes-table .gradebook-trimester-score.grade-mid,
.student-notes-table .gradebook-trimester-score.grade-high {
    background: color-mix(in srgb, #1683c7 7%, var(--surface)) !important;
}

.student-notes-table .gradebook-score-cell.is-insumo-detail {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
}

.score-pill {
    display: inline-grid;
    width: 100%;
    min-width: 48px;
    min-height: 30px;
    padding: 5px 8px;
    place-items: center;
    color: inherit;
    background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--surface-soft) 74%, #ffffff));
    border: 1px solid color-mix(in srgb, #c9d7e8 86%, var(--border));
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        0 2px 5px rgba(15, 23, 42, 0.1);
    font-size: 0.86rem;
    line-height: 1;
}

.score-pill.is-empty {
    color: var(--text-gray);
    background: color-mix(in srgb, #ecf6f8 78%, var(--surface));
}

.gradebook-score-cell.grade-high .score-pill {
    color: #047857 !important;
    background: linear-gradient(180deg, #f1fff9, #e4f8ef);
    border-color: #b9e4d1;
}

.gradebook-score-cell.grade-mid .score-pill {
    color: #0b5ed7 !important;
    background: linear-gradient(180deg, #f5fbff, #e8f3ff);
    border-color: #bfd8f7;
}

.gradebook-score-cell.grade-low .score-pill {
    color: #b42318 !important;
    background: linear-gradient(180deg, #fff6f5, #fee8e8);
    border-color: #f5c2c0;
}

.score-detail-button {
    display: inline-grid;
    width: 100%;
    min-height: 28px;
    padding: 0;
    place-items: center;
    position: relative;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.score-detail-button i {
    position: absolute;
    right: 2px;
    top: 1px;
    display: inline-grid;
    width: 15px;
    height: 15px;
    place-items: center;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 999px;
    font-size: 0.55rem;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.score-detail-button:hover .score-pill,
.score-detail-button:focus-visible .score-pill {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}

.score-detail-button:hover i,
.score-detail-button:focus-visible i {
    color: #ffffff;
    background: var(--primary);
}

.cell-detail-chip {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    color: color-mix(in srgb, var(--primary) 55%, var(--text-gray));
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 0.62rem;
    font-weight: 900;
    cursor: pointer;
}

.cell-detail-chip::before,
.cell-detail-chip::after {
    position: absolute;
    color: currentColor;
    font-family: "Font Awesome 6 Free";
    font-size: 0.56rem;
    font-weight: 900;
    opacity: 0.56;
}

.cell-detail-chip::before {
    content: "\f060";
    left: 4px;
    bottom: 3px;
    transform: rotate(-45deg);
}

.cell-detail-chip::after {
    content: "\f061";
    top: 3px;
    right: 4px;
    transform: rotate(-45deg);
}

.cell-detail-chip.is-simple::before,
.cell-detail-chip.is-simple::after {
    display: none;
}

.cell-detail-chip:hover,
.cell-detail-chip:focus-visible {
    color: var(--primary);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}

.gradebook-filter-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px;
    padding: 14px 16px;
    color: var(--text-gray);
    background: var(--surface-soft);
    border: 1px dashed var(--border);
    border-radius: 10px;
    font-weight: 700;
}

.gradebook-filter-empty[hidden] {
    display: none;
}

.grade-detail-modal .modal-dialog {
    border-radius: 8px;
    overflow: hidden;
}

.grade-detail-modal .modal-head {
    background: var(--surface);
}

.grade-detail-modal .modal-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 1.05rem;
}

.grade-detail-modal .modal-head h2 i {
    color: var(--primary);
}

.grade-detail-modal .modal-head p {
    margin: 4px 0 0;
    color: var(--text-gray);
}

.grade-detail-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: #ffffff;
    background: linear-gradient(90deg, #2383d1, #2f7fc5);
    border-radius: 8px 8px 0 0;
    font-weight: 800;
}

.grade-detail-band span {
    font-size: 0.86rem;
    opacity: 0.92;
}

.grade-detail-table-wrap {
    overflow: auto;
    border: 1px solid color-mix(in srgb, #2383d1 28%, var(--border));
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.grade-detail-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.grade-detail-table th {
    padding: 10px 12px;
    color: #ffffff;
    background: #2f7fc5;
    text-align: left;
    font-size: 0.86rem;
}

.grade-detail-table th:first-child,
.grade-detail-table td:first-child {
    width: 48px;
    text-align: center;
}

.grade-detail-table th:last-child,
.grade-detail-table td:last-child {
    text-align: center;
}

.grade-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.grade-detail-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
}

.grade-detail-table tfoot td {
    color: #ffffff;
    background: #2f7fc5;
    border-bottom: 0;
    font-weight: 900;
}

.grade-detail-subnotes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
}

.grade-detail-subnotes small {
    padding: 3px 6px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

body.compact-grades .student-notes-table .gradebook-score-cell {
    height: 29px;
    padding: 2px !important;
}

body.compact-grades .score-pill {
    min-width: 36px;
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.78rem;
}

body.contrast-grades .score-pill {
    border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 2px 8px rgba(15, 23, 42, 0.12);
}

.student-gradebook {
    display: grid;
    gap: 16px;
}

.student-gradebook .gradebook-card {
    display: grid;
    gap: 16px;
    position: relative;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.student-gradebook .gradebook-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--color-accent-gold, #f5b400));
}

.gradebook-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(142px, 180px);
    gap: 16px;
    align-items: start;
}

.gradebook-card-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gradebook-card-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.25;
}

.gradebook-card-head p {
    margin: 6px 0 0;
    color: var(--text-gray);
    font-size: 0.88rem;
}

.gradebook-average {
    display: grid;
    gap: 3px;
    justify-items: end;
    padding: 12px;
    text-align: right;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.gradebook-average span {
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 800;
}

.gradebook-average strong {
    color: var(--text);
    font-size: 1.65rem;
    line-height: 1;
}

.gradebook-average em {
    color: var(--text-gray);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
}

.gradebook-average.is-excellent,
.trimester-card.is-excellent,
.partial-pill.is-excellent,
.gradebook-activity-row.is-excellent {
    border-color: rgba(5, 150, 105, 0.34);
    background: color-mix(in srgb, #10b981 12%, var(--surface));
}

.gradebook-average.is-approved,
.trimester-card.is-approved,
.partial-pill.is-approved,
.gradebook-activity-row.is-approved {
    border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.gradebook-average.is-risk,
.trimester-card.is-risk,
.partial-pill.is-risk,
.gradebook-activity-row.is-risk {
    border-color: rgba(220, 38, 38, 0.34);
    background: color-mix(in srgb, #ef4444 10%, var(--surface));
}

.gradebook-average.is-empty,
.trimester-card.is-empty,
.partial-pill.is-empty,
.gradebook-activity-row.is-empty {
    border-color: color-mix(in srgb, #94a3b8 34%, var(--border));
    background: color-mix(in srgb, #94a3b8 8%, var(--surface));
}

.gradebook-trimester-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.trimester-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.trimester-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.trimester-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

.trimester-card-head span {
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 900;
}

.partial-list {
    display: grid;
    gap: 8px;
}

.partial-pill {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}

.partial-pill span {
    overflow: hidden;
    color: var(--text-gray);
    font-size: 0.82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partial-pill strong {
    color: var(--text);
    font-size: 0.92rem;
    white-space: nowrap;
}

.student-gradebook .gradebook-detail-toggle {
    justify-self: start;
    margin-top: 0;
}

.student-gradebook .gradebook-detail-row {
    display: none;
}

.student-gradebook .gradebook-detail-row.is-open {
    display: block;
}

.student-gradebook .gradebook-detail-panel {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.student-gradebook .gradebook-period-detail h3 {
    color: var(--text);
    font-size: 0.92rem;
}

.student-gradebook .gradebook-activity-row {
    grid-template-columns: minmax(220px, 1fr) minmax(86px, 0.35fr) minmax(86px, 0.35fr) minmax(86px, 0.35fr) minmax(96px, auto);
    background: var(--surface);
}

.student-gradebook .gradebook-activity-row > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.student-gradebook .activity-score {
    text-align: right;
}

html[data-theme="dark"] .student-gradebook .gradebook-card,
body.dark-mode .student-gradebook .gradebook-card,
html[data-theme="dark"] .student-gradebook .gradebook-detail-panel,
body.dark-mode .student-gradebook .gradebook-detail-panel {
    box-shadow: none;
}

@media (max-width: 980px) {
    .student-gradebook .gradebook-activity-row {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(76px, auto));
    }
}

@media (max-width: 760px) {
    .gradebook-trimester-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .student-gradebook .gradebook-card {
        padding: 14px;
    }

    .gradebook-card-head {
        grid-template-columns: 1fr;
    }

    .gradebook-average {
        justify-items: start;
        text-align: left;
    }

    .student-gradebook .gradebook-activity-row {
        grid-template-columns: 1fr;
    }

    .student-gradebook .gradebook-activity-row span,
    .student-gradebook .activity-score {
        text-align: left;
        white-space: normal;
    }
}

/* --- Tareas --- */
.task-tabs,
.mail-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-tabs button,
.mail-tabs button {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-gray);
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 800;
}

.task-tabs button.active,
.mail-tabs button.active {
    background: var(--primary);
    color: #ffffff;
}

.task-actions,
.mail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.task-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}

.task-state.pending { color: var(--warning); }
.task-state.past { color: var(--muted); }

.task-family-state {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.task-family-state span {
    padding: 3px 7px;
    color: #7a5900;
    background: #fff1bd;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}

.task-family-state span.done { color: #08725a; background: #dff7ec; }
.task-family-state span.late { color: #a52222; background: #ffe1e1; }
[data-theme="dark"] .task-family-state span { color: #ffd96a; background: #3b3217; }
[data-theme="dark"] .task-family-state span.done { color: #78f3d1; background: #153b31; }
[data-theme="dark"] .task-family-state span.late { color: #ff9b9b; background: #402126; }
.task-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    background: var(--surface-soft);
    font-weight: 800;
    text-decoration: none;
}
.task-tabs a.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.class-tag {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--primary);
    font-weight: 800;
}

.task-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-gray);
    font-size: 0.86rem;
    margin-top: 14px;
}

/* --- Resumen anual --- */
.annual-summary {
    display: grid;
    gap: 18px;
}

.timeline-progress {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.timeline-progress span {
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    font-weight: 800;
}

.timeline-progress span.active {
    background: var(--primary);
    color: #ffffff;
}

.subject-summary-card {
    min-height: 150px;
}

.chart-card canvas {
    max-height: 330px;
}

/* --- Comportamiento --- */
.module-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-pills a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--text-gray);
    font-weight: 800;
}

.filter-pills a.active {
    background: var(--primary);
    color: #ffffff;
}

.behavior-list {
    display: grid;
    gap: 12px;
}

.behavior-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

/* --- Mensajes --- */
.mail-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
}

.mail-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 12px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.mail-folder {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-gray);
    font-weight: 800;
}

.mail-folder.active,
.mail-folder:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.mail-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.mail-list {
    display: grid;
    gap: 8px;
}

.mail-row {
    display: grid;
    grid-template-columns: auto minmax(110px, 0.25fr) minmax(220px, 1fr) auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.mail-row.is-unread {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent), var(--surface);
}

.mail-status {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    background: var(--primary);
}

.mail-row p {
    color: var(--text-gray);
    font-size: 0.86rem;
}

/* --- Perfil por secciones --- */
.profile-card {
    max-width: 1100px;
}

.profile-sections {
    display: grid;
    gap: 18px;
}

.profile-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: var(--surface);
}

.profile-section legend {
    padding: 0 8px;
    color: var(--primary);
    font-weight: 800;
}

/* --- Configuracion de cuenta --- */
.settings-layout {
    display: grid;
    gap: 18px;
    max-width: 1120px;
}

.settings-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
}

.settings-hero h2,
.settings-hero p,
.settings-panel h3,
.settings-panel p {
    margin: 0;
}

.settings-kicker {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.settings-hero-icon {
    display: inline-grid;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--color-primary-dark, #0b6b63));
    border-radius: 14px;
    font-size: 1.45rem;
}

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

.settings-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.settings-panel-wide {
    grid-column: 1 / -1;
}

.settings-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.settings-panel-head p {
    margin-top: 4px;
    color: var(--text-gray);
}

.settings-icon {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 10px;
}

.settings-action-stack {
    display: grid;
    gap: 10px;
}

.settings-action-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.settings-action-button span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.settings-action-button:hover,
.settings-action-button:focus-visible {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.settings-preferences {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-switch-list {
    display: grid;
    gap: 10px;
}

.settings-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 800;
}

.settings-switch input {
    width: 42px;
    height: 22px;
    accent-color: var(--primary);
}

.settings-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--text-gray);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 700;
}

.settings-check input {
    accent-color: var(--primary);
}

.settings-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-status-grid div {
    display: grid;
    gap: 4px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.settings-status-grid span {
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (max-width: 820px) {
    .settings-grid,
    .settings-preferences,
    .settings-status-grid {
        grid-template-columns: 1fr;
    }

    .settings-hero {
        align-items: flex-start;
        flex-direction: column;
    }
}

.security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-gray);
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    padding: 12px;
}

.security-note i {
    color: var(--primary);
}

.placeholder-icon {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 2rem;
}

.placeholder-card h2 {
    margin: 10px 0 5px;
    font-size: 2rem;
}

.placeholder-card p {
    color: var(--text-gray);
}

.placeholder-progress {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 0.7fr 0.45fr;
    gap: 10px;
}

.placeholder-progress span {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-soft);
}

@media (max-width: 1060px) {
    .nav-group-title {
        display: none;
    }

    .login-modern,
    .register-shell,
    .nova-hero {
        grid-template-columns: 1fr;
    }

    .login-visual-panel {
        min-height: 420px;
    }

    .student-hero,
    .role-hero {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .nav-group-title {
        display: block;
        grid-column: 1 / -1;
    }

    .login-modern,
    .register-shell {
        padding: 16px;
    }

    .login-visual-panel {
        padding: 24px;
        min-height: 430px;
    }

    .school-visual-card h2,
    .register-hero h1 {
        font-size: 2.1rem;
    }

    .floating-note,
    .visual-orbit {
        display: none;
    }

    .visual-metrics,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .student-id-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .placeholder-card {
        grid-template-columns: 1fr;
    }

    .placeholder-progress {
        grid-template-columns: 1fr;
    }

    .placeholder-mini-grid,
    .calendar-page-grid {
        grid-template-columns: 1fr;
    }

    .calendar-board {
        grid-template-columns: repeat(7, minmax(38px, 1fr));
        gap: 5px;
    }

    .calendar-cell {
        min-height: 66px;
        padding: 6px;
    }

    .calendar-tag {
        font-size: 0.62rem;
        padding: 3px 5px;
    }

    .gradebook-activity-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .activity-period,
    .activity-score {
        text-align: left;
    }

    .notification-item {
        grid-template-columns: 1fr;
    }

    .notification-actions {
        justify-content: stretch;
    }

    .notification-actions .btn,
    .notification-actions form {
        width: 100%;
    }
}

/* Sidebar toggle: reglas finales para que no las pisen media queries anteriores. */
.sidebar-toggle {
    display: inline-flex;
}

body.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar {
    width: 80px;
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-collapsed .main-view,
html.sidebar-collapsed .main-view,
body.sidebar-collapsed .main-content,
html.sidebar-collapsed .main-content {
    width: calc(100% - 80px);
    margin-left: 80px;
}

body.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .theme-toggle span,
body.sidebar-collapsed .sidebar .logout-link span,
body.sidebar-collapsed .sidebar .nav-group-title span,
body.sidebar-collapsed .sidebar .nav-group-title i,
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .section-title,
html.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
html.sidebar-collapsed .sidebar .nav-link span,
html.sidebar-collapsed .sidebar .theme-toggle span,
html.sidebar-collapsed .sidebar .logout-link span,
html.sidebar-collapsed .sidebar .nav-group-title span,
html.sidebar-collapsed .sidebar .nav-group-title i,
html.sidebar-collapsed .sidebar .brand-text,
html.sidebar-collapsed .sidebar .nav-text,
html.sidebar-collapsed .sidebar .section-title {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-link,
body.sidebar-collapsed .sidebar .theme-toggle,
body.sidebar-collapsed .sidebar .sidebar-head,
html.sidebar-collapsed .sidebar .nav-link,
html.sidebar-collapsed .sidebar .theme-toggle,
html.sidebar-collapsed .sidebar .sidebar-head {
    justify-content: center;
}

body.sidebar-collapsed .sidebar .sidebar-collapse-button,
html.sidebar-collapsed .sidebar .sidebar-collapse-button {
    display: none;
}

@media (max-width: 1060px) and (min-width: 721px) {
    html:not(.sidebar-collapsed) {
        --sidebar-width: 240px;
    }

    html:not(.sidebar-collapsed) .sidebar {
        width: var(--sidebar-width);
        align-items: stretch;
        padding: 18px;
    }

    html:not(.sidebar-collapsed) .nav-logo span:not(.logo-mark),
    html:not(.sidebar-collapsed) .nav-link span,
    html:not(.sidebar-collapsed) .theme-toggle span,
    html:not(.sidebar-collapsed) .logout-link span {
        display: inline;
    }

    html:not(.sidebar-collapsed) .nav-link,
    html:not(.sidebar-collapsed) .theme-toggle {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    body.sidebar-collapsed .main-view,
    html.sidebar-collapsed .main-view,
    body.sidebar-collapsed .main-content,
    html.sidebar-collapsed .main-content,
    .main-view,
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        width: min(310px, 86vw);
        height: 100vh;
        padding: 18px;
        transform: translateX(-110%);
        transition: transform 0.2s ease;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .theme-toggle span,
    body.sidebar-collapsed .sidebar .logout-link span,
    body.sidebar-collapsed .sidebar .nav-group-title span,
    body.sidebar-collapsed .sidebar .nav-group-title i,
    html.sidebar-collapsed .sidebar .nav-logo span:not(.logo-mark),
    html.sidebar-collapsed .sidebar .nav-link span,
    html.sidebar-collapsed .sidebar .theme-toggle span,
    html.sidebar-collapsed .sidebar .logout-link span,
    html.sidebar-collapsed .sidebar .nav-group-title span,
    html.sidebar-collapsed .sidebar .nav-group-title i {
        display: inline;
    }

    body.sidebar-collapsed .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .theme-toggle,
    body.sidebar-collapsed .sidebar .sidebar-head,
    html.sidebar-collapsed .sidebar .nav-link,
    html.sidebar-collapsed .sidebar .theme-toggle,
    html.sidebar-collapsed .sidebar .sidebar-head {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar .sidebar-collapse-button,
    html.sidebar-collapsed .sidebar .sidebar-collapse-button {
        display: inline-flex;
    }
}

/* Identidad NovaClass: logo completo expandido e icono en sidebar colapsado. */
.nav-logo .brand-logo-full {
    width: 142px;
    height: 82px;
}

body.sidebar-collapsed .sidebar .brand-logo-full,
html.sidebar-collapsed .sidebar .brand-logo-full {
    display: none;
}

body.sidebar-collapsed .sidebar .brand-logo-icon,
html.sidebar-collapsed .sidebar .brand-logo-icon {
    display: block;
}

body.sidebar-collapsed .sidebar .nav-logo,
html.sidebar-collapsed .sidebar .nav-logo {
    justify-content: center;
}

@media (max-width: 720px) {
    body.sidebar-collapsed .sidebar .brand-logo-full,
    html.sidebar-collapsed .sidebar .brand-logo-full,
    .sidebar .brand-logo-full {
        display: block;
    }

    body.sidebar-collapsed .sidebar .brand-logo-icon,
    html.sidebar-collapsed .sidebar .brand-logo-icon,
    .sidebar .brand-logo-icon {
        display: none;
    }

    body.sidebar-collapsed .sidebar .nav-logo,
    html.sidebar-collapsed .sidebar .nav-logo,
    .sidebar .nav-logo {
        justify-content: flex-start;
    }
}

/* Override finalisimo EOF: mantener solidos los encabezados de la matriz academica. */
.academic-matrix-table thead .activity-head,
.academic-matrix-table thead .promedio-header,
.academic-matrix-table thead .matrix-add-head {
    color: #ffffff !important;
    background: var(--insumo-bg, #7c3aed) !important;
    border-right: 4px solid var(--matrix-head-gap, var(--surface)) !important;
    border-bottom: 4px solid var(--matrix-head-gap, var(--surface)) !important;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.academic-matrix-table thead .activity-head strong,
.academic-matrix-table thead .activity-head small,
.academic-matrix-table thead .activity-head-button,
.academic-matrix-table thead .promedio-header,
.academic-matrix-table thead .matrix-add-head,
.academic-matrix-table thead .matrix-add-button,
.academic-matrix-table thead .matrix-add-button i {
    color: #ffffff !important;
}

.academic-matrix-table thead .activity-head-button,
.academic-matrix-table thead .activity-head-button:hover,
.academic-matrix-table thead .activity-head-button:focus-visible {
    background: transparent !important;
}

.academic-matrix-table thead .category-chip {
    color: #ffffff !important;
    background: rgba(15, 23, 42, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.46) !important;
}

/* Ajuste final de legibilidad para Mis Notas: cabezales finos, compactos y solidos. */
.student-notes-table .gradebook-score-cell,
.student-notes-table thead .gradebook-head-actions th {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
}

.student-notes-table thead .gradebook-angle-head {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 74px !important;
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px) !important;
    border-right-width: 2px !important;
}

.student-notes-table thead .gradebook-angle-head span {
    left: 10px !important;
    bottom: 7px !important;
    width: 88px !important;
    font-size: 0.62rem !important;
    line-height: 0.95 !important;
    letter-spacing: 0 !important;
}

.student-notes-table thead .gradebook-head-actions th {
    height: 20px !important;
    padding: 0 2px !important;
}

.student-notes-table thead .gradebook-head-detail-button {
    width: 17px !important;
    height: 17px !important;
    font-size: 0.62rem !important;
    color: #0b84d8 !important;
}

.student-notes-table thead .gradebook-insumo-heads th {
    height: 82px !important;
    background: color-mix(in srgb, #effafa 88%, var(--surface)) !important;
}

.student-notes-table thead .gradebook-top-detail-pad,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table .gradebook-score-cell.is-insumo-detail {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
}

.student-notes-table thead .gradebook-insumo-head {
    height: 82px !important;
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px) !important;
    border-right-width: 2px !important;
}

.student-notes-table thead .gradebook-insumo-head span {
    left: 10px !important;
    bottom: 7px !important;
    width: 126px !important;
    font-size: 0.54rem !important;
    line-height: 0.92 !important;
    letter-spacing: 0 !important;
    color: #ffffff !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-tarea {
    background: #7a4fc7 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-individual {
    background: #6d5bd0 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-grupal {
    background: #5067c7 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-leccion {
    background: #8a55b5 !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    background: #9a5bc5 !important;
}

.student-notes-table .subject-head {
    height: 74px !important;
}

/* Pulido visual de Mis Notas: cabezales redondeados, menos ruido y nombres legibles. */
.student-notes-table .subject-cell {
    min-width: 286px !important;
    padding: 9px 12px !important;
}

.student-notes-table .subject-cell strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    color: var(--text) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    line-height: 1.22 !important;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.student-notes-table .subject-cell small {
    display: none !important;
}

.student-notes-table thead .gradebook-angle-head,
.student-notes-table thead .gradebook-insumo-head {
    overflow: visible !important;
    isolation: isolate;
    background: transparent !important;
    clip-path: none !important;
    border-right: 3px solid var(--surface) !important;
    border-bottom: 0 !important;
    border-radius: 8px 8px 3px 3px !important;
}

.student-notes-table thead .gradebook-angle-head::before,
.student-notes-table thead .gradebook-insumo-head::before {
    content: "";
    position: absolute;
    inset: 0 3px 0 0;
    z-index: -1;
    background: var(--insumo-head-bg, var(--grade-head-bg, #6f55b5));
    border-radius: 8px 8px 3px 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 1px 0 rgba(15, 23, 42, 0.08);
    transform: skewX(-38deg);
    transform-origin: 100% 100%;
}

.student-notes-table thead .gradebook-angle-head:hover::before {
    background: var(--grade-head-hover, var(--grade-head-bg, #0b84d8));
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-tarea {
    --insumo-head-bg: #7a4fc7;
    background: transparent !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-individual {
    --insumo-head-bg: #6d5bd0;
    background: transparent !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-actividad-grupal {
    --insumo-head-bg: #5067c7;
    background: transparent !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-leccion {
    --insumo-head-bg: #8a55b5;
    background: transparent !important;
}

.student-notes-table thead .gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    --insumo-head-bg: #9a5bc5;
    background: transparent !important;
}

.student-notes-table thead .gradebook-insumo-heads th {
    background: color-mix(in srgb, #eaf9f8 78%, var(--surface)) !important;
}

.student-notes-table thead .gradebook-head-detail-button,
.student-notes-table thead .gradebook-head-detail-button.is-active,
.student-notes-table thead .gradebook-head-detail-button:hover,
.student-notes-table thead .gradebook-head-detail-button:focus-visible {
    color: #0b84d8 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 5px !important;
}

.student-notes-table thead .gradebook-head-detail-button.is-active {
    color: var(--primary) !important;
    background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
}

/* Sidebar: collapse mas ligero, sin transiciones internas pesadas durante el clic. */
.sidebar,
.main-view,
.main-content {
    transition-duration: 0.16s !important;
    transition-timing-function: cubic-bezier(0.2, 0, 0.2, 1) !important;
}

.sidebar {
    contain: layout paint;
    will-change: width, transform;
}

.main-view,
.main-content {
    will-change: margin-left, width;
}

body.sidebar-animating .sidebar *,
html.sidebar-animating .sidebar * {
    transition: none !important;
}

/* Mis Notas: sin fila fantasma cuando los insumos estan cerrados. */
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads,
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
    background: transparent !important;
}

.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads span,
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads .gradebook-insumo-head::before {
    display: none !important;
}

.student-notes-table thead .gradebook-angle-head span,
.student-notes-table thead .gradebook-insumo-head span {
    left: 50% !important;
    bottom: 9px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    transform-origin: center bottom !important;
}

.student-notes-table thead .gradebook-angle-head span {
    width: 78px !important;
}

.student-notes-table thead .gradebook-insumo-head span {
    width: 104px !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-heads,
.student-notes-table.has-expanded-details thead .gradebook-insumo-heads th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    line-height: 0 !important;
    background: transparent !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head {
    height: 0 !important;
    overflow: visible !important;
    z-index: 12;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    top: auto !important;
    right: 3px !important;
    bottom: 4px !important;
    left: 0 !important;
    height: 70px !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    bottom: 13px !important;
    font-size: 0.52rem !important;
    z-index: 2;
}

/* Sidebar: en escritorio se colapsa inmediato para evitar tirones con tablas anchas. */
@media (min-width: 721px) {
    .sidebar,
    .main-view,
    .main-content {
        transition: none !important;
        will-change: auto !important;
    }

    .nav-link:hover,
    .theme-toggle:hover,
    .icon-button:hover,
    .user-badge:hover {
        transform: none !important;
    }
}

/* Afinado final de Mis Notas: textos centrados y notas menos pesadas. */
.student-notes-table thead .gradebook-angle-head span {
    left: 50% !important;
    bottom: 14px !important;
    width: 72px !important;
    height: 12px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.56rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    transform-origin: center center !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    left: 50% !important;
    bottom: 18px !important;
    width: 94px !important;
    height: 12px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.48rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    transform-origin: center center !important;
}

.student-notes-table .gradebook-score-cell {
    height: 36px !important;
    padding: 4px !important;
}

.student-notes-table .score-pill {
    min-width: 42px !important;
    min-height: 26px !important;
    padding: 4px 6px !important;
    border-radius: 7px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

/* Mis Notas: alineacion final de cabeceras inclinadas y desplegables solo por parcial. */
.student-notes-table .gradebook-head-static {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
}

.student-notes-table thead .gradebook-angle-head,
.student-notes-table thead .gradebook-head-actions th,
.student-notes-table thead .gradebook-insumo-spacer,
.student-notes-table thead .gradebook-insumo-head {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
}

.student-notes-table thead .gradebook-angle-head {
    height: 78px !important;
    border-radius: 8px 8px 0 0;
    clip-path: polygon(24px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%, 0 24px);
}

.student-notes-table thead .gradebook-angle-head span {
    left: 50% !important;
    top: 52% !important;
    bottom: auto !important;
    width: 78px !important;
    height: 12px !important;
    font-size: 0.5rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    transform: translate(-50%, -50%) rotate(-45deg) !important;
    transform-origin: center center !important;
}

.student-notes-table thead .gradebook-head-actions th {
    height: 20px !important;
}

.student-notes-table thead .gradebook-head-detail-button {
    width: 18px !important;
    height: 18px !important;
    font-size: 0.68rem !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head {
    height: 0 !important;
    overflow: visible !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    right: 2px !important;
    bottom: 28px !important;
    left: 1px !important;
    height: 70px !important;
    border-radius: 8px 8px 0 0 !important;
    clip-path: polygon(22px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%, 0 22px) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    left: 50% !important;
    top: auto !important;
    bottom: 55px !important;
    width: 90px !important;
    height: 12px !important;
    font-size: 0.4rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    transform-origin: center center !important;
}

.student-notes-table .gradebook-score-cell {
    height: 34px !important;
    padding: 3px 4px !important;
}

.student-notes-table .score-pill {
    min-width: 40px !important;
    min-height: 24px !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
}

/* Mis Notas: centrado legible de nombres dentro de sus recuadros inclinados. */
.student-notes-table thead .gradebook-angle-head {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 84px !important;
    border-radius: 9px 9px 0 0 !important;
    clip-path: polygon(22px 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%, 0 22px) !important;
}

.student-notes-table thead .gradebook-head-actions th,
.student-notes-table thead .gradebook-insumo-spacer,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table .gradebook-head-static {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
}

.student-notes-table thead .gradebook-angle-head span {
    position: absolute !important;
    left: 9px !important;
    top: auto !important;
    right: auto !important;
    bottom: 13px !important;
    width: 82px !important;
    height: 11px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
    color: #ffffff !important;
    font-size: 0.49rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    right: 2px !important;
    bottom: 20px !important;
    left: 2px !important;
    height: 70px !important;
    border-radius: 9px 9px 0 0 !important;
    clip-path: polygon(22px 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%, 0 22px) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    position: absolute !important;
    left: 8px !important;
    top: auto !important;
    right: auto !important;
    bottom: 39px !important;
    width: 92px !important;
    height: 11px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    color: #ffffff !important;
    font-size: 0.39rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
}

/* Mis Notas: version limpia y estable. Sin diagonales para priorizar legibilidad. */
.student-gradebook-matrix {
    border-radius: 12px !important;
}

.student-notes-table {
    table-layout: fixed !important;
    border-spacing: 0 !important;
}

.student-notes-table thead .gradebook-angle-head,
.student-notes-table thead .gradebook-head-actions th,
.student-notes-table thead .gradebook-insumo-spacer,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table .gradebook-head-static,
.student-notes-table .gradebook-score-cell {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
}

.student-notes-table thead .gradebook-angle-head {
    height: 58px !important;
    padding: 6px !important;
    overflow: hidden !important;
    vertical-align: middle !important;
    clip-path: none !important;
    border-radius: 10px 10px 0 0 !important;
    border-right: 2px solid var(--surface) !important;
    border-bottom: 2px solid color-mix(in srgb, var(--surface) 80%, var(--border)) !important;
}

.student-notes-table thead .gradebook-angle-head span {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.66rem !important;
    font-weight: 850 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    transform: none !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.18) !important;
}

.student-notes-table thead .gradebook-head-actions th {
    height: 26px !important;
    padding: 3px !important;
    background: color-mix(in srgb, var(--surface) 92%, var(--primary)) !important;
}

.student-notes-table thead .gradebook-head-detail-button {
    width: 22px !important;
    height: 22px !important;
    border-radius: 7px !important;
    font-size: 0.72rem !important;
}

.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads,
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-heads,
.student-notes-table.has-expanded-details thead .gradebook-insumo-heads th {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: color-mix(in srgb, #eaf9f8 84%, var(--surface)) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head {
    height: 48px !important;
    padding: 5px !important;
    overflow: hidden !important;
    color: #ffffff !important;
    clip-path: none !important;
    border-radius: 9px 9px 0 0 !important;
    border-right: 2px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    content: none !important;
    display: none !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.54rem !important;
    font-weight: 850 !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    transform: none !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.18) !important;
}

.student-notes-table .gradebook-score-cell {
    height: 38px !important;
    padding: 4px 5px !important;
    vertical-align: middle !important;
}

.student-notes-table .score-pill {
    min-width: 52px !important;
    min-height: 26px !important;
    padding: 4px 7px !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
}

/* Cuaderno docente: matriz de calificaciones limpia y legible. */
.academic-matrix-table thead .activity-head,
.academic-matrix-table thead .promedio-header,
.academic-matrix-table thead .matrix-add-head {
    min-width: 142px !important;
    max-width: 170px !important;
    padding: 8px !important;
    color: #ffffff !important;
    background: var(--insumo-bg, var(--primary)) !important;
    border-right: 3px solid var(--matrix-head-gap, var(--surface)) !important;
    border-bottom: 3px solid var(--matrix-head-gap, var(--surface)) !important;
    border-radius: 10px 10px 0 0 !important;
    vertical-align: middle !important;
}

.academic-matrix-table thead .activity-head-button {
    width: 100% !important;
    min-height: 92px !important;
    padding: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    color: #ffffff !important;
    text-align: center !important;
    background: transparent !important;
    border: 0 !important;
}

.academic-matrix-table thead .activity-head strong {
    max-width: 100% !important;
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    line-height: 1.12 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
}

.academic-matrix-table thead .activity-head small {
    max-width: 100% !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.66rem !important;
    line-height: 1.1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.academic-matrix-table thead .activity-head .category-chip {
    max-width: 100% !important;
    color: #ffffff !important;
    background: rgba(15, 23, 42, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.38) !important;
}

.academic-matrix-table td {
    text-align: center;
}

.academic-matrix-table .input-nota {
    width: 72px !important;
    min-width: 72px !important;
    height: 36px !important;
    border-radius: 8px !important;
}

/* Mis Notas: diagonal final, sin huecos falsos y con columnas reales. */
.student-notes-table {
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.student-notes-table thead .gradebook-angle-head,
.student-notes-table thead .gradebook-head-actions th,
.student-notes-table thead .gradebook-insumo-spacer,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table .gradebook-head-static,
.student-notes-table .gradebook-score-cell {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
}

.student-notes-table thead .gradebook-angle-head {
    position: relative !important;
    height: 88px !important;
    padding: 0 !important;
    overflow: visible !important;
    vertical-align: bottom !important;
    color: #ffffff !important;
    background: var(--grade-head-bg) !important;
    clip-path: polygon(24px 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%, 0 24px) !important;
    border-radius: 9px 9px 0 0 !important;
    border-right: 3px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
}

.student-notes-table thead .gradebook-angle-head span {
    position: absolute !important;
    left: 9px !important;
    bottom: 10px !important;
    width: 86px !important;
    height: 12px !important;
    inset: auto auto 10px 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.56rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: visible !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28) !important;
}

.student-notes-table thead .gradebook-head-actions th {
    height: 24px !important;
    padding: 2px !important;
    text-align: center !important;
    vertical-align: middle !important;
    background: color-mix(in srgb, #eaf9f8 82%, var(--surface)) !important;
    border-right: 2px solid var(--surface) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)) !important;
}

.student-notes-table thead .gradebook-head-detail-button {
    width: 20px !important;
    height: 20px !important;
    color: #0b84d8 !important;
    background: rgba(255, 255, 255, 0.76) !important;
    border: 1px solid color-mix(in srgb, #0b84d8 22%, var(--border)) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

.student-notes-table thead .gradebook-head-detail-button.is-active,
.student-notes-table thead .gradebook-head-detail-button:hover,
.student-notes-table thead .gradebook-head-detail-button:focus-visible {
    color: #ffffff !important;
    background: #14b8a6 !important;
    border-color: #14b8a6 !important;
}

.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads,
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-heads,
.student-notes-table.has-expanded-details thead .gradebook-insumo-heads th {
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: color-mix(in srgb, #eaf9f8 82%, var(--surface)) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head {
    position: relative !important;
    height: 78px !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #ffffff !important;
    clip-path: polygon(24px 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%, 0 24px) !important;
    border-radius: 9px 9px 0 0 !important;
    border-right: 3px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-tarea {
    background: #7a4fc7 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-actividad-individual {
    background: #6d5bd0 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-actividad-grupal {
    background: #5067c7 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-leccion {
    background: #8a55b5 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    background: #9a5bc5 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    content: none !important;
    display: none !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    position: absolute !important;
    left: 9px !important;
    bottom: 9px !important;
    width: 92px !important;
    height: 12px !important;
    inset: auto auto 9px 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.48rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28) !important;
}

.student-notes-table .gradebook-score-cell {
    height: 38px !important;
    padding: 4px 5px !important;
    vertical-align: middle !important;
}

.student-notes-table .score-pill {
    min-width: 50px !important;
    min-height: 26px !important;
    padding: 4px 7px !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
}

.student-notes-table .subject-cell {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    padding: 9px 12px !important;
    vertical-align: middle !important;
}

.student-notes-table .subject-cell strong {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    color: var(--text) !important;
    font-size: 0.84rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
}

.student-notes-table thead .gradebook-top-detail-pad,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table tbody .gradebook-score-cell.is-insumo-detail {
    display: none !important;
}

.student-notes-table.has-expanded-details thead .gradebook-top-detail-pad.is-expanded,
.student-notes-table.has-expanded-details thead .gradebook-insumo-head.is-expanded,
.student-notes-table.has-expanded-details tbody .gradebook-score-cell.is-insumo-detail.is-expanded {
    display: table-cell !important;
}

.grade-detail-modal .grade-detail-band {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #1988c8, #14b8a6) !important;
    border-radius: 10px 10px 0 0 !important;
}

.grade-detail-modal .grade-detail-band span {
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
}

.grade-detail-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
}

.grade-detail-table thead th {
    color: #ffffff !important;
    background: #1988c8 !important;
    border-bottom: 0 !important;
}

.grade-detail-table tbody td {
    border-bottom: 1px solid var(--border) !important;
}

.grade-detail-table tfoot td {
    color: #ffffff !important;
    background: #0b6b63 !important;
    font-weight: 900 !important;
}

/* Mis Notas 2026-07-02: capa final estable para diagonales, detalle y alineación. */
.student-gradebook-matrix {
    overflow-x: auto !important;
    overflow-y: visible !important;
    border-radius: 12px !important;
}

.student-notes-table {
    --notes-subject-width: 276px;
    --notes-col-width: 64px;
    --notes-head-height: 82px;
    --notes-action-height: 24px;
    --notes-detail-head-height: 70px;
    min-width: max-content !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.student-notes-table .subject-head,
.student-notes-table .subject-cell {
    width: var(--notes-subject-width) !important;
    min-width: var(--notes-subject-width) !important;
    max-width: var(--notes-subject-width) !important;
}

.student-notes-table .subject-head {
    height: calc(var(--notes-head-height) + var(--notes-action-height)) !important;
    padding: 12px 16px !important;
    background: var(--surface) !important;
    border-bottom: 2px solid var(--primary) !important;
    vertical-align: bottom !important;
}

.student-notes-table .subject-head > span {
    margin-bottom: 10px !important;
    color: var(--primary) !important;
    font-size: 0.88rem !important;
}

.student-notes-table thead .gradebook-angle-head,
.student-notes-table thead .gradebook-head-actions th,
.student-notes-table thead .gradebook-insumo-spacer,
.student-notes-table thead .gradebook-top-detail-pad,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table .gradebook-head-static,
.student-notes-table .gradebook-score-cell {
    width: var(--notes-col-width) !important;
    min-width: var(--notes-col-width) !important;
    max-width: var(--notes-col-width) !important;
}

.student-notes-table thead .gradebook-angle-head {
    position: relative !important;
    height: var(--notes-head-height) !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #ffffff !important;
    background: var(--grade-head-bg) !important;
    clip-path: polygon(24px 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%, 0 24px) !important;
    border-right: 3px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
    border-radius: 10px 10px 0 0 !important;
    vertical-align: bottom !important;
}

.student-notes-table thead .gradebook-angle-head span {
    position: absolute !important;
    left: 8px !important;
    bottom: 12px !important;
    width: 82px !important;
    height: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.53rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: visible !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28) !important;
}

.student-notes-table thead .gradebook-head-actions th {
    height: var(--notes-action-height) !important;
    min-height: var(--notes-action-height) !important;
    padding: 2px !important;
    text-align: center !important;
    vertical-align: middle !important;
    background: color-mix(in srgb, #eaf9f8 84%, var(--surface)) !important;
    border-right: 2px solid var(--surface) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)) !important;
}

.student-notes-table thead .gradebook-head-detail-button {
    width: 20px !important;
    height: 20px !important;
    margin: 0 auto !important;
    display: inline-grid !important;
    place-items: center !important;
    color: #0b84d8 !important;
    background: rgba(255, 255, 255, 0.78) !important;
    border: 1px solid color-mix(in srgb, #0b84d8 25%, var(--border)) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    font-size: 0.68rem !important;
}

.student-notes-table thead .gradebook-head-detail-button.is-active,
.student-notes-table thead .gradebook-head-detail-button:hover,
.student-notes-table thead .gradebook-head-detail-button:focus-visible {
    color: #ffffff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.student-notes-table thead .gradebook-top-detail-pad,
.student-notes-table thead .gradebook-insumo-head,
.student-notes-table tbody .gradebook-score-cell.is-insumo-detail {
    display: none !important;
}

.student-notes-table.has-expanded-details thead .gradebook-top-detail-pad.is-expanded,
.student-notes-table.has-expanded-details thead .gradebook-insumo-head.is-expanded,
.student-notes-table.has-expanded-details tbody .gradebook-score-cell.is-insumo-detail.is-expanded {
    display: table-cell !important;
}

.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads,
.student-notes-table:not(.has-expanded-details) thead .gradebook-insumo-heads th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-heads,
.student-notes-table.has-expanded-details thead .gradebook-insumo-heads th {
    height: var(--notes-detail-head-height) !important;
    min-height: var(--notes-detail-head-height) !important;
    max-height: var(--notes-detail-head-height) !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: color-mix(in srgb, #eaf9f8 86%, var(--surface)) !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head {
    position: relative !important;
    height: var(--notes-detail-head-height) !important;
    color: #ffffff !important;
    background: #7656c7 !important;
    clip-path: polygon(22px 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%, 0 22px) !important;
    border-right: 3px solid var(--surface) !important;
    border-bottom: 2px solid var(--surface) !important;
    border-radius: 10px 10px 0 0 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head::before {
    content: none !important;
    display: none !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-tarea {
    background: #7a4fc7 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-actividad-individual {
    background: #6857cf !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-actividad-grupal {
    background: #4f63c7 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-leccion {
    background: #8753b8 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head.insumo-type-evaluacion-sumativa {
    background: #9a58c4 !important;
}

.student-notes-table.has-expanded-details thead .gradebook-insumo-head span {
    position: absolute !important;
    left: 8px !important;
    bottom: 10px !important;
    width: 86px !important;
    height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 0.45rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transform: rotate(-45deg) !important;
    transform-origin: left center !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28) !important;
}

.student-notes-table .subject-cell {
    min-height: 40px !important;
    padding: 8px 12px !important;
    vertical-align: middle !important;
    background: var(--surface) !important;
}

.student-notes-table tbody tr:nth-child(odd) .subject-cell,
.student-notes-table tbody tr:nth-child(odd) td {
    background-color: color-mix(in srgb, #94a3b8 9%, var(--surface)) !important;
}

.student-notes-table .subject-cell strong {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    color: var(--text) !important;
    font-size: 0.8rem !important;
    font-weight: 850 !important;
    line-height: 1.12 !important;
}

.student-notes-table .subject-cell small {
    display: block !important;
    margin-top: 4px !important;
    color: var(--text-gray) !important;
    font-size: 0.68rem !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.student-notes-table .gradebook-score-cell {
    height: 36px !important;
    padding: 3px 5px !important;
    text-align: center !important;
    vertical-align: middle !important;
    background-clip: padding-box !important;
    border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent) !important;
}

.student-notes-table .score-pill {
    min-width: 46px !important;
    min-height: 24px !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
    font-size: 0.72rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
}

.student-notes-table .cell-detail-chip::before,
.student-notes-table .cell-detail-chip::after {
    font-size: 0.5rem !important;
    opacity: 0.42 !important;
}

.student-notes-table .cell-detail-chip::before {
    left: 3px !important;
    bottom: 2px !important;
}

.student-notes-table .cell-detail-chip::after {
    top: 2px !important;
    right: 3px !important;
}

.grade-detail-modal .modal-dialog {
    border-radius: 12px !important;
}

.grade-detail-modal .grade-detail-band {
    background: linear-gradient(135deg, #1683c7, #14b8a6) !important;
    border-radius: 10px 10px 0 0 !important;
}

.grade-detail-table-wrap {
    border-color: color-mix(in srgb, #1683c7 28%, var(--border)) !important;
}

.grade-detail-table thead th {
    background: #1683c7 !important;
}

.grade-detail-table td {
    font-size: 0.86rem !important;
}

.grade-detail-table .activity-score {
    display: inline-grid !important;
    min-width: 54px !important;
    min-height: 26px !important;
    place-items: center !important;
    border-radius: 8px !important;
    font-weight: 850 !important;
}

@media (max-width: 760px) {
    .student-notes-table {
        --notes-subject-width: 210px;
        --notes-col-width: 58px;
    }

    .student-notes-table .subject-cell strong {
        font-size: 0.74rem !important;
    }

    .student-notes-table thead .gradebook-angle-head span {
        font-size: 0.48rem !important;
        width: 76px !important;
    }
}

/* Calendario 2026-07-02: eventos compactos y sin desbordes. */
.calendar-board {
    gap: 6px !important;
}

.calendar-cell {
    min-height: 88px !important;
    gap: 5px !important;
    padding: 8px !important;
    overflow: hidden !important;
}

.calendar-cell > strong {
    display: inline-grid !important;
    width: 24px !important;
    height: 24px !important;
    place-items: center !important;
    margin-bottom: 1px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
}

.calendar-cell.is-today > strong {
    color: #ffffff !important;
    background: var(--primary) !important;
}

.calendar-tag {
    min-height: 20px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    font-size: 0.64rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.calendar-more {
    display: inline-flex !important;
    align-items: center !important;
    width: max-content !important;
    max-width: 100% !important;
    min-height: 20px !important;
    padding: 3px 7px !important;
    color: var(--primary) !important;
    background: color-mix(in srgb, var(--primary) 11%, var(--surface)) !important;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)) !important;
    border-radius: 999px !important;
    font-size: 0.64rem !important;
    font-weight: 900 !important;
}

.calendar-side .notice-item {
    padding: 10px 12px !important;
    border-radius: 9px !important;
}

.calendar-side .notice-item strong,
.calendar-side .notice-item span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Notas 2026-07-18: matrices fijas de cuatro insumos por parcial. */
.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.grade-scale-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 750;
}

.grade-scale-note i {
    color: #287f75;
}

.gradebook-child-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gradebook-child-select label {
    color: var(--text-gray);
    font-size: 0.76rem;
    font-weight: 750;
}

.gradebook-child-select select {
    min-width: 190px;
}

.student-ledger {
    width: 100%;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.student-ledger-scroll {
    width: 100%;
    overflow: auto;
    overscroll-behavior-inline: contain;
}

.sidebar,
.nav-list,
.table-container,
.student-ledger-scroll,
.grade-detail-table-wrap,
.teacher-gradebook-scroll,
.modal-body,
.app-modal,
textarea,
html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar,
.nav-list::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.student-ledger-scroll::-webkit-scrollbar,
.grade-detail-table-wrap::-webkit-scrollbar,
.teacher-gradebook-scroll::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.app-modal::-webkit-scrollbar,
textarea::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.sidebar::-webkit-scrollbar-track,
.nav-list::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.student-ledger-scroll::-webkit-scrollbar-track,
.grade-detail-table-wrap::-webkit-scrollbar-track,
.teacher-gradebook-scroll::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.app-modal::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 68%, transparent);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb,
.nav-list::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.student-ledger-scroll::-webkit-scrollbar-thumb,
.grade-detail-table-wrap::-webkit-scrollbar-thumb,
.teacher-gradebook-scroll::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.app-modal::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
    min-width: 42px;
    min-height: 42px;
    background: var(--scrollbar-thumb);
    border: 2px solid var(--scrollbar-track);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-dark) 32%, transparent);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.nav-list::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.student-ledger-scroll::-webkit-scrollbar-thumb:hover,
.grade-detail-table-wrap::-webkit-scrollbar-thumb:hover,
.teacher-gradebook-scroll::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.app-modal::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.sidebar::-webkit-scrollbar-thumb:active,
.nav-list::-webkit-scrollbar-thumb:active,
.table-container::-webkit-scrollbar-thumb:active,
.student-ledger-scroll::-webkit-scrollbar-thumb:active,
.grade-detail-table-wrap::-webkit-scrollbar-thumb:active,
.teacher-gradebook-scroll::-webkit-scrollbar-thumb:active,
.modal-body::-webkit-scrollbar-thumb:active,
.app-modal::-webkit-scrollbar-thumb:active,
textarea::-webkit-scrollbar-thumb:active,
html::-webkit-scrollbar-thumb:active {
    background: var(--scrollbar-thumb-active);
}

.sidebar::-webkit-scrollbar-corner,
.nav-list::-webkit-scrollbar-corner,
.table-container::-webkit-scrollbar-corner,
.student-ledger-scroll::-webkit-scrollbar-corner,
.grade-detail-table-wrap::-webkit-scrollbar-corner,
.teacher-gradebook-scroll::-webkit-scrollbar-corner,
.modal-body::-webkit-scrollbar-corner,
.app-modal::-webkit-scrollbar-corner,
textarea::-webkit-scrollbar-corner,
html::-webkit-scrollbar-corner {
    background: transparent;
}

.student-ledger-table.student-notes-table {
    --ledger-subject-width: 210px;
    --ledger-average-width: 66px;
    --ledger-grade-width: 62px;
    width: max-content !important;
    min-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.student-ledger-table th,
.student-ledger-table td {
    box-sizing: border-box !important;
    letter-spacing: 0 !important;
}

.student-ledger-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 5px 4px !important;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.32) !important;
}

.student-ledger-table .ledger-subject-head,
.student-ledger-table .ledger-subject-cell {
    position: sticky !important;
    left: 0;
    z-index: 6;
    width: var(--ledger-subject-width) !important;
    min-width: var(--ledger-subject-width) !important;
    max-width: var(--ledger-subject-width) !important;
}

.student-ledger-table .ledger-average-head,
.student-ledger-table .ledger-average-cell {
    position: sticky !important;
    left: var(--ledger-subject-width);
    z-index: 5;
    width: var(--ledger-average-width) !important;
    min-width: var(--ledger-average-width) !important;
    max-width: var(--ledger-average-width) !important;
}

.student-ledger-table .ledger-subject-head {
    z-index: 9;
    background: #283548 !important;
    font-size: 0.8rem;
}

.student-ledger-table .ledger-average-head {
    z-index: 8;
    background: #4f5d70 !important;
    font-size: 0.66rem;
    white-space: nowrap;
}

.student-ledger-table .ledger-trimester {
    height: 34px;
    font-size: 0.76rem;
    font-weight: 850;
}

.student-ledger-table .trimester-1 {
    background: #1976b9 !important;
}

.student-ledger-table .trimester-2 {
    background: #2f7d67 !important;
}

.student-ledger-table .trimester-3 {
    background: #c65343 !important;
}

.student-ledger-table .ledger-partial,
.student-ledger-table .ledger-exam {
    height: 48px;
    font-size: 0.68rem;
    font-weight: 800;
}

.student-ledger-table .ledger-partial {
    position: relative;
    min-width: var(--ledger-grade-width);
    padding: 5px 4px 4px !important;
}

.student-ledger-table .ledger-partial > span {
    display: block;
    line-height: 1.05;
}

.student-ledger-table .ledger-partial-toggle {
    width: 24px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    margin: 4px auto 0;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 5px;
    font-size: 0.62rem;
    cursor: pointer;
}

.student-ledger-table .ledger-partial-toggle:hover,
.student-ledger-table .ledger-partial-toggle:focus-visible,
.student-ledger-table .ledger-partial-toggle.is-active {
    color: #17405c;
    background: #ffffff;
    border-color: #ffffff;
    outline: 0;
}

.student-ledger-table .partial-one.trimester-1,
.student-ledger-table .partial-two.trimester-1,
.student-ledger-table .ledger-exam.trimester-1 {
    background: #3290c8 !important;
}

.student-ledger-table .partial-one.trimester-2,
.student-ledger-table .partial-two.trimester-2,
.student-ledger-table .ledger-exam.trimester-2 {
    background: #4b9276 !important;
}

.student-ledger-table .partial-one.trimester-3,
.student-ledger-table .partial-two.trimester-3,
.student-ledger-table .ledger-exam.trimester-3 {
    background: #d76a52 !important;
}

.student-ledger-table .partial-two {
    filter: brightness(0.88);
}

.student-ledger-table .ledger-insumo-row {
    display: none;
}

.student-ledger-table.has-ledger-detail .ledger-insumo-row {
    display: table-row;
}

.student-ledger-table .ledger-detail-column {
    display: none !important;
}

.student-ledger-table .ledger-detail-column.is-expanded {
    display: table-cell !important;
}

.student-ledger-table .ledger-insumo-row th {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
    height: 36px;
    padding: 4px 3px !important;
    color: #253247;
    background: #eef3f7 !important;
    border-right: 1px solid #d5dde6 !important;
    border-bottom: 1px solid #cbd5df !important;
}

.student-ledger-table .ledger-insumo-row th span {
    display: block;
    max-width: 100%;
    font-size: 0.57rem;
    font-weight: 800;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.student-ledger-table .ledger-exam {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
}

.student-ledger-table tbody td {
    height: 40px !important;
    padding: 4px !important;
    text-align: center;
    vertical-align: middle;
    background: var(--surface);
    border-right: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
}

.student-ledger-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, #8191a5 7%, var(--surface)) !important;
}

.student-ledger-table .ledger-subject-cell {
    padding: 6px 10px !important;
    text-align: left;
    box-shadow: 1px 0 0 var(--border);
}

.student-ledger-table .ledger-subject-cell strong {
    display: block;
    max-width: 100%;
    color: var(--text);
    font-size: 0.71rem;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.student-ledger-table .ledger-subject-cell small {
    display: block;
    margin-top: 3px;
    color: var(--text-gray);
    font-size: 0.57rem;
    font-weight: 650;
}

.student-ledger-table .ledger-grade-cell {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
}

.student-ledger-table .ledger-grade-cell button,
.student-ledger-table .ledger-grade-cell > span {
    width: 44px;
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 4px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 850;
    line-height: 1;
}

.student-ledger-table .ledger-grade-cell button {
    cursor: pointer;
}

.student-ledger-table .ledger-score-button.is-empty-grade {
    color: var(--text-gray);
    background: transparent;
    border: 0;
}

.student-ledger-table .ledger-period-summary {
    box-shadow: inset 0 3px 0 color-mix(in srgb, var(--primary) 48%, transparent);
}

html[data-theme="dark"] .student-ledger-table .ledger-grade-cell.grade-high .ledger-score-button,
body.dark-mode .student-ledger-table .ledger-grade-cell.grade-high .ledger-score-button {
    color: #70eac6;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme="dark"] .student-ledger-table .ledger-grade-cell.grade-mid .ledger-score-button,
body.dark-mode .student-ledger-table .ledger-grade-cell.grade-mid .ledger-score-button {
    color: #f4c95d;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme="dark"] .student-ledger-table .ledger-grade-cell.grade-low .ledger-score-button,
body.dark-mode .student-ledger-table .ledger-grade-cell.grade-low .ledger-score-button {
    color: #ff8f9c;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme="dark"] .student-ledger-table .ledger-grade-cell .ledger-score-button,
body.dark-mode .student-ledger-table .ledger-grade-cell .ledger-score-button {
    width: 48px;
    min-height: 28px;
    font-size: 0.76rem;
    font-weight: 900;
}

html[data-theme="dark"] .student-ledger-table .ledger-score-button.is-empty-grade,
body.dark-mode .student-ledger-table .ledger-score-button.is-empty-grade {
    color: #8294a4;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme="dark"] .student-ledger-table .ledger-grade-cell .ledger-score-button:hover,
html[data-theme="dark"] .student-ledger-table .ledger-grade-cell .ledger-score-button:focus-visible,
body.dark-mode .student-ledger-table .ledger-grade-cell .ledger-score-button:hover,
body.dark-mode .student-ledger-table .ledger-grade-cell .ledger-score-button:focus-visible {
    filter: brightness(1.18);
}

html[data-theme="dark"] .student-ledger-table .ledger-period-summary,
body.dark-mode .student-ledger-table .ledger-period-summary {
    box-shadow: inset 0 2px 0 rgba(28, 185, 166, 0.38);
}

.student-ledger-table .ledger-grade-cell button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.student-ledger-table .ledger-grade-cell button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 58%, transparent);
    outline-offset: 1px;
}

.student-ledger-table .ledger-grade-cell.grade-high button,
.student-ledger-table .ledger-grade-cell.grade-high > span {
    color: #126449;
    background: transparent;
}

.student-ledger-table .ledger-grade-cell.grade-mid button,
.student-ledger-table .ledger-grade-cell.grade-mid > span {
    color: #79540e;
    background: transparent;
}

.student-ledger-table .ledger-grade-cell.grade-low button,
.student-ledger-table .ledger-grade-cell.grade-low > span {
    color: #a12e38;
    background: transparent;
}

.student-ledger-table .ledger-average-cell {
    box-shadow: 1px 0 0 var(--border);
}

.grade-detail-modal .grade-detail-context {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.grade-detail-modal .grade-detail-table th:first-child,
.grade-detail-modal .grade-detail-table td:first-child {
    width: auto !important;
    min-width: 260px;
    text-align: left !important;
}

.grade-detail-modal .grade-detail-table th:nth-child(2),
.grade-detail-modal .grade-detail-table td:nth-child(2) {
    width: 150px;
    min-width: 150px;
}

.grade-detail-modal .grade-detail-table th:nth-child(3),
.grade-detail-modal .grade-detail-table td:nth-child(3) {
    width: 120px;
    min-width: 120px;
}

.grade-detail-modal .grade-detail-table th:last-child,
.grade-detail-modal .grade-detail-table td:last-child {
    width: 90px;
    min-width: 90px;
    text-align: center !important;
}

.grade-detail-empty {
    min-height: 164px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 28px 20px;
    color: var(--text-gray);
    text-align: center;
    background: var(--surface-soft);
    border: 1px dashed var(--border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.grade-detail-empty i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border-radius: 50%;
}

.grade-detail-empty strong {
    color: var(--text);
    font-size: 0.88rem;
}

.grade-detail-empty span {
    max-width: 420px;
    font-size: 0.74rem;
    line-height: 1.45;
}

.teacher-gradebook-form {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.teacher-gradebook-tools {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.teacher-gradebook-scroll {
    width: 100%;
    overflow: auto;
}

.teacher-grade-grid {
    --teacher-name-width: 240px;
    --teacher-slot-width: 154px;
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.teacher-grade-grid th,
.teacher-grade-grid td {
    box-sizing: border-box;
    letter-spacing: 0;
}

.teacher-grade-grid .teacher-student-head,
.teacher-grade-grid .teacher-student-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    width: var(--teacher-name-width);
    min-width: var(--teacher-name-width);
    max-width: var(--teacher-name-width);
}

.teacher-grade-grid .teacher-student-head {
    z-index: 5;
    height: 116px;
    padding: 14px;
    color: #fff;
    text-align: left;
    vertical-align: bottom;
    background: #283548;
}

.teacher-grade-grid .teacher-student-head span,
.teacher-grade-grid .teacher-student-head small {
    display: block;
}

.teacher-grade-grid .teacher-student-head span {
    font-size: 0.86rem;
    font-weight: 850;
}

.teacher-grade-grid .teacher-student-head small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.66rem;
}

.teacher-grade-grid .teacher-insumo-head,
.teacher-grade-grid .teacher-average-head {
    position: relative;
    width: var(--teacher-slot-width);
    min-width: var(--teacher-slot-width);
    max-width: var(--teacher-slot-width);
    height: 116px;
    padding: 11px 10px;
    color: #fff;
    text-align: left;
    vertical-align: top;
    border-right: 2px solid var(--surface);
    border-bottom: 2px solid var(--surface);
}

.teacher-grade-grid .teacher-insumo-head.slot-1 {
    background: #5d6098;
}

.teacher-grade-grid .teacher-insumo-head.slot-2 {
    background: #2f7d73;
}

.teacher-grade-grid .teacher-insumo-head.slot-3 {
    background: #ad693d;
}

.teacher-grade-grid .teacher-insumo-head.slot-4 {
    background: #a8475d;
}

.teacher-grade-grid .teacher-insumo-head.is-empty {
    color: #435066;
    background: #e9eef3;
    border-color: var(--surface);
}

.teacher-grade-grid .teacher-slot-number,
.teacher-grade-grid .teacher-insumo-head strong,
.teacher-grade-grid .teacher-insumo-head small,
.teacher-grade-grid .teacher-average-head span,
.teacher-grade-grid .teacher-average-head small {
    display: block;
    max-width: 100%;
}

.teacher-grade-grid .teacher-slot-number {
    margin-bottom: 9px;
    font-size: 0.62rem;
    font-weight: 750;
    text-transform: uppercase;
}

.teacher-grade-grid .teacher-insumo-head strong {
    min-height: 32px;
    font-size: 0.75rem;
    font-weight: 850;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.teacher-grade-grid .teacher-insumo-head small {
    margin-top: 6px;
    font-size: 0.61rem;
    font-weight: 650;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.teacher-slot-add {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #1976b9;
    border-radius: 6px;
}

.teacher-slot-add:hover,
.teacher-slot-add:focus-visible {
    color: #fff;
    background: #135f95;
}

.teacher-slot-edit {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.teacher-slot-edit:hover,
.teacher-slot-edit:focus-visible {
    color: #083c38;
    background: #c9fff4;
    border-color: #c9fff4;
}

.teacher-slot-edit.is-active {
    color: #263238;
    background: var(--scrollbar-thumb-active);
    border-color: var(--scrollbar-thumb-active);
}

.teacher-grade-grid .teacher-insumo-head.is-editing {
    box-shadow: inset 0 -4px 0 var(--scrollbar-thumb-active);
}

.teacher-grade-grid .teacher-average-head {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    background: #4f5d70;
}

.teacher-grade-grid .teacher-average-head span {
    font-size: 0.75rem;
    font-weight: 850;
}

.teacher-grade-grid .teacher-average-head small {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.61rem;
}

.teacher-grade-grid tbody td {
    height: 52px;
    padding: 7px;
    text-align: center;
    vertical-align: middle;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.teacher-grade-grid tbody tr:nth-child(even) td {
    background: color-mix(in srgb, #8191a5 7%, var(--surface));
}

.teacher-grade-grid .teacher-student-cell {
    padding: 8px 12px;
    text-align: left;
    box-shadow: 1px 0 0 var(--border);
}

.teacher-grade-grid .teacher-student-cell strong,
.teacher-grade-grid .teacher-student-cell small {
    display: block;
    max-width: 100%;
}

.teacher-grade-grid .teacher-student-cell strong {
    color: var(--text);
    font-size: 0.76rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.teacher-grade-grid .teacher-student-cell small {
    margin-top: 3px;
    color: var(--text-gray);
    font-size: 0.61rem;
}

.teacher-grade-grid .teacher-grade-cell {
    width: var(--teacher-slot-width);
    min-width: var(--teacher-slot-width);
    max-width: var(--teacher-slot-width);
}

.teacher-grade-grid .input-nota {
    width: 74px !important;
    min-width: 74px !important;
    height: 34px !important;
    margin: 0 auto;
    text-align: center;
    border-radius: 6px !important;
}

.teacher-gradebook-form .input-nota[readonly] {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
}

.teacher-gradebook-form .input-nota[readonly][data-grade-detail-enabled="0"] {
    cursor: not-allowed;
}

.teacher-gradebook-form .teacher-grade-cell.is-editing {
    background: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important;
    box-shadow: inset 2px 0 0 color-mix(in srgb, var(--primary) 58%, transparent),
                inset -2px 0 0 color-mix(in srgb, var(--primary) 58%, transparent);
}

.teacher-gradebook-form .teacher-grade-cell.is-editing .input-nota {
    background: var(--surface) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent) !important;
    cursor: text;
}

.teacher-gradebook-form .teacher-grade-cell.is-editing .input-nota:focus {
    border-color: var(--scrollbar-thumb-active) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--scrollbar-thumb-active) 24%, transparent) !important;
}

.grade-entry-dialog {
    width: min(680px, 100%);
}

.grade-entry-form {
    display: grid;
    gap: 18px;
    padding: 22px;
    overflow-y: auto;
}

.grade-entry-context {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.grade-entry-context span {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text-gray);
}

.grade-entry-context i {
    margin-top: 2px;
    color: var(--primary);
}

.grade-entry-context strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.grade-entry-form textarea {
    min-height: 150px;
    resize: vertical;
}

.grade-detail-save-status {
    min-height: 22px;
    font-weight: 750;
}

.grade-detail-save-status.is-saving {
    color: var(--primary);
}

.grade-detail-save-status.is-success {
    color: var(--success);
}

.grade-detail-save-status.is-error {
    color: var(--danger);
}

@media (max-width: 640px) {
    .grade-entry-modal {
        padding: 10px;
    }

    .grade-entry-context {
        grid-template-columns: 1fr;
    }

    .grade-entry-form {
        padding: 16px;
    }
}

.teacher-empty-grade {
    color: var(--text-gray);
    font-weight: 750;
}

.teacher-average-cell {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    font-size: 0.78rem;
    font-weight: 850;
}

.teacher-gradebook-footer {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

.teacher-gradebook-footer span {
    color: var(--text-gray);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 6px;
}

.profile-photo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.profile-photo-card {
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: 96px 300px;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.profile-photo-preview {
    width: 68px;
    height: 68px;
    grid-row: 1 / span 2;
}

.profile-photo-copy {
    min-width: 0;
}

.profile-photo-copy strong,
.profile-photo-copy span,
.profile-photo-copy small {
    display: block;
}

.profile-photo-copy strong {
    color: var(--text);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.profile-photo-copy span,
.profile-photo-copy small {
    color: var(--text-gray);
    font-size: 0.7rem;
}

.profile-photo-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    align-items: center;
}

.profile-photo-picker {
    min-width: 0;
    justify-content: center;
    cursor: pointer;
}

.profile-photo-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-photo-remove {
    color: var(--danger);
}

.report-filter-toolbar {
    margin-bottom: 14px;
}

.report-filter-toolbar .filter-bar {
    width: 100%;
}

.report-filter-toolbar .filter-bar select {
    flex: 1 1 180px;
}

.report-stats {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.report-subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.report-subject-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "copy grade"
        "notes action";
    gap: 8px 12px;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.report-subject-card > div:first-child {
    grid-area: copy;
    min-width: 0;
}

.report-subject-card strong,
.report-subject-card span {
    display: block;
}

.report-subject-card strong {
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.report-subject-card span,
.report-subject-card small {
    color: var(--text-gray);
    font-size: 0.66rem;
}

.report-subject-card > small {
    grid-area: notes;
}

.report-subject-card > .icon-button {
    grid-area: action;
}

.report-subject-card > .report-view-only {
    grid-area: action;
    justify-self: end;
    color: var(--text-gray);
    font-size: 0.68rem;
}

.report-subject-metric {
    grid-area: grade;
    font-size: 1.1rem;
    font-weight: 850;
}

.report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
    gap: 14px;
    align-items: start;
}

.report-grade-table {
    min-width: 0;
    overflow: hidden;
}

.report-grade-table .table-header-tools {
    min-width: 0;
    align-items: flex-end;
    gap: 12px;
}

.report-matrix-tools {
    min-width: min(100%, 520px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.report-matrix-tools .report-performance-tabs {
    flex: 1 1 auto;
    margin: 0;
}

.report-matrix-tools .search-box {
    width: min(220px, 100%);
    flex: 0 1 220px;
}

.report-subject-matrix-scroll {
    width: 100%;
    max-height: calc(100vh - 235px);
    overflow: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.report-grade-table .report-subject-matrix {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.report-subject-matrix th,
.report-subject-matrix td {
    height: 38px;
    padding: 4px 6px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.report-subject-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    height: 64px;
    color: #fff;
    background: #497a72;
    font-size: 0.59rem;
    line-height: 1.12;
    vertical-align: middle;
}

.report-subject-matrix thead th:nth-child(3n + 3) {
    background: #357eaa;
}

.report-subject-matrix thead th:nth-child(3n + 4) {
    background: #6d64a6;
}

.report-subject-matrix thead th > span {
    display: -webkit-box;
    max-height: 2.3em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.report-subject-matrix thead th > a {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    margin: 4px auto 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 5px;
    text-decoration: none;
}

.report-subject-matrix .report-matrix-student-head,
.report-subject-matrix .report-matrix-student-cell {
    position: sticky;
    left: 0;
    width: 236px;
    min-width: 236px;
    max-width: 236px;
    text-align: left;
}

.report-subject-matrix .report-matrix-student-head {
    z-index: 7;
    background: #26394f;
    text-align: center;
}

.report-subject-matrix .report-matrix-student-cell {
    z-index: 3;
    padding: 4px 8px;
    background: var(--surface);
    box-shadow: 2px 0 0 color-mix(in srgb, var(--border) 88%, transparent);
}

.report-subject-matrix tbody tr:nth-child(even) .report-matrix-student-cell,
.report-subject-matrix tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.report-subject-matrix .report-matrix-average-head,
.report-subject-matrix .report-matrix-score,
.report-subject-matrix .report-matrix-reports {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
}

.report-subject-matrix .report-matrix-average-head {
    background: #53657b;
}

.report-subject-matrix .student-name-cell {
    gap: 7px;
}

.report-subject-matrix .student-name-cell > div {
    min-width: 0;
}

.report-subject-matrix .student-table-avatar {
    width: 29px;
    min-width: 29px;
    height: 29px;
}

.report-subject-matrix .student-name-cell strong,
.report-subject-matrix .student-name-cell small {
    display: block;
}

.report-subject-matrix .student-name-cell strong {
    overflow: hidden;
    color: var(--text);
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-subject-matrix .student-name-cell small {
    margin-top: 1px;
    color: var(--text-gray);
    font-size: 0.55rem;
}

.report-top-star {
    width: 13px;
    flex: 0 0 13px;
    color: color-mix(in srgb, var(--text-gray) 30%, transparent);
    font-size: 0.56rem;
    visibility: hidden;
}

.report-top-star.is-top {
    color: #e5a11a;
    visibility: visible;
}

.report-matrix-score > strong,
.report-matrix-score > a,
.report-matrix-score > span,
.report-matrix-reports > a {
    display: inline;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 0.69rem;
    font-weight: 900;
    text-decoration: none;
}

.report-matrix-reports > a {
    color: var(--primary);
}

html[data-theme="dark"] .report-subject-matrix .grade-low,
body.dark-mode .report-subject-matrix .grade-low {
    color: #ff7785 !important;
}

html[data-theme="dark"] .report-subject-matrix .grade-mid,
body.dark-mode .report-subject-matrix .grade-mid {
    color: #f4c95d !important;
}

html[data-theme="dark"] .report-subject-matrix .grade-high,
body.dark-mode .report-subject-matrix .grade-high {
    color: #65e7bd !important;
}

.report-grade-table .student-name-cell > div {
    min-width: 0;
}

.report-grade-table .student-name-cell strong,
.report-grade-table .student-name-cell small {
    display: block;
}

.report-grade-table .student-name-cell strong {
    color: var(--text);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.report-grade-table .student-name-cell small {
    color: var(--text-gray);
    font-size: 0.64rem;
}

.report-followup-panel {
    position: sticky;
    top: 18px;
    padding: 14px;
}

.report-followup-item {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.report-followup-item:last-of-type {
    border-bottom: 0;
}

.report-followup-item > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.report-followup-item strong,
.report-followup-item span,
.report-followup-item small {
    font-size: 0.68rem;
}

.report-followup-item strong {
    color: var(--text);
}

.report-followup-item span,
.report-followup-item small,
.report-followup-item time {
    color: var(--text-gray);
}

.report-followup-item time {
    display: block;
    margin-top: 3px;
    font-size: 0.61rem;
}

.report-followup-item p {
    margin: 7px 0 4px;
    color: var(--text);
    font-size: 0.68rem;
    line-height: 1.45;
}

.teacher-idukay-form {
    min-width: 0;
}

.teacher-idukay-scroll {
    width: 100%;
    min-height: 390px;
    max-height: calc(100vh - 270px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.teacher-idukay-grid.student-notes-table {
    --ledger-subject-width: 208px;
    --ledger-average-width: 60px;
    --ledger-grade-width: 56px;
}

.teacher-idukay-grid thead {
    position: sticky;
    top: 0;
    z-index: 8;
}

.teacher-idukay-grid thead th {
    position: relative;
    top: auto;
}

.teacher-idukay-grid .ledger-trimester-row th {
    height: 32px;
}

.teacher-idukay-grid .ledger-partial-row th {
    height: 48px;
}

.teacher-idukay-grid .ledger-insumo-row th {
    height: 44px;
}

.teacher-idukay-grid .ledger-subject-head,
.teacher-idukay-grid .ledger-average-head {
    position: sticky !important;
    top: auto !important;
    vertical-align: middle;
}

.teacher-idukay-grid .ledger-subject-head span,
.teacher-idukay-grid .ledger-subject-head small {
    display: block;
}

.teacher-idukay-grid .ledger-subject-head span {
    font-size: 0.74rem;
}

.teacher-idukay-grid .ledger-subject-head small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.58rem;
}

.teacher-idukay-grid .teacher-term-average-head {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 850;
}

.teacher-idukay-grid .teacher-term-average-head.trimester-1 {
    background: #246f9e !important;
}

.teacher-idukay-grid .teacher-term-average-head.trimester-2 {
    background: #286c58 !important;
}

.teacher-idukay-grid .teacher-term-average-head.trimester-3 {
    background: #a84a3b !important;
}

.teacher-idukay-grid .ledger-partial,
.teacher-idukay-grid .ledger-exam {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
    padding: 4px 2px !important;
}

.teacher-idukay-grid .ledger-partial.is-expanded {
    width: auto !important;
    max-width: none !important;
}

.teacher-idukay-grid .ledger-partial > span,
.teacher-idukay-grid .teacher-exam-head > span {
    font-size: 0.58rem;
    line-height: 1.05;
}

.teacher-idukay-grid .ledger-partial-toggle {
    width: 22px;
    height: 20px;
    margin-top: 3px;
}

.teacher-idukay-grid .teacher-compact-insumo-head,
.teacher-idukay-grid .teacher-exam-head {
    position: relative;
}

.teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head,
.teacher-idukay-grid .ledger-insumo-row .ledger-partial-average-label {
    color: #fff;
    background: #6d64a6 !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

.teacher-idukay-grid .teacher-compact-insumo-head > span {
    min-height: 14px;
    padding-right: 20px;
    font-size: 0.54rem;
    line-height: 1.05;
}

.teacher-idukay-grid .teacher-slot-edit,
.teacher-idukay-grid .teacher-slot-add {
    right: 3px;
    bottom: 3px;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 0.55rem;
}

.teacher-idukay-grid .teacher-slot-add {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.42);
}

.teacher-idukay-grid .teacher-exam-head .teacher-slot-edit,
.teacher-idukay-grid .teacher-exam-head .teacher-slot-add {
    right: 4px;
    bottom: 4px;
}

.teacher-idukay-grid thead th.is-editing {
    box-shadow: inset 0 -3px 0 var(--scrollbar-thumb-active);
}

.teacher-idukay-grid tbody td {
    height: 34px !important;
    padding: 2px !important;
}

.teacher-idukay-grid .teacher-student-cell {
    padding: 4px 9px !important;
}

.teacher-idukay-grid .teacher-student-cell strong {
    font-size: 0.66rem;
    line-height: 1.1;
}

.teacher-idukay-grid .teacher-summary-cell {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
    font-size: 0.66rem;
    font-weight: 850;
}

.teacher-idukay-grid .teacher-summary-cell.grade-low {
    color: #c93745 !important;
}

.teacher-idukay-grid .teacher-summary-cell.grade-mid {
    color: #a46e0d !important;
}

.teacher-idukay-grid .teacher-summary-cell.grade-high {
    color: #137456 !important;
}

.teacher-idukay-grid .teacher-grade-cell {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
}

.teacher-idukay-grid .teacher-compact-input {
    width: 48px !important;
    min-width: 48px !important;
    height: 27px !important;
    margin: 0 auto;
    padding: 2px !important;
    text-align: center;
    border-radius: 5px !important;
    font-size: 0.66rem !important;
    font-weight: 850;
    appearance: textfield;
}

.teacher-idukay-grid .teacher-compact-input::-webkit-outer-spin-button,
.teacher-idukay-grid .teacher-compact-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.teacher-idukay-form .teacher-grade-cell.is-editing {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)) !important;
    box-shadow: inset 1px 0 0 color-mix(in srgb, var(--primary) 52%, transparent),
                inset -1px 0 0 color-mix(in srgb, var(--primary) 52%, transparent);
}

.teacher-idukay-form .teacher-grade-cell.is-editing .teacher-compact-input {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent) !important;
}

html[data-theme="dark"] .teacher-idukay-grid .teacher-summary-cell.grade-low,
body.dark-mode .teacher-idukay-grid .teacher-summary-cell.grade-low {
    color: #ff7785 !important;
}

html[data-theme="dark"] .teacher-idukay-grid .teacher-summary-cell.grade-mid,
body.dark-mode .teacher-idukay-grid .teacher-summary-cell.grade-mid {
    color: #f4c95d !important;
}

html[data-theme="dark"] .teacher-idukay-grid .teacher-summary-cell.grade-high,
body.dark-mode .teacher-idukay-grid .teacher-summary-cell.grade-high {
    color: #65e7bd !important;
}

html[data-theme="dark"] .student-ledger-table .ledger-insumo-row th,
body.dark-mode .student-ledger-table .ledger-insumo-row th,
html[data-theme="dark"] .teacher-grade-grid .teacher-insumo-head.is-empty,
body.dark-mode .teacher-grade-grid .teacher-insumo-head.is-empty {
    color: #dbe5ef;
    background: #2b3543 !important;
}

@media (max-width: 760px) {
    .student-ledger-table.student-notes-table {
        --ledger-subject-width: 166px;
        --ledger-average-width: 70px;
        --ledger-grade-width: 58px;
    }

    .teacher-grade-grid {
        --teacher-name-width: 190px;
        --teacher-slot-width: 136px;
    }

    .teacher-gradebook-tools,
    .teacher-gradebook-footer,
    .teacher-grade-filters {
        align-items: stretch;
    }

    .teacher-gradebook-tools .search-box,
    .teacher-gradebook-tools .row-actions {
        width: 100%;
    }

    .teacher-gradebook-footer {
        flex-direction: column;
    }

    .profile-photo-toolbar,
    .profile-photo-form {
        align-items: stretch;
    }

    .profile-photo-toolbar {
        flex-direction: column;
    }

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

    .profile-photo-picker {
        grid-column: 1 / -1;
    }

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

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

    .report-grade-table .table-header-tools,
    .report-matrix-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .report-matrix-tools {
        width: 100%;
    }

    .report-matrix-tools .search-box {
        width: 100%;
        flex-basis: auto;
    }

    .report-subject-matrix .report-matrix-student-head,
    .report-subject-matrix .report-matrix-student-cell {
        width: 190px;
        min-width: 190px;
        max-width: 190px;
    }

    .report-followup-panel {
        position: static;
    }
}

@media (max-width: 1120px) {
    .report-stats {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

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

    .report-followup-panel {
        position: static;
    }
}

/* --- Perfil familiar y analitica academica --- */
.grade-empty {
    color: var(--text-gray) !important;
}

.grade-mid {
    color: #a66b00 !important;
    font-weight: 900;
}

.student-context-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.student-context-selector label,
.student-profile-switcher label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-gray);
    font-size: 0.72rem;
    font-weight: 800;
}

.student-context-selector select {
    min-width: 240px;
}

.student-profile-hero,
.indicator-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
}

.student-profile-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-profile-identity > div:last-child {
    min-width: 0;
}

.student-profile-identity h2 {
    margin: 2px 0 0;
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.student-profile-avatar {
    width: 86px;
    min-width: 86px;
    height: 86px;
    font-size: 1.65rem;
    border-radius: 8px;
}

.student-profile-photo-form {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) auto auto;
    align-items: center;
    gap: 7px;
}

.student-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.student-profile-stats article {
    min-width: 0;
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.student-profile-stats span,
.student-profile-stats strong {
    display: block;
}

.student-profile-stats span {
    margin-bottom: 4px;
    color: var(--text-gray);
    font-size: 0.68rem;
    font-weight: 750;
}

.student-profile-stats strong {
    color: var(--text);
    font-size: 1.25rem;
}

.student-profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
    gap: 14px;
    align-items: start;
}

.student-profile-details dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 8px 0 0;
}

.student-profile-details dl > div {
    min-width: 0;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
}

.student-profile-details dt {
    color: var(--text-gray);
    font-size: 0.65rem;
    font-weight: 750;
}

.student-profile-details dd {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.student-profile-access {
    padding: 14px;
}

.student-profile-access > a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    padding: 8px 5px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.student-profile-access > a:last-child {
    border-bottom: 0;
}

.student-profile-access > a > i:first-child {
    color: var(--primary);
    text-align: center;
}

.student-profile-access > a > i:last-child {
    color: var(--text-gray);
    font-size: 0.65rem;
}

.student-profile-access > a span {
    font-size: 0.74rem;
    font-weight: 750;
}

.annual-profile-hero {
    margin-bottom: 0;
}

.annual-main-grade {
    flex: 0 0 auto;
    min-width: 126px;
    text-align: right;
}

.annual-main-grade span,
.annual-main-grade strong,
.annual-main-grade small {
    display: block;
}

.annual-main-grade span,
.annual-main-grade small {
    color: var(--text-gray);
    font-size: 0.67rem;
    font-weight: 750;
}

.annual-main-grade strong {
    margin: 3px 0;
    font-size: 2rem;
    line-height: 1;
}

.academic-progress-card {
    padding: 13px 18px;
}

.academic-progress-line {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 8px;
}

.academic-progress-line::before {
    content: "";
    position: absolute;
    top: 17px;
    right: 12%;
    left: 12%;
    height: 2px;
    background: var(--border);
}

.academic-progress-line > div {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 5px;
    color: var(--text-gray);
    font-size: 0.66rem;
    font-weight: 750;
    text-align: center;
}

.academic-progress-line i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
}

.academic-progress-line .is-current i {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.academic-progress-line .is-complete i {
    color: #fff;
    background: var(--success);
    border-color: var(--success);
}

.annual-report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 14px;
    align-items: start;
}

.annual-subject-list {
    max-height: 480px;
    overflow: auto;
}

.annual-subject-list > article {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 55px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
}

.annual-subject-list > article:last-child {
    border-bottom: 0;
}

.annual-subject-list strong,
.annual-subject-list span {
    display: block;
}

.annual-subject-list > article > div:first-child {
    min-width: 0;
}

.annual-subject-list > article > div:first-child strong {
    color: var(--text);
    font-size: 0.73rem;
    overflow-wrap: anywhere;
}

.annual-subject-list > article > div:first-child span,
.annual-subject-metrics span {
    color: var(--text-gray);
    font-size: 0.62rem;
}

.annual-subject-metrics {
    flex: 0 0 auto;
    text-align: right;
}

.annual-subject-metrics strong {
    margin-top: 2px;
    font-size: 0.92rem;
}

.annual-chart-panel {
    position: sticky;
    top: 14px;
    min-height: 390px;
}

.annual-chart-panel canvas {
    width: 100% !important;
    max-height: 330px;
}

.chart-legend-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-gray);
    font-size: 0.61rem;
}

.chart-legend-note span {
    width: 14px;
    height: 3px;
    background: #2563eb;
}

.chart-legend-note span:nth-of-type(2) {
    background: #ef7d7d;
}

.indicator-heading {
    margin-bottom: 14px;
}

.indicator-heading .avatar {
    width: 58px;
    min-width: 58px;
    height: 58px;
    border-radius: 7px;
}

.indicator-heading .student-profile-identity span {
    color: var(--text-gray);
    font-size: 0.7rem;
}

.indicator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 14px;
    align-items: stretch;
}

.indicator-chart {
    min-height: 300px;
}

.indicator-chart-wide {
    grid-row: span 2;
    min-height: 590px;
}

.indicator-chart canvas {
    width: 100% !important;
    height: 245px !important;
}

.indicator-chart-wide canvas {
    height: 520px !important;
}

.indicator-summary {
    display: grid;
    align-content: start;
}

.indicator-summary > div:not(.widget-title) {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--border);
}

.indicator-summary > div:not(.widget-title) span,
.indicator-summary > div:not(.widget-title) strong {
    font-size: 0.73rem;
}

.indicator-summary > div:not(.widget-title) span {
    color: var(--text-gray);
}

html[data-theme="dark"] .grade-mid,
body.dark-mode .grade-mid {
    color: #f4c95d !important;
}

@media (max-width: 980px) {
    .student-profile-layout,
    .annual-report-grid,
    .indicator-grid {
        grid-template-columns: 1fr;
    }

    .annual-chart-panel {
        position: static;
    }

    .indicator-chart-wide {
        grid-row: auto;
        min-height: 460px;
    }

    .indicator-chart-wide canvas {
        height: 390px !important;
    }
}

@media (max-width: 680px) {
    .student-context-selector,
    .student-context-selector label,
    .student-context-selector select,
    .student-profile-switcher form,
    .student-profile-switcher label,
    .student-profile-switcher select {
        width: 100%;
    }

    .student-context-selector label,
    .student-profile-switcher label {
        align-items: stretch;
        flex-direction: column;
    }

    .student-profile-hero,
    .indicator-heading {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .student-profile-identity {
        align-items: flex-start;
    }

    .student-profile-avatar {
        width: 68px;
        min-width: 68px;
        height: 68px;
    }

    .student-profile-photo-form {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .student-profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-profile-details dl {
        grid-template-columns: 1fr;
    }

    .annual-main-grade {
        min-width: 0;
        text-align: left;
    }

    .academic-progress-card {
        overflow-x: auto;
    }

    .academic-progress-line {
        min-width: 480px;
    }

    .annual-subject-list > article {
        align-items: flex-start;
    }

    .indicator-chart,
    .indicator-chart-wide {
        min-height: 350px;
    }

    .indicator-chart canvas,
    .indicator-chart-wide canvas {
        height: 290px !important;
    }
}

/* --- Cliente de correo institucional --- */
.mail-command-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.mail-search-form,
.mail-command-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-search-form {
    min-width: 0;
    flex: 1 1 520px;
}

.mail-search-form .search-box {
    max-width: 520px;
    flex: 1 1 320px;
}

.mail-command-actions {
    flex: 0 0 auto;
}

.mail-client {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 12px;
}

.mail-client .mail-sidebar {
    gap: 3px;
    padding: 10px;
    border-radius: 7px;
    box-shadow: none;
}

.mail-compose-button {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 8px;
    color: #fff;
    background: #9c2f6d;
    border-color: #9c2f6d;
}

.mail-compose-button:hover,
.mail-compose-button:focus-visible {
    color: #fff;
    background: #7f2358;
    border-color: #7f2358;
}

.mail-client .mail-folder {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    min-height: 40px;
    padding: 8px 9px;
    border-radius: 5px;
    font-size: 0.75rem;
}

.mail-client .mail-folder strong {
    min-width: 22px;
    padding: 2px 6px;
    color: #fff;
    background: var(--success);
    border-radius: 10px;
    font-size: 0.61rem;
    text-align: center;
}

.mail-client .mail-panel {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.mail-client .mail-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: max-content;
    padding: 7px 10px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.mail-client .mail-tabs a {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 12px;
    color: var(--text-gray);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    font-size: 0.72rem;
    font-weight: 700;
}

.mail-client .mail-tabs a.active {
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: inset 0 2px 0 var(--primary);
}

.mail-client .mail-tabs strong {
    min-width: 21px;
    padding: 2px 6px;
    color: var(--text-gray);
    background: var(--surface-soft);
    border-radius: 10px;
    font-size: 0.61rem;
    text-align: center;
}

.mail-client .mail-list {
    display: block;
}

.mail-client .mail-row {
    display: grid;
    grid-template-columns: 25px 8px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 52px;
    padding: 6px 11px;
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.mail-client .mail-row:last-child {
    border-bottom: 0;
}

.mail-client .mail-row.is-unread {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.mail-star {
    width: 25px;
    height: 25px;
    padding: 0;
    color: var(--text-gray);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mail-star-form {
    margin: 0;
    line-height: 0;
}

.mail-star-placeholder {
    display: block;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
}

.mail-star.is-starred {
    color: #e5a11a;
}

.mail-star:hover {
    color: #e5a11a;
}

.mail-unread-dot {
    width: 7px;
    height: 7px;
    background: transparent;
    border-radius: 50%;
}

.mail-row.is-unread .mail-unread-dot {
    background: var(--primary);
}

.mail-open {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(135px, 0.27fr) minmax(230px, 1fr);
    align-items: center;
    gap: 14px;
    padding: 0;
    color: var(--text);
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mail-open > strong,
.mail-open > span,
.mail-open b,
.mail-open small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-open > strong {
    font-size: 0.72rem;
}

.mail-open > span {
    display: flex;
    gap: 5px;
    align-items: baseline;
}

.mail-open b {
    flex: 0 1 auto;
    font-size: 0.72rem;
}

.mail-open small {
    flex: 1 1 auto;
    color: var(--text-gray);
    font-size: 0.67rem;
}

.mail-row.is-unread .mail-open > strong,
.mail-row.is-unread .mail-open b {
    font-weight: 850;
}

.mail-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 0.62rem;
    white-space: nowrap;
}

.mail-empty {
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 30px;
    color: var(--text-gray);
    text-align: center;
}

.mail-empty i {
    font-size: 2rem;
    color: var(--primary);
}

.mail-empty strong {
    color: var(--text);
}

.mail-empty span {
    font-size: 0.72rem;
}

.mail-compose-modal {
    width: min(680px, calc(100vw - 28px));
}

.mail-compose-form {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 12px;
}

.mail-compose-form label {
    display: grid;
    gap: 5px;
    color: var(--text-gray);
    font-size: 0.69rem;
    font-weight: 750;
}

.mail-compose-form label:nth-of-type(3),
.mail-compose-form label:nth-of-type(4),
.mail-compose-form .modal-actions {
    grid-column: 1 / -1;
}

.mail-message-modal {
    width: min(720px, calc(100vw - 28px));
}

.mail-message-sender {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.mail-message-sender .avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
}

.mail-message-sender strong,
.mail-message-sender span {
    display: block;
}

.mail-message-sender strong {
    color: var(--text);
    font-size: 0.78rem;
}

.mail-message-sender span,
.mail-message-sender time {
    color: var(--text-gray);
    font-size: 0.65rem;
}

.mail-message-body {
    min-height: 160px;
    padding: 20px 4px;
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.65;
}

@media (max-width: 900px) {
    .mail-command-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .mail-search-form,
    .mail-command-actions {
        width: 100%;
    }

    .mail-command-actions {
        justify-content: flex-end;
    }

    .mail-client {
        grid-template-columns: 1fr;
    }

    .mail-client .mail-sidebar {
        grid-template-columns: repeat(5, minmax(115px, 1fr));
        overflow-x: auto;
    }

    .mail-compose-button {
        min-width: 125px;
        margin: 0;
    }

    .mail-client .mail-folder {
        min-width: 115px;
    }
}

@media (max-width: 620px) {
    .mail-search-form {
        flex-wrap: wrap;
    }

    .mail-search-form .search-box {
        max-width: none;
        flex-basis: calc(100% - 48px);
    }

    .mail-command-actions {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .mail-command-actions .btn {
        width: 100%;
    }

    .mail-open {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .mail-open > span {
        display: grid;
    }

    .mail-client .mail-row {
        grid-template-columns: 21px 6px minmax(0, 1fr);
        min-height: 62px;
        padding: 7px 8px;
    }

    .mail-row-meta {
        grid-column: 3;
        justify-self: start;
    }

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

    .mail-compose-form label,
    .mail-compose-form label:nth-of-type(3),
    .mail-compose-form label:nth-of-type(4),
    .mail-compose-form .modal-actions {
        grid-column: 1;
    }
}

/* La cabecera movil debe ganar sobre las reglas heredadas antiguas. */
@media (max-width: 900px) {
    body .top-header {
        min-height: 56px;
        display: flex;
        align-items: center !important;
        justify-content: space-between;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px;
        margin-bottom: 12px;
        padding: 8px 10px;
    }

    body .top-title-area {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        gap: 8px;
    }

    body .top-actions {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 6px;
    }

    body .top-year-select,
    body .top-title-copy p,
    body .breadcrumb-lite {
        display: none;
    }

    body .top-title-copy h1 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body .account-menu,
    body .account-menu .user-badge {
        width: auto;
    }

    body .account-menu .user-badge > div:first-child,
    body .account-chevron {
        display: none;
    }

    body .account-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        width: 230px;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    body .main-view,
    body .main-content {
        padding: 8px;
    }

    body .top-header {
        margin-right: -2px;
        margin-left: -2px;
        padding: 7px 8px;
    }

    body .top-title-copy h1 {
        max-width: 135px;
        font-size: 0.96rem;
    }
}

/* Final notebook sizing: later legacy matrix rules must not widen these columns. */
body .academic-matrix-table.teacher-notebook-matrix {
    width: auto !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

body .academic-matrix-table.teacher-notebook-matrix thead .activity-head {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 88px !important;
    min-height: 88px !important;
}

body .academic-matrix-table.teacher-notebook-matrix thead .activity-head-button {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
}

body .academic-matrix-table.teacher-notebook-matrix thead .promedio-header {
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 88px !important;
    min-height: 88px !important;
}

body .academic-matrix-table.teacher-notebook-matrix .input-nota {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
}

body .teacher-idukay-grid [data-ledger-partial].is-expanded {
    border-right: 3px solid var(--primary) !important;
    border-left: 3px solid var(--primary) !important;
}

body .teacher-idukay-grid [data-ledger-detail-group].is-expanded {
    border-top-width: 1px !important;
    border-bottom-width: 1px !important;
}

body .teacher-idukay-grid .ledger-partial-boundary-start.is-expanded,
body .teacher-idukay-grid [data-ledger-summary-group].is-expanded-partial {
    border-left: 3px solid var(--primary) !important;
}

body .teacher-idukay-grid .ledger-partial-boundary-end.is-expanded {
    border-right: 3px solid var(--primary) !important;
}

body .report-subject-matrix thead .report-matrix-subject-head {
    position: relative;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    height: 96px !important;
    padding: 0 !important;
    overflow: hidden;
    vertical-align: bottom;
    clip-path: polygon(27px 0, 100% 0, 100% 100%, 0 100%, 0 27px);
}

body .report-subject-matrix thead .report-matrix-subject-head > span {
    position: absolute;
    bottom: 17px;
    left: 9px;
    display: block;
    width: 110px;
    overflow: hidden;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 850;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: left bottom;
}

body .report-subject-matrix thead .report-matrix-subject-head > a {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 2;
    width: 20px;
    height: 20px;
}

body .report-subject-matrix thead .report-matrix-reports-head {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
}

/* Matrices docentes: encabezados compactos tipo cuaderno. */
body .teacher-idukay-grid.has-ledger-detail .ledger-insumo-row {
    height: 82px;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head {
    position: relative;
    height: 82px !important;
    padding: 0 !important;
    overflow: hidden;
    vertical-align: bottom;
    background: #6d64a6 !important;
    clip-path: none !important;
}

body .teacher-idukay-grid .ledger-insumo-row .ledger-partial-average-label {
    background: #3f4b5e !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-slot-1 {
    background: #6d56ad !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-slot-2 {
    background: #a13f78 !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-slot-3 {
    background: #59677d !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-slot-4 {
    background: #8d5b3d !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-type-tarea,
.student-ledger-table .ledger-insumo-row th.insumo-type-tarea {
    background: #6d56ad !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-type-actividad-individual,
.student-ledger-table .ledger-insumo-row th.insumo-type-actividad-individual {
    background: #a13f78 !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-type-actividad-grupal,
.student-ledger-table .ledger-insumo-row th.insumo-type-actividad-grupal {
    background: #bf3f5e !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-type-leccion,
.student-ledger-table .ledger-insumo-row th.insumo-type-leccion {
    background: #4a648f !important;
}

body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head.insumo-type-evaluacion,
.student-ledger-table .ledger-insumo-row th.insumo-type-evaluacion {
    background: #8d5b3d !important;
}

.student-ledger-table .ledger-insumo-row th.insumo-type-tarea,
.student-ledger-table .ledger-insumo-row th.insumo-type-actividad-individual,
.student-ledger-table .ledger-insumo-row th.insumo-type-actividad-grupal,
.student-ledger-table .ledger-insumo-row th.insumo-type-leccion,
.student-ledger-table .ledger-insumo-row th.insumo-type-evaluacion {
    color: #fff !important;
    border-right-color: rgba(255, 255, 255, 0.26) !important;
    border-bottom-color: rgba(15, 23, 42, 0.28) !important;
}

.student-ledger-table tbody td.ledger-detail-column.insumo-type-tarea {
    background-color: color-mix(in srgb, #6d56ad 9%, var(--surface)) !important;
}

.student-ledger-table tbody td.ledger-detail-column.insumo-type-actividad-individual {
    background-color: color-mix(in srgb, #a13f78 9%, var(--surface)) !important;
}

.student-ledger-table tbody td.ledger-detail-column.insumo-type-actividad-grupal {
    background-color: color-mix(in srgb, #bf3f5e 9%, var(--surface)) !important;
}

.student-ledger-table tbody td.ledger-detail-column.insumo-type-leccion {
    background-color: color-mix(in srgb, #4a648f 10%, var(--surface)) !important;
}

.student-ledger-table tbody td.ledger-detail-column.insumo-type-evaluacion {
    background-color: color-mix(in srgb, #8d5b3d 9%, var(--surface)) !important;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-insumo-number {
    position: absolute;
    top: 7px;
    right: 4px;
    left: auto;
    display: block;
    width: auto;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.45rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-insumo-kind {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: block;
    width: 72px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    color: #fff;
    font-size: 0.52rem;
    font-weight: 900;
    line-height: 1;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: left bottom;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit,
body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-add {
    right: 3px;
    bottom: 3px;
    z-index: 3;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit {
    color: #243142;
    background: #ffd34e;
    border-color: #ffd34e;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit:hover,
body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit:focus-visible,
body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit.is-active {
    color: #0f172a;
    background: #ffe68e;
    border-color: #ffe68e;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-add-more {
    bottom: 27px;
}

body .teacher-idukay-grid .teacher-insumo-kind small {
    display: inline-grid;
    min-width: 13px;
    height: 13px;
    margin-left: 3px;
    place-items: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 50%;
    font-size: 0.43rem;
    font-weight: 900;
    transform: rotate(45deg);
}

body .teacher-idukay-grid .teacher-slot-average {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 900;
    cursor: pointer;
}

body .teacher-idukay-grid .teacher-grade-cell.is-empty .teacher-slot-average {
    cursor: default;
}

body .teacher-idukay-grid .teacher-slot-average.grade-low {
    color: #dc2626;
}

body .teacher-idukay-grid .teacher-slot-average.grade-mid {
    color: #a16207;
}

body .teacher-idukay-grid .teacher-slot-average.grade-high {
    color: #047857;
}

body .teacher-idukay-grid .teacher-slot-inputs {
    display: none;
}

body .teacher-idukay-grid .teacher-slot-input-row {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

body .teacher-idukay-grid .teacher-slot-input-row.is-active {
    display: flex;
}

body .teacher-idukay-grid .teacher-slot-input-row > span {
    width: 10px;
    color: var(--text-gray);
    font-size: 0.52rem;
    font-weight: 850;
}

body .teacher-idukay-form .teacher-grade-cell.is-editing .teacher-slot-average {
    display: none;
}

body .teacher-idukay-form .teacher-grade-cell.is-editing .teacher-slot-inputs {
    display: block;
}

body .teacher-idukay-form .teacher-grade-cell.is-editing {
    height: 34px !important;
    padding: 2px !important;
}

body .teacher-idukay-grid .teacher-slot-activity-select {
    position: absolute;
    right: 2px;
    bottom: 28px;
    z-index: 4;
    display: none;
    width: 28px;
    height: 19px;
    padding: 0 2px;
    color: #243142;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.28);
    border-radius: 4px;
    font-size: 0.5rem;
    font-weight: 900;
}

body .teacher-idukay-grid [data-grade-column-head].is-editing .teacher-slot-activity-select {
    display: block;
}

html[data-theme="dark"] body .teacher-idukay-grid .teacher-slot-average.grade-low,
body.dark-mode .teacher-idukay-grid .teacher-slot-average.grade-low {
    color: #ff7382 !important;
}

html[data-theme="dark"] body .teacher-idukay-grid .teacher-slot-average.grade-mid,
body.dark-mode .teacher-idukay-grid .teacher-slot-average.grade-mid {
    color: #ffd66f !important;
}

html[data-theme="dark"] body .teacher-idukay-grid .teacher-slot-average.grade-high,
html[data-theme="dark"] body .teacher-idukay-grid .teacher-summary-cell.grade-high,
html[data-theme="dark"] body .teacher-idukay-grid .input-nota.grade-high,
body.dark-mode .teacher-idukay-grid .teacher-slot-average.grade-high,
body.dark-mode .teacher-idukay-grid .teacher-summary-cell.grade-high,
body.dark-mode .teacher-idukay-grid .input-nota.grade-high {
    color: #7cf7cf !important;
}

body .teacher-idukay-grid.has-ledger-detail .ledger-partial-row th {
    height: 44px;
}

body .teacher-idukay-grid .teacher-student-cell strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .report-grade-table {
    min-width: 0;
}

body .report-subject-matrix thead .report-matrix-subject-head > span {
    width: 86px;
    font-size: 0.54rem;
    text-overflow: clip;
}

@media (max-width: 760px) {
    body .report-stats,
    body .report-subject-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Selector global de ciclo lectivo. */
.top-year-menu {
    position: relative;
}

.top-year-menu > summary {
    display: flex;
    min-height: 44px;
    padding: 0 12px;
    align-items: center;
    gap: 9px;
    color: #fff;
    background: #8d2f70;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    list-style: none;
}

.top-year-menu > summary::-webkit-details-marker {
    display: none;
}

.top-year-menu > summary .fa-chevron-down {
    font-size: 0.62rem;
    transition: transform 150ms ease;
}

.top-year-menu[open] > summary .fa-chevron-down {
    transform: rotate(180deg);
}

.top-year-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 90;
    width: 280px;
    max-height: min(560px, calc(100vh - 100px));
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.22);
}

.top-year-dropdown > header {
    padding: 11px 13px;
    color: var(--text-gray);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    font-size: 0.74rem;
}

.top-year-options {
    max-height: min(500px, calc(100vh - 150px));
    padding: 4px 8px;
    overflow-y: auto;
}

.top-year-options form + form {
    border-top: 1px solid var(--border);
}

.top-year-options button {
    display: grid;
    width: 100%;
    min-height: 46px;
    padding: 7px 4px;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--text);
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.top-year-options button:hover {
    color: var(--primary);
}

.top-year-options button:disabled {
    color: var(--primary);
    cursor: default;
    opacity: 1;
}

.top-year-options button span {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.top-year-options button small {
    color: var(--text-gray);
    font-size: 0.68rem;
    font-weight: 650;
}

/* Apertura y cierre administrativo de parciales. */
.academic-period-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.academic-period-group {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.academic-period-group > header {
    display: flex;
    padding: 14px;
    align-items: center;
    gap: 10px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
}

.academic-period-group > header > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
}

.academic-period-group > header div,
.academic-period-group > header strong,
.academic-period-group > header small,
.academic-period-row > span:nth-child(6) {
    display: block;
}

.academic-period-group > header small,
.academic-period-row small {
    margin-top: 2px;
    color: var(--text-gray);
    font-size: 0.7rem;
}

.academic-period-row {
    display: grid;
    min-height: 68px;
    padding: 10px 12px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--border);
}

.academic-period-row:last-child {
    border-bottom: 0;
}

.academic-period-lock {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 6px;
}

.academic-period-row.is-open .academic-period-lock {
    color: #047857;
    background: rgba(16, 185, 129, 0.13);
}

.academic-period-row.is-closed .academic-period-lock {
    color: #b42318;
    background: rgba(239, 68, 68, 0.13);
}

@media (max-width: 980px) {
    .academic-period-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .top-year-menu > summary {
        min-height: 36px;
        padding: 0 9px;
    }

    .top-year-menu > summary span {
        display: none;
    }

    .top-year-dropdown {
        position: fixed;
        top: 58px;
        right: 8px;
        left: 8px;
        width: auto;
    }
}

/* Cuaderno docente compacto: la pagina controla el desplazamiento vertical. */
body .teacher-idukay-scroll {
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}

body .teacher-idukay-grid.student-notes-table {
    --ledger-subject-width: 180px;
    --ledger-average-width: 52px;
    --ledger-grade-width: 52px;
    width: max-content !important;
    min-width: max-content !important;
}

body .teacher-idukay-grid.has-ledger-detail .ledger-insumo-row,
body .teacher-idukay-grid .ledger-insumo-row .teacher-compact-insumo-head {
    height: 70px !important;
}

body .teacher-idukay-grid .ledger-trimester-row th {
    height: 27px;
}

body .teacher-idukay-grid .ledger-partial-row th {
    height: 38px;
}

body .teacher-idukay-grid tbody td {
    height: 35px !important;
    padding: 2px !important;
}

body .teacher-idukay-grid .teacher-student-cell {
    padding-inline: 7px !important;
}

body .teacher-idukay-grid .teacher-student-cell strong {
    font-size: 0.66rem;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-insumo-kind {
    bottom: 7px;
    left: 7px;
    width: 60px;
    font-size: 0.5rem;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-insumo-number {
    top: 5px;
    font-size: 0.41rem;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit,
body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-add {
    width: 18px;
    height: 18px;
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-edit {
    width: 22px;
    height: 22px;
    font-size: 0.64rem;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.38);
}

body .teacher-idukay-grid .ledger-partial-toggle {
    width: 26px;
    height: 24px;
    color: #155e75;
    background: #fff;
    border-color: rgba(255, 255, 255, 0.95);
    font-size: 0.68rem;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.28);
}

body .teacher-idukay-grid .teacher-compact-insumo-head .teacher-slot-add-more {
    bottom: 23px;
}

body .teacher-idukay-grid .teacher-summary-cell,
body .teacher-idukay-grid .teacher-slot-average,
body .teacher-idukay-grid .teacher-compact-input {
    font-size: 0.66rem !important;
}

body .teacher-idukay-grid tbody tr:nth-child(odd) td {
    background-color: var(--surface) !important;
}

body .teacher-idukay-grid tbody tr:nth-child(even) td {
    background-color: color-mix(in srgb, var(--primary) 10%, var(--surface)) !important;
}

body .teacher-idukay-grid tbody tr:hover td {
    background-color: color-mix(in srgb, var(--primary) 12%, var(--surface)) !important;
}

body .teacher-idukay-grid tbody tr td {
    transition: background-color 110ms ease;
}

html[data-theme="dark"] body .teacher-idukay-grid tbody tr:nth-child(odd) td,
body.dark-mode .teacher-idukay-grid tbody tr:nth-child(odd) td {
    background-color: color-mix(in srgb, #ffffff 3%, var(--surface)) !important;
}

html[data-theme="dark"] body .teacher-idukay-grid tbody tr:nth-child(even) td,
body.dark-mode .teacher-idukay-grid tbody tr:nth-child(even) td {
    background-color: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important;
}

html[data-theme="dark"] body .teacher-idukay-grid tbody tr:hover td,
body.dark-mode .teacher-idukay-grid tbody tr:hover td {
    background-color: color-mix(in srgb, var(--primary) 18%, var(--surface)) !important;
}

.period-edit-state {
    display: inline-flex;
    min-height: 30px;
    padding: 5px 8px;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 0.72rem;
    font-weight: 800;
}

.period-edit-state.is-open {
    color: #047857;
}

.period-edit-state.is-closed {
    color: #b42318;
}

.grade-autosave-status {
    display: inline-flex;
    min-height: 30px;
    padding: 5px 8px;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 0.72rem;
    font-weight: 800;
}

.grade-autosave-status.is-saved {
    color: #047857;
}

.grade-autosave-status.is-saving,
.grade-autosave-status.is-pending {
    color: #a16207;
}

.grade-autosave-status.is-error {
    color: #b42318;
}

@media (max-width: 760px) {
    body .teacher-idukay-grid.student-notes-table {
        --ledger-subject-width: 158px;
        --ledger-average-width: 48px;
        --ledger-grade-width: 49px;
    }
}

/* Los examenes conservan una franja ambar propia en todas las matrices. */
.student-ledger-table thead .ledger-exam,
.student-ledger-table thead .ledger-exam.trimester-1,
.student-ledger-table thead .ledger-exam.trimester-2,
.student-ledger-table thead .ledger-exam.trimester-3 {
    color: #3c2a00 !important;
    background: #f4c44e !important;
    border-right-color: rgba(112, 76, 0, 0.32) !important;
    border-bottom-color: rgba(112, 76, 0, 0.42) !important;
    box-shadow: none !important;
}

.student-ledger-table tbody td.ledger-exam-cell,
.student-ledger-table tbody td.teacher-exam-cell,
body .teacher-idukay-grid tbody tr:nth-child(odd) td.teacher-exam-cell {
    background-color: color-mix(in srgb, #f4c44e 15%, var(--surface)) !important;
    box-shadow: inset 2px 0 0 rgba(185, 128, 0, 0.34);
}

.student-ledger-table tbody tr:nth-child(even) td.ledger-exam-cell,
body .teacher-idukay-grid tbody tr:nth-child(even) td.teacher-exam-cell {
    background-color: color-mix(in srgb, #f4c44e 22%, var(--surface)) !important;
}

.student-ledger-table tbody tr:hover td.ledger-exam-cell,
body .teacher-idukay-grid tbody tr:hover td.teacher-exam-cell {
    background-color: color-mix(in srgb, #f4c44e 28%, var(--surface)) !important;
}

html[data-theme="dark"] .student-ledger-table thead .ledger-exam,
html[data-theme="dark"] .student-ledger-table thead .ledger-exam.trimester-1,
html[data-theme="dark"] .student-ledger-table thead .ledger-exam.trimester-2,
html[data-theme="dark"] .student-ledger-table thead .ledger-exam.trimester-3,
body.dark-mode .student-ledger-table thead .ledger-exam {
    color: #261900 !important;
    background: #e5ad2f !important;
}

html[data-theme="dark"] .student-ledger-table tbody td.ledger-exam-cell,
html[data-theme="dark"] body .teacher-idukay-grid tbody td.teacher-exam-cell,
body.dark-mode .student-ledger-table tbody td.ledger-exam-cell,
body.dark-mode .teacher-idukay-grid tbody td.teacher-exam-cell {
    background-color: color-mix(in srgb, #d99d19 18%, var(--surface)) !important;
    box-shadow: inset 2px 0 0 rgba(244, 196, 78, 0.42);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) {
    --ledger-subject-width: 196px;
    --ledger-average-width: 58px;
    --ledger-grade-width: 50px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody td {
    height: 29px !important;
    padding-block: 1px !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(odd) td {
    background-color: color-mix(in srgb, #334155 4%, var(--surface)) !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(even) td {
    background-color: color-mix(in srgb, var(--primary) 11%, var(--surface)) !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:hover td {
    background-color: color-mix(in srgb, var(--primary) 17%, var(--surface)) !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-subject-cell {
    padding: 3px 8px !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-subject-cell small {
    display: none;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-grade-cell button,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-grade-cell > span {
    width: 34px;
    min-height: 20px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam {
    height: 38px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial-toggle {
    width: 22px;
    height: 18px;
    margin-top: 1px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-trimester {
    height: 30px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(odd) td.ledger-exam-cell {
    background-color: color-mix(in srgb, #f4c44e 17%, var(--surface)) !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(even) td.ledger-exam-cell {
    background-color: color-mix(in srgb, #f4c44e 25%, var(--surface)) !important;
}

html[data-theme="dark"] .student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(odd) td,
body.dark-mode .student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(odd) td {
    background-color: color-mix(in srgb, #ffffff 4%, var(--surface)) !important;
}

html[data-theme="dark"] .student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(even) td,
body.dark-mode .student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody tr:nth-child(even) td {
    background-color: color-mix(in srgb, var(--primary) 13%, var(--surface)) !important;
}

.student-ledger-table .ledger-period-summary,
html[data-theme="dark"] .student-ledger-table .ledger-period-summary,
body.dark-mode .student-ledger-table .ledger-period-summary {
    box-shadow: none !important;
}

/* Vista de alumno/padre: cabeceras diagonales continuas y legibles. */
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) {
    --ledger-grade-width: 54px;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-trimester {
    height: 34px;
    border-right: 3px solid rgba(255, 255, 255, 0.52) !important;
    border-left: 2px solid rgba(255, 255, 255, 0.34) !important;
    font-size: 0.8rem;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam {
    position: relative;
    height: 66px;
    padding: 0 !important;
    overflow: visible;
    vertical-align: bottom;
    background: var(--period-head-underlay) !important;
    border: 0 !important;
    filter: none;
    clip-path: none !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial::before,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    content: "";
    clip-path: polygon(15px 0, 100% 0, 100% 100%, 0 100%, 0 15px);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial::before {
    height: auto;
    background: var(--period-head-color);
    box-shadow: inset -1px 0 rgba(255, 255, 255, 0.28);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam::before {
    height: auto;
    background: #f4c44e;
    border-right: 2px solid #c79418;
    box-shadow: inset -1px 0 rgba(112, 76, 0, 0.16);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.trimester-1 {
    --period-head-color: #328fc6;
    --period-head-underlay: #247fb7;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.partial-two.trimester-1 {
    --period-head-color: #267aa9;
    --period-head-underlay: #328fc6;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.trimester-2 {
    --period-head-color: #4a9276;
    --period-head-underlay: #347f67;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.partial-two.trimester-2 {
    --period-head-color: #3b775f;
    --period-head-underlay: #4a9276;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.trimester-3 {
    --period-head-color: #d86b53;
    --period-head-underlay: #c95846;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.partial-two.trimester-3 {
    --period-head-color: #b95745;
    --period-head-underlay: #d86b53;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam.trimester-1 {
    --period-head-underlay: #267aa9;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam.trimester-2 {
    --period-head-underlay: #3b775f;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam.trimester-3 {
    --period-head-underlay: #b95745;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial > span,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam > span {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 50%;
    z-index: 2;
    display: block;
    width: 68px;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0;
    transform: translate(-50%, -50%) rotate(-48deg);
    transform-origin: center;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial > span {
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam > span {
    color: #3c2a00;
    font-size: 0.64rem;
    font-weight: 900;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial-toggle {
    position: absolute;
    top: auto;
    right: 5px;
    bottom: 5px;
    z-index: 3;
    width: 22px;
    height: 21px;
    margin: 0;
    color: #fff;
    background: rgba(15, 23, 42, 0.14);
    border-color: rgba(255, 255, 255, 0.68);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.is-expanded {
    height: 32px !important;
    background: var(--period-head-color) !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.is-expanded::before {
    height: auto;
    clip-path: none;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.is-expanded > span {
    top: 50%;
    bottom: auto;
    left: 50%;
    width: auto;
    font-size: 0.7rem;
    text-align: center;
    transform: translate(-50%, -50%);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-partial.is-expanded .ledger-partial-toggle {
    top: 50%;
    right: 7px;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded {
    --insumo-color: #4f5d70;
    --insumo-underlay: #4f5d70;
    position: relative;
    height: 68px !important;
    padding: 0 !important;
    overflow: visible;
    color: #fff !important;
    vertical-align: bottom;
    background: var(--insumo-underlay) !important;
    border: 0 !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    background: var(--insumo-color);
    clip-path: polygon(15px 0, 100% 0, 100% 100%, 0 100%, 0 15px);
    box-shadow: inset -1px 0 rgba(255, 255, 255, 0.24);
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded > span {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 70px;
    max-width: none;
    color: #fff;
    font-size: 0.6rem;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-48deg);
    transform-origin: center;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded.insumo-type-tarea {
    --insumo-color: #6d56ad;
    --insumo-underlay: #4f5d70;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded.insumo-type-actividad-individual {
    --insumo-color: #a13f78;
    --insumo-underlay: #6d56ad;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded.insumo-type-actividad-grupal {
    --insumo-color: #bf3f5e;
    --insumo-underlay: #a13f78;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded.insumo-type-leccion {
    --insumo-color: #4a648f;
    --insumo-underlay: #a13f78;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-insumo-row th.is-expanded.insumo-type-evaluacion {
    --insumo-color: #8d5b3d;
    --insumo-underlay: #4a648f;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam,
.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) .ledger-exam-cell {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
}

.student-ledger-table.student-notes-table:not(.teacher-idukay-grid) tbody td.ledger-exam-cell {
    border-right: 2px solid color-mix(in srgb, #c79418 68%, var(--border)) !important;
}

.student-ledger-table.student-notes-table tfoot td {
    height: 34px !important;
    padding-block: 2px !important;
    box-sizing: border-box;
    vertical-align: middle;
    background: color-mix(in srgb, var(--surface) 82%, #334155) !important;
    border-top: 2px solid color-mix(in srgb, var(--primary) 62%, var(--border)) !important;
    font-weight: 900;
}

.student-ledger-table.student-notes-table tfoot .ledger-subject-cell {
    width: var(--ledger-subject-width) !important;
    min-width: var(--ledger-subject-width) !important;
    max-width: var(--ledger-subject-width) !important;
}

.student-ledger-table.student-notes-table tfoot .ledger-average-cell {
    width: var(--ledger-average-width) !important;
    min-width: var(--ledger-average-width) !important;
    max-width: var(--ledger-average-width) !important;
}

.student-ledger-table.student-notes-table tfoot .ledger-grade-cell:not(.ledger-average-cell) {
    width: var(--ledger-grade-width) !important;
    min-width: var(--ledger-grade-width) !important;
    max-width: var(--ledger-grade-width) !important;
}

.student-ledger-table.student-notes-table tfoot .ledger-subject-cell,
.student-ledger-table.student-notes-table tfoot .ledger-average-cell {
    position: sticky;
    z-index: 7;
}

.student-ledger-table.student-notes-table tfoot .ledger-subject-cell {
    left: 0;
}

.student-ledger-table.student-notes-table tfoot .ledger-average-cell {
    left: var(--ledger-subject-width);
}

.student-ledger-table.student-notes-table .ledger-total-label {
    padding-inline: 9px !important;
    color: var(--text-dark);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.student-ledger-table.student-notes-table tfoot .ledger-grade-cell > span {
    display: inline-grid;
    place-items: center;
    width: 36px;
    min-height: 20px;
    font-size: 0.71rem;
}

.student-ledger-table.student-notes-table tfoot td.ledger-exam-cell {
    background: color-mix(in srgb, #f4c44e 28%, var(--surface)) !important;
}

.ledger-noncontributing-mark {
    margin-left: 2px;
    color: #d17c00;
    font-size: 0.78rem;
    font-weight: 900;
}

.ledger-aggregate-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    margin-top: 8px;
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.ledger-aggregate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 9px 12px;
    background: var(--surface);
}

.ledger-aggregate-item span {
    color: var(--text-gray);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.ledger-aggregate-item strong {
    margin-left: 8px;
    font-size: 0.95rem;
}

.ledger-aggregate-item.is-general {
    border-left: 4px solid #526277;
}

.ledger-aggregate-item.trimester-1 {
    border-left: 4px solid #247fb7;
}

.ledger-aggregate-item.trimester-2 {
    border-left: 4px solid #347f67;
}

.ledger-aggregate-item.trimester-3 {
    border-left: 4px solid #c95846;
}

.ledger-aggregate-item strong.grade-high {
    color: #087f5b;
}

.ledger-aggregate-item strong.grade-mid {
    color: #b16a00;
}

.ledger-aggregate-item strong.grade-low {
    color: #d1222f;
}

.ledger-noncontributing-note {
    margin: 7px 2px 0;
    color: var(--text-gray);
    font-size: 0.72rem;
}

.ledger-noncontributing-note span {
    color: #d17c00;
    font-weight: 900;
}

html[data-theme="dark"] .student-ledger-table.student-notes-table tfoot td,
body.dark-mode .student-ledger-table.student-notes-table tfoot td {
    background: color-mix(in srgb, #ffffff 9%, var(--surface)) !important;
}

html[data-theme="dark"] .ledger-aggregate-item,
body.dark-mode .ledger-aggregate-item {
    background: color-mix(in srgb, #ffffff 5%, var(--surface));
}

@media (max-width: 720px) {
    .ledger-aggregate-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ledger-aggregate-item {
        padding: 8px 9px;
    }
}

.public-status-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.public-status-card {
    width: min(460px, 100%);
    text-align: center;
}

.public-status-card h1 {
    margin: 12px 0 8px;
}

.public-status-card p {
    margin-bottom: 20px;
    color: var(--text-gray);
}

.status-icon {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 8px;
    font-size: 1.4rem;
}

.status-icon.status-success {
    color: #047857;
    background: #d1fae5;
}

.status-icon.status-danger {
    color: #b42318;
    background: #fee2e2;
}

/* Novita */
.novita-assistant {
    position: fixed;
    right: 22px;
    bottom: 20px;
    z-index: 1240;
    font-family: 'Inter', Arial, sans-serif;
}

.novita-launcher {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    color: #fff;
    background: #087f72;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(5, 68, 64, 0.22), inset 0 1px rgba(255, 255, 255, 0.16);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.novita-launcher:hover,
.novita-launcher:focus-visible {
    background: #066b61;
    box-shadow: 0 13px 28px rgba(5, 68, 64, 0.28), inset 0 1px rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.novita-launcher:focus-visible {
    outline: 3px solid color-mix(in srgb, #22d3c5 42%, transparent);
    outline-offset: 3px;
}

.novita-launcher-icon,
.novita-avatar,
.novita-message-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    background: #eaf8f5;
    border: 1px solid rgba(255, 255, 255, 0.48);
}

.novita-launcher-icon img,
.novita-avatar img,
.novita-message-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.novita-launcher-icon {
    width: 36px;
    height: 36px;
    background: #f4fffd;
    border-color: rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(4, 55, 52, 0.18);
}

.novita-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: min(390px, calc(100vw - 28px));
    height: min(570px, calc(100vh - 112px));
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(7, 40, 46, 0.24);
}

.novita-panel[hidden] {
    display: none;
}

.novita-header {
    display: flex;
    height: 66px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #fff;
    background: #0d766e;
    border-bottom: 3px solid #f8c94d;
}

.novita-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.novita-avatar {
    width: 38px;
    height: 38px;
    border-radius: 7px;
}

.novita-identity h2 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.novita-identity p {
    margin: 1px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.7rem;
    line-height: 1.3;
}

.novita-close {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 6px;
    cursor: pointer;
}

.novita-close:hover,
.novita-close:focus-visible {
    background: rgba(255, 255, 255, 0.13);
}

.novita-messages {
    height: calc(100% - 184px);
    min-height: 220px;
    padding: 14px 12px 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 66%, var(--surface)), var(--surface));
}

.novita-message {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 10px;
}

.novita-message.is-user {
    justify-content: flex-end;
}

.novita-message-avatar {
    width: 25px;
    height: 25px;
    margin-top: 2px;
    border-radius: 5px;
    border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
}

.novita-message p {
    max-width: 82%;
    margin: 0;
    padding: 9px 10px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.8rem;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.novita-message.is-user p {
    color: #fff;
    background: #0d766e;
    border-color: #0d766e;
    border-bottom-right-radius: 2px;
}

.novita-message.is-assistant p {
    border-bottom-left-radius: 2px;
}

.novita-message.is-loading p {
    color: var(--text-gray);
    font-style: italic;
}

.novita-message.is-error p {
    color: #b42318;
    background: color-mix(in srgb, #fee2e2 78%, var(--surface));
    border-color: color-mix(in srgb, #dc2626 38%, var(--border));
}

.novita-suggestions {
    display: flex;
    min-height: 45px;
    gap: 6px;
    padding: 6px 10px 5px;
    overflow-x: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.novita-suggestions[hidden] {
    display: none;
}

.novita-assistant.has-conversation .novita-messages {
    height: calc(100% - 139px);
}

.novita-suggestions button {
    flex: 0 0 auto;
    max-width: 205px;
    padding: 6px 9px;
    color: #0b6b63;
    background: var(--surface-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border));
    border-radius: 6px;
    font: inherit;
    font-size: 0.69rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.novita-suggestions button:hover,
.novita-suggestions button:focus-visible {
    color: #fff;
    background: #0d766e;
    border-color: #0d766e;
}

.novita-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: end;
    gap: 7px;
    padding: 8px 10px 4px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.novita-composer textarea {
    width: 100%;
    min-height: 38px;
    max-height: 96px;
    padding: 9px 10px;
    resize: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.35;
}

.novita-composer textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.novita-composer button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: #0d766e;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.novita-composer button:hover,
.novita-composer button:focus-visible {
    background: #095f59;
}

.novita-composer button:disabled,
.novita-composer textarea:disabled {
    cursor: wait;
    opacity: 0.68;
}

.novita-privacy {
    height: 24px;
    margin: 0;
    padding: 2px 11px 7px;
    color: var(--text-gray);
    background: var(--surface);
    font-size: 0.62rem;
    line-height: 1.5;
}

.novita-privacy i {
    margin-right: 4px;
    color: #0d766e;
}

html[data-theme="dark"] .novita-message.is-error p,
body.dark-mode .novita-message.is-error p {
    color: #fecaca;
    background: #3b1b22;
}

html[data-theme="dark"] .novita-suggestions button,
body.dark-mode .novita-suggestions button {
    color: #7ce8dc;
}

@media (max-width: 720px) {
    .novita-assistant {
        right: 10px;
        bottom: 10px;
    }

    .novita-launcher {
        min-height: 46px;
        padding: 5px 13px 5px 5px;
        border-radius: 13px;
    }

    .novita-launcher-icon {
        width: 34px;
        height: 34px;
    }

    .novita-panel {
        position: fixed;
        inset: auto 8px 8px;
        width: auto;
        height: min(72vh, 560px);
    }

    .novita-assistant.is-open .novita-launcher {
        visibility: hidden;
    }

    .novita-messages {
        height: calc(100% - 184px);
    }

    .novita-assistant.has-conversation .novita-messages {
        height: calc(100% - 139px);
    }
}

/* Security, virtual secretary and quick contact */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-gray);
    font-size: 0.72rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--border);
}

.passkey-login-button {
    justify-content: center;
}

.passkey-login-hint {
    margin: -2px 0 0;
    color: var(--text-gray);
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: center;
}

.passkey-status {
    min-height: 18px;
    color: var(--text-gray);
    font-size: 0.76rem;
    line-height: 1.4;
}

.passkey-status.is-success {
    color: var(--success);
}

.passkey-status.is-error {
    color: var(--danger);
}

.passkey-register-row {
    display: grid;
    grid-template-columns: minmax(220px, 380px) minmax(0, 1fr);
    align-items: end;
    gap: 14px;
}

.passkey-register-row label,
.secretary-settings-form label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.passkey-register-row input,
.secretary-settings-form textarea {
    width: 100%;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 7px;
    font: inherit;
}

.passkey-list {
    display: grid;
    gap: 8px;
}

.passkey-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.passkey-item-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 7px;
}

.passkey-item strong,
.passkey-item span,
.passkey-item small {
    display: block;
}

.passkey-item span,
.passkey-item small {
    margin-top: 2px;
    color: var(--text-gray);
    font-size: 0.72rem;
}

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

.secretary-settings-form textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.45;
}

.secretary-settings-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 4px;
}

.secretary-settings-actions p {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.novita-proactive {
    position: absolute;
    right: 0;
    bottom: 61px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(310px, calc(100vw - 30px));
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(7, 40, 46, 0.2);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.42;
    cursor: pointer;
}

.novita-proactive[hidden] {
    display: none;
}

.novita-proactive::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-right: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    transform: rotate(45deg);
}

.novita-proactive:hover,
.novita-proactive:focus-visible {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.novita-proactive i {
    color: var(--primary);
}

.whatsapp-fab {
    position: fixed;
    right: 142px;
    bottom: 20px;
    z-index: 1235;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #fff;
    text-decoration: none;
    background: #20d866;
    border: 1px solid rgba(156, 255, 191, 0.92);
    border-radius: 50%;
    box-shadow:
        0 0 0 3px rgba(54, 255, 126, 0.18),
        0 0 18px rgba(37, 238, 108, 0.7),
        0 10px 24px rgba(9, 92, 49, 0.3);
    font-size: 1.62rem;
    animation: whatsapp-float 3.2s ease-in-out infinite;
}

.whatsapp-fab.is-public {
    right: 22px;
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
    color: #fff;
    background: #24e76e;
    box-shadow:
        0 0 0 4px rgba(69, 255, 134, 0.22),
        0 0 25px rgba(52, 255, 124, 0.9),
        0 13px 28px rgba(9, 92, 49, 0.38);
    animation-play-state: paused;
    transform: translateY(-3px);
}

@keyframes whatsapp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (max-width: 720px) {
    .passkey-register-row,
    .secretary-settings-form {
        grid-template-columns: 1fr;
    }

    .secretary-settings-actions {
        grid-column: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .secretary-settings-actions .btn,
    .passkey-settings-panel .settings-panel-head .btn {
        width: 100%;
        justify-content: center;
    }

    .passkey-settings-panel .settings-panel-head {
        flex-wrap: wrap;
    }

    .novita-proactive {
        right: 0;
        bottom: 57px;
        width: min(286px, calc(100vw - 24px));
    }

    .whatsapp-fab.is-authenticated {
        right: auto;
        left: 10px;
        bottom: 10px;
    }

    .whatsapp-fab.is-public {
        right: 14px;
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-fab {
        animation: none;
    }
}

/* Public contact */
.contact-page {
    overflow-x: hidden;
}

.contact-main {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 24px 0 54px;
}

.contact-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 900;
    text-decoration: none;
}

.contact-brand img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr);
    align-items: stretch;
    gap: 28px;
}

.contact-info {
    padding: 24px 8px 24px 0;
}

.contact-kicker,
.contact-section-heading > span {
    display: inline-flex;
    margin-bottom: 7px;
    color: #0d9488;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.contact-info h1 {
    max-width: 570px;
    margin: 0;
    color: var(--text);
    font-size: 2.8rem;
    line-height: 1.05;
}

.contact-lead {
    max-width: 540px;
    margin: 14px 0 24px;
    color: var(--text-gray);
    font-size: 1.02rem;
    line-height: 1.65;
}

.contact-reasons {
    display: grid;
    gap: 10px;
}

.contact-reasons > div {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.contact-reasons i {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #0d766e;
    background: #dff8f3;
    border-radius: 7px;
}

.contact-reasons > div:nth-child(2) i {
    color: #9a6700;
    background: #fff1bd;
}

.contact-reasons > div:nth-child(3) i {
    color: #c2412d;
    background: #ffe3dc;
}

.contact-reasons strong,
.contact-reasons span {
    display: block;
}

.contact-reasons span {
    color: var(--text-gray);
    font-size: 0.82rem;
    line-height: 1.45;
}

.contact-reasons strong {
    margin-bottom: 2px;
    color: var(--text);
    font-size: 0.88rem;
}

.contact-direct {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 22px;
    color: var(--text-gray);
    font-size: 0.78rem;
}

.contact-direct span {
    flex-basis: 100%;
}

.contact-direct a {
    color: #0d766e;
    font-weight: 850;
    text-decoration: none;
}

.contact-direct a:last-child {
    color: #138a48;
}

.contact-form-panel {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid #12b8a6;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(7, 49, 55, 0.13);
}

.contact-form-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.contact-form-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #fff;
    background: #0d9488;
    border-radius: 8px;
}

.contact-form-heading h2,
.contact-form-heading p {
    margin: 0;
}

.contact-form-heading h2 {
    color: var(--text);
    font-size: 1.18rem;
}

.contact-form-heading p {
    margin-top: 3px;
    color: var(--text-gray);
    font-size: 0.76rem;
}

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

.contact-form label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 800;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 7px;
    font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
    outline: none;
}

.contact-form textarea {
    resize: vertical;
    line-height: 1.5;
}

.contact-field-wide,
.contact-form-actions {
    grid-column: 1 / -1;
}

.contact-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 4px;
}

.contact-form-actions p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.7rem;
    line-height: 1.45;
}

.contact-form-actions i {
    color: #0d9488;
}

.contact-about-band,
.contact-feature-band,
.contact-solutions-band {
    margin-top: 34px;
    padding: 34px;
    border-radius: 8px;
}

.contact-about-band {
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
    gap: 34px;
    color: #fff;
    background: #087b73;
    border-left: 7px solid #f8c94d;
}

.contact-about-band .contact-section-heading > span,
.contact-about-band .contact-section-heading h2,
.contact-about-copy p {
    color: #fff;
}

.contact-about-band .contact-section-heading > span {
    color: #ffe28b;
}

.contact-section-heading h2 {
    max-width: 720px;
    margin: 0;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1.18;
}

.contact-about-copy {
    display: grid;
    gap: 12px;
}

.contact-about-copy p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.68;
}

.contact-feature-band {
    background: color-mix(in srgb, var(--surface) 88%, #dff8f3);
    border: 1px solid var(--border);
}

.contact-difference-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.contact-difference {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 5px solid #0d9488;
    border-radius: 7px;
}

.contact-difference.is-yellow { border-top-color: #f0b429; }
.contact-difference.is-coral { border-top-color: #e6654f; }
.contact-difference.is-blue { border-top-color: #2786c2; }

.contact-difference i {
    margin-bottom: 14px;
    color: #0d9488;
    font-size: 1.25rem;
}

.contact-difference.is-yellow i { color: #b77800; }
.contact-difference.is-coral i { color: #d14c38; }
.contact-difference.is-blue i { color: #2678ab; }

.contact-difference h3,
.contact-difference p,
.contact-solutions-grid h3,
.contact-solutions-grid p {
    margin: 0;
}

.contact-difference h3,
.contact-solutions-grid h3 {
    color: var(--text);
    font-size: 0.94rem;
}

.contact-difference p,
.contact-solutions-grid p {
    margin-top: 6px;
    color: var(--text-gray);
    font-size: 0.78rem;
    line-height: 1.5;
}

.contact-solutions-band {
    padding-right: 0;
    padding-left: 0;
}

.contact-solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.contact-solutions-grid article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.contact-solutions-grid article > i {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: #0d9488;
    border-radius: 7px;
}

.contact-solutions-grid article:nth-child(2) > i,
.contact-solutions-grid article:nth-child(6) > i { background: #2786c2; }
.contact-solutions-grid article:nth-child(3) > i { background: #e6654f; }
.contact-solutions-grid article:nth-child(4) > i { color: #4b3600; background: #f8c94d; }
.contact-solutions-grid article:nth-child(5) > i { background: #7a5cc7; }

html[data-theme="dark"] .contact-reasons i,
.dark-mode .contact-reasons i {
    background: color-mix(in srgb, currentColor 16%, var(--surface));
}

@media (max-width: 900px) {
    .contact-layout,
    .contact-about-band {
        grid-template-columns: 1fr;
    }

    .contact-difference-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-solutions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .contact-main {
        width: min(100% - 24px, 1180px);
        padding-top: 16px;
    }

    .contact-brand {
        margin-bottom: 10px;
    }

    .contact-brand img {
        width: 42px;
        height: 42px;
    }

    .contact-info {
        padding: 12px 2px 4px;
    }

    .contact-info h1 {
        font-size: 2.1rem;
    }

    .contact-form-panel,
    .contact-about-band,
    .contact-feature-band {
        padding: 20px;
    }

    .contact-form,
    .contact-difference-grid,
    .contact-solutions-grid {
        grid-template-columns: 1fr;
    }

    .contact-field-wide,
    .contact-form-actions {
        grid-column: auto;
    }

    .contact-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .contact-about-band,
    .contact-feature-band,
    .contact-solutions-band {
        margin-top: 24px;
    }

    .contact-section-heading h2 {
        font-size: 1.4rem;
    }
}

.profile-photo-card.filtro-oculto {
    display: none;
}

/* Aula virtual */
.aula-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.aula-context-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-gray);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.aula-context-form select { width: 100%; }

.aula-tabs {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.aula-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    color: var(--text-gray);
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

.aula-tabs a.active {
    color: #fff;
    background: #0b756d;
}

.aula-heading-band {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    margin-bottom: 14px;
    color: #fff;
    background: #123f47;
    border-left: 5px solid #f5b400;
}

.aula-heading-band span,
.aula-call-stage header span {
    color: #86efe2;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.aula-heading-band h2,
.aula-heading-band p { margin: 0; }
.aula-heading-band h2 { margin-top: 3px; font-size: 1.45rem; }
.aula-heading-band p { color: #d9f3ef; }

.aula-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.aula-metrics > div {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 68px;
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.aula-metrics i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #087c72;
    background: color-mix(in srgb, #1cc8b6 15%, var(--surface));
    border-radius: 7px;
}

.aula-metrics span { color: var(--text-gray); font-size: 0.76rem; font-weight: 800; }
.aula-metrics strong { color: var(--text); font-size: 1.35rem; }

.aula-feed-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: min(100%, 920px);
    padding: 10px;
    margin: 0 auto 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.aula-feed-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.aula-feed-search i { color: var(--text-gray); }
.aula-feed-search input { width: 100%; border: 0; background: transparent; box-shadow: none; }
.aula-feed-search input:focus { box-shadow: none; }

.aula-filter-buttons {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    background: var(--surface-soft);
    border-radius: 7px;
}

.aula-filter-buttons button {
    min-height: 34px;
    padding: 6px 10px;
    color: var(--text-gray);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
}

.aula-filter-buttons button.active { color: #fff; background: #0b756d; }
.aula-filter-count { color: var(--text-gray); font-size: 0.74rem; font-weight: 800; white-space: nowrap; }

.aula-feed {
    width: min(100%, 920px);
    margin: 0 auto;
}

.aula-post {
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.aula-post.is-pinned { border-left: 4px solid #f5b400; }
.aula-post.is-assignment { border-top: 3px solid #0b9e91; }
.aula-post.is-highlighted { box-shadow: 0 0 0 3px color-mix(in srgb, #13b8a7 30%, transparent); }
.aula-post.is-unread { border-left: 4px solid #16b8a7; }
.aula-post[hidden] { display: none !important; }
.aula-post.is-assignment .aula-post-icon { background: #c75b42; }

.aula-post > header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 14px 16px 10px;
}

.aula-post-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: #0b756d;
    border-radius: 50%;
}

.aula-post-kicker {
    color: #a65b00;
    font-size: 0.73rem;
    font-weight: 900;
    text-transform: uppercase;
}

.aula-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    background: #14b8a6;
    border-radius: 50%;
    box-shadow: 0 0 0 3px color-mix(in srgb, #14b8a6 18%, transparent);
}

.aula-read-count { display: inline-flex; align-items: center; gap: 4px; }

.aula-post h3 { margin: 2px 0; font-size: 1rem; }
.aula-post header p { margin: 0; color: var(--text-gray); font-size: 0.78rem; }
.aula-post-actions { display: flex; gap: 4px; }
.aula-post-actions form { margin: 0; }
.aula-post-actions .danger { color: var(--danger); }

.aula-post-body {
    padding: 4px 16px 16px 69px;
    color: var(--text);
    line-height: 1.58;
}

.aula-resource-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin: 0 16px 14px 69px;
    color: #075f58;
    background: #e7faf7;
    border: 1px solid #a7e8df;
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

.aula-assignment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 10px 16px 10px 69px;
    color: var(--text-gray);
    background: color-mix(in srgb, #e8f8f5 64%, var(--surface));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 750;
}

.aula-assignment-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.aula-assignment-meta i { color: #087c72; }

.aula-attachments {
    display: grid;
    gap: 7px;
    padding: 12px 16px 13px 69px;
}

.aula-attachments .attachment-row { margin: 0; }

.aula-assignment-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px 12px 69px;
    background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
    border-top: 1px solid var(--border);
}

.aula-assignment-status > div:first-child:not(.aula-family-status) {
    display: grid;
    gap: 2px;
}

.aula-assignment-status strong { color: var(--text); font-size: 0.87rem; }
.aula-assignment-status span { color: var(--text-gray); font-size: 0.76rem; }

.aula-assignment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aula-family-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.aula-child-status {
    display: inline-grid;
    gap: 1px;
    min-width: 150px;
    padding: 7px 10px;
    border-left: 3px solid #d5a20c;
    background: color-mix(in srgb, #fff3c4 60%, var(--surface));
}

.aula-child-status.done { border-left-color: #0b9e74; background: color-mix(in srgb, #dff8ed 65%, var(--surface)); }
.aula-child-status.late { border-left-color: #d44545; background: color-mix(in srgb, #ffe4e4 60%, var(--surface)); }
.aula-child-status small { color: var(--text-gray); }

.aula-task-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 13px;
    background: color-mix(in srgb, #e8f8f5 65%, var(--surface));
    border: 1px solid color-mix(in srgb, #0b9e91 35%, var(--border));
    border-radius: 6px;
}

.aula-task-fields[hidden] { display: none !important; }

.aula-comments {
    padding: 10px 16px 13px 69px;
    background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
    border-top: 1px solid var(--border);
}

.aula-comment {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr auto;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    font-size: 0.82rem;
}

.aula-comment time { color: var(--text-gray); font-size: 0.72rem; }
.aula-comment-form { display: grid; grid-template-columns: 1fr 38px; gap: 8px; margin-top: 9px; }
.aula-comment-form input { min-width: 0; }

.aula-call-list { display: grid; gap: 9px; }

.aula-call-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.aula-call-date {
    display: grid;
    place-items: center;
    height: 56px;
    color: #fff;
    background: #c64f3d;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 900;
}

.aula-call-date strong { font-size: 1.2rem; line-height: 1; }
.aula-call-row h3 { margin: 4px 0 2px; font-size: 1rem; }
.aula-call-row p { margin: 0; color: var(--text-gray); font-size: 0.8rem; }
.aula-call-actions { display: flex; align-items: center; gap: 8px; }

.aula-call-stage { margin-bottom: 18px; background: #07191d; }
.aula-call-stage > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; color: #fff; }
.aula-call-stage h2 { margin: 2px 0 0; font-size: 1.15rem; }
.aula-jitsi { width: 100%; min-height: 620px; height: min(72vh, 760px); }
.aula-jitsi iframe { display: block; width: 100%; height: 100%; border: 0; }
.aula-call-loading { display: grid; place-items: center; min-height: 400px; color: #fff; }

.aula-modal[hidden] { display: none !important; }
.aula-modal .modal-card { width: min(720px, calc(100vw - 28px)); max-height: min(90vh, 820px); overflow: auto; }

[data-theme="dark"] .aula-tabs { background: #17363d; }
[data-theme="dark"] .aula-resource-link { color: #8cf5e7; background: #123b3a; border-color: #236b65; }
[data-theme="dark"] .aula-comments { background: #0c2026; }
[data-theme="dark"] .aula-post-kicker { color: #ffd166; }
[data-theme="dark"] .aula-assignment-meta,
[data-theme="dark"] .aula-assignment-status,
[data-theme="dark"] .aula-task-fields { background: #102d33; }
[data-theme="dark"] .aula-assignment-meta i { color: #72e7d8; }
[data-theme="dark"] .aula-child-status { background: #332e19; }
[data-theme="dark"] .aula-child-status.done { background: #13382f; }
[data-theme="dark"] .aula-child-status.late { background: #3b2024; }
[data-theme="dark"] .aula-feed-search { background: #0d252b; }
[data-theme="dark"] .aula-filter-buttons { background: #17363d; }
[data-theme="dark"] .aula-metrics i { color: #7bf1e3; background: #123b3a; }

@media (max-width: 900px) {
    .aula-toolbar { grid-template-columns: 1fr auto; }
    .aula-context-form { grid-column: 1 / -1; }
    .aula-heading-band { align-items: flex-start; flex-direction: column; gap: 6px; }
    .aula-metrics { grid-template-columns: 1fr 1fr; }
    .aula-feed-tools { grid-template-columns: 1fr; }
    .aula-filter-buttons { display: grid; grid-template-columns: repeat(4, 1fr); }
    .aula-filter-count { text-align: right; }
    .aula-jitsi { min-height: 520px; height: 68vh; }
}

@media (max-width: 620px) {
    .aula-toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .aula-tabs { display: grid; grid-template-columns: 1fr 1fr; }
    .aula-tabs a { justify-content: center; }
    .aula-toolbar > .btn { width: 100%; justify-content: center; }
    .aula-heading-band { padding: 16px; }
    .aula-metrics { gap: 7px; }
    .aula-metrics > div { grid-template-columns: 30px 1fr auto; min-height: 58px; padding: 8px; }
    .aula-metrics i { width: 30px; height: 30px; }
    .aula-metrics strong { font-size: 1.08rem; }
    .aula-filter-buttons { grid-template-columns: 1fr 1fr; }
    .aula-post > header { grid-template-columns: 38px minmax(0, 1fr); }
    .aula-post-actions { grid-column: 2; justify-content: flex-end; }
    .aula-post-body { padding: 4px 14px 14px; }
    .aula-resource-link { margin: 0 14px 12px; }
    .aula-assignment-meta,
    .aula-attachments,
    .aula-assignment-status { padding-left: 14px; padding-right: 14px; }
    .aula-assignment-status { align-items: stretch; flex-direction: column; }
    .aula-assignment-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .aula-assignment-actions .btn { justify-content: center; }
    .aula-task-fields { grid-template-columns: 1fr 1fr; }
    .aula-comments { padding: 10px 14px 12px; }
    .aula-comment { grid-template-columns: 1fr auto; }
    .aula-comment span { grid-column: 1 / -1; }
    .aula-call-row { grid-template-columns: 50px 1fr; }
    .aula-call-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .aula-call-actions .btn { flex: 1; justify-content: center; }
    .aula-jitsi { min-height: 480px; height: 70vh; }
}

@media (max-width: 430px) {
    .aula-task-fields,
    .aula-assignment-actions { grid-template-columns: 1fr; }
    .aula-child-status { width: 100%; }
}
