:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --ink: #0f172a;
    --muted: #667085;
    --line: #e6e8f0;
    --brand: #001f3f;
    --brand-dark: #00162d;
    --brand-soft: #002b5c;
    --accent: #ffd54a;
    --accent-strong: #ffbd2b;
    --danger: #b42318;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --focus: 0 0 0 3px rgba(255, 213, 74, .34);
    --tag-titular-bg: #dff3ff;
    --tag-titular-ink: #075985;
    --tag-titular-line: #9bd8f5;
    --tag-especial-bg: #fff2bd;
    --tag-especial-ink: #7a4a00;
    --tag-especial-line: #f5c84c;
    --tag-maternal-bg: #ffedd5;
    --tag-maternal-ink: #c2410c;
    --tag-maternal-line: #fed7aa;
    --tag-preescolar-bg: #dcfce7;
    --tag-preescolar-ink: #15803d;
    --tag-preescolar-line: #bbf7d0;
    --tag-primaria-bg: #001f3f;
    --tag-primaria-ink: #ffd54a;
    --tag-primaria-line: #bfdbfe;
    --tag-inicial-bg: linear-gradient(135deg, #ffedd5 0%, #dcfce7 100%);
    --tag-inicial-ink: #07502d;
    --tag-inicial-line: #a7f3d0;
    --tag-mixta-bg: linear-gradient(135deg, #ffedd5 0%, #dcfce7 48%, #dff3ff 100%);
    --tag-mixta-ink: #00315f;
    --tag-mixta-line: #93c5fd;
}

* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(1000px 500px at 0% -10%, rgba(0, 31, 63, .06), transparent 62%),
        radial-gradient(900px 440px at 100% 0%, rgba(255, 213, 74, .08), transparent 58%),
        var(--bg);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 213, 74, .12);
    border: 1px solid rgba(255, 213, 74, .2);
    color: var(--brand-soft);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
    font-weight: 700;
}

a { color: inherit; text-decoration: none; }

.app-page {
    padding-left: 260px;
    overflow-x: hidden;
}

.auth-page {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, .018) 1px, transparent 1px),
        radial-gradient(900px 520px at 50% 26%, rgba(35, 60, 112, .16), transparent 62%),
        linear-gradient(180deg, #0d1424 0%, #081124 100%);
    background-size: 13px 13px, auto, auto;
}

.admin-page {
    width: min(1280px, calc(100vw - 32px));
    margin: 22px auto 28px;
    padding-bottom: 12px;
}

.admin-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-page__header h1 {
    margin: 8px 0 0;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
}

.admin-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    padding: 18px 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.admin-panel h2 {
    margin: 0 0 16px;
    color: var(--brand-soft);
}

.admin-form {
    display: grid;
    gap: 18px;
}

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

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

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

.admin-form label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 600;
}

.admin-form textarea,
.admin-form select,
.admin-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.primary-button,
.button-primary {
    background: linear-gradient(180deg, var(--brand-soft), var(--brand-dark));
    color: var(--accent);
    border: 1px solid rgba(0, 31, 63, .2);
    box-shadow: 0 10px 24px rgba(0, 31, 63, .14);
}

.primary-button:hover,
.button-primary:hover {
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.secondary-button,
.button-secondary {
    background: #f2f4f7;
    color: var(--brand);
    border: 1px solid var(--line);
}

.secondary-button:hover,
.button-secondary:hover {
    background: #e8edf3;
}

.dark-ghost {
    background: rgba(0, 31, 63, .06);
    color: var(--brand-soft);
    border: 1px solid rgba(0, 31, 63, .12);
}

body.modal-open {
    overflow: hidden;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 600;
}

.success-alert {
    background: rgba(21, 128, 61, .1);
    color: #166534;
    border: 1px solid rgba(21, 128, 61, .18);
}

.danger-alert {
    background: rgba(180, 35, 24, .08);
    color: #991b1b;
    border: 1px solid rgba(180, 35, 24, .2);
}

.resource-icon-choice {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    align-self: start;
    padding: 10px 12px;
    border: 1px solid rgba(0, 31, 63, 0.12);
    border-radius: 12px;
    background: rgba(0, 31, 63, 0.015);
}

.resource-icon-choice__title {
    margin: 0;
    color: var(--brand-soft);
    font-weight: 700;
    white-space: nowrap;
}

.resource-icon-choice__options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    padding-right: 0;
    margin-left: 2px;
}

.resource-icon-option {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    cursor: pointer;
    color: var(--brand-soft);
    font-weight: 700;
    user-select: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.resource-icon-option input {
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand-soft);
}

.resource-icon-option__box {
    display: none;
}

.resource-icon-option__label {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    line-height: 1;
    white-space: nowrap;
}

.sticker-panel {
    display: grid;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.02);
}

.sticker-image-box {
    display: grid;
    gap: 8px;
}

.published-modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(7, 14, 24, 0.52);
    padding: 24px;
    z-index: 50;
}

.published-modal-backdrop[hidden] {
    display: none;
}

.published-modal {
    width: min(860px, 100%);
    max-height: 82vh;
    overflow: auto;
    background: #fff;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    padding: 18px 18px 12px;
}

.published-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.published-modal__header h2 {
    margin: 0;
    color: var(--brand-soft);
}

.resource-list {
    display: grid;
    gap: 14px;
}

.resource-admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: var(--panel);
}

.resource-admin-item__content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.resource-admin-item__badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(0, 31, 63, 0.08);
    border: 1px solid rgba(0, 31, 63, 0.08);
    overflow: hidden;
    flex-shrink: 0;
}

.resource-admin-item__badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-admin-item__badge span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    color: var(--brand-soft);
}

.resource-admin-item__text {
    min-width: 0;
}

.resource-admin-item__tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.resource-admin-item h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.resource-admin-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.resource-admin-item__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.resource-admin-item--primary .resource-admin-item__tag {
    background: rgba(0, 31, 63, .08);
    color: var(--brand-soft);
}

.resource-admin-item--gold .resource-admin-item__tag {
    background: rgba(255, 213, 74, .16);
    color: #6f4d00;
}

.resource-admin-item--soft .resource-admin-item__tag {
    background: rgba(59, 130, 246, .08);
    color: #114e99;
}

