:root {
    --app-bg: #edf1f5;
    --app-surface: #ffffff;
    --app-surface-soft: #f6f8fb;
    --app-border: #d7dee7;
    --app-border-strong: #b4c1cf;
    --app-text: #1f2f42;
    --app-muted: #66788d;
    --app-accent: #244c78;
    --app-accent-soft: #e6edf5;
    --app-accent-strong: #183a5d;
    --app-sky: #7f98b8;
    --app-sky-soft: #dfe8f2;
    --app-sidebar: #24384f;
    --app-sidebar-strong: #1b2c40;
    --app-shadow: 0 14px 30px rgba(22, 41, 64, 0.08);
}

.calendar-mode-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 8px 0 6px;
}

.calendar-mode-label {
    color: var(--app-muted);
    margin-right: 2px;
}

@media (max-width: 1100px) {
    .calendar-mode-line {
        flex-wrap: wrap;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

a {
    color: var(--app-accent);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background:
        radial-gradient(circle at top right, rgba(127, 152, 184, 0.14), transparent 28%),
        linear-gradient(180deg, #edf1f5 0%, #f5f7fa 100%);
}

.app-sidebar {
    width: 272px;
    background: linear-gradient(180deg, var(--app-sidebar) 0%, var(--app-sidebar-strong) 100%);
    color: #ffffff;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
    transition: width 0.22s ease, padding 0.22s ease, gap 0.22s ease;
    overflow: hidden;
    position: relative;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-brand-copy {
    min-width: 0;
}

.app-brand strong,
.app-brand span {
    display: block;
}

.app-brand strong {
    font-size: 17px;
}

.app-brand span {
    margin-top: 4px;
    color: rgba(222, 236, 252, 0.74);
    font-size: 13px;
}

.app-brand-mark,
.auth-mark {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: linear-gradient(180deg, #516b89 0%, #314b69 100%);
    color: #ffffff;
    font-weight: 700;
    text-transform: lowercase;
    box-shadow: 0 8px 18px rgba(22, 41, 64, 0.18);
}

.app-brand-logo,
.auth-logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(22, 41, 64, 0.18);
}

.app-nav {
    display: grid;
    gap: 8px;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e8f2ff;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-label {
    min-width: 0;
}

.mobile-menu-toggle,
.desktop-sidebar-toggle,
.mobile-menu-close,
.mobile-menu-backdrop {
    display: none;
}

.app-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(183, 201, 223, 0.2);
    transform: translateX(2px);
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    overflow: hidden;
}

.app-sidebar .app-nav {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dcecff;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-context {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-context-label {
    display: block;
    margin-bottom: 6px;
    color: rgba(222, 236, 252, 0.74);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-context strong,
.sidebar-context span {
    display: block;
}

.sidebar-context span {
    margin-top: 4px;
    color: rgba(222, 236, 252, 0.74);
    font-size: 13px;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 26px;
}

.desktop-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #cfd9e6;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    color: #203d60;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(31, 63, 102, 0.10);
    position: absolute;
    right: 10px;
    top: 56px;
    z-index: 3;
}

.desktop-sidebar-toggle:hover {
    background: #ffffff;
    border-color: #9fb6d2;
}

.desktop-sidebar-toggle .nav-icon {
    width: 18px;
    height: 18px;
    color: #203d60;
    background: transparent;
}

.desktop-sidebar-toggle [data-desktop-sidebar-toggle-label] {
    display: none;
}

body.sidebar-collapsed .app-sidebar {
    width: 88px;
    padding: 18px 12px;
    gap: 18px;
}

body.sidebar-collapsed .desktop-sidebar-toggle {
    right: 10px;
}

body.sidebar-collapsed .app-brand {
    justify-content: center;
}

body.sidebar-collapsed .app-brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-context {
    display: none !important;
}

body.sidebar-collapsed .app-sidebar .app-nav {
    padding-right: 0;
    overflow-x: hidden;
}

body.sidebar-collapsed .app-nav a,
body.sidebar-collapsed .app-nav-group > summary,
body.sidebar-collapsed .sidebar-logout {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
}

body.sidebar-collapsed .app-nav a:hover {
    transform: none;
}

body.sidebar-collapsed .app-nav-group-links {
    display: none;
}

body.sidebar-collapsed .app-nav-group[open] {
    background: transparent;
}

body.sidebar-collapsed .app-nav-group > summary::after {
    display: none;
}

body.sidebar-collapsed .nav-icon {
    width: 34px;
    height: 34px;
}

body.sidebar-collapsed .app-nav,
body.sidebar-collapsed .app-nav-group,
body.sidebar-collapsed .app-sidebar,
body.sidebar-collapsed .sidebar-footer {
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-logout {
    overflow: hidden;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.app-header-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.app-content {
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(212, 223, 236, 0.8);
    border-radius: 6px;
    padding: 22px;
    backdrop-filter: blur(8px);
}

.app-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(212, 223, 236, 0.9);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(244, 248, 252, 0.96) 100%);
    box-shadow: var(--app-shadow);
}

.app-footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.app-footer-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(180, 193, 207, 0.65);
    box-shadow: 0 8px 18px rgba(22, 41, 64, 0.1);
    padding: 6px;
}

.app-footer-brand-text {
    display: grid;
    gap: 4px;
}

.app-footer-brand-text strong,
.app-footer-meta strong {
    color: var(--app-accent-strong);
    font-size: 14px;
}

.app-footer-brand-text span,
.app-footer-meta span {
    color: var(--app-muted);
    font-size: 13px;
}

.app-footer-meta {
    text-align: right;
    display: grid;
    gap: 4px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--app-accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header-title {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
}

.header-context {
    margin: 8px 0 0;
    color: var(--app-muted);
    font-size: 14px;
}

.header-context-exit {
    margin-top: 14px;
}

.header-context-exit .button-secondary {
    min-height: 40px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.header-user-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.header-role-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    max-width: min(620px, 52vw);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--app-shadow);
}
.header-role-shortcuts-label {
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.header-role-shortcuts .role-switcher-current {
    display: none;
}
.header-role-shortcuts .role-switcher-options {
    gap: 6px;
}
.profile-switcher-form--roles-mobile {
    display: none;
}

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

.header-user span {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 13px;
}
.header-entity-logo {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    background: #ffffff;
    padding: 3px;
    margin-bottom: 6px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    font-weight: 700;
    text-transform: uppercase;
}
.profile-switcher-float {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 320px;
    max-width: 92vw;
    z-index: 70;
    box-shadow: var(--app-shadow);
}
.profile-switcher-form + .profile-switcher-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--app-border);
}
.profile-switcher-label {
    display: block;
    margin-bottom: 6px;
    color: #3f4b5a;
    font-size: 12px;
    font-weight: 600;
}
.profile-switcher-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.profile-switcher-select {
    min-width: 220px;
}
.profile-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--app-shadow);
    padding: 8px 10px;
    cursor: pointer;
}
.profile-switcher-summary strong {
    font-size: 13px;
}
.profile-switcher-summary span {
    margin-top: 2px;
    font-size: 12px;
}
.profile-switcher-entity-name {
    margin: 0 0 8px;
    color: var(--app-muted);
    font-size: 12px;
}
.role-switcher-current {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fbff;
}
.role-switcher-current-badge,
.role-switcher-badge {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 32px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #c7d8ef;
    border-radius: 7px;
    background: #edf4ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
}
.role-switcher-current-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}
.role-switcher-current-label {
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.role-switcher-current-copy strong {
    color: #19324f;
    font-size: 13px;
    font-weight: 700;
}
.role-switcher-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.role-switcher-option-form {
    margin: 0;
}
.role-switcher-option {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px 5px 6px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #fff;
    color: #355070;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.role-switcher-option:hover {
    transform: translateY(-1px);
    border-color: #9bb8ff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}
.role-switcher-option.is-active {
    border-color: #1d4ed8;
    background: #f0f6ff;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.12);
}
.role-switcher-option-label {
    color: #29496b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
}
.role-switcher-option-state {
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.header-academic-chip {
    margin-top: 2px;
    display: inline-grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    max-width: 520px;
    width: 100%;
}

.header-academic-chip img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px !important;
    max-height: 32px !important;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: #fff;
    display: block;
}

.header-academic-fallback {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: #f1f6fc;
    color: var(--app-accent);
    font-size: 12px;
    font-weight: 700;
}

.header-academic-meta {
    display: grid;
    gap: 2px;
    margin: 0;
}

.header-academic-title {
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
    color: #21344a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-academic-year {
    font-style: normal;
    color: #3e5f83;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .app-header {
        gap: 12px;
    }

    .header-academic-chip {
        max-width: 100%;
    }
}

.materias-filter-row {
    margin: 12px 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.materias-filter-button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--app-accent);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
}

.materias-filter-button.is-active {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
}

.docente-workflow-card {
    margin-bottom: 12px;
}

.docente-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.docente-workflow-actions .button-secondary.is-active {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(36, 76, 120, 0.22);
}

.app-nav-group {
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
}

.app-nav-group > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e8f2ff;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 6px;
}

.app-nav-group > summary::-webkit-details-marker {
    display: none;
}

.app-nav-group:hover > summary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(183, 201, 223, 0.2);
}

.app-nav-group.is-active > summary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(183, 201, 223, 0.24);
}

.app-nav-group-links {
    margin-top: 4px;
    display: grid;
    gap: 6px;
    padding: 0 6px 8px 40px;
}

.app-nav-group-links a {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #dcecff;
    border: 1px solid transparent;
}

.app-nav-group-links a.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(183, 201, 223, 0.24);
}

.page-title {
    margin: 0 0 10px;
    font-size: 24px;
}

.page-subtitle {
    margin: 0 0 24px;
    color: var(--app-muted);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px 22px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(36, 76, 120, 0.96) 0%, rgba(63, 94, 129, 0.92) 100%);
    color: #ffffff;
    box-shadow: var(--app-shadow);
}

.hero-panel .eyebrow,
.hero-panel .hero-copy {
    color: rgba(255, 255, 255, 0.84);
}

.hero-title {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.25;
}

.hero-copy {
    margin: 0;
    max-width: 62ch;
    font-size: 14px;
}

.hero-panel-compact {
    grid-template-columns: 1fr;
}

.hero-chip-group {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 10px;
}

.hero-chip {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 12px;
}

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

.stats-grid {
    margin-bottom: 18px;
}

.stat-card,
.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    padding: 18px;
    box-shadow: var(--app-shadow);
}

.card-link {
    display: block;
    text-decoration: none;
}

.card-feature,
.stat-card {
    position: relative;
    overflow: hidden;
}

.card h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.card p {
    margin: 0;
    color: var(--app-muted);
}

.card-icon,
.stat-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 6px;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
}

.icon-svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nav-icon .icon-svg {
    width: 15px;
    height: 15px;
}

.card-icon .icon-svg,
.stat-icon .icon-svg {
    width: 18px;
    height: 18px;
}

.stat-card strong,
.stat-card span {
    display: block;
}

.stat-card strong {
    font-size: 24px;
}

.stat-card span:last-child {
    margin-top: 6px;
    color: var(--app-muted);
}

.banner {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: var(--app-shadow);
}

.banner-success {
    background: #eff9ff;
    border-color: #c3e7fb;
}

.banner-error {
    background: #fff1f2;
    border-color: #fecdd3;
}

.top-news-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid #c7d7ea;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--app-shadow);
}

.top-news-label {
    display: grid;
    place-items: center;
    padding: 10px 14px;
    background: #123d73;
    color: #ffffff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.top-news-items {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
}

.top-news-item {
    min-width: 260px;
    padding: 9px 14px;
    color: #153456;
    text-decoration: none;
    border-right: 1px solid #d8e2ef;
}

.top-news-item:hover {
    background: #f4f8fd;
}

.top-news-item span,
.top-news-item em {
    display: block;
    line-height: 1.25;
}

.top-news-item span {
    color: #a11322;
    font-size: 13px;
}

.top-news-item em {
    margin-top: 2px;
    color: #425b78;
    font-size: 12px;
    font-style: normal;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 16px;
    align-items: start;
}

.form-group-title {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--app-border);
    color: var(--app-accent-strong);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-card h2 {
    margin-bottom: 16px;
    font-size: 19px;
}

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

.section-head h2,
.section-head h3 {
    margin: 0 0 6px;
}

.grid-two,
.grid-three {
    display: grid;
    gap: 14px;
}

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

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

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

.stack-form {
    display: grid;
    gap: 14px;
}

.compact-form {
    margin-bottom: 16px;
}

.stack-form label {
    display: grid;
    gap: 6px;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--app-border-strong);
    border-radius: 6px;
    font: inherit;
    background: var(--app-surface-soft);
    color: var(--app-text);
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
    outline: none;
    border-color: var(--app-sky);
    box-shadow: 0 0 0 3px rgba(88, 183, 242, 0.18);
}

.inline-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.inline-check input {
    width: auto;
}

.button-primary {
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--app-accent) 0%, var(--app-accent-strong) 100%);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(22, 41, 64, 0.16);
}

.button-secondary {
    padding: 11px 16px;
    border: 1px solid var(--app-border-strong);
    border-radius: 6px;
    background: #ffffff;
    color: var(--app-accent-strong);
    cursor: pointer;
    font-weight: 700;
}

.card-filter {
    margin-bottom: 16px;
}

.tabs-shell {
    display: grid;
    gap: 16px;
}

.tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-button {
    padding: 11px 16px;
    border: 1px solid var(--app-border-strong);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--app-accent-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.tab-button.is-active {
    background: linear-gradient(180deg, var(--app-accent) 0%, var(--app-accent-strong) 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(22, 41, 64, 0.16);
}

.tab-panel {
    width: 100%;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.button-link,
.button-link:hover,
.button-link:focus,
.button-link:active,
a.button-primary,
a.button-primary:hover,
a.button-primary:focus,
a.button-primary:active,
a.button-secondary,
a.button-secondary:hover,
a.button-secondary:focus,
a.button-secondary:active {
    text-decoration: none;
}

.tab-button,
.tab-button:hover,
.tab-button:focus,
.tab-button:active,
.icon-action-button,
.icon-action-button:hover,
.icon-action-button:focus,
.icon-action-button:active {
    text-decoration: none;
}

.context-banner-card {
    margin-bottom: 16px;
}

.context-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.context-banner h2 {
    margin: 0;
}

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

.inline-action-form {
    display: inline-flex;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.icon-action-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--app-border-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--app-accent-strong);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(22, 41, 64, 0.06);
}

.icon-action-button:hover {
    background: var(--app-surface-soft);
    border-color: var(--app-sky);
}

.icon-action-button.is-danger {
    color: #b12c37;
    border-color: #e5c0c5;
}

.icon-action-button.is-danger:hover {
    background: #fff2f3;
    border-color: #d79ba2;
}

.icon-action-button .icon-svg {
    width: 16px;
    height: 16px;
}

.icon-action-button.is-current {
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
}

.table-pill-muted {
    background: #eef2f7;
    color: #556476;
}

.inline-filter-form {
    display: flex;
    align-items: end;
    gap: 12px;
}

.inline-filter-form label {
    flex: 1;
    display: grid;
    gap: 6px;
}

.inline-filter-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--app-border-strong);
    border-radius: 6px;
    font: inherit;
    background: var(--app-surface-soft);
    color: var(--app-text);
}