.resource-admin-item--dark .resource-admin-item__tag {
    background: rgba(17, 35, 61, .08);
    color: #243b67;
}

.danger-button {
    background: rgba(180, 35, 24, .1);
    color: #991b1b;
    border: 1px solid rgba(180, 35, 24, .18);
}

.empty-state {
    margin: 0;
    color: var(--muted);
}

.login-wrap {
    width: 430px;
    max-width: calc(100vw - 32px);
}

.resources-public {
    width: 100%;
    min-height: 100vh;
    background: #f3f3f3;
    color: #0f172a;
}

.resources-header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #001f3f;
    min-height: 120px;
    width: 100%;
    padding: 12px 20px 18px;
}

.resources-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.resources-logo {
    display: block;
    width: min(260px, 45vw);
    height: auto;
    max-height: 92px;
    object-fit: contain;
}

.resources-public {
    width: 100%;
    min-height: 100vh;
    background: #f2f2f2;
    color: #0f172a;
}

.resources-header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #001f3f;
    height: 120px;
    width: 100%;
    padding: 12px 20px;
}

.resources-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.resources-logo {
    display: block;
    width: min(260px, 45vw);
    height: auto;
    max-height: 92px;
    object-fit: contain;
}

.resources-panel {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    overflow: hidden;
    display: block;
    padding: 28px 20px 40px;
    background: #f2f2f2;
}

.resources-panel::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, 72vw);
    height: min(560px, 52vw);
    background-image: url('/howard_hendricks/public/assets/img/large-logo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 1;
    pointer-events: none;
}

.resources-tiles {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
    width: min(840px, 100%);
    margin: 0 auto;
    margin-top: 36px;
    transform: translateY(-18px);
}

.resource-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: min(260px, 30vw);
    min-height: 190px;
    padding: 18px 18px 16px;
    color: var(--resource-text, #fff);
    background: var(--resource-bg, #5d9ad7);
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.15;
    box-shadow: 0 14px 22px rgba(31, 69, 102, 0.18), inset 0 1px 0 rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    text-decoration: none;
}

.resource-tile--primary {
    background: var(--resource-bg, linear-gradient(180deg, #5d9ad7 0%, #4e87c8 100%));
}

.resource-tile--gold {
    background: var(--resource-bg, linear-gradient(180deg, #f5c75a 0%, #d9a42b 100%));
    color: var(--resource-text, #1b1b1b);
}

.resource-tile--soft {
    background: var(--resource-bg, linear-gradient(180deg, #7bc9eb 0%, #63b3d7 100%));
}

.resource-tile--dark {
    background: var(--resource-bg, linear-gradient(180deg, #1d3557 0%, #102238 100%));
}

.resource-tile__header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
    overflow: hidden;
    margin-top: 4px;
}

.resource-tile__badge {
    font-size: 1.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.resource-tile__sticker {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.resource-tile__text {
    display: block;
    width: 100%;
    min-height: 46px;
}

.resource-tile__label {
    display: block;
    width: 100%;
    letter-spacing: -0.02em;
    text-align: center;
    font-size: 1.08rem;
    line-height: 1.2;
}

.resource-tile__actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}

.resource-tile__action {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
}

.resource-tile__action--primary {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.resource-tile__action--secondary {
    background: rgba(16, 34, 56, 0.18);
    color: #fff;
}

.resources-group {
    position: relative;
    z-index: 1;
}

.resources-group__title {
    margin: 10px auto 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-soft);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.resources-empty {
    position: relative;
    z-index: 1;
    margin: 60px auto 0;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 820px) {
    .resources-header {
        height: 90px;
    }

    .resources-panel {
        min-height: calc(100vh - 90px);
        padding: 18px 16px 32px;
    }

    .resources-panel::before {
        width: min(620px, 90vw);
        height: min(420px, 62vw);
    }

    .resources-tiles {
        width: 100%;
        gap: 12px;
        margin-top: 28px;
        transform: translateY(-8px);
    }

    .resource-tile {
        width: min(170px, 44vw);
        min-height: 96px;
        font-size: .92rem;
        gap: 10px;
        padding: 14px 12px;
    }

    .resource-tile__icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 1.2rem;
    }

    .resource-tile__label {
        max-width: 90px;
    }
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #101a31;
    border: 1px solid rgba(131, 151, 190, .16);
    border-radius: 16px;
    padding: 38px 28px 26px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.login-brand, .brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-brand {
    align-items: center;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.login-logo {
    display: block;
    width: 178px;
    max-width: 70vw;
    height: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .24));
}

.login-brand h1 {
    margin: 18px 0 0;
    color: #f2f5ff;
    font-size: 24px;
}

.login-brand p {
    margin: 2px 0 0;
    color: #afc1ea;
    font-size: 14px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
}

.auth-page label {
    color: #b6c6ee;
}

input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

input[data-uppercase] {
    text-transform: uppercase;
}

.auth-page input {
    border-color: rgba(138, 161, 210, .32);
    background: rgba(8, 20, 46, .72);
    color: #cdd9f3;
    border-radius: 12px;
    padding: 11px 14px;
}

.auth-page input::placeholder {
    color: #9cb0dc;
}

.auth-page input:focus {
    border-color: rgba(255, 213, 74, .72);
    box-shadow: 0 0 0 3px rgba(255, 213, 74, .16);
}

.login-meta {
    margin-top: 18px;
    display: grid;
    gap: 8px;
    text-align: center;
    color: #afc1ea;
    font-size: 13px;
}

.login-meta p {
    margin: 0;
}

.public-link {
    color: #f7d66b;
    text-decoration: none;
    font-weight: 700;
}

.public-link:hover {
    text-decoration: underline;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    background: transparent;
    color: #5d6a87;
    border-radius: 8px;
    box-shadow: none;
}

.password-toggle svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.password-toggle:hover {
    background: rgba(15, 23, 42, .08);
}

input:focus, select:focus {
    border-color: transparent;
    box-shadow: var(--focus);
    outline: none;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 11px 16px;
    background: var(--brand);
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

button:hover { background: var(--brand-dark); }

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f2f4f7;
    color: var(--brand);
    font-weight: 700;
}

.button-link:hover {
    background: #e8edf3;
}

.button-link.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.button-secondary {
    background: #f2f4f7;
    color: var(--brand);
    border: 1px solid var(--line);
}

.button-secondary:hover {
    background: #e8edf3;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #8f1d15;
}

.alert {
    margin-top: 18px;
    padding: 12px;
    border-radius: 6px;
    background: #f3f4f6;
    color: var(--ink);
}

.alert.success-alert {
    background: rgba(21, 128, 61, .12);
    color: #166534;
    border: 1px solid rgba(21, 128, 61, .2);
}

.alert.danger-alert {
    background: rgba(180, 35, 24, .08);
    color: #991b1b;
    border: 1px solid rgba(180, 35, 24, .2);
}

.login-error-banner {
    margin-top: 14px;
    margin-bottom: 0;
    text-align: center;
    font-weight: 700;
    background: #dc2626;
    color: #ffffff;
}

.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.login-actions button {
    min-width: 82px;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #101828;
}

.login-actions button:hover {
    filter: brightness(1.04);
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #b6c6ee;
}

.remember-row input {
    width: 17px;
    height: 17px;
    padding: 0;
    accent-color: var(--accent);
}

.login-meta {
    margin-top: 22px;
    color: #9fb1dc;
    text-align: center;
    font-size: 13px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f2747 0%, #0b1c35 100%);
    color: #fff;
    padding: 22px;
    box-shadow: 8px 0 24px rgba(0, 31, 63, .12);
    overflow-y: auto;
}

.brand-logo {
    width: 54px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.22));
}

.brand span {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.68);
    font-size: 13px;
}

.sidebar nav,
.sidebar .main-nav {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.sidebar nav a,
.sidebar nav summary {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, .88);
    font-weight: 500;
    border: 1px solid transparent;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.sidebar nav a:hover,
.sidebar nav summary:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: #fff;
}

.sidebar nav a.is-active,
.sidebar nav summary.is-active {
    background: linear-gradient(135deg, rgba(116, 162, 224, .4), rgba(70, 117, 185, .3));
    color: #fff;
    font-weight: 700;
    border-color: rgba(151, 189, 240, .35);
}

.sidebar .nav-group {
    display: block;
}

.sidebar .nav-item-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.sidebar .nav-icon {
    width: 18px;
    height: 18px;
    opacity: .95;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(113deg) brightness(105%) contrast(101%);
    flex: 0 0 18px;
}

.sidebar .nav-group summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    position: relative;
}

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

.sidebar .nav-group summary::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    background: url('../img/icons/chevron-right.svg') center/14px 14px no-repeat;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(113deg) brightness(105%) contrast(101%);
    transform: translateY(-50%);
    opacity: .7;
}

.sidebar .nav-group[open] summary::after {
    transform: translateY(-50%) rotate(90deg);
}

.sidebar .nav-submenu {
    margin: 6px 0 2px 14px;
    padding: 8px 0 4px 10px;
    border-left: 1px solid rgba(255,255,255,.16);
    display: grid;
    gap: 6px;
}

.sidebar .nav-submenu a {
    padding: 7px 10px;
    font-size: 13.5px;
    border-radius: 8px;
    color: rgba(226, 236, 252, .9);
}

.sidebar .nav-sub-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar .nav-sub-icon {
    width: 12px;
    height: 12px;
    opacity: .8;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(113deg) brightness(105%) contrast(101%);
}

.shell {
    min-height: 100vh;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    overflow-x: clip;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 10px rgba(15, 23, 42, .04);
}

.topbar strong, .topbar span { display: block; }
.muted { color: var(--muted); font-size: 13px; }

.icon-button {
    background: #f2f4f7;
    color: var(--brand);
}

.content {
    padding: 28px;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.users-heading {
    margin-top: -14px;
    margin-bottom: 8px;
}

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

h1 {
    margin: 6px 0 8px;
    font-size: 32px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    max-width: 720px;
}

.user-stats-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.metrics article, .module-card, .table-wrap, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metrics article {
    padding: 18px;
}

.metrics span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.metrics strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    padding: 20px;
}

.module-card:hover {
    border-color: var(--brand);
}

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

.module-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.dashboard-hero {
    align-items: center;
}

.dashboard-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--brand);
    font-size: 14px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-kpi-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.dashboard-kpi-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eef4ff;
    font-size: 22px;
}

.dashboard-kpi-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-kpi-card strong {
    display: block;
    margin-top: 2px;
    color: var(--brand);
    font-size: 34px;
    line-height: 1.05;
}

.dashboard-focus-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-focus-card {
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #ffffff;
}

.dashboard-focus-card h2 {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 20px;
}

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

.dashboard-focus-card ul {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    line-height: 1.65;
}

.dashboard-focus-card strong {
    color: var(--brand);
}

.dashboard-module-grid {
    margin-top: 0;
}

.dashboard-module-card {
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.dashboard-module-card:hover {
    transform: translateY(-2px);
    border-color: #bfd2ef;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.dashboard-module-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.dashboard-module-emoji {
    font-size: 22px;
}

.dashboard-module-card h2 {
    margin: 0;
    color: var(--brand);
    font-size: 28px;
}

.dashboard-module-card p {
    margin: 10px 0 12px;
    color: #5b6f8c;
}

.dashboard-module-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0f4fbf;
}

.dashboard-module-link::after {
    content: ">";
    font-size: 12px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.toolbar-inline {
    justify-content: flex-end;
    margin: 0;
    min-width: min(520px, 46vw);
}

.toolbar input {
    max-width: 380px;
}

.toolbar-inline input {
    max-width: none;
}

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

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

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

.topbar-avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(180deg, #eff4fb, #dbe5f2);
    border: 2px solid rgba(0, 31, 63, .12);
    color: var(--brand);
    font-weight: 800;
    flex: 0 0 auto;
}

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

.profile-photo-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
}

.profile-photo-preview {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(180deg, #eff4fb, #dbe5f2);
    border: 2px solid rgba(0, 31, 63, .12);
    color: var(--brand);
    font-size: 30px;
    font-weight: 800;
    flex: 0 0 auto;
}

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

.profile-photo-copy strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.profile-photo-copy p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.profile-photo-upload {
    margin-top: 12px;
}

.profile-photo-upload input {
    background: #fff;
}

.curriculum-action-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 22px;
    border: 1px solid rgba(255, 213, 74, .65);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--brand-soft), var(--brand-dark));
    color: #fff7cf;
    box-shadow: 0 14px 30px rgba(0, 31, 63, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
    font-weight: 800;
    letter-spacing: .01em;
}

.curriculum-action-button:hover {
    background: linear-gradient(180deg, #0a2f5f, #00162d);
}

.curriculum-action-button:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.curriculum-action-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 213, 74, .12);
    color: var(--accent);
    font-size: 16px;
    line-height: 1;
}

.user-heading-actions {
    flex: 1 1 720px;
}

.user-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr);
    gap: 10px;
    min-width: min(320px, 100%);
}