.materias-switcher {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.materia-switch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--app-border-strong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--app-accent-strong);
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.materia-switch-button:hover {
    border-color: var(--app-sky);
    background: #f7fbfe;
    transform: translateY(-1px);
}

.materia-switch-button.is-active {
    border-color: transparent;
    background: linear-gradient(180deg, var(--app-accent) 0%, var(--app-accent-strong) 100%);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(23, 103, 168, 0.2);
}

@media (max-width: 1300px) {
    .materias-switcher {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .materias-switcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .materias-switcher {
        grid-template-columns: 1fr;
    }
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    font-size: 11px;
    font-weight: 700;
}

.table select {
    min-width: 180px;
}

.table-compact th,
.table-compact td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.task-tablero-column {
    max-width: 75px;
    width: 75px;
}

.task-period-group {
    border-bottom: 2px solid currentColor;
    font-size: 11px;
    letter-spacing: .02em;
    text-align: center;
    white-space: nowrap;
}

.task-period-group--c1 {
    background: #edf5ff;
    color: #24588e;
}

.task-period-group--c2 {
    background: #f3efff;
    color: #5c428f;
}

.task-period-title-row th {
    border-top: 0;
}

.task-tablero-link {
    display: inline-block;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    hyphens: none;
    line-height: 1.1;
    font-size: 10px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    vertical-align: middle;
}

.entity-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-badge {
    display: flex;
    align-items: start;
    gap: 10px;
}

.admin-badge-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    flex: 0 0 30px;
}

.entity-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: #ffffff;
}

.entity-logo-fallback {
    display: inline-grid;
    place-items: center;
    background: var(--app-accent-soft);
    color: var(--app-accent-strong);
    font-weight: 700;
}

.cell-subtext {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 12px;
}

.nota-rapida-btn--rubrica {
    display: inline-flex;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-color: #8bb7e8;
    background: #eaf4ff;
    color: #15569a;
    cursor: not-allowed;
}

.task-period-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 12px 0 10px;
}

.task-period-filter label {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 700;
}

.task-period-filter select {
    min-width: 210px;
    padding: 7px 10px;
}

.task-correction-table {
    min-width: 920px;
}

.task-correction-table thead th {
    position: sticky;
    z-index: 3;
    background: var(--app-surface-soft);
}

.task-correction-table thead tr:first-child th {
    top: 0;
}

.task-correction-table thead tr:nth-child(2) th {
    top: 37px;
}

.task-correction-sticky-head {
    position: fixed;
    top: 0;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
    background: var(--app-surface-soft);
    box-shadow: 0 4px 12px rgba(16, 35, 58, 0.12);
}

.task-correction-sticky-head[hidden] {
    display: none;
}

.task-correction-sticky-head table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.task-correction-sticky-head th {
    background: var(--app-surface-soft);
}

.task-correction-sticky-head a {
    pointer-events: auto;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.1;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
}

.task-correction-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

.field-help,
.empty-note {
    color: var(--app-muted);
    font-size: 12px;
}

.section-separator {
    height: 1px;
    margin: 22px 0;
    background: var(--app-border);
}

.inset-card {
    padding: 16px;
    background: var(--app-surface-soft);
}

.logo-preview-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface-soft);
}

.app-logo-preview {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: #ffffff;
}

.status-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 999px;
}

.status-on {
    background: #38b56f;
}

.status-off {
    background: #9aa8b5;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.2fr minmax(320px, 440px);
    gap: 24px;
    align-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(88, 183, 242, 0.2), transparent 28%),
        linear-gradient(180deg, #edf4fb 0%, #f6f9fc 100%);
}

.auth-showcase {
    padding: 28px;
}

.auth-showcase h1 {
    margin: 0 0 14px;
    font-size: 42px;
    line-height: 1.12;
    color: var(--app-text);
}

.auth-showcase p:last-child {
    max-width: 54ch;
    color: var(--app-muted);
    font-size: 18px;
}

.auth-showcase-eas {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.auth-showcase-eas-logo-wrap {
    width: 116px;
    height: 116px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(36, 76, 120, 0.12);
    box-shadow: 0 10px 24px rgba(22, 41, 64, 0.12);
    display: grid;
    place-items: center;
    padding: 10px;
    margin-bottom: 8px;
}

.auth-showcase-eas-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-showcase-eas h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.08;
    color: var(--app-text);
}

.auth-showcase-eas-subtitle,
.auth-showcase-eas-university {
    margin: 0;
    color: var(--app-muted);
    font-size: 20px;
}

.auth-showcase-eas-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(36, 76, 120, 0.18);
}

.auth-showcase-eas-footer p {
    margin: 0;
    color: var(--app-accent-strong);
    font-size: 14px;
    font-weight: 600;
}

.auth-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    padding: 28px;
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(8px);
}

.auth-box-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-box h1 {
    margin: 0 0 4px;
}

.auth-box p {
    margin: 0;
    color: var(--app-muted);
}

.auth-box form {
    display: grid;
    gap: 14px;
}

.auth-box label {
    display: grid;
    gap: 6px;
}

.auth-box input {
    width: 100%;
    padding: 11px 10px;
    border: 1px solid var(--app-border-strong);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.auth-box input:focus {
    outline: none;
    border-color: var(--app-sky);
    box-shadow: 0 0 0 3px rgba(88, 183, 242, 0.18);
}

.auth-box button {
    padding: 11px 14px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--app-accent) 0%, var(--app-accent-strong) 100%);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eef6ff;
    border: 1px solid #c6def8;
}

.alert-error {
    background: #fff1f2;
    border-color: #fecdd3;
}

.alert-warning {
    background: var(--app-warning-soft);
    border-color: #ffd38a;
    color: #6f4a08;
}

.confirm-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 700;
}

.confirm-checkbox input {
    width: auto;
    margin-top: 3px;
}

@media (max-width: 800px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
    }

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

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

    .app-header,
    .hero-panel,
    .auth-page {
        grid-template-columns: 1fr;
    }

    .app-header {
        align-items: start;
    }

    .inline-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .context-banner {
        flex-direction: column;
        align-items: start;
    }

    .context-actions {
        justify-content: start;
    }

    .auth-showcase {
        padding: 0;
    }

    .auth-showcase h1 {
        font-size: 28px;
    }

    .auth-showcase-eas h1 {
        font-size: 34px;
    }

    .auth-showcase-eas-subtitle,
    .auth-showcase-eas-university {
        font-size: 17px;
    }
}

/* Modern institutional theme, progressive layer */
:root {
    --app-bg: #f3f6fa;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-border: #dce4ee;
    --app-border-strong: #b7c5d6;
    --app-text: #162235;
    --app-muted: #627086;
    --app-accent: #1767a8;
    --app-accent-soft: #e8f3fb;
    --app-accent-strong: #0f4778;
    --app-sky: #36a3d9;
    --app-sky-soft: #dff4fb;
    --app-success: #168056;
    --app-success-soft: #e7f6ef;
    --app-warning: #b97814;
    --app-warning-soft: #fff4df;
    --app-sidebar: #10243c;
    --app-sidebar-strong: #0b1829;
    --app-shadow: 0 18px 42px rgba(18, 34, 53, 0.09);
    --app-shadow-soft: 0 8px 20px rgba(18, 34, 53, 0.06);
}

body {
    background: var(--app-bg);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    letter-spacing: 0;
}

.app-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(243, 246, 250, 0.94) 46%, #eef3f8 100%);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 286px;
    padding: 20px 16px;
    background: linear-gradient(180deg, #10243c 0%, #102f4f 52%, #0b1829 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-brand {
    min-height: 58px;
    padding: 8px;
    border-radius: 8px;
}

.app-brand strong {
    font-size: 16px;
    letter-spacing: 0;
}

.app-brand span {
    color: rgba(233, 243, 255, 0.72);
}

.app-brand-mark,
.app-brand-logo,
.auth-mark,
.auth-logo {
    border-radius: 8px;
}

.app-brand-mark,
.auth-mark {
    background: linear-gradient(135deg, #36a3d9 0%, #1767a8 58%, #168056 100%);
}

.app-nav a,
.sidebar-logout {
    min-height: 44px;
    border-radius: 8px;
    color: rgba(241, 247, 255, 0.9);
}

.app-nav a:hover,
.app-nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(179, 218, 246, 0.26);
    color: #ffffff;
    transform: translateX(3px);
}

.app-nav a.is-active .nav-icon {
    background: #ffffff;
    color: var(--app-accent-strong);
}