.user-filter-bar input,
.user-filter-bar select {
    min-height: 40px;
    border-color: #d8dee8;
    background-color: #fff;
}

.user-filter-bar input:focus,
.user-filter-bar select:focus {
    border-color: #c9a24b;
    box-shadow: 0 0 0 3px rgba(201, 162, 75, .18);
}

.table-filter-th {
    min-width: 190px;
}

.table-filter-select {
    display: block;
    min-width: 100%;
    min-height: 38px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    padding-right: 28px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 8px;
}

.table-filter-select:focus {
    border: 0;
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 8px;
    box-shadow: none;
}

.table-filter-input {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
}

.table-filter-input::placeholder {
    color: #8792a3;
    font-weight: 500;
}

.table-filter-input:focus {
    border: 0;
    box-shadow: 0 0 0 3px rgba(201, 162, 75, .22);
}

.table-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: calc(100vh - 250px);
    border-radius: 14px;
}

.table-wrap table {
    min-width: 100%;
}

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.user-table-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #cfd8e3;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    color: #425466;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.user-count-badge [data-user-visible-count] {
    margin-right: 2px;
    color: inherit;
    font: inherit;
    font-weight: 800;
}

.table-summary .muted {
    color: var(--muted);
    font-size: 14px;
}

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

.panel {
    padding: 20px;
    min-width: 0;
    max-width: 100%;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.student-filters {
    position: sticky;
    top: 82px;
    z-index: 25;
    margin-bottom: 16px;
    padding: 14px;
}

.student-filters form {
    display: grid;
    grid-template-columns: minmax(180px, 1.45fr) repeat(4, minmax(112px, 1fr)) auto;
    gap: 10px;
    align-items: center;
}

.students-heading {
    margin-bottom: 14px;
}

.students-heading h1 {
    margin-bottom: 4px;
}

.students-heading p {
    font-size: 14px;
}

.students-heading .heading-actions button {
    min-height: 40px;
    padding: 9px 14px;
}

.student-filters input,
.student-filters select,
.student-filters .button-link {
    min-height: 40px;
    padding: 8px 12px;
}

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

.students-table th,
.students-table td {
    padding: 9px 12px;
    white-space: nowrap;
}
.concentrado-heading .inline-header-filters {
    min-width: 0;
}

.concentrado-heading-actions {
    flex: 1 1 auto;
    min-width: 0;
}

.concentrado-level-tabs {
    display: inline-flex;
    gap: 8px;
    margin: 0 0 12px;
}

.concentrado-level-tabs a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.concentrado-level-tabs a.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--accent);
}

.concentrado-filters-wrap {
    margin-bottom: 12px;
}

.concentrado-inline-filters {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.concentrado-inline-filters select {
    width: auto;
    min-width: 132px;
    flex: 0 0 132px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 15px;
}

.concentrado-group-filter {
    display: grid;
    gap: 4px;
}

.concentrado-group-filter select {
    min-width: 150px;
    flex-basis: 150px;
}

.concentrado-group-reason {
    margin: 0;
    max-width: 260px;
    color: #b45309;
    font-size: 12px;
    line-height: 1.35;
}

.concentrado-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.concentrado-inline-filters .table-filter-input {
    margin-left: 0;
    width: 180px;
    min-width: 160px;
    min-height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
}

.search-clear-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.search-clear-btn:hover {
    border-color: #c9a24b;
    color: #334155;
}

.concentrado-only-uploaded {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.concentrado-only-uploaded input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}
.concentrado-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.concentrado-stats article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.concentrado-stats span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.concentrado-stats strong {
    display: block;
    margin-top: 2px;
    color: var(--brand);
    font-size: 24px;
    line-height: 1.1;
}
.concentrado-table-wrap {
    max-height: calc(100vh - 260px);
}
.concentrado-table {
    min-width: 1180px;
    font-size: 13px;
}
.concentrado-table th {
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.concentrado-table td {
    white-space: nowrap;
    text-align: center;
    padding: 9px 10px;
}
.concentrado-table td:first-child,
.concentrado-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    text-align: left;
    min-width: 320px;
    max-width: 320px;
}
.concentrado-table th:first-child {
    background: #f8fafc;
    z-index: 3;
}
.concentrado-table td:nth-child(2),
.concentrado-table td:nth-child(3),
.concentrado-table th:nth-child(2),
.concentrado-table th:nth-child(3) {
    min-width: 70px;
}
.concentrado-table td:nth-child(4),
.concentrado-table th:nth-child(4) {
    min-width: 260px;
    text-align: left;
}
.concentrado-promedio {
    font-weight: 800;
    color: var(--brand);
}

.students-table td:nth-child(2) {
    min-width: 260px;
}

.table-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.table-summary-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.inline-header-filters {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: min(620px, 56vw);
}

.inline-header-filters .table-filter-input {
    min-width: 280px;
}

.auditoria-heading {
    align-items: flex-start;
}

.auditoria-heading-actions {
    align-self: flex-start;
}

.auditoria-table .table-filter-th {
    min-width: 190px;
}

.auditoria-table td,
.auditoria-table th {
    white-space: nowrap;
}

.auditoria-table .audit-resumen-cell {
    min-width: 280px;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.button-link-small {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 13px;
}

.audit-detail-modal .modal-header {
    margin-bottom: 10px;
}

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

.audit-detail-grid p {
    margin: 0;
    color: var(--ink);
}

.audit-detail-grid strong {
    color: var(--brand);
}

.audit-detail-resumen {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    white-space: normal;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

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

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

.config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
    min-width: 0;
    max-width: 100%;
}

.assignment-list-panel {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: 100%;
    padding: 16px;
    overflow: hidden;
}

[data-assignment-list-fragment] {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.assignment-list-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    min-height: 0;
}

.assignment-list-head h2 {
    margin-bottom: 3px;
}

.assignment-count {
    flex: 0 0 auto;
    align-self: center;
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    color: #425466;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.assignment-count [data-assignment-visible-count] {
    margin-right: 2px;
    color: inherit;
    font: inherit;
    font-weight: 800;
}

.assignment-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) minmax(150px, .75fr) minmax(210px, 1fr) minmax(170px, .85fr);
    gap: 10px;
    margin-bottom: 12px;
}