.nav-icon {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-context {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.app-main {
    padding: 24px;
}

.app-header {
    min-height: 76px;
    padding: 4px 2px;
}

.header-title {
    font-size: 26px;
    letter-spacing: 0;
}

.header-user,
.app-content,
.card,
.stat-card,
.banner,
.auth-box {
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
}

.header-user {
    min-width: 230px;
}

.user-avatar,
.card-icon,
.stat-icon,
.icon-action-button,
.admin-badge-icon {
    border-radius: 8px;
}

.app-content {
    background: rgba(255, 255, 255, 0.74);
    border-color: rgba(220, 228, 238, 0.92);
}

.hero-panel {
    border: 0;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #0f4778 0%, #1767a8 48%, #168056 120%);
    box-shadow: 0 20px 42px rgba(15, 71, 120, 0.22);
}

.hero-title {
    font-size: 26px;
    letter-spacing: 0;
}

.hero-chip {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.card,
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-link:hover,
.stat-card:hover {
    border-color: #b9dcef;
    box-shadow: var(--app-shadow);
    transform: translateY(-2px);
}

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

.materia-quick-card {
    padding: 14px;
    background: #f3f8ff;
    border-color: #b7d2ee;
}

.materia-quick-card h3 {
    margin: 8px 0 4px;
    font-size: 17px;
    line-height: 1.3;
    color: var(--app-primary);
}

.materia-quick-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: 14px;
}

.compact-actions-grid {
    margin-top: 14px;
}

.stat-card strong {
    font-size: 28px;
}

.button-primary,
.button-secondary,
.tab-button,
.icon-action-button,
.auth-box button {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button-primary:hover,
.button-secondary:hover,
.tab-button:hover,
.icon-action-button:hover,
.auth-box button:hover {
    transform: translateY(-1px);
}

.button-primary,
.auth-box button,
.tab-button.is-active {
    background: linear-gradient(180deg, #1767a8 0%, #0f4778 100%);
    box-shadow: 0 10px 22px rgba(23, 103, 168, 0.2);
}

.button-secondary {
    background: #ffffff;
    border-color: #cad7e6;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-filter-form select,
.auth-box input {
    min-height: 42px;
    border-radius: 8px;
    background: #ffffff;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.inline-filter-form select:focus,
.auth-box input:focus {
    border-color: var(--app-sky);
    box-shadow: 0 0 0 4px rgba(54, 163, 217, 0.14);
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: #f8fafc;
    color: #536276;
}

.table tbody tr {
    transition: background 0.14s ease;
}

.table tbody tr:hover {
    background: #f7fbfe;
}

.table-pill {
    background: var(--app-accent-soft);
}

.table-pill-muted {
    background: #eef3f7;
}

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

.module-matrix-table td:not(:first-child),
.module-matrix-table th:not(:first-child) {
    text-align: center;
}

.module-matrix-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.stack-form .module-matrix-table input[type='checkbox'] {
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    max-width: 16px;
    margin: 0;
    padding: 0 !important;
    display: inline-block;
    accent-color: #1b65c2;
    cursor: pointer;
    box-shadow: none !important;
    transform: none !important;
    vertical-align: middle;
}

.stack-form .module-matrix-check {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    inline-size: 16px !important;
    block-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 2px;
}

.stack-form .module-matrix-table td:first-child {
    font-weight: 700;
    color: #1f334a;
}

.module-matrix-table tbody tr:nth-child(odd) {
    background: #fbfdff;
}

.module-matrix-table thead th {
    font-size: 0.86rem;
    letter-spacing: 0;
}

.module-matrix-table td:not(:first-child) label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-on {
    background: var(--app-success);
}

.banner-success {
    background: var(--app-success-soft);
    border-color: #b9e7d1;
}

.banner-error {
    background: #fff1f2;
    border-color: #fecdd3;
}

[data-ajax-region] {
    transition: opacity 0.16s ease, transform 0.16s ease;
}

body.is-loading [data-ajax-region] {
    opacity: 0.55;
    transform: translateY(2px);
    pointer-events: none;
}

.ajax-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #36a3d9, #168056, #36a3d9);
    background-size: 200% 100%;
    opacity: 0;
    transform: scaleX(0.2);
    transform-origin: left;
    transition: opacity 0.16s ease, transform 0.24s ease;
    animation: ajax-bar 1s linear infinite;
}

body.is-loading .ajax-progress-bar {
    opacity: 1;
    transform: scaleX(1);
}

@keyframes ajax-bar {
    from { background-position: 0 0; }
    to { background-position: 200% 0; }
}

@media (max-width: 800px) {
    .app-sidebar {
        position: static;
        height: auto;
        width: 100%;
    }

    .app-main {
        padding: 16px;
    }

    .app-content {
        padding: 16px;
    }

    .header-user {
        width: 100%;
    }
}

.table-pill-success {
    background: var(--app-success-soft);
    color: var(--app-success);
}

.table-pill-warning {
    background: var(--app-warning-soft);
    color: var(--app-warning);
}

.attendance-layout {
    grid-template-columns: minmax(280px, 420px) 1fr;
}

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

.attendance-class-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--app-text);
    text-decoration: none;
}

.attendance-class-item:hover,
.attendance-class-item.is-active {
    border-color: var(--app-sky);
    background: #f7fbfe;
}

.attendance-class-item strong,
.attendance-class-item small {
    display: block;
}

.attendance-class-item small {
    margin-top: 4px;
    color: var(--app-muted);
}

.attendance-class-item em {
    align-self: start;
    white-space: nowrap;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: var(--app-accent-strong);
}

.attendance-form {
    gap: 16px;
}

.attendance-no-activity,
.attendance-student-notes,
.attendance-student-note {
    display: grid;
    gap: 12px;
}

.attendance-table input,
.attendance-table select {
    width: 100%;
    min-width: 150px;
    padding: 9px 10px;
    border: 1px solid var(--app-border-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--app-text);
    font: inherit;
}

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

.attendance-workspace {
    display: grid;
    gap: 14px;
}

.attendance-daybar,
.attendance-commandbar,
.attendance-roster-head,
.attendance-savebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.attendance-daybar h2,
.attendance-commandbar h2,
.attendance-roster-head h3 {
    margin: 0;
}

.attendance-daybar {
    padding: 16px 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.attendance-date-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.attendance-date-form input {
    min-width: 168px;
    background: #ffffff;
    border: 1px solid #c9d6e2;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
    padding: 10px 12px;
    font-weight: 700;
}

.attendance-date-form input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.attendance-class-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.attendance-class-chip {
    display: grid;
    gap: 4px;
    min-height: 94px;
    padding: 12px;
    text-decoration: none;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.attendance-class-chip:hover,
.attendance-class-chip.is-active {
    border-color: var(--app-accent);
    background: #f7fbfe;
}

.attendance-class-chip.is-now {
    border-color: #2e7d55;
    background: #eef7f2;
    box-shadow: inset 0 0 0 1px rgba(46, 125, 85, 0.2);
}

.attendance-class-chip strong {
    font-size: 20px;
}

.attendance-class-chip span,
.attendance-class-chip small,
.attendance-class-chip em {
    overflow-wrap: anywhere;
}

.attendance-class-chip span {
    font-weight: 700;
}

.attendance-class-chip small {
    color: var(--app-muted);
}

.attendance-class-chip em {
    justify-self: start;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: var(--app-accent);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.attendance-class-chip.is-now em {
    background: #2e7d55;
    color: #ffffff;
}

.attendance-chip-status {
    border: 1px solid transparent;
}

.attendance-chip-status.is-pending {
    background: #eef2ff;
    color: #2a4f8f;
    border-color: #d4def7;
}

.attendance-chip-status.is-done {
    background: #e9f8ef;
    color: #1f7a49;
    border-color: #c9e9d7;
}

.attendance-chip-status.is-no-class {
    background: #fff5e8;
    color: #9a640d;
    border-color: #f2ddbb;
}

.attendance-chip-status.is-now {
    background: #1f7a49;
    color: #ffffff;
    border-color: transparent;
}

.attendance-fast-form {
    display: grid;
    gap: 14px;
}

.attendance-offline-notice {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 13px;
}

.attendance-offline-notice.is-offline {
    background: #fff4e5;
    border-color: #f2d2a3;
    color: #7e4a00;
}

.attendance-offline-notice.is-syncing {
    background: #e9f3ff;
    border-color: #c3daf9;
    color: #1c4f88;
}

.attendance-offline-notice.is-ready {
    background: #e9f8ef;
    border-color: #c9e9d7;
    color: #1f7a49;
}

.attendance-commandbar {
    position: sticky;
    top: 10px;
    z-index: 5;
    padding: 16px 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(22, 41, 64, 0.08);
}

.attendance-commandbar p {
    margin: 4px 0 0;
    color: var(--app-muted);
}

.attendance-command-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.attendance-command-actions .button-primary,
.attendance-command-actions .button-secondary,
.attendance-continuous-slots .button-secondary {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 9px;
}

.attendance-no-class-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface-soft);
    font-weight: 700;
}

.attendance-no-class-toggle input {
    width: 18px;
    height: 18px;
}

.attendance-no-class-panel {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 12px;
    padding: 14px;
    background: var(--app-warning-soft);
    border: 1px solid rgba(180, 123, 36, 0.24);
    border-radius: 6px;
}

.attendance-continuous-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: #eef7f2;
    border: 1px solid rgba(46, 125, 85, 0.22);
    border-radius: 6px;
}

.attendance-continuous-banner strong,
.attendance-continuous-banner span {
    display: block;
}

.attendance-continuous-banner span {
    margin-top: 3px;
    color: var(--app-muted);
}

.attendance-continuous-slots {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.attendance-continuous-slots span {
    margin: 0;
    padding: 5px 8px;
    border: 1px solid rgba(46, 125, 85, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #2e7d55;
    font-size: 12px;
    font-weight: 700;
}

.attendance-continuous-slots .is-current {
    background: #2e7d55;
    color: #ffffff;
}

.attendance-docente-field {
    max-width: 360px;
}

.attendance-roster-head {
    padding: 12px 14px;
    background: #f8fbfd;
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.attendance-roster-head p {
    margin: 4px 0 0;
    color: var(--app-muted);
}

.attendance-legend {
    display: grid;
    grid-template-columns: repeat(4, auto auto);
    align-items: center;
    gap: 6px 8px;
    color: var(--app-muted);
    font-size: 12px;
}

.attendance-mini-state {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
}

.attendance-roster {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.attendance-student-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

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

.attendance-student-main strong,
.attendance-student-main small {
    display: block;
    overflow-wrap: anywhere;
}

.attendance-student-main strong {
    font-size: 15px;
}

.attendance-student-main small {
    margin-top: 3px;
    color: var(--app-muted);
    font-size: 12px;
}

.attendance-state-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(84px, 1fr));
    gap: 6px;
}

.attendance-state-option {
    cursor: pointer;
}

.attendance-state-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.attendance-state-option span {
    min-height: 34px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.attendance-state-option input:focus-visible + span {
    outline: 3px solid rgba(36, 76, 120, 0.22);
    outline-offset: 2px;
}

.attendance-state-option input:not(:checked) + span {
    opacity: 1;
    filter: none;
}

.attendance-state-option input:checked + span {
    box-shadow: 0 0 0 2px rgba(36, 76, 120, 0.2);
}

.attendance-state-presente span {
    background: #e9f8ef;
    color: #1f7a49;
    border-color: #cae9d8;
}

.attendance-state-ausente span {
    background: #ffebee;
    color: #a53b44;
    border-color: #f4c8cf;
}

.attendance-state-tarde span {
    background: #fff5e8;
    color: #9a640d;
    border-color: #f0dcb9;
}

.attendance-state-justificado span {
    background: #ebf2ff;
    color: #355e9b;
    border-color: #d2dff7;
}

.attendance-mini-state-presente {
    background: #2e7d55;
}

.attendance-mini-state-ausente {
    background: #b13f3f;
}

.attendance-mini-state-tarde {
    background: #b87925;
}

.attendance-mini-state-justificado {
    background: #476b9e;
}

.attendance-state-presente input:checked + span {
    background: #1f7a49;
    color: #ffffff;
    border-color: #1f7a49;
}

.attendance-state-ausente input:checked + span {
    background: #a53b44;
    color: #ffffff;
    border-color: #a53b44;
}

.attendance-state-tarde input:checked + span {
    background: #9a640d;
    color: #ffffff;
    border-color: #9a640d;
}

.attendance-state-justificado input:checked + span {
    background: #355e9b;
    color: #ffffff;
    border-color: #355e9b;
}

.attendance-quick-note {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.attendance-material-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--app-muted);
}

.attendance-material-check input {
    width: auto;
}

.attendance-material-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.attendance-material-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.material-switch-track {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    min-width: 146px;
    min-height: 34px;
    padding: 3px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #f4f7fb;
    overflow: hidden;
}

.material-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border-radius: 999px;
    background: #1f7a49;
    transition: transform 0.16s ease, background-color 0.16s ease;
}

.attendance-material-switch input:checked + .material-switch-track::before {
    transform: translateX(100%);
    background: #a53b44;
}

.material-switch-option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #5b6d84;
    user-select: none;
}

.attendance-material-switch input:not(:checked) + .material-switch-track .is-yes {
    color: #ffffff;
}

.attendance-material-switch input:checked + .material-switch-track .is-no {
    color: #ffffff;
}

.attendance-extra-area {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.attendance-extra-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7e2ee;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.attendance-extra-panel summary {
    cursor: pointer;
    padding: 13px 14px;
    font-weight: 800;
    color: #0f2a44;
}

.attendance-extra-panel[open] {
    padding-bottom: 14px;
}

.attendance-extra-panel[open] > :not(summary) {
    margin: 0 14px 12px;
}

.attendance-extra-panel label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: #23384f;
}

.attendance-extra-panel input[type="text"],
.attendance-extra-panel input[type="date"],
.attendance-extra-panel select,
.attendance-extra-panel textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #c8d5e3;
    border-radius: 8px;
    background: #ffffff;
    color: #162235;
    font: inherit;
    line-height: 1.35;
}

.attendance-extra-panel textarea {
    min-height: 96px;
    resize: vertical;
}

.attendance-extra-panel input:focus,
.attendance-extra-panel select:focus,
.attendance-extra-panel textarea:focus {
    outline: none;
    border-color: var(--app-sky);
    box-shadow: 0 0 0 4px rgba(54, 163, 217, 0.14);
}

.attendance-student-note {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.attendance-extra-panel .context-actions {
    margin-top: 8px;
}

.attendance-savebar {
    position: sticky;
    bottom: 0;
    z-index: 4;
    justify-content: flex-end;
    padding: 12px 0 0;
    background: linear-gradient(180deg, rgba(245, 247, 250, 0), var(--app-bg) 36%);
}

.attendance-savebar .button-primary {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 9px;
}

.attendance-empty-state {
    min-height: 220px;
    display: grid;
    align-content: center;
}

.attendance-form-is-no-class [data-attendance-active-section] {
    display: none;
}

.attendance-fast-form:not(.attendance-form-is-no-class) .attendance-no-class-panel {
    display: none;
}

/* Compact app-like refinement layer */
:root {
    --app-shell-gap: 10px;
}

body {
    font-size: 14px;
}

.app-sidebar {
    width: 248px;
    padding: 16px 12px;
    gap: 16px;
}

.app-brand {
    min-height: 52px;
    padding: 6px;
    gap: 10px;
}

.app-brand strong {
    font-size: 14px;
    font-weight: 700;
}

.app-brand span {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 0.01em;
}

.app-brand-mark,
.app-brand-logo,
.auth-mark,
.auth-logo {
    width: 34px;
    height: 34px;
}

.app-sidebar .app-nav {
    max-height: calc(100vh - 160px);
}

.app-nav {
    gap: 6px;
}

.app-nav a,
.sidebar-logout {
    min-height: 36px;
    padding: 7px 9px;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.nav-icon .icon-svg {
    width: 12px;
    height: 12px;
}

.sidebar-context {
    margin-bottom: 10px;
    padding: 10px;
}

.sidebar-context-label {
    font-size: 10px;
}

.sidebar-context span {
    font-size: 11px;
}

.app-main {
    padding: 16px;
}

.app-header {
    min-height: 60px;
    margin-bottom: 14px;
}

.eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
}

.header-title {
    font-size: 21px;
}

.header-context {
    font-size: 12.5px;
}

.header-user {
    min-width: 200px;
    padding: 8px 10px;
    gap: 9px;
}

.header-user strong {
    font-size: 13px;
}

.header-user span {
    font-size: 11px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.app-content {
    padding: 16px;
}

.card,
.stat-card,
.banner,
.auth-box {
    border-radius: 7px;
}

.card,
.stat-card {
    padding: 14px;
}

.table th,
.table td {
    padding: 9px 7px;
}

.button-primary,
.button-secondary,
.tab-button,
.auth-box button {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.icon-action-button {
    width: 32px;
    height: 32px;
}

.icon-action-button .icon-svg {
    width: 14px;
    height: 14px;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-filter-form select,
.auth-box input {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
}

.table-pill {
    padding: 5px 8px;
    font-size: 10.5px;
}

@media (max-width: 800px) {
    .attendance-daybar,
    .attendance-commandbar,
    .attendance-roster-head {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-date-form,
    .attendance-command-actions {
        width: 100%;
    }

    .attendance-date-form input,
    .attendance-command-actions .button-primary {
        flex: 1;
    }

    .attendance-no-class-panel {
        grid-template-columns: 1fr;
    }

    .attendance-continuous-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-continuous-slots {
        justify-content: flex-start;
    }

    .attendance-legend {
        grid-template-columns: repeat(2, auto auto);
        align-self: start;
    }

    .attendance-roster {
        grid-template-columns: 1fr;
    }

    .attendance-student-card {
        grid-template-columns: 1fr;
    }

    .attendance-state-options {
        grid-template-columns: repeat(4, minmax(42px, 1fr));
    }

    .attendance-state-option span {
        width: 100%;
    }
}

/* UX/UI refinement layer: consistency, readability and focus */
:root {
    --ui-focus-ring: 0 0 0 3px rgba(23, 63, 144, 0.18);
}

.app-nav a,
.button-primary,
.button-secondary,
.tab-button,
.icon-action-button,
.attendance-class-chip,
.attendance-state-option span {
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.app-nav a {
    position: relative;
}

.app-nav a.is-active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: #1a4297;
}

.app-content {
    box-shadow: 0 8px 24px rgba(17, 40, 61, 0.06);
}

.card-link.card-feature:hover {
    border-color: #c6d6eb;
    background: #fbfdff;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.button-primary:hover,
.button-secondary:hover,
.tab-button:hover,
.icon-action-button:hover {
    transform: translateY(-1px);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.attendance-state-option input:focus-visible + span {
    outline: none;
    box-shadow: var(--ui-focus-ring);
}

.context-actions {
    gap: 8px;
}

.header-title {
    letter-spacing: 0;
}

/* Data-dense tables refinement */
.table-wrap {
    border-radius: 12px;
}

.table {
    font-size: 13px;
}

.table th,
.table td {
    padding: 8px 8px;
}

.table th {
    font-size: 11px;
    letter-spacing: 0.02em;
}

/* Docente: acciones rápidas consistentes (sobrescribe capas previas) */
.docente-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.docente-workflow-actions a.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 136px;
}

.docente-workflow-actions a.button-secondary.is-active {
    background: linear-gradient(180deg, #1767a8 0%, #0f4778 100%) !important;
    border-color: #0f4778 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(23, 103, 168, 0.2) !important;
}

.table td {
    line-height: 1.35;
}

.table td .cell-subtext {
    margin-top: 2px;
    font-size: 11px;
}

.table-pill {
    min-height: 22px;
    padding: 3px 8px;
    font-size: 10px;
}

.table-actions {
    gap: 5px;
}

.table-compact th,
.table-compact td {
    padding-top: 7px;
    padding-bottom: 7px;
}

.calif-input-number {
    min-width: 76px;
    width: 76px;
    text-align: center;
}

@media (max-width: 800px) {
    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
    }
}

/* Dashboard por rol */
.dashboard-home {
    display: grid;
    gap: 14px;
}

.dashboard-hero-v2 {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #123c69 0%, #0f766e 100%);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(18, 60, 105, 0.18);
}

.dashboard-hero-v2 .eyebrow,
.dashboard-hero-v2 h2,
.dashboard-hero-v2 p {
    margin: 0;
    color: #ffffff;
    letter-spacing: 0;
}

.dashboard-hero-v2 h2 {
    margin-top: 6px;
    font-size: 28px;
    line-height: 1.1;
}

.dashboard-hero-v2 p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.86);
}

.dashboard-hero-meta {
    min-width: 180px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    gap: 4px;
}

.dashboard-hero-meta span {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.78);
}

.dashboard-hero-meta strong {
    font-size: 15px;
}

.dashboard-action-panel,
.dashboard-metric-card,
.dashboard-alert-card {
    border: 1px solid #d9e3ef;
    border-radius: 10px;
    background: #ffffff;
}

.dashboard-action-panel {
    padding: 14px;
}

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

.dashboard-action-card {
    min-height: 82px;
    padding: 13px;
    border: 1px solid #d9e3ef;
    border-radius: 8px;
    background: #f8fbff;
    color: #17324d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-1px);
    border-color: #9db9d9;
    box-shadow: 0 12px 24px rgba(17, 43, 73, 0.09);
}

.dashboard-action-card.is-primary {
    background: linear-gradient(135deg, #1e57a8 0%, #0f766e 100%);
    color: #ffffff;
}

.dashboard-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #e9f2ff;
    color: #1e57a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.dashboard-action-card.is-primary .dashboard-action-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.dashboard-action-icon svg {
    width: 20px;
    height: 20px;
}

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

.dashboard-alert-card {
    padding: 13px 14px;
    text-decoration: none;
    color: #17324d;
    display: grid;
    gap: 5px;
    border-left: 5px solid #3677bc;
}

.dashboard-alert-card span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: #4f6074;
}

.dashboard-alert-card strong {
    font-size: 14px;
    line-height: 1.3;
}

.dashboard-alert-card.is-warn {
    border-left-color: #d39b19;
    background: #fff9eb;
}

.dashboard-alert-card.is-good {
    border-left-color: #16835f;
    background: #f0fbf6;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-metric-card {
    padding: 14px;
    display: grid;
    gap: 5px;
}

.dashboard-metric-card span {
    color: #5d7087;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-metric-card strong {
    color: #102b48;
    font-size: 32px;
    line-height: 1;
}

.dashboard-metric-card p {
    margin: 0;
    color: #6a7f96;
    line-height: 1.35;
}

.dashboard-notes-status {
    display: grid;
    gap: 12px;
}

.dashboard-notes-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-notes-status-grid article {
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #f8fbff;
    padding: 13px;
    display: grid;
    gap: 5px;
}

.dashboard-notes-status-grid span {
    color: #536983;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-notes-status-grid strong {
    color: #102b48;
    font-size: 30px;
    line-height: 1;
}

.dashboard-notes-status-grid p {
    margin: 0;
    color: #6a7f96;
    line-height: 1.35;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 12px;
}

.dashboard-chart-card {
    min-height: 260px;
}

.dashboard-bars {
    display: grid;
    gap: 11px;
}

.dashboard-bar-row {
    display: grid;
    gap: 6px;
}

.dashboard-bar-row > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.dashboard-bar-row strong {
    color: #17324d;
    font-size: 13px;
}

.dashboard-bar-row span {
    color: #6a7f96;
    font-size: 12px;
}

.dashboard-bar-track {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9eef5;
}

.dashboard-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2a6fbb, #0f766e);
}

.dashboard-bar-track.is-good span {
    background: #16835f;
}

.dashboard-bar-track.is-mid span {
    background: #d39b19;
}

.dashboard-bar-track.is-low span {
    background: #c94a4a;
}

.dashboard-donut-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.dashboard-donut {
    width: 124px;
    height: 124px;
    border-radius: 999px;
    background: conic-gradient(#16835f 0 calc(var(--a) * 1%), #d39b19 calc(var(--a) * 1%) calc(var(--b) * 1%), #c94a4a calc(var(--b) * 1%) 100%);
    display: grid;
    place-items: center;
    position: relative;
}

.dashboard-donut::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: inherit;
    background: #ffffff;
}

.dashboard-donut span {
    position: relative;
    z-index: 1;
    font-size: 26px;
    font-weight: 800;
    color: #102b48;
}

.dashboard-legend,
.dashboard-mini-list {
    display: grid;
    gap: 8px;
}

.dashboard-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4f6074;
}

.dashboard-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.dashboard-legend i.is-good {
    background: #16835f;
}

.dashboard-legend i.is-mid {
    background: #d39b19;
}

.dashboard-legend i.is-low {
    background: #c94a4a;
}

.dashboard-mini-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid #e0e8f1;
    border-radius: 8px;
    color: #17324d;
    text-decoration: none;
    background: #f8fbff;
}

.dashboard-mini-list strong {
    min-width: 32px;
    text-align: center;
    color: #102b48;
}

.dashboard-course-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

@media (max-width: 980px) {
    .dashboard-metric-grid,
    .dashboard-notes-status-grid,
    .dashboard-main-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-hero-v2,
    .dashboard-donut-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .dashboard-metric-grid,
    .dashboard-notes-status-grid,
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Form UX refinement */
.stack-form {
    gap: 12px;
}

.stack-form label,
.inline-filter-form label {
    font-weight: 600;
    color: #23384f;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-filter-form select,
.auth-box input {
    background: #ffffff;
    border-color: #c8d5e3;
}

.stack-form input::placeholder,
.stack-form textarea::placeholder {
    color: #7c8ea3;
}

.stack-form textarea {
    resize: vertical;
    min-height: 78px;
    line-height: 1.35;
}

.field-help,
.empty-note,
.cell-subtext {
    color: #6a7f96;
}

.section-head {
    margin-bottom: 12px;
}

.section-head h2,
.section-head h3 {
    color: #132f4d;
}

.button-primary,
.button-secondary {
    white-space: nowrap;
}

/* Entry dashboard refresh */
.dashboard-entry-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 14px 16px;
    border: 1px solid #d5e0ec;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
}

.dashboard-entry-hero h2 {
    margin: 0;
    color: #122c47;
    font-size: 22px;
}

.dashboard-entry-hero p {
    margin: 6px 0 0;
    color: #5f7288;
}

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

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

.dashboard-quick-grid .button-secondary {
    width: 100%;
    justify-content: center;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.dashboard-kpi-grid .section-card h3 {
    margin: 0;
    font-size: 14px;
    color: #48617d;
    font-weight: 700;
}

.dashboard-kpi-value {
    margin: 6px 0 2px;
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
    color: #102b48;
}

.dashboard-entry-hero .eyebrow,
.dashboard-entry-hero h2,
.dashboard-entry-hero p,
.dashboard-kpi-grid h3,
.dashboard-kpi-value,
.dashboard-quick-grid .button-secondary {
    letter-spacing: 0;
}

.dashboard-top-stats .stat-card {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    padding: 14px 15px;
    border: 0;
    box-shadow: 0 1px 0 #dbe4ef, 0 8px 20px rgba(16, 43, 72, 0.04);
}

.dashboard-top-stat-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-top-stats .dashboard-top-stat-title {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    color: #5a6f88;
    letter-spacing: 0;
}

.dashboard-top-stats .stat-icon {
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    color: #35597f;
}

.dashboard-top-stats .stat-card strong {
    font-size: 34px;
    line-height: 1;
    font-weight: 650;
    margin: 0;
    color: #16385f;
}

.dashboard-entry-hero h2,
.dashboard-kpi-grid .section-card h3,
.section-card h2 {
    font-family: inherit;
    font-weight: 650;
}

.dashboard-entry-hero h2 {
    font-size: 18px;
    font-weight: 700;
}

.dashboard-entry-hero p {
    font-size: 14px;
    line-height: 1.35;
}

.dashboard-entry-hero .eyebrow {
    font-size: 11px;
    font-weight: 700;
}

.dashboard-kpi-grid .section-card h3 {
    font-size: 13px;
    font-weight: 600;
}

.dashboard-kpi-value {
    font-size: 30px;
    font-weight: 700;
}

.dashboard-kpi-grid .section-card {
    padding: 12px 14px;
}

.dashboard-kpi-grid .cell-subtext {
    font-size: 12px;
}

.dashboard-quick-grid {
    gap: 7px;
}

.dashboard-quick-grid .button-secondary {
    min-height: 34px;
}

.dashboard-top-stats {
    margin-bottom: 10px;
}

.dashboard-top-stats .stat-card {
    min-height: 100px;
    padding: 12px;
}

.dashboard-top-stats .stat-card strong {
    font-size: 34px;
}

.table .td-number {
    text-align: right;
}

.table .td-number .table-pill,
.table .td-number .metric-pill {
    margin-left: auto;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.metric-pill.is-good {
    background: #e8f7ef;
    color: #1f7a49;
}

.metric-pill.is-mid {
    background: #fff5e5;
    color: #9a640d;
}

.metric-pill.is-low {
    background: #ffebee;
    color: #a63b45;
}

@media (max-width: 800px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-entry-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-entry-hero-actions {
        justify-content: flex-start;
    }
}

/* Reference-inspired professional app skin */
:root {
    --app-bg: #f4f7fa;
    --app-surface: #ffffff;
    --app-surface-soft: #f7f9fc;
    --app-border: #dbe3ec;
    --app-border-strong: #c6d2df;
    --app-text: #11283d;
    --app-muted: #5f7186;
    --app-accent: #173f90;
    --app-accent-soft: #eaf0ff;
    --app-accent-strong: #0f2f73;
    --app-shadow-soft: 0 6px 18px rgba(17, 40, 61, 0.05);
}

body {
    background: linear-gradient(180deg, #f7f9fc 0%, #f2f5f9 100%);
    color: var(--app-text);
}

.app-shell {
    background: transparent;
}

.app-sidebar {
    width: 286px;
    background: #f8fafd;
    color: var(--app-text);
    border-right: 1px solid var(--app-border);
    box-shadow: none;
}

.app-brand {
    border: 1px solid var(--app-border);
    background: #ffffff;
}

.app-brand strong {
    color: #163559;
}

.app-brand span {
    color: var(--app-muted);
}

.app-nav {
    gap: 5px;
}

.app-nav a {
    min-height: 40px;
    padding: 8px 10px;
    color: #314964;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.app-nav a:hover {
    background: #eef3fb;
    border-color: #d5e0f0;
    color: #1d3656;
    transform: none;
}

.app-nav a.is-active {
    background: linear-gradient(180deg, #1a4297 0%, #163a88 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(23, 63, 144, 0.24);
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #edf3fb;
    color: #3a5474;
}

.nav-icon--panel { background: #eaf1ff; color: #244ea6; }
.nav-icon--perfil { background: #eef6ff; color: #2f6fb1; }
.nav-icon--cursos { background: #eef7ff; color: #2563eb; }
.nav-icon--espacios { background: #effcf5; color: #15803d; }
.nav-icon--horarios { background: #f5f3ff; color: #7c3aed; }
.nav-icon--alumnos { background: #fff7ed; color: #ea580c; }
.nav-icon--docentes { background: #f0fdfa; color: #0f766e; }
.nav-icon--asistencias { background: #ecfeff; color: #0891b2; }
.nav-icon--calificaciones { background: #fff1f2; color: #e11d48; }
.nav-icon--reportes { background: #eff6ff; color: #1d4ed8; }
.nav-icon--correcciones { background: #fff7ed; color: #c2410c; }
.nav-icon--tickets { background: #fefce8; color: #a16207; }
.nav-icon--evolucion { background: #f0fdf4; color: #16a34a; }
.nav-icon--ia { background: #faf5ff; color: #9333ea; }
.nav-icon--entidades { background: #ecfdf5; color: #047857; }
.nav-icon--usuarios { background: #f8fafc; color: #475569; }
.nav-icon--configuracion { background: #f1f5f9; color: #334155; }

.app-nav a.is-active .nav-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.app-nav .nav-icon .icon-svg {
    width: 18px;
    height: 18px;
}

.academic-overview-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.academic-overview-link h3 {
    margin: 0;
}

.academic-overview-link:hover {
    border-color: #a9bed8;
}

.academic-overview-link--anual { border-left: 4px solid #b8cdf0; }
.academic-overview-link--modular { border-left: 4px solid #b4dfc2; }
.academic-overview-link--optativa { border-left: 4px solid #f0d0aa; }
.academic-overview-type { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 10px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 700; }
.academic-overview-type--anual { background: #eaf2ff; color: #174989; border-color: #b8cdf0; }
.academic-overview-type--modular { background: #e9f8ef; color: #1f6a3a; border-color: #b4dfc2; }
.academic-overview-type--optativa { background: #fff3e4; color: #8a4f15; border-color: #f0d0aa; }

.app-nav-group > summary {
    color: #314964;
    border: 1px solid transparent;
}

.app-nav-group > summary:hover {
    background: #eef3fb;
    border-color: #d5e0f0;
    color: #1d3656;
}

.app-nav-group-links a {
    color: #3d5672;
    background: #ffffff;
    border: 1px solid #dde6f0;
}

.app-nav-group-links a:hover {
    background: #f2f7ff;
    border-color: #c8d8ec;
    color: #1d3656;
}

.app-nav-group-links a.is-active {
    background: linear-gradient(180deg, #1a4297 0%, #163a88 100%);
    border-color: transparent;
    color: #ffffff;
}

.sidebar-context {
    border-color: var(--app-border);
    background: #ffffff;
}

.sidebar-context-label {
    color: #62758d;
}

.sidebar-context span {
    color: var(--app-muted);
}

.sidebar-logout {
    background: #ffffff;
    border: 1px solid var(--app-border);
    color: #314964;
}

.app-main {
    padding: 18px;
}

.app-header {
    margin-bottom: 16px;
}

.header-title {
    font-size: 20px;
    color: #0f2740;
}

.header-user {
    background: #ffffff;
    border-color: var(--app-border);
    box-shadow: none;
}

.app-content {
    background: #ffffff;
    border-color: var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow-soft);
}

.card,
.stat-card,
.banner,
.auth-box,
.attendance-student-card,
.attendance-class-item,
.attendance-daybar,
.attendance-commandbar,
.attendance-roster-head,
.attendance-extra-panel,
.logo-preview-card {
    border-radius: 14px;
    border-color: var(--app-border);
    box-shadow: none;
}

.stats-grid,
.card-grid {
    gap: 12px;
}

.card,
.stat-card {
    padding: 16px;
}

.card h2 {
    font-size: 16px;
    color: #385573;
}

.stat-card strong {
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #0c2542;
}

.card-icon,
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.table-wrap {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #ffffff;
}

.table th {
    padding: 11px 10px;
    background: #f8fbff;
    color: #617792;
}

.table td {
    padding: 11px 10px;
}

.table tbody tr:hover {
    background: #f7fbff;
}

.table-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
}

.button-primary,
.button-secondary,
.tab-button {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.button-primary,
.tab-button.is-active {
    background: linear-gradient(180deg, #1a4297 0%, #163a88 100%);
    box-shadow: 0 8px 18px rgba(23, 63, 144, 0.2);
}

.button-secondary {
    border-color: var(--app-border-strong);
    background: #ffffff;
}

.table-actions {
    gap: 6px;
}

.icon-action-button {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border-color: #d2dbe7;
    box-shadow: none;
}

.icon-action-button .icon-svg {
    width: 13px;
    height: 13px;
}

.icon-action-button:hover {
    border-color: #98b3d1;
    background: #f2f7ff;
}

@media (max-width: 800px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .desktop-sidebar-toggle {
        display: none !important;
    }

    .app-sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(84vw, 320px);
        border-right: 1px solid var(--app-border);
        border-bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 20;
        border: 0;
        background: rgba(14, 25, 38, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.sidebar-open .mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 6px 10px;
        border: 1px solid var(--app-border);
        border-radius: 9px;
        background: #ffffff;
        color: #203d60;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-menu-close {
        display: inline-flex;
        align-self: flex-end;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid var(--app-border);
        border-radius: 9px;
        background: #ffffff;
        color: #203d60;
        cursor: pointer;
    }

    .mobile-menu-close .icon-svg {
        width: 14px;
        height: 14px;
    }

    .mobile-menu-toggle .nav-icon {
        width: 20px;
        height: 20px;
    }

    .mobile-menu-toggle .nav-icon .icon-svg {
        width: 12px;
        height: 12px;
    }
}

/* === Global UI Coherence Pass (May 2026) === */
:root {
    --ui-radius-sm: 8px;
    --ui-radius-md: 10px;
    --ui-radius-lg: 12px;
    --ui-control-h: 40px;
    --ui-focus-ring: 0 0 0 3px rgba(31, 79, 151, 0.16);
}

.app-content {
    border-radius: var(--ui-radius-lg);
    padding: 24px;
}

.card,
.stat-card,
.banner,
.section-card {
    border-radius: var(--ui-radius-md);
}

.section-card h2,
.card h2 {
    letter-spacing: 0;
}

.hero-panel {
    border-radius: var(--ui-radius-md);
}

.inline-filter-form {
    gap: 10px;
    align-items: end;
}

.inline-filter-form label {
    font-size: 12px;
    color: #29486f;
    font-weight: 600;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-filter-form select,
.inline-filter-form input,
.auth-box input,
select,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea {
    min-height: var(--ui-control-h);
    border-radius: var(--ui-radius-sm);
    border: 1px solid #c9d5e5;
    background: #fcfdff;
    color: #203a5d;
    font-size: 14px;
    letter-spacing: 0;
}

.stack-form textarea,
textarea {
    min-height: 90px;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.inline-filter-form input:focus,
.inline-filter-form select:focus,
.auth-box input:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: #2b62ad;
    box-shadow: var(--ui-focus-ring);
}

.button-primary,
.button-secondary,
.tab-button {
    min-height: var(--ui-control-h);
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
    letter-spacing: 0;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, transform .12s ease;
}

.button-primary:hover,
.button-secondary:hover,
.tab-button:hover {
    transform: translateY(-1px);
}

.button-primary:focus-visible,
.button-secondary:focus-visible,
.tab-button:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus-ring);
}

.tabs-header {
    gap: 8px;
}

.tab-button {
    border: 1px solid #c6d4e7;
    background: #fff;
    color: #21446f;
}

.tab-button.is-active {
    border-color: #1f4f97;
}

.table-wrap {
    border-radius: var(--ui-radius-sm);
    overflow: auto;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: #f2f6fb;
    color: #3d5c81;
    font-size: 12px;
    letter-spacing: 0;
}

.table td {
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f7faff;
}

.table-pill {
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

.table-actions {
    gap: 8px;
}

.icon-action-button {
    width: 32px;
    height: 32px;
    border-radius: var(--ui-radius-sm);
}

.banner-success,
.banner-error {
    border-radius: var(--ui-radius-sm);
}

/* Final mobile header override to beat earlier layered rules */
@media (max-width: 800px) {
    body,
    .app-shell,
    .app-main {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .app-main,
    .app-content,
    .card,
    .stat-card,
    .section-card,
    .hero-panel,
    .tabs-shell {
        min-width: 0;
        max-width: 100%;
    }

    .table-wrap {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        width: max-content;
        min-width: 100%;
    }

    .inline-filter-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

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

    .inline-filter-form input,
    .inline-filter-form select,
    .inline-filter-form textarea {
        width: 100%;
        max-width: 100%;
    }

    .inline-filter-form .button-secondary,
    .inline-filter-form .button-link,
    .inline-filter-form button {
        width: 100%;
        justify-content: center;
    }

    .app-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "menu user"
            "main main";
        align-items: start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mobile-menu-toggle {
        grid-area: menu;
        width: fit-content;
        min-height: 40px;
        padding: 8px 12px;
    }

    .app-header-main {
        grid-area: main;
        gap: 6px;
        width: 100%;
    }

    .header-title {
        font-size: 19px;
        line-height: 1.1;
    }

    .header-context {
        margin-top: 4px;
        font-size: 12px;
        line-height: 1.35;
    }

    .header-context-exit {
        margin-top: 8px;
    }

    .header-context-exit .button-secondary {
        width: 100%;
        justify-content: center;
    }

    .header-academic-chip {
        max-width: none;
        width: 100%;
        padding: 8px 10px;
        gap: 8px;
    }

    .header-academic-chip img,
    .header-academic-fallback {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px;
        min-height: 28px;
    }

    .header-academic-title,
    .header-academic-year {
        font-size: 11px;
        white-space: normal;
    }

    .header-user {
        grid-area: user;
        width: auto;
        min-width: 0;
        justify-self: end;
        align-self: start;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .profile-switcher-trigger {
        width: min(100vw - 140px, 340px);
        max-width: 100%;
        justify-content: space-between;
        padding: 7px 8px;
    }

    .profile-switcher-summary {
        min-width: 0;
    }

    .profile-switcher-summary strong,
    .profile-switcher-summary span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .profile-switcher-float {
        position: static;
        inset: auto;
        top: auto;
        right: auto;
        min-width: 0;
        width: 100%;
        max-width: none;
        margin-top: 0;
    }

    .profile-switcher-row {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-switcher-select,
    .profile-switcher-row .button-secondary {
        width: 100%;
        min-width: 0;
    }

    .profile-switcher-form + .profile-switcher-form {
        margin-top: 8px;
    }

    .header-user-wrap {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .header-role-shortcuts {
        display: none;
    }

    .profile-switcher-form--roles-mobile {
        display: block;
    }

    .role-switcher-current {
        align-items: flex-start;
        flex-direction: column;
    }

    .role-switcher-options {
        width: 100%;
        flex-direction: column;
        gap: 6px;
    }

    .role-switcher-option {
        width: 100%;
        justify-content: flex-start;
    }

    .role-switcher-option-state {
        margin-left: auto;
    }

    .app-content {
        padding: 14px;
    }

    .header-user strong,
    .header-user span {
        font-size: 12px;
    }

    .header-user span {
        margin-top: 2px;
    }

    .docentes-table .icon-action-button,
    .usuarios-table .icon-action-button {
        width: 30px;
        height: 30px;
    }

    .app-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .app-footer-brand-link {
        width: 100%;
        align-items: center;
        gap: 10px;
    }

    .app-footer-logo {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        padding: 4px;
        flex: 0 0 auto;
    }

    .app-footer-brand-text strong,
    .app-footer-meta strong {
        font-size: 13px;
    }

    .app-footer-brand-text span,
    .app-footer-meta span {
        font-size: 12px;
    }

    .app-footer-meta {
        width: 100%;
        text-align: left;
    }

    .alumnos-table,
    .docentes-table,
    .usuarios-table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .alumnos-table thead,
    .docentes-table thead,
    .usuarios-table thead {
        display: none;
    }

    .alumnos-table tbody,
    .docentes-table tbody,
    .usuarios-table tbody {
        display: grid;
        gap: 10px;
    }

    .alumnos-table tr,
    .docentes-table tr,
    .usuarios-table tr {
        display: block;
        width: 100%;
        border: 1px solid var(--app-border);
        border-radius: 14px;
        background: #ffffff;
        box-shadow: var(--app-shadow-soft);
        overflow: hidden;
    }

    .alumnos-table td,
    .docentes-table td,
    .usuarios-table td {
        display: grid;
        grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        width: 100%;
        padding: 10px 12px;
        border-top: 1px solid #edf2f7;
        font-size: 13px;
    }

    .alumnos-table td:first-child,
    .docentes-table td:first-child,
    .usuarios-table td:first-child {
        border-top: 0;
    }

    .alumnos-table td::before,
    .docentes-table td::before,
    .usuarios-table td::before {
        content: attr(data-label);
        font-size: 11px;
        line-height: 1.2;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #5c718a;
        padding-top: 3px;
    }

    .alumnos-table td strong,
    .docentes-table td strong,
    .usuarios-table td strong {
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    .alumnos-table td[data-label="Acciones"],
    .docentes-table td[data-label="Acciones"],
    .usuarios-table td[data-label="Acciones"] {
        grid-template-columns: 1fr;
    }

    .alumnos-table td[data-label="Acciones"]::before,
    .docentes-table td[data-label="Acciones"]::before,
    .usuarios-table td[data-label="Acciones"]::before {
        margin-bottom: 2px;
    }

    .alumnos-table .table-actions,
    .docentes-table .table-actions,
    .usuarios-table .table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .alumnos-table .icon-action-button,
    .docentes-table .icon-action-button,
    .usuarios-table .icon-action-button {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 420px) {
    .header-title {
        font-size: 18px;
    }

    .app-header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "menu"
            "user"
            "main";
    }

    .header-academic-chip {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .header-user {
        justify-self: stretch;
        gap: 6px;
    }

    .profile-switcher-trigger {
        width: 100%;
        padding: 8px 9px;
    }

    .header-academic-title,
    .header-academic-year {
        font-size: 10px;
        line-height: 1.2;
    }

    .app-footer {
        padding: 10px 12px;
    }

    .app-footer-brand-link {
        gap: 8px;
    }

    .app-footer-logo {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }
}

.auth-access-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 16px;
    padding: 4px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #f6f9fd;
}

.auth-access-choice a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #52677f;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-access-choice a.is-active {
    background: #ffffff;
    color: #14365f;
    box-shadow: 0 6px 18px rgba(22, 41, 64, 0.08);
}

.auth-recovery-block {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
}

.auth-recovery-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-recovery-form {
    margin-top: 12px;
}

.auth-recovery-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #14365f;
}

.auth-support-banner {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}

.auth-support-button {
    min-width: 0;
}

.portal-body {
    min-height: 100vh;
    margin: 0;
    background: #f4f7fb;
    color: #14263a;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 42px);
    border-bottom: 1px solid #dfe8f4;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.portal-topbar-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
}

.portal-topbar-copy {
    min-width: 0;
}

.portal-topbar-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #52627a;
    font-size: 1rem;
}

.portal-topbar-line strong,
.portal-topbar-line .portal-brand {
    color: #1a3552;
}

.portal-topbar-sep {
    color: #94a3b8;
}

.portal-brand {
    color: #14365f;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.portal-topbar-main,
.portal-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-topbar-actions form {
    margin: 0;
    display: flex;
    align-items: center;
}

.portal-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
    padding: 22px 0 8px;
}

.portal-hero-copy {
    max-width: 1100px;
}

.portal-hero-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-hero .eyebrow {
    margin: 0 0 6px;
    color: #58708d;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.portal-hero h1 {
    margin: 0;
    font-size: clamp(24px, 3.6vw, 36px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: 0;
    color: #132942;
}

.portal-hero p {
    margin: 0;
    color: #637890;
}

.portal-hero-subtitle {
    margin: 8px 0 0;
    color: #5f7490;
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.45;
}

.portal-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.portal-role-badge.is-family {
    border-color: #cfe0fb;
    background: #eaf3ff;
    color: #1c5aa6;
}

.portal-role-badge.is-student {
    border-color: #cfe7d3;
    background: #edf8ef;
    color: #2c6a34;
}

.portal-hero--compact {
    margin-bottom: 16px;
    padding-top: 2px;
}

.portal-hero--compact h1 {
    font-size: clamp(22px, 3.2vw, 30px);
}

.portal-hero--compact .portal-hero-subtitle {
    font-size: 0.96rem;
}

.portal-profile-card {
    max-width: 820px;
}

.portal-profile-form {
    gap: 18px;
}

.portal-profile-grid {
    align-items: start;
}

.portal-profile-side-note {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid #dce6f2;
    border-radius: 10px;
    background: #f8fbff;
    color: #4c6279;
}

.portal-profile-side-note strong {
    color: #17324f;
}

.portal-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.portal-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.portal-students {
    position: sticky;
    top: 86px;
}

.portal-student-list {
    display: grid;
    gap: 8px;
}

.portal-student-link {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid #dce6f2;
    border-radius: 8px;
    color: #17324f;
    text-decoration: none;
    background: #fff;
}

.portal-student-link span {
    color: #637890;
    font-size: 13px;
}

.portal-student-link.is-active,
.portal-student-link:hover {
    border-color: #9ab8da;
    background: #f3f8ff;
}

.portal-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 22px;
}

.portal-info-grid > div {
    min-height: 74px;
    padding: 12px;
    border: 1px solid #dce6f2;
    border-radius: 8px;
    background: #fff;
}

.portal-info-grid span {
    display: block;
    margin-bottom: 6px;
    color: #637890;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-info-grid strong {
    overflow-wrap: anywhere;
}

.portal-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 22px;
}

.portal-permissions span {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #d8e1ed;
    border-radius: 999px;
    color: #6b7d91;
    background: #f7f9fc;
    font-size: 13px;
    font-weight: 700;
}

.portal-permissions span.is-on {
    border-color: #b9d6bf;
    color: #23633a;
    background: #f0faF2;
}

.familias-tabs--line {
    gap: 0;
    margin: -18px -18px 4px;
    padding: 0 18px;
    border-bottom: 1px solid #dbe4ef;
}

.familias-tabs--line .tab-button {
    padding: 14px 18px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #5a708b;
    box-shadow: none;
}

.familias-tabs--line .tab-button.is-active {
    background: transparent;
    color: #163a67;
    border-bottom-color: #2f73d9;
    box-shadow: none;
}

.familias-detail-shell {
    margin-top: 16px;
}

.stat-card-link {
    color: inherit;
    text-decoration: none;
}

.stat-card-link:hover {
    border-color: #c6d8ee;
    background: #f8fbff;
}

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

.familias-inner-panel {
    padding: 18px 0;
    border-top: 1px solid #e5edf6;
}

.familias-inner-panel:first-child {
    padding-top: 0;
    border-top: 0;
}

.familias-inner-panel--full {
    grid-column: 1 / -1;
}

.familias-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.familias-export-form {
    gap: 10px;
}

.familias-export-panel {
    overflow: hidden;
}

.familias-export-summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--ui-radius-sm);
    background: #ffffff;
    color: var(--app-accent-strong);
    font-size: 12px;
    font-weight: 700;
    margin: 12px;
}

.familias-export-summary::-webkit-details-marker {
    display: none;
}

.familias-export-panel[open] .familias-export-summary {
    margin-bottom: 0;
}

.familias-export-body {
    padding: 0 16px 16px;
}

.familias-export-head h3 {
    margin-bottom: 4px;
    font-size: 15px;
}

.familias-export-head .page-subtitle {
    font-size: 12px;
}

.familias-export-format {
    max-width: 220px;
}

.familias-export-format label {
    font-size: 12px;
}

.familias-export-form select {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

.familias-export-columns {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 8px !important;
}

.familias-export-option {
    min-height: 40px;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    gap: 8px;
}

.familias-export-option span {
    font-size: 12px;
    line-height: 1.25;
}

.familias-export-option input[type='checkbox'] {
    width: 14px;
    height: 14px;
    min-height: 14px;
}

.familias-export-actions .button-secondary {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
}

.familias-stats-compact {
    margin-top: 18px;
}

.familias-alert-stack {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.familias-inline-banner {
    margin: 0;
}

.familias-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.familias-module-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fbfdff;
}

.familias-module-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.familias-module-tag--warn {
    background: #fff1da;
    color: #8a5a10;
}

.familias-module-tag--neutral {
    background: #eef2f7;
    color: #52677f;
}

.familias-module-tag--info {
    background: #dfeeff;
    color: #1e5ca8;
}

.familias-context-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #f8fbff;
}

.familias-context-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.familias-context-banner--estudiante {
    background: #f4f8ff;
    border-color: #cfe0fb;
}

.familias-context-banner--estudiante .familias-context-pill {
    background: #dceaff;
    color: #184d93;
}

.familias-context-banner--responsable {
    background: #f7fbf5;
    border-color: #d5e7d0;
}

.familias-context-banner--responsable .familias-context-pill {
    background: #deefda;
    color: #2d6b33;
}

.preceptoria-course-status {
    align-items: center;
    border: 1px solid #d9e2ee;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 12px;
}

.preceptoria-course-status span {
    color: #64748b;
    font-size: .9rem;
}

.preceptoria-course-status.is-pending {
    background: #f8fafc;
    color: #64748b;
}

.preceptoria-course-status.is-partial {
    background: #fff8e8;
    border-color: #eed49b;
    color: #8a6415;
}

.preceptoria-course-status.is-complete {
    background: #edf9f2;
    border-color: #b9e2c8;
    color: #247346;
}

@media (max-width: 820px) {
    .portal-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-topbar-main,
    .portal-topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

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

    .portal-students {
        position: static;
    }

    .portal-info-grid {
        grid-template-columns: 1fr;
    }

    .portal-profile-grid {
        grid-template-columns: 1fr;
    }

    .portal-hero h1 {
        font-size: 2rem;
    }

    .portal-hero-subtitle {
        font-size: 1rem;
    }

    .portal-role-badge {
        min-height: 30px;
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .portal-hero--compact h1 {
        font-size: 2rem;
    }

    .portal-hero--compact .portal-hero-subtitle {
        font-size: 0.92rem;
    }

    .auth-access-choice {
        grid-template-columns: 1fr;
    }

    .auth-recovery-choice {
        grid-template-columns: 1fr;
    }

    .familias-dashboard-grid,
    .familias-pagination {
        grid-template-columns: 1fr;
        display: grid;
    }

    .familias-context-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .familias-module-grid {
        grid-template-columns: 1fr;
    }
}

.attendance-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.attendance-hero .hero-copy {
    max-width: 760px;
}

.attendance-active-date {
    min-width: 178px;
    padding: 13px 16px;
    border: 1px solid rgba(36, 76, 120, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #244c78;
    text-align: right;
}

.attendance-active-date span,
.attendance-active-date strong,
.attendance-active-date small {
    display: block;
}

.attendance-active-date span {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.attendance-active-date .icon-svg,
.attendance-section-icon .icon-svg,
.attendance-legend-help .icon-svg {
    width: 16px;
    height: 16px;
}

.attendance-active-date strong {
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.1;
}

.attendance-active-date small {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 12px;
}

.button-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.button-with-icon .icon-svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.attendance-column-legend-card .section-head {
    align-items: center;
}

.attendance-legend-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-accent);
}

.attendance-column-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.attendance-column-legend span {
    display: grid;
    gap: 3px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fbfd;
}

.attendance-column-legend strong {
    color: var(--app-text);
    font-size: 12px;
}

.attendance-column-legend small {
    color: var(--app-muted);
    font-size: 11px;
    line-height: 1.35;
}

.attendance-history-card {
    display: grid;
    gap: 14px;
}

.attendance-history-summary,
.attendance-history-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.attendance-load-badge,
.attendance-history-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
}

.attendance-load-badge {
    padding: 6px 9px;
    border-radius: 999px;
}

.attendance-load-badge.is-loaded,
.attendance-history-legend .is-loaded {
    color: #1f7a49;
}

.attendance-load-badge.is-loaded {
    background: #e9f8ef;
}

.attendance-load-badge.is-pending,
.attendance-history-legend .is-pending {
    color: #7e5b21;
}

.attendance-load-badge.is-pending {
    background: #fff5e8;
}

.attendance-history-legend {
    color: var(--app-muted);
    font-size: 12px;
}

.attendance-history-legend .is-active {
    color: #244c78;
}

.attendance-calendar-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    background: currentColor;
}

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

.attendance-calendar-weekday {
    padding: 4px 6px;
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.attendance-calendar-empty {
    min-height: 58px;
}

.attendance-calendar-day {
    display: grid;
    gap: 3px;
    min-height: 58px;
    padding: 8px 9px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--app-text);
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.attendance-calendar-day:hover {
    border-color: var(--app-sky);
    box-shadow: 0 4px 12px rgba(36, 76, 120, 0.1);
    transform: translateY(-1px);
}

.attendance-calendar-day strong {
    font-size: 16px;
}

.attendance-calendar-day small {
    font-size: 10px;
    font-weight: 800;
}

.attendance-calendar-day.is-loaded {
    border-color: #c9e9d7;
    background: #f2fbf5;
}

.attendance-calendar-day.is-loaded small {
    color: #1f7a49;
}

.attendance-calendar-day.is-pending {
    background: #fffaf2;
}

.attendance-calendar-day.is-pending small {
    color: #9a640d;
}

.attendance-calendar-day.is-today {
    box-shadow: inset 0 0 0 2px rgba(36, 76, 120, 0.15);
}

.attendance-calendar-day.is-active {
    border-color: #244c78;
    background: #244c78;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(36, 76, 120, 0.16);
}

.attendance-calendar-day.is-active small {
    color: #ffffff;
}

.attendance-course-table th,
.attendance-course-table td {
    vertical-align: middle;
}

.attendance-course-table th {
    white-space: nowrap;
}

.attendance-state-column {
    min-width: 74px;
    text-align: center;
}

.attendance-column-label,
.attendance-column-icon {
    display: block;
}

.attendance-column-label {
    font-size: 12px;
}

.attendance-column-icon {
    margin-top: 5px;
    color: var(--app-muted);
}

.attendance-column-icon .icon-svg {
    width: 21px;
    height: 21px;
}

.attendance-state-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.attendance-state-trigger input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.attendance-state-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: #f8fbfd;
    color: var(--app-muted);
    opacity: 0.48;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.attendance-state-icon .icon-svg {
    width: 20px;
    height: 20px;
}

.attendance-state-trigger input:focus-visible + .attendance-state-icon {
    outline: none;
    box-shadow: var(--ui-focus-ring);
}

.attendance-state-trigger input:checked + .attendance-state-icon {
    opacity: 1;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(36, 76, 120, 0.14);
}

.attendance-state-presente input:checked + .attendance-state-icon {
    background: #1f7a49;
    border-color: #1f7a49;
}

.attendance-state-ausente input:checked + .attendance-state-icon {
    background: #a53b44;
    border-color: #a53b44;
}

.attendance-state-tarde input:checked + .attendance-state-icon {
    background: #9a640d;
    border-color: #9a640d;
}

.attendance-state-justificado input:checked + .attendance-state-icon {
    background: #355e9b;
    border-color: #355e9b;
}

.attendance-student-link {
    color: inherit;
    text-decoration: none;
}

.attendance-student-link:hover {
    color: var(--app-accent);
    text-decoration: underline;
}

.attendance-report-hero {
    margin-bottom: 0;
}

.attendance-report-card {
    display: grid;
    gap: 14px;
}

.attendance-report-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attendance-report-stat {
    border-top: 3px solid var(--app-border);
}

.attendance-report-stat--presente {
    border-top-color: #1f7a49;
}

.attendance-report-stat--ausente {
    border-top-color: #a53b44;
}

.attendance-report-stat--tarde {
    border-top-color: #9a640d;
}

.attendance-report-stat--justificado {
    border-top-color: #355e9b;
}

.attendance-report-optativas-summary {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fbfd;
}

.attendance-report-optativas-summary > strong {
    color: var(--app-text);
    font-size: 13px;
}

.attendance-report-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.attendance-report-mini-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--app-border);
    background: #ffffff;
    color: var(--app-muted);
    font-size: 11px;
}

.attendance-report-mini-stat strong {
    color: var(--app-text);
    font-size: 16px;
}

.attendance-report-mini-stat--presente {
    border-left-color: #1f7a49;
}

.attendance-report-mini-stat--ausente {
    border-left-color: #a53b44;
}

.attendance-report-mini-stat--tarde {
    border-left-color: #9a640d;
}

.attendance-report-mini-stat--justificado {
    border-left-color: #355e9b;
}

.attendance-report-table td {
    vertical-align: middle;
}

.attendance-workspace,
.attendance-fast-form,
.attendance-fast-form > .section-card {
    min-width: 0;
    max-width: 100%;
}

.attendance-fast-form .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* La cabecera de correccion acompana el scroll vertical de la pagina.
   El desplazamiento horizontal sigue disponible para las laminas. */
.task-correction-table-wrap {
    overflow-x: auto;
    overflow-y: clip;
}

.task-correction-table thead th {
    position: sticky;
    z-index: 4;
    background: var(--app-surface-soft);
}

.task-correction-table thead tr:first-child th {
    top: 0;
}

.task-correction-table thead tr:nth-child(2) th {
    top: 37px;
}

@media (max-width: 800px) {
    .attendance-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-active-date {
        text-align: left;
    }

    .attendance-active-date span {
        justify-content: flex-start;
    }

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

    .attendance-calendar-grid {
        grid-template-columns: repeat(7, minmax(42px, 1fr));
        gap: 4px;
    }

    .attendance-calendar-day {
        min-height: 48px;
        padding: 6px;
    }

    .attendance-calendar-day small {
        font-size: 9px;
    }

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

    .attendance-report-mini-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* Certificados: composición suave coherente con los paneles del sistema. */
.cert-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.cert-hero-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
.cert-editor-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.cert-editor-status { border-radius:999px; background:#eaf3ed; color:#24533b; padding:.45rem .8rem; font-size:.78rem; font-weight:700; white-space:nowrap; }
.cert-editor-grid { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:1.4rem; margin-top:1rem; align-items:start; }
.cert-editor-canvas-wrap { min-width:0; }
.cert-editor-page { position:relative; width:100%; aspect-ratio:297/210; overflow:hidden; background-color:#fff; background-size:100% 100%; box-shadow:0 8px 32px rgba(20,40,60,.18); border:1px solid #dbe4e9; --cert-page-scale:1; }
.cert-editor-block { position:absolute; box-sizing:border-box; overflow:hidden; color:#17231c; border:1px dashed transparent; cursor:grab; touch-action:none; user-select:none; line-height:1.16; }
.cert-editor-block:hover { border-color:#3571a0; background:rgba(220,240,255,.20); }
.cert-editor-block.is-selected { border:2px solid #1e5c9b; background:rgba(220,240,255,.24); z-index:2; }
.cert-editor-block:active { cursor:grabbing; }
.cert-editor-block img { width:100%; height:100%; object-fit:contain; pointer-events:none; }
.cert-editor-titulo,.cert-editor-nombre { font-weight:800; }
.cert-editor-line { display:block; border-top:1px solid #255030; width:100%; }
.cert-editor-detalle { display:flex; flex-direction:column; justify-content:space-around; gap:.3em; line-height:1.25; }
.cert-editor-firma { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; text-align:center; font-size:calc(var(--cert-page-scale) * 10px); }
.cert-editor-firma .cert-editor-signature { flex:1; display:flex; align-items:center; justify-content:center; font-style:italic; color:#445c78; }
.cert-editor-signline { width:70%; border-top:1px solid #1b2f22; }
.cert-editor-firma small { font-size:.82em; }
.cert-editor-qr-placeholder { display:grid; place-items:center; width:100%; height:100%; border:1px solid #415c55; font-weight:700; background:repeating-linear-gradient(45deg,#f5f7f7,#f5f7f7 4px,#e1e7e4 4px,#e1e7e4 8px); }
.cert-editor-inspector { border:1px solid #dce6ed; border-radius:16px; background:#f8fbfd; padding:1rem; display:flex; flex-direction:column; gap:.8rem; }
.cert-editor-inspector h3 { margin:0; }
.cert-editor-inspector label { display:flex; flex-direction:column; gap:.25rem; font-size:.8rem; font-weight:700; color:#40566b; }
.cert-editor-inspector select,.cert-editor-inspector input[type=number] { width:100%; box-sizing:border-box; border:1px solid #ccd9e4; border-radius:9px; padding:.55rem; background:#fff; color:#1c3044; }
.cert-editor-fields { display:grid; grid-template-columns:1fr 1fr; gap:.65rem; }
.cert-editor-inspector form { margin:0; }
.cert-editor-inspector button,.cert-editor-inspector .cert-editor-preview { width:100%; box-sizing:border-box; text-align:center; justify-content:center; }
.cert-editor-inspector button:disabled { opacity:.5; cursor:not-allowed; }
#cert-editor-unsaved { color:#9b4c21; font-weight:700; }
.cert-profile-section { margin-top:22px; }
.cert-my-table { width:100%; border-collapse:separate; border-spacing:0; }
.cert-my-table th { padding:12px 14px; text-align:left; color:#52677a; font-size:.76rem; letter-spacing:.04em; text-transform:uppercase; border-bottom:1px solid #dce6ed; }
.cert-my-table td { padding:15px 14px; vertical-align:middle; border-bottom:1px solid #e8eef3; }
.cert-my-table tbody tr:last-child td { border-bottom:0; }
.cert-my-table time { font-weight:700; color:#27445e; white-space:nowrap; }
.cert-row-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.cert-row-actions .button-link { min-width:82px; justify-content:center; padding:.55rem .8rem; }
.cert-status { display:inline-flex; margin-left:.45rem; padding:.18rem .45rem; border-radius:999px; font-size:.7rem; font-weight:800; text-transform:uppercase; }
.cert-status-anulado { color:#9a3e31; background:#fde8e4; }
.cert-empty-state { display:flex; flex-direction:column; gap:.35rem; padding:28px; border:1px dashed #c8d7e2; border-radius:14px; text-align:center; color:#607489; background:#f8fbfd; }
.cert-empty-state strong { color:#29455e; }
.cert-activity-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.cert-activity-summary > div { display:grid; gap:5px; padding:12px 14px; border:1px solid #dce7f4; border-radius:12px; background:#f8fbff; }
.cert-activity-summary span { color:#718399; font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.cert-activity-summary strong { color:#234967; }
.cert-activity-certificates { display:grid; gap:14px; margin-top:16px; }
.cert-person-card { display:grid; gap:14px; padding:18px; border:1px solid #dce7f4; border-radius:16px; background:#fbfdff; }
.cert-person-card header,.cert-person-card footer,.cert-card-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }
.cert-person-card h3 { margin:3px 0 0; color:#224661; }
.cert-person-card footer { justify-content:flex-start; }
.cert-person-card footer form { margin:0; }
.cert-role-readonly { display:grid; gap:8px; padding-left:18px; margin:0; color:#405c73; }
.cert-role-readonly small { display:block; margin-top:3px; color:#718399; }
@media (max-width:720px) {
  .cert-activity-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cert-my-table thead { display:none; }
  .cert-my-table,.cert-my-table tbody,.cert-my-table tr,.cert-my-table td { display:block; width:100%; box-sizing:border-box; }
  .cert-my-table tr { padding:10px 0; border-bottom:1px solid #dfe8ef; }
  .cert-my-table td { display:grid; grid-template-columns:105px minmax(0,1fr); gap:10px; border:0; padding:6px 10px; }
  .cert-my-table td::before { content:attr(data-label); font-size:.73rem; font-weight:800; color:#65798b; text-transform:uppercase; }
}
@media (max-width:1000px) { .cert-editor-grid { grid-template-columns:1fr; } .cert-editor-inspector { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .cert-editor-inspector h3,.cert-editor-fields { grid-column:1/-1; } }
@media (max-width:650px) { .cert-editor-inspector { display:flex; } .cert-editor-page { min-width:650px; } .cert-editor-canvas-wrap { overflow-x:auto; } }

.cert-hero h1 {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(23px, 2.2vw, 30px);
}

.cert-hero .button-secondary {
    background: rgba(255, 255, 255, 0.96);
    white-space: nowrap;
}

.cert-card {
    margin-bottom: 22px;
    padding: 24px;
    border-radius: 18px;
    border-color: #dbe6f2;
    box-shadow: 0 12px 30px rgba(22, 55, 92, 0.06);
}

.cert-card h2 {
    margin-bottom: 14px;
}

.cert-form > .grid-three,
.cert-form > .cert-period-grid {
    margin-bottom: 16px;
}

.cert-form .grid-three > label,
.cert-form .grid-two > label,
.cert-batch-panel label,
.cert-edit-row > label {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    font-weight: 600;
}

.cert-form > label {
    display: grid;
    gap: 6px;
    margin: 14px 0;
    font-weight: 600;
}

.cert-form input:not([type="checkbox"]):not([type="hidden"]),
.cert-form select,
.cert-form textarea,
.cert-settings-form input:not([type="hidden"]),
.cert-batch-panel select,
.cert-edit-row input,
.cert-edit-row select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    padding: 9px 11px;
    font: inherit;
    border: 1px solid #cbd9e9;
    border-radius: 10px;
    background: #fcfdff;
}

.cert-form textarea {
    resize: vertical;
}

.cert-role-row {
    padding: 18px;
    border: 1px solid #dce7f4;
    border-radius: 14px;
    background: #f8fbff;
}

.cert-period-grid,
.cert-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cert-period-card {
    min-width: 0;
    margin: 0;
    padding: 14px 16px 18px;
    border: 1px solid #dce7f4;
    border-radius: 14px;
    background: #f8fbff;
}

.cert-period-card legend {
    padding: 0 8px;
    color: #1b5184;
    font-weight: 700;
}

.cert-hours-label {
    max-width: 360px;
}

.cert-batch-panel {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid #dce7f4;
    border-radius: 14px;
    background: #f8fbff;
}

.cert-batch-panel summary {
    cursor: pointer;
    color: #1b5184;
    font-weight: 700;
}

.cert-batch-panel .grid-two {
    margin: 15px 0 8px;
}

.cert-batch-panel button {
    margin-top: 12px;
}

.cert-setting-item {
    min-width: 0;
    padding: 18px;
    border: 1px solid #dce7f4;
    border-radius: 14px;
    background: #f8fbff;
}

.cert-setting-item h3 {
    margin: 0 0 8px;
}

.cert-setting-preview {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 130px;
    margin: 12px 0;
    object-fit: contain;
    border-radius: 8px;
}

.cert-setting-preview-wide {
    width: 100%;
    max-height: 180px;
}

.cert-role-row > button {
    align-self: end;
}

.cert-edit-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

@media (max-width: 1000px) {
    .cert-period-grid,
    .cert-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .cert-hero {
        grid-template-columns: 1fr;
    }

    .cert-role-row > label[style*="grid-column"] {
        grid-column: auto !important;
    }

    .cert-edit-row {
        grid-template-columns: 1fr;
    }
}

/* Perfil profesional del docente */
.teacher-profile-shell {
    display: grid;
    gap: 18px;
}

.teacher-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid #dbe6f2;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8fd 72%, #e8f1fb 100%);
    box-shadow: 0 14px 34px rgba(22, 55, 91, .08);
}

.teacher-profile-identity {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.teacher-profile-avatar {
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 5px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #2a63aa, #183e70);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: 0 10px 25px rgba(36, 76, 120, .22);
}

.teacher-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-profile-heading { min-width: 0; }
.teacher-profile-heading h1 { margin: 2px 0 5px; color: #173755; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; }
.teacher-profile-heading p { margin: 0; color: #64778c; }
.teacher-profile-kicker { color: #2f6fac; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.teacher-role-list,
.teacher-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-role-list { margin-top: 14px; }
.teacher-profile-actions { justify-content: flex-end; }
.teacher-role-chip,
.teacher-status-chip,
.teacher-section-count,
.teacher-activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.teacher-role-chip { background: #e7f0fb; color: #245c92; }
.teacher-status-chip.is-active { background: #e1f6ea; color: #187044; }
.teacher-status-chip.is-inactive { background: #fbe7e7; color: #a03939; }

.teacher-profile-stats,
.teacher-activity-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.teacher-stat-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 4px;
    min-height: 104px;
    padding: 20px 22px;
    border: 1px solid #dfe8f2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 55, 82, .06);
}

.teacher-stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #3d79b6; }
.teacher-stat-card strong { color: #1d456d; font-size: 30px; line-height: 1; }
.teacher-stat-card span { align-self: end; color: #65798e; font-size: 13px; font-weight: 650; }
.teacher-section-card { margin: 0; border-radius: 18px; box-shadow: 0 8px 24px rgba(30, 55, 82, .05); }
.teacher-section-count { min-width: 32px; background: #edf3fa; color: #315d89; }

.teacher-profile-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.teacher-data-item {
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid #e2e9f0;
    border-radius: 12px;
    background: #f8fafc;
}

.teacher-data-item dt { margin-bottom: 7px; color: #718196; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.teacher-data-item dd { overflow-wrap: anywhere; margin: 0; color: #243b53; font-weight: 650; }

.teacher-roles-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.teacher-role-card { display: grid; grid-template-columns: 10px 1fr; column-gap: 12px; padding: 16px; border: 1px solid #dfe8f2; border-radius: 13px; background: #f8fbff; }
.teacher-role-card strong { color: #254b72; }
.teacher-role-card small { grid-column: 2; margin-top: 3px; color: #74869a; }
.teacher-role-mark { grid-row: 1 / 3; align-self: stretch; border-radius: 10px; background: linear-gradient(180deg, #4d8bca, #2a5f96); }
.teacher-subject-table td { vertical-align: middle; }
.teacher-subject-table th:nth-child(1) { width: 18%; }
.teacher-subject-table th:nth-child(3) { width: 110px; }
.teacher-empty-state { display: grid; justify-items: center; gap: 6px; padding: 34px 20px; border: 1px dashed #c9d7e5; border-radius: 14px; background: #f8fafc; text-align: center; }
.teacher-empty-state strong { color: #31526f; }
.teacher-empty-state span { color: #718399; }
.teacher-section-count-warning { background: #fff3d8; color: #9a6512; }
.teacher-internal-list { display: grid; gap: 9px; }
.teacher-internal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #e1e9f1; border-radius: 12px; background: #fbfdff; color: inherit; text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.teacher-internal-item:hover { border-color: #9dbbdd; box-shadow: 0 7px 15px rgba(36, 76, 120, .09); transform: translateY(-1px); }
.teacher-internal-state { display: inline-flex; justify-content: center; min-width: 78px; padding: 5px 8px; border-radius: 999px; background: #e7f0fb; color: #245c92; font-size: 11px; font-weight: 800; }
.teacher-internal-state.is-tomado { background: #fff2d9; color: #9a6512; }
.teacher-internal-state.is-en_proceso { background: #ede7fb; color: #6548a7; }
.teacher-internal-copy { display: grid; gap: 3px; min-width: 0; }
.teacher-internal-copy strong { overflow: hidden; color: #2c4965; text-overflow: ellipsis; white-space: nowrap; }
.teacher-internal-copy small { color: #74869a; }
.teacher-internal-open { color: #2d6398; font-size: 12px; font-weight: 800; }
.teacher-internal-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.teacher-activity-filter {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto;
    align-items: end;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border-radius: 16px;
}
.teacher-activity-filter label { display: grid; gap: 6px; color: #405870; font-size: 13px; font-weight: 700; }
.teacher-activity-filter input { width: 100%; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 9px; background: #fff; color: var(--app-text); font: inherit; }
.teacher-activity-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.teacher-stat-card.is-auth::before { background: #397ac0; }
.teacher-stat-card.is-asistencias::before { background: #1f9a73; }
.teacher-stat-card.is-calificaciones::before { background: #7a5bc5; }

.teacher-activity-timeline { display: grid; }
.teacher-activity-item { display: grid; grid-template-columns: 100px 16px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid #e7edf3; }
.teacher-activity-item:last-child { border-bottom: 0; }
.teacher-activity-date { display: grid; text-align: right; }
.teacher-activity-date strong { color: #334e68; font-size: 13px; }
.teacher-activity-date span { color: #8292a3; font-size: 12px; }
.teacher-activity-dot { width: 12px; height: 12px; border: 3px solid #d7e7f6; border-radius: 50%; background: #397ac0; box-shadow: 0 0 0 4px #f2f7fc; }
.teacher-activity-dot.is-asistencias { background: #1f9a73; border-color: #cfefe3; }
.teacher-activity-dot.is-calificaciones { background: #7a5bc5; border-color: #e6ddf8; }
.teacher-activity-content { display: grid; gap: 3px; min-width: 0; }
.teacher-activity-content strong { color: #28445e; }
.teacher-activity-content span { color: #7a8b9d; font-size: 12px; }
.teacher-activity-badge { background: #edf3fa; color: #315d89; }
.teacher-activity-badge.is-asistencias { background: #e5f6ef; color: #197153; }
.teacher-activity-badge.is-calificaciones { background: #f0ebfb; color: #6243a8; }

@media (max-width: 900px) {
    .teacher-profile-hero { align-items: flex-start; flex-direction: column; }
    .teacher-profile-actions { justify-content: flex-start; }
    .teacher-profile-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-activity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .teacher-profile-hero { padding: 20px; }
    .teacher-profile-identity { align-items: flex-start; }
    .teacher-profile-avatar { width: 76px; height: 76px; flex-basis: 76px; border-width: 3px; font-size: 25px; }
    .teacher-profile-actions { width: 100%; }
    .teacher-profile-actions .button-link { flex: 1 1 140px; }
    .teacher-profile-stats,
    .teacher-profile-data-grid,
    .teacher-activity-summary,
    .teacher-activity-filter { grid-template-columns: 1fr; }
    .teacher-activity-item { grid-template-columns: 74px 12px minmax(0, 1fr); gap: 10px; }
    .teacher-activity-badge { grid-column: 3; justify-self: start; }
    .teacher-internal-item { grid-template-columns: 1fr auto; }
    .teacher-internal-state { justify-self: start; }
    .teacher-internal-copy { grid-column: 1; }
    .teacher-internal-open { grid-column: 2; grid-row: 1 / 3; }
}

/* Mesas de examen: calendario y actas sin alterar los horarios semanales. */
.exam-shell { display: grid; gap: 18px; min-width: 0; }
.exam-card { min-width: 0; }
.exam-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; align-items: end; }
.exam-form-grid label, .exam-stack label, .exam-inline-add label, .exam-filter label { display: grid; gap: 5px; font-weight: 600; color: #33445f; }
.exam-form-grid input, .exam-form-grid select, .exam-stack input, .exam-stack select, .exam-inline-add input, .exam-inline-add select, .exam-filter input, .exam-row-actions input { width: 100%; min-width: 0; }
.exam-form-action { align-self: end; }
.exam-filter, .exam-actions, .exam-month-nav, .exam-status-line, .exam-nomina-tools, .exam-publish { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.exam-filter label { min-width: 160px; }
.exam-month-nav { justify-content: space-between; padding: 15px 0 10px; }
.exam-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid #d7e2ed; border-radius: 10px; overflow: hidden; }
.exam-weekday { padding: 9px 6px; background: #eaf1f8; color: #24436c; text-align: center; font-weight: 700; }
.exam-day { min-height: 104px; padding: 8px; border-top: 1px solid #d7e2ed; border-right: 1px solid #d7e2ed; background: #fff; }
.exam-day:nth-child(7n) { border-right: 0; }
.exam-day-outside { background: #f5f7fa; color: #8491a2; }
.exam-day-number { display: block; margin-bottom: 7px; font-weight: 700; }
.exam-event { display: block; margin: 4px 0; padding: 5px 6px; border-left: 3px solid #1f719b; border-radius: 4px; background: #eaf5f7; color: #174d6a; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.exam-event:hover { background: #d6edf1; }
.exam-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.exam-stack { display: grid; gap: 10px; align-content: start; }
.exam-stack .exam-check { display: flex; align-items: center; gap: 8px; }
.exam-stack .exam-check input { width: auto; }
.exam-status-line { padding: 10px 15px; background: #eff5f8; border: 1px solid #d6e4ec; border-radius: 10px; }
.exam-nomina-tools { align-items: end; margin-bottom: 15px; }
.exam-inline-add { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; }
.exam-inline-add label { min-width: 190px; }
.exam-previa-add { margin: 0 0 15px; padding: 12px; border: 1px dashed #b8cadb; border-radius: 8px; background: #f6f9fc; }
.exam-row-actions summary { cursor: pointer; color: #215d87; font-weight: 700; }
.exam-row-actions form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.exam-row-actions input { flex: 1 1 180px; }
.exam-publish { margin-top: 17px; }
.exam-publish small { color: #62738b; }
.exam-audit-json { max-width: 570px; max-height: 190px; overflow: auto; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; background: #f1f5f9; font-size: 11px; }
@media (max-width: 1000px) { .exam-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .exam-day { min-height: 80px; } }
@media (max-width: 700px) { .exam-two-columns, .exam-form-grid { grid-template-columns: 1fr; } .exam-calendar { overflow-x: auto; min-width: 650px; } .exam-shell .exam-card:has(.exam-calendar) { overflow-x: auto; } }
.tutoriales-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tutoriales-url-field { display: grid; gap: 7px; color: #26384e; font-weight: 700; }
.tutoriales-url-field input { width: 100%; min-width: 0; }
.tutoriales-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tutoriales-card { min-width: 0; padding: 16px; border: 1px solid #dce5ee; border-radius: 12px; background: #fff; }
.tutoriales-card h4 { margin: 0 0 8px; }
.tutoriales-card p { min-height: 44px; color: #607187; }
.tutoriales-player { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: #101820; }
.tutoriales-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tutoriales-pendiente { display: grid; min-height: 190px; place-items: center; border-radius: 9px; background: #f1f5f9; color: #617187; }
@media (max-width: 760px) { .tutoriales-form, .tutoriales-grid { grid-template-columns: 1fr; } }

/* Mobile academic views: readable materia cards and grade tables. */
@media screen and (max-width: 800px) {
    .bulk-update-card > .table-wrap { overflow: visible; }
    .bulk-update-card > .table-wrap > .table,
    .bulk-update-card > .table-wrap > .table tbody { display: block; width: 100%; min-width: 0; }
    .bulk-update-card > .table-wrap > .table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .bulk-update-card > .table-wrap > .table tbody tr {
        display: grid; grid-template-columns: 44px minmax(0, 1fr);
        margin: 0 0 12px; border: 1px solid #d8e2ef; border-radius: 10px;
        background: #fff; overflow: hidden;
    }
    .bulk-update-card > .table-wrap > .table tbody td {
        box-sizing: border-box; min-width: 0; border: 0;
        padding: 8px 12px; overflow-wrap: anywhere;
    }
    .bulk-update-card > .table-wrap > .table tbody td:first-child {
        grid-column: 1; grid-row: 1; align-self: center; text-align: center;
    }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(2) {
        grid-column: 2; grid-row: 1; align-self: center; padding-left: 0; font-size: 16px;
    }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(n+3) {
        grid-column: 1 / -1; border-top: 1px solid #e8eef5;
    }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(n+3)::before {
        display: block; margin-bottom: 3px; color: #52627a; font-size: 11px;
        font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(3)::before { content: 'Tipo'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(4)::before { content: 'Ciclo / orientación'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(5)::before { content: 'Evaluación'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(6)::before { content: 'Unidades'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(7)::before { content: 'Curso'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(8)::before { content: 'Código curso'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(9)::before { content: 'Docentes'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(10)::before { content: 'Alumnos'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(11)::before { content: 'Estado'; }
    .bulk-update-card > .table-wrap > .table tbody td:nth-child(12)::before { content: 'Acciones'; }
    .bulk-update-card > .table-wrap > .table .table-actions { flex-wrap: wrap; }
    .bulk-update-card > .table-wrap > .table .icon-action-button { min-width: 40px; min-height: 40px; }
    .calificaciones-matriz-shell .calificaciones-matriz-head { flex-wrap: wrap; }
    .calificaciones-matriz-shell .filtro-inline-2 { grid-template-columns: minmax(0, 1fr); }
    .calificaciones-matriz-shell .matrix-scroll { -webkit-overflow-scrolling: touch; }
    .calificaciones-matriz-shell .matrix-scroll::before {
        content: 'Deslizá la tabla para ver todas las materias. El alumno permanece visible.';
        display: block; position: sticky; left: 0; width: min(100%, 270px);
        box-sizing: border-box; padding: 8px; color: #24446b; background: #eef4ff; font-size: 12px;
    }
    .calificaciones-matriz-shell .calificaciones-matrix-table th:first-child,
    .calificaciones-matriz-shell .calificaciones-matrix-table td:first-child { display: none; }
    .calificaciones-matriz-shell .calificaciones-matrix-table th:nth-child(2),
    .calificaciones-matriz-shell .calificaciones-matrix-table td:nth-child(2) {
        position: sticky; left: 0; z-index: 2; width: 158px; min-width: 158px;
        max-width: 158px; box-shadow: 3px 0 5px rgba(15, 23, 42, .13); background: #fff;
    }
    .calificaciones-matriz-shell .calificaciones-matrix-table th:nth-child(2) { z-index: 3; background: #f3f6fb; }
    .calificaciones-matriz-shell .calificaciones-matrix-table .matrix-row-has-fail td:nth-child(2) { background: #fff4f4; }
    .calificaciones-matriz-shell .student-link-cell { display: block; overflow-wrap: anywhere; line-height: 1.3; }
    .calificaciones-matriz-shell .student-link-cell .libreta-link { display: inline-block; margin-top: 5px; }
    .calificaciones-matriz-shell .libreta-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .calificaciones-matriz-shell .libreta-card::before {
        content: 'Deslizá la libreta para leer todas las notas.';
        display: block; margin-bottom: 8px; color: #52627a; font-size: 12px;
    }
    .calificaciones-matriz-shell .libreta-card .libreta-table th:first-child,
    .calificaciones-matriz-shell .libreta-card .libreta-table tbody tr:not(.libreta-module-print-row) > td:first-child {
        position: sticky; left: 0; z-index: 1; box-shadow: 3px 0 5px rgba(15, 23, 42, .12);
    }
    .calificaciones-matriz-shell .libreta-card .libreta-table th:first-child { background: #e2e8f0; }
    .calificaciones-matriz-shell .libreta-card .libreta-table tbody tr:not(.libreta-module-print-row) > td:first-child { background: #fff; }
}

@media screen and (max-width: 800px) {
    #listado-espacios > .section-card > .section-head { display: block; }
    #listado-espacios .materias-tipo-nav {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 12px;
    }
    #listado-espacios .materias-tipo-nav .tipo-chip {
        min-width: 0;
        white-space: normal;
        text-align: center;
    }
    #listado-espacios .bulk-update-grid > label > select,
    #listado-espacios .bulk-update-grid > label > input {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        margin-top: 4px;
    }
}

@media screen and (max-width: 800px) {
    .calificaciones-matriz-shell .calificaciones-matrix-table {
        width: max-content;
        min-width: 100%;
        table-layout: auto;
    }
    .calificaciones-matriz-shell .calificaciones-matrix-table .matrix-subject-col {
        min-width: 40px;
    }
}

@media screen and (max-width: 800px) {
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-materia,
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-materia-superior,
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-modulo-materia {
        width: 160px;
    }
}

@media screen and (max-width: 800px) {
    .calificaciones-matriz-shell .libreta-card .libreta-table { width: 650px; min-width: 650px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-materia { width: 160px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-nota { width: 40px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-resumen,
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-final { width: 50px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-obs { width: 70px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table th:first-child,
    .calificaciones-matriz-shell .libreta-card .libreta-table td:first-child { width: 160px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table th:last-child,
    .calificaciones-matriz-shell .libreta-card .libreta-table td:last-child { width: 70px; }
}

@media screen and (max-width: 800px) {
    .calificaciones-matriz-shell .libreta-card::before,
    .calificaciones-matriz-shell .libreta-card > .libreta-head,
    .calificaciones-matriz-shell .libreta-card > .libreta-meta,
    .calificaciones-matriz-shell .libreta-card > .libreta-legend,
    .calificaciones-matriz-shell .libreta-card > .libreta-foot,
    .calificaciones-matriz-shell .libreta-card > .libreta-module-title {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
    }
}

/* A wide table must not set the minimum width of an entire tab panel. */
.tabs-shell > .tab-panel { min-width: 0; max-width: 100%; }

@media screen and (max-width: 800px) {
    .familias-export-panel ~ .table-wrap { overflow: visible; }
    .familias-export-panel ~ .table-wrap > .table-compact,
    .familias-export-panel ~ .table-wrap > .table-compact tbody {
        display: block; width: 100%; min-width: 0;
    }
    .familias-export-panel ~ .table-wrap > .table-compact thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .familias-export-panel ~ .table-wrap > .table-compact tbody tr {
        display: block; margin: 0 0 12px; border: 1px solid #d8e2ef;
        border-radius: 10px; background: #fff; overflow: hidden;
    }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td {
        display: block; min-width: 0; box-sizing: border-box;
        padding: 8px 12px; border: 0; overflow-wrap: anywhere;
    }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td + td { border-top: 1px solid #e8eef5; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td::before {
        display: block; margin-bottom: 3px; color: #52627a; font-size: 11px;
        font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-child(1):nth-last-child(9)::before { content: 'Seleccionar'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(8)::before { content: 'Estudiante'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(7)::before { content: 'Curso'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(6)::before { content: 'Contacto'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(5)::before { content: 'Datos personales'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(4)::before { content: 'Responsables'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(3)::before { content: 'Acceso estudiante'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:nth-last-child(2)::before { content: 'Último ingreso'; }
    .familias-export-panel ~ .table-wrap > .table-compact tbody td:last-child::before { content: 'Acciones'; }
    .familias-export-panel ~ .table-wrap > .table-compact .table-actions { flex-wrap: wrap; }
    .familias-export-panel ~ .table-wrap > .table-compact .icon-action-button { min-width: 40px; min-height: 40px; }
    .inline-filter-form .inline-check input[type='checkbox'],
    .familias-export-option input[type='checkbox'] {
        width: 18px; min-width: 18px; max-width: 18px;
    }
}

@media screen and (max-width: 800px) {
    .attendance-course-table th:first-child,
    .attendance-course-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        overflow-wrap: anywhere;
        box-shadow: 3px 0 5px rgba(15, 23, 42, .13);
        background: #fff;
    }
    .attendance-course-table th:first-child {
        z-index: 3;
        background: #f2f6fb;
    }
}

@media screen and (max-width: 800px) {
    .calificaciones-table thead tr:first-child th:first-child,
    .calificaciones-table thead tr:nth-child(2) th:first-child,
    .calificaciones-table tbody td:first-child { display: none; }
    .calificaciones-table thead tr:first-child th:nth-child(2),
    .calificaciones-table tbody td:nth-child(2) {
        position: sticky; left: 0; z-index: 2; width: 160px;
        min-width: 160px; max-width: 160px; overflow-wrap: anywhere;
        box-shadow: 3px 0 5px rgba(15, 23, 42, .13); background: #fff;
    }
    .calificaciones-table thead tr:first-child th:nth-child(2) {
        z-index: 3; background: #f2f6fb;
    }
}

@media screen and (max-width: 800px) {
    .table-wrap:has(.optativas-change) { overflow: visible; }
    .table-wrap:has(.optativas-change) > .table,
    .table-wrap:has(.optativas-change) > .table tbody {
        display: block; width: 100%; min-width: 0;
    }
    .table-wrap:has(.optativas-change) > .table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .table-wrap:has(.optativas-change) > .table tbody tr {
        display: block; margin: 0 0 12px; border: 1px solid #d8e2ef;
        border-radius: 10px; background: #fff; overflow: hidden;
    }
    .table-wrap:has(.optativas-change) > .table tbody td {
        display: block; box-sizing: border-box; min-width: 0;
        padding: 8px 12px; border: 0; overflow-wrap: anywhere;
    }
    .table-wrap:has(.optativas-change) > .table tbody td + td { border-top: 1px solid #e8eef5; }
    .table-wrap:has(.optativas-change) > .table tbody td::before {
        display: block; margin-bottom: 3px; color: #52627a; font-size: 11px;
        font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(2)::before { content: 'Curso'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(3)::before { content: 'DNI'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(4)::before { content: 'Apellido'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(5)::before { content: 'Nombre'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(6)::before { content: 'Optativa materia'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(7)::before { content: 'Optativa docente'; }
    .table-wrap:has(.optativas-change) > .table tbody td:nth-child(8)::before { content: 'Reasignar'; }
    .table-wrap:has(.optativas-change) .optativas-change form {
        box-sizing: border-box; width: 100%; min-width: 0 !important; max-width: 100%;
    }
}

/* Allow wide grade sheets to scroll inside their form at tablet widths too. */
.stack-form fieldset { min-width: 0; max-width: 100%; }

@media screen and (max-width: 800px) {
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) { overflow: visible; }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table,
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table tbody {
        display: block; width: 100%; min-width: 0;
    }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table tbody tr {
        display: block; margin: 0 0 10px; border: 1px solid #d8e2ef;
        border-radius: 8px; background: #fff; overflow: hidden;
    }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table tbody td {
        display: block; box-sizing: border-box; min-width: 0;
        padding: 8px 10px; border: 0; overflow-wrap: anywhere;
    }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table tbody td + td {
        border-top: 1px solid #e8eef5;
    }
    :is(#form-gestion-docentes ~ .table-wrap, #espacio-alumnos > .table-wrap) > .table tbody td::before {
        display: block; margin-bottom: 3px; color: #52627a;
        font-size: 11px; font-weight: 700; text-transform: uppercase;
    }
    #form-gestion-docentes ~ .table-wrap td:nth-child(1)::before { content: 'Docente'; }
    #form-gestion-docentes ~ .table-wrap td:nth-child(2)::before { content: 'Rol'; }
    #form-gestion-docentes ~ .table-wrap td:nth-child(3)::before { content: 'Estado'; }
    #form-gestion-docentes ~ .table-wrap td:nth-child(4)::before { content: 'Acción'; }
    #espacio-alumnos > .table-wrap td:nth-child(2)::before { content: 'Alumno'; }
    #espacio-alumnos > .table-wrap td:nth-child(3)::before { content: 'Curso'; }
    #espacio-alumnos > .table-wrap td:nth-child(4)::before { content: 'Origen'; }
    #espacio-alumnos > .table-wrap td:nth-child(5)::before { content: 'Estado'; }
    #espacio-alumnos > .table-wrap td:nth-child(6)::before { content: 'Acción'; }
}

@media screen and (max-width: 800px) {
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-materia-superior { width: 160px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-nota-superior { width: 80px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-resumen-superior,
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-final-superior { width: 60px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table col.libreta-col-obs-superior { width: 50px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table-modulos col.libreta-col-modulo-materia { width: 160px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table-modulos col.libreta-col-modulo-ud { width: 45px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table-modulos col.libreta-col-modulo-pct { width: 42.5px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table:has(col.libreta-col-materia-superior) th:last-child,
    .calificaciones-matriz-shell .libreta-card .libreta-table:has(col.libreta-col-materia-superior) td:last-child { width: 50px; }
    .calificaciones-matriz-shell .libreta-card .libreta-table-modulos th:last-child,
    .calificaciones-matriz-shell .libreta-card .libreta-table-modulos td:last-child { width: 42.5px; }
}
.teacher-access-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #dfe8f2;
    border-radius: 12px;
    background: #f8fbff;
}
.teacher-access-info { display: grid; gap: 5px; min-width: 0; }
.teacher-access-heading { display: flex; align-items: center; gap: 9px; }
.teacher-access-heading h3 { margin: 0; color: #294968; font-size: 14px; }
.teacher-access-info p { margin: 0; color: #718196; font-size: 12px; line-height: 1.45; }
.teacher-access-status { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.teacher-access-status.is-enabled { background: #e3f5ec; color: #16724f; }
.teacher-access-status.is-disabled { background: #f1f3f6; color: #68778a; }
.teacher-access-form { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.teacher-access-choice { display: inline-flex !important; align-items: center; gap: 8px !important; color: #40566d; font-size: 12px; font-weight: 650; cursor: pointer; }
.teacher-access-choice input[type="checkbox"] { width: 16px !important; height: 16px !important; min-height: 16px !important; margin: 0; padding: 0; accent-color: #2864a2; }
.teacher-access-save { min-height: 34px; padding: 6px 12px; border-radius: 7px; font-size: 12px; }

.teacher-access-save:hover { box-shadow: 0 4px 10px rgba(36, 76, 120, .1); }

@media (max-width: 620px) {
    .teacher-access-panel { align-items: flex-start; flex-direction: column; gap: 12px; padding: 13px; }
    .teacher-access-form { width: 100%; justify-content: space-between; }
}