.assignment-filter-bar input,
.assignment-filter-bar select {
    min-height: 40px;
    border-color: #c9a24b;
    border-width: 2px;
    border-radius: 6px;
    background-color: #fff;
}

.assignment-filter-bar input:focus,
.assignment-filter-bar select:focus {
    border-color: #b98b2d;
    box-shadow: 0 0 0 3px rgba(201, 162, 75, .2);
}

.assignment-teacher-table-wrap {
    box-shadow: none;
}

.assignment-teacher-table th {
    color: var(--brand);
    font-size: 14px;
}

.assignment-teacher-table td {
    vertical-align: middle;
}

.assignment-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    max-width: 360px;
}

.assignment-summary .cell-note {
    flex-basis: 100%;
}

.assignment-actions {
    white-space: nowrap;
}

.teacher-assignment-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    align-items: start;
}

.teacher-modal-header {
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.teacher-modal-title h2 {
    margin-top: 2px;
    font-size: 28px;
}

.teacher-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.teacher-modal-meta span {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.teacher-assignment-level {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.teacher-assignment-level h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 15px;
}

.teacher-assignment-level h3 span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.teacher-assignment-level.level-card-maternal {
    border-color: var(--tag-maternal-line);
    background: #fff7ed;
}

.teacher-assignment-level.level-card-maternal h3 {
    color: var(--tag-maternal-ink);
}

.teacher-assignment-level.level-card-preescolar {
    border-color: var(--tag-preescolar-line);
    background: #f0fdf4;
}

.teacher-assignment-level.level-card-preescolar h3 {
    color: var(--tag-preescolar-ink);
}

.teacher-assignment-level.level-card-primaria {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.teacher-assignment-level.level-card-primaria h3 {
    color: var(--brand);
}

.teacher-assignment-group-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.teacher-assignment-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.teacher-assignment-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 7px 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.teacher-assignment-group > header strong {
    font-size: 20px;
}

.teacher-assignment-group > header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.teacher-assignment-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.teacher-assignment-subject {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 5px 6px 5px 9px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.teacher-assignment-subject span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.teacher-assignment-subject .chip-remove {
    width: 22px;
    height: 22px;
    min-width: 22px;
}

.teacher-subject-detail {
    display: grid;
    gap: 10px;
}

.teacher-subject-table-wrap {
    box-shadow: none;
}

.teacher-subject-table th {
    color: var(--brand);
    font-size: 14px;
}

.teacher-subject-table td {
    vertical-align: middle;
}

.teacher-subject-table th:first-child,
.teacher-subject-table td:first-child {
    width: 220px;
}

.teacher-subject-table th:nth-child(2),
.teacher-subject-table td:nth-child(2) {
    width: 260px;
}

.teacher-subject-groups-cell {
    min-width: 0;
}

.teacher-subject-group-line {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 3px 8px 3px 0;
}

.teacher-titular-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.teacher-titular-table th {
    background: #f8fafc;
    color: var(--brand);
    font-size: 14px;
}

.teacher-titular-table th:first-child,
.teacher-titular-table td:first-child {
    width: 150px;
}

.teacher-titular-table th:nth-child(2),
.teacher-titular-table td:nth-child(2) {
    width: 150px;
}

.teacher-titular-table tr:last-child td {
    border-bottom: 0;
}

.teacher-group-name {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--brand);
    font-size: 16px;
}

.teacher-titular-subject-cell {
    min-width: 0;
}

.teacher-titular-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.teacher-subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    margin: 0;
    padding: 5px 6px 5px 10px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}

.teacher-subject-chip span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.teacher-subject-chip.mini-tag-maternal {
    background: var(--tag-maternal-bg);
    color: var(--tag-maternal-ink);
    border-color: var(--tag-maternal-line);
}

.teacher-subject-chip.mini-tag-preescolar {
    background: var(--tag-preescolar-bg);
    color: var(--tag-preescolar-ink);
    border-color: var(--tag-preescolar-line);
}

.teacher-subject-chip.mini-tag-primaria {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
    border-color: var(--tag-primaria-bg);
}

.teacher-subject-chip .chip-remove {
    width: 21px;
    height: 21px;
    min-width: 21px;
}

.teacher-subject-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.teacher-subject-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.teacher-subject-card > header strong {
    color: var(--brand);
    font-size: 18px;
    text-transform: uppercase;
}

.teacher-subject-levels {
    display: grid;
    gap: 8px;
    padding: 10px 12px 12px;
}

.teacher-subject-level {
    display: grid;
    grid-template-columns: minmax(120px, .22fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.teacher-subject-level.level-card-maternal {
    border-color: var(--tag-maternal-line);
    background: #fff7ed;
}

.teacher-subject-level.level-card-preescolar {
    border-color: var(--tag-preescolar-line);
    background: #f0fdf4;
}

.teacher-subject-level.level-card-primaria {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.teacher-group-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.teacher-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 5px 6px 5px 10px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}

.teacher-group-chip.mini-tag-maternal {
    background: var(--tag-maternal-bg);
    color: var(--tag-maternal-ink);
    border-color: var(--tag-maternal-line);
}

.teacher-group-chip.mini-tag-preescolar {
    background: var(--tag-preescolar-bg);
    color: var(--tag-preescolar-ink);
    border-color: var(--tag-preescolar-line);
}

.teacher-group-chip.mini-tag-primaria {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
    border-color: var(--tag-primaria-bg);
}

.teacher-group-chip .chip-remove {
    width: 21px;
    height: 21px;
    min-width: 21px;
}

.chip-remove {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border-radius: 999px;
    background: #feeceb;
    color: var(--danger);
    line-height: 1;
}

.chip-remove:hover {
    background: var(--danger);
    color: #fff;
}

.assignment-empty {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
}

.assignment-tabs {
    margin-top: 0;
}

.assignment-panel {
    display: none;
}

.assignment-panel.is-active {
    display: block;
}

.assignment-panel.panel {
    grid-column: 1 / -1;
    max-width: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.assignment-panel + .assignment-list-panel {
    margin-top: 0;
}

.assignment-flow {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
}

.assignment-step {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.step-heading {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.step-heading h3 {
    margin: 0 0 2px;
    color: var(--brand);
    font-size: 18px;
}

.step-heading p {
    margin: 0;
}

.step-number {
    display: inline-grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--accent);
    font-weight: 900;
    background: var(--brand);
    border-radius: 999px;
}

.assignment-picker {
    display: grid;
    gap: 10px;
}

.assignment-level-block {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.assignment-level-block h4 {
    margin: 0;
    font-size: 16px;
}

.assignment-level-block.level-card-maternal h4 { color: var(--tag-maternal-ink); }
.assignment-level-block.level-card-preescolar h4 { color: var(--tag-preescolar-ink); }
.assignment-level-block.level-card-primaria h4 { color: var(--tag-primaria-bg); }

.assignment-grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 8px;
}

.assignment-grade-line {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 8px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
}

.assignment-grade-line > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.assignment-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
    gap: 10px;
}

.group-chip span {
    min-width: 34px;
    background: #fff;
}

.subject-choice {
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
}

.subject-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.subject-choice span {
    display: inline-flex;
}

.subject-choice-readonly {
    cursor: default;
}

.subject-choice:hover {
    filter: brightness(.98);
}

.subject-choice.is-selected {
    outline: 3px solid rgba(255, 213, 74, .42);
    outline-offset: 2px;
}

.subject-choice.mini-tag-especial.is-selected {
    background: var(--brand);
    color: var(--accent);
    border-color: var(--brand);
}

.mini-tag.subject-tag-inicial {
    background: var(--tag-inicial-bg);
    color: var(--tag-inicial-ink);
    border: 1px solid var(--tag-inicial-line);
}

.mini-tag.subject-tag-primaria {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
    border: 1px solid var(--tag-primaria-bg);
}

.mini-tag.subject-tag-mixta {
    background: var(--tag-mixta-bg);
    color: var(--tag-mixta-ink);
    border: 1px solid var(--tag-mixta-line);
}

.subject-choice.subject-tag-inicial.is-selected,
.subject-choice.subject-tag-mixta.is-selected {
    outline-color: rgba(21, 128, 61, .24);
}

.subject-choice.subject-tag-primaria.is-selected {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
    border-color: var(--tag-primaria-bg);
}

.assignment-preview {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

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

.assignment-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.button-small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.assignment-subject-block {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.assignment-subject-block + .assignment-subject-block {
    margin-top: 8px;
}

.assignment-subject-block h4 {
    margin: 0;
    color: var(--brand);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.assignment-subject-block.level-card-maternal {
    border-color: var(--tag-maternal-line);
    background: #fff7ed;
}

.assignment-subject-block.level-card-maternal h4 {
    color: var(--tag-maternal-ink);
}

.assignment-subject-block.level-card-preescolar {
    border-color: var(--tag-preescolar-line);
    background: #f0fdf4;
}

.assignment-subject-block.level-card-preescolar h4 {
    color: var(--tag-preescolar-ink);
}

.assignment-subject-block.level-card-primaria {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.assignment-subject-block.level-card-primaria h4 {
    color: var(--brand);
}

.assignment-subject-block.level-card-maternal .subject-choice {
    background: var(--tag-maternal-bg);
    color: var(--tag-maternal-ink);
    border-color: var(--tag-maternal-line);
}

.assignment-subject-block.level-card-preescolar .subject-choice {
    background: var(--tag-preescolar-bg);
    color: var(--tag-preescolar-ink);
    border-color: var(--tag-preescolar-line);
}

.assignment-subject-block.level-card-primaria .subject-choice {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
    border-color: var(--tag-primaria-bg);
}

.assignment-subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.assignment-subject-list:empty::after,
.assignment-subject-list.is-empty::after {
    content: "Selecciona un grupo para ver materias disponibles";
    color: var(--muted);
    font-size: 13px;
}

.config-tabs-row {
    position: sticky;
    top: 82px;
    z-index: 24;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 10px;
    background: rgba(246, 247, 251, .92);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.section-tabs {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
}

.config-tabs-row .section-tabs {
    position: static;
}

.section-tabs button {
    min-height: 38px;
    padding: 9px 14px;
    background: #f2f4f7;
    color: var(--brand);
    border: 1px solid var(--line);
}

.section-tabs button.is-active {
    background: var(--brand);
    color: var(--accent);
}

.assignment-tabs {
    margin-left: auto;
}

.config-section {
    display: none;
    min-width: 0;
    max-width: 100%;
}

.config-section.is-active {
    display: block;
}

.config-section > .panel,
.config-section > .config-grid {
    margin-bottom: 16px;
}

.config-inline-form {
    display: grid;
    grid-template-columns: minmax(140px, .75fr) minmax(220px, 1.5fr) minmax(140px, .75fr) auto;
    gap: 10px;
    align-items: end;
}

.materia-form {
    display: grid;
    grid-template-columns: minmax(140px, .75fr) minmax(220px, 1.4fr) minmax(140px, .65fr) auto;
    gap: 12px;
    align-items: end;
}

.materia-form-modal {
    grid-template-columns: minmax(140px, .75fr) minmax(220px, 1.35fr) minmax(140px, .6fr) minmax(130px, .55fr);
}

.placement-fieldset {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.placement-fieldset legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.level-picker {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(220px, 1fr) minmax(300px, 1.4fr);
    gap: 10px;
}

.level-picker-compact {
    grid-template-columns: 1fr;
    margin-top: 10px;
    width: min(520px, 72vw);
}

.level-card {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.level-card-maternal {
    border-color: var(--tag-maternal-line);
    background: #fff7ed;
}

.level-card-preescolar {
    border-color: var(--tag-preescolar-line);
    background: #f0fdf4;
}

.level-card-primaria {
    border-color: var(--tag-primaria-line);
    background: #eff6ff;
}

.level-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.level-card strong {
    color: var(--brand);
    font-size: 14px;
}

.level-card-maternal strong { color: var(--tag-maternal-ink); }
.level-card-preescolar strong { color: var(--tag-preescolar-ink); }
.level-card-primaria strong { color: var(--tag-primaria-bg); }

.tiny-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.tiny-check input {
    width: auto;
    padding: 0;
}

.grade-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.grade-chip {
    display: inline-flex;
    cursor: pointer;
}

.grade-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.grade-chip span {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.grade-chip input:checked + span {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--accent);
}

.grade-chip input:focus + span {
    box-shadow: var(--focus);
}

.tiny-check input,
.grade-chip input {
    width: auto;
    padding: 0;
}

.tag-cell {
    min-width: 180px;
}

.mini-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 2px 3px 2px 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.mini-tag-neutral {
    background: #f2f4f7;
    color: var(--muted);
}

.mini-tag-titular {
    background: var(--tag-titular-bg);
    color: var(--tag-titular-ink);
    border: 1px solid var(--tag-titular-line);
}

.mini-tag-especial {
    background: var(--tag-especial-bg);
    color: var(--tag-especial-ink);
    border: 1px solid var(--tag-especial-line);
}

.mini-tag-maternal {
    background: var(--tag-maternal-bg);
    color: var(--tag-maternal-ink);
}

.mini-tag-preescolar {
    background: var(--tag-preescolar-bg);
    color: var(--tag-preescolar-ink);
}

.mini-tag-primaria {
    background: var(--tag-primaria-bg);
    color: var(--tag-primaria-ink);
}

.mini-tag-muted {
    background: #f2f4f7;
    color: var(--muted);
}

.grade-summary-cell {
    min-width: 220px;
    color: var(--muted);
    font-size: 13px;
}

.grade-summary-cell span {
    display: block;
    line-height: 1.45;
}

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

.section-title-row h2 {
    margin: 0 0 4px;
}

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

.compact-table input,
.compact-table select {
    min-height: 36px;
    padding: 7px 9px;
}

.center-cell {
    text-align: center;
}

.center-cell input {
    width: auto;
}

.compact-form {
    margin-top: 0;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

.notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.notice-success {
    border-color: #a6d8b8;
    color: #05603a;
    background: #ecfdf3;
}

.notice-error {
    border-color: #f5b5b0;
    color: var(--danger);
    background: #fff1f0;
}

.cell-note {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-on {
    background: #ecfdf3;
    color: #05603a;
}

.status-off {
    background: #f2f4f7;
    color: #667085;
}

.action-cell {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.icon-action {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #f2f4f7;
    color: var(--brand);
    font-size: 17px;
}

.icon-action:hover {
    background: #e8edf3;
}

.icon-action-danger {
    background: #fff1f0;
}

.icon-action-danger:hover {
    background: #fee4e2;
}

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

.panel-card {
    display: grid;
    gap: 18px;
}

.panel-section {
    background: rgba(255,255,255,.9);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
}

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

.eyebrow {
    margin: 0 0 6px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

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

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title-row h2 {
    margin: 0;
}

.panel-title-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #eef3fa;
    color: var(--brand);
    font-size: 18px;
}

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

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.field-label .required-mark {
    line-height: 1;
}

.form-span-3 {
    grid-column: 1 / -1;
}

.form-note {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.required-mark {
    color: var(--danger);
    font-weight: 800;
}

.button-primary-wide {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(180deg, var(--brand-soft), var(--brand-dark));
    color: var(--accent);
    box-shadow: 0 10px 24px rgba(0, 31, 63, .14);
}

.button-primary-wide:hover {
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

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

.upload-help {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #d9e4f3;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.document-table-wrap {
    margin-top: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

.document-table td:first-child {
    min-width: 220px;
}

.document-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.document-file-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef3fa;
    color: var(--brand);
    font-size: 16px;
}

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

.document-actions form {
    margin: 0;
}

.document-actions .icon-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-on {
    background: #e7f8ed;
    color: #15803d;
}

.status-off {
    background: #fee4e2;
    color: #b42318;
}

.cell-note {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

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

@media (max-width: 1100px) {
    .grid-2,
    .form-grid-3,
    .document-upload-grid {
        grid-template-columns: 1fr;
    }

    .form-span-3 {
        grid-column: auto;
    }
}

.document-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.empty-state {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

th, td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
    background: #f8fafc;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.sort-link span {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #eef2f7;
    color: #8090a8;
    font-size: 11px;
}
.profile-photo-trigger-shell {
    overflow: visible;
    background: linear-gradient(180deg, #f2f7ff, #e3ebf7);
    border: 1px solid rgba(0, 31, 63, .08);
}

.profile-photo-trigger {
    all: unset;
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    cursor: pointer;
}

.profile-photo-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.profile-photo-trigger-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 31, 63, .24);
}

.profile-photo-hint {
    margin: 3px 0 0;
    font-size: 12px;
}

.sort-link:hover,
.sort-link.is-active {
    color: var(--brand);
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
}

.sort-link.is-active span {
    background: var(--brand);
    color: var(--accent);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .45);
}

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

.modal-card {
    width: min(620px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
    padding: 22px;
}

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

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

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

.modal-header h2 {
    margin: 4px 0 0;
    font-size: 24px;
}

.modal-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

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

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
}

.toast {
    padding: 13px 14px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
    animation: toast-in .18s ease-out;
}

.toast-success {
    border-color: #a6d8b8;
    color: #05603a;
    background: #ecfdf3;
}

.toast-error {
    border-color: #f5b5b0;
    color: var(--danger);
    background: #fff1f0;
}

.toast-warning {
    border-color: #fcd34d;
    color: #92400e;
    background: #fffbeb;
}

.toast-hide {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.captura-filtros-panel {
    margin-bottom: 14px;
}

.captura-filtros-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

/* Filtros en línea dentro del heading */
.captura-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.captura-heading-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.captura-filtros-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.captura-filtros-inline label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    gap: 4px;
    min-width: 200px;
}

.captura-filtros-inline select {
    padding: 7px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
}

.captura-header {
    margin-bottom: 12px;
}

.captura-period-alert {
    margin-bottom: 12px;
    border-color: #fbbf24;
    background: #fffbeb;
    color: #92400e;
}

.captura-input-cell {
    min-width: 150px;
}

.captura-input-cell input {
    width: 100%;
    border: 1.5px solid #94a3b8;
    border-radius: 6px;
    padding: 7px 10px;
    background: #fff;
}

.captura-input-cell input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    outline: none;
}

.captura-input-cell input[disabled] {
    border: 1.5px solid #cbd5e1;
    background: #e5e7eb;
    color: #64748b;
    cursor: not-allowed;
}

.captura-grid-table th {
    white-space: nowrap;
    vertical-align: bottom;
}

.captura-grid-table th small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
}

.captura-grid-table td:first-child,
.captura-grid-table th:first-child {
    min-width: 280px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

.captura-grid-table th:first-child {
    background: #f8fafc;
    z-index: 3;
}

.captura-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.captura-row-actions {
    white-space: nowrap;
    min-width: 110px;
}

.captura-lock-chip {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 11px;
    font-weight: 700;
}

.captura-lock-chip::before {
    content: "\1F512";
    margin-right: 6px;
    font-size: 11px;
}

.button-small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
}

.captura-edit-btn {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
    border: 1px solid #d97706;
}

.captura-edit-btn:hover {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    color: #111827;
}

.captura-save-btn {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: 1px solid #1e40af;
}

.captura-save-btn:hover {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
}

/* ── Textarea inline de observación ─────────────────────────────────────── */
.captura-obs-textarea {
    width: 100%;
    min-width: 180px;
    min-height: 88px;
    padding: 7px 10px;
    border: 1.5px solid #94a3b8;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    resize: vertical;
    line-height: 1.45;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.captura-obs-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.14);
    outline: none;
}

.captura-obs-textarea:disabled {
    background: #e5e7eb;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    resize: none;
}

.obs-char-counter {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
}

.obs-counter-near {
    color: #dc2626;
    font-weight: 600;
}

/* ── Modal informativo: límite de caracteres ─────────────────────────────── */
.obs-info-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .40);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.obs-info-dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.16);
    width: 100%;
    max-width: 380px;
    padding: 32px 28px 24px;
    text-align: center;
}

.obs-info-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.obs-info-close:hover { background: #f1f5f9; color: #1e293b; }

.obs-info-icon {
    font-size: 36px;
    color: #2563eb;
    margin-bottom: 10px;
}

.obs-info-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
}

.obs-info-body {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px;
}

.obs-info-ok {
    width: 100%;
}


.captura-grid-table tr[data-row-locked="1"] td {
    color: inherit;
}

.captura-grid-table tr[data-row-locked="1"] .captura-input-cell {
    background: #f3f4f6;
}

.captura-grid-table tr[data-period-locked="1"] .captura-row-actions {
    opacity: .9;
}

.captura-grid-table tr[data-row-locked="1"] input[disabled] {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.captura-grid-table tr[data-row-editing="1"] .captura-input-cell {
    background: #eff6ff;
}

.captura-grid-table tr[data-row-editing="1"] td:first-child {
    border-left: 3px solid #2563eb;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
    .app-page {
        display: block;
        padding-left: 0;
    }

    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .shell {
        width: auto;
        margin-left: 0;
    }

    .metrics, .module-grid, .split-layout, .config-grid {
        grid-template-columns: 1fr;
    }

    .concentrado-stats {
        grid-template-columns: 1fr 1fr;
    }

    .concentrado-level-tabs {
        display: flex;
        flex-wrap: wrap;
    }

    .dashboard-focus-grid {
        grid-template-columns: 1fr;
    }

    .page-heading, .section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .heading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-header-filters {
        min-width: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .inline-header-filters .table-filter-input {
        min-width: 0;
    }

    .concentrado-inline-filters .table-filter-input {
        margin-left: 0;
        width: 100%;
    }

    .concentrado-inline-filters {
        flex-wrap: wrap;
    }

    .concentrado-group-filter {
        width: 100%;
    }

    .concentrado-group-filter select {
        min-width: 0;
        width: 100%;
    }

    .concentrado-group-reason {
        max-width: none;
    }

    .concentrado-inline-filters select {
        min-width: 0;
        flex: 1 1 auto;
        width: 100%;
    }

    .concentrado-heading-actions {
        min-width: 0;
    }

    .concentrado-search-wrap {
        margin-left: 0;
        width: 100%;
    }

    .user-filter-bar {
        grid-template-columns: 1fr;
        min-width: 0;
    }

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

    .table-wrap {
        max-height: none;
    }

    .captura-filtros-form {
        grid-template-columns: 1fr;
    }

    .user-table-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar, .toolbar {
        align-items: stretch;
        flex-direction: column;
        height: auto;
        padding: 16px;
    }

    .topbar {
        position: static;
    }

    .student-filters {
        position: static;
    }

    .section-tabs {
        position: static;
        overflow-x: auto;
    }

    .student-filters form, .form-grid, .config-inline-form, .materia-form, .materia-form-modal, .level-picker {
        grid-template-columns: 1fr;
    }

    .assignment-flow, .assignment-controls {
        grid-template-columns: 1fr;
    }

    .assignment-filter-bar {
        grid-template-columns: 1fr;
    }

    .assignment-list-head,
    .teacher-modal-header,
    .teacher-assignment-group > header {
        align-items: stretch;
        flex-direction: column;
    }

    .assignment-count {
        align-self: flex-start;
    }

    .teacher-assignment-group-grid,
    .teacher-assignment-subjects {
        grid-template-columns: 1fr;
    }

    .teacher-assignment-detail {
        grid-template-columns: 1fr;
    }

    .teacher-subject-level {
        grid-template-columns: 1fr;
    }


    .level-picker-compact {
        width: min(420px, 78vw);
    }

    .toolbar-inline {
        min-width: 0;
        padding: 0;
    }

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