.tenant-app {
    --adtech-primary: #4f46e5;
    --adtech-primary-600: #4338ca;
    --adtech-primary-soft: rgba(79, 70, 229, 0.2);
    --adtech-surface: #ffffff;
    --adtech-muted: #f4f7ff;
    --adtech-page: #f6f8fc;
    background: var(--adtech-page);
}

/* ── AL_Alunos filtros ─────────────────────────────────── */
.alunos-filtros {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.alunos-pesquisa {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.alunos-pesquisa-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.9rem;
}

.alunos-pesquisa-input {
    padding-left: 2.25rem !important;
}

.alunos-filtro-estado,
.alunos-filtro-turma {
    min-width: 160px;
}

.alunos-table-wrapper {
    overflow-x: auto;
    margin-top: 1.2rem;
    width: 100%;
}
.alunos-table-scroll {
    max-height: 480px;
    overflow-y: auto;
    width: 100%;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(43,92,255,0.06);
}

.alunos-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0.5rem 0.2rem 0.5rem;
    font-size: 1.01rem;
    color: #334155;
    background: none;
    margin-top: 0.2rem;
}
.alunos-table-info {
    font-weight: 600;
}
.alunos-table-paginacao {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.alunos-table-paginacao button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.alunos-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(43,92,255,0.06);
    font-size: 1.05rem;
    min-width: 900px;
    margin: 0;
    table-layout: auto;
}

.alunos-table th {
    background: #f3f6ff;
    color: #1e293b;
    font-weight: 800;
    padding: 1.1rem 0.9rem 1.1rem 1.2rem;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    letter-spacing: 0.01em;
    font-size: 1.08em;
}

.alunos-table td {
    padding: 1.05rem 0.9rem 1.05rem 1.2rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background: #fff;
}

.alunos-table tr:last-child td {
    border-bottom: none;
}

.aluno-nome {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 600;
    color: #1e293b;
}

.avatar-mini {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b5cff, #1f4fd1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 2px 8px rgba(43,92,255,0.13);
    border: 2px solid #fff;
}

.estado-ativo {
    color: #22c55e;
    font-weight: 700;
    background: #e7fbe9;
    padding: 0.32em 1.1em;
    border-radius: 999px;
    font-size: 1em;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px rgba(34,197,94,0.07);
}
.estado-inativo {
    color: #dc2626;
    font-weight: 700;
    background: #fee2e2;
    padding: 0.32em 1.1em;
    border-radius: 999px;
    font-size: 1em;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px rgba(220,38,38,0.07);
}

.kt-btn-table {
    background: #f3f6ff;
    color: #1f4fd1;
    border: none;
    border-radius: 8px;
    padding: 0.45em 1.2em;
    font-size: 1em;
    margin-right: 0.3em;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.15s, color 0.15s;
    box-shadow: 0 1px 4px rgba(43,92,255,0.07);
    outline: none;
}
.kt-btn-table:hover {
    background: #e0e7ff;
    color: #1e40af;
}

@media (max-width: 1200px) {
    .alunos-table {
        min-width: 700px;
        font-size: 0.98rem;
    }
    .aluno-nome span {
        font-size: 1rem;
    }
}

@media (max-width: 900px) {
    .alunos-table {
        min-width: 520px;
        font-size: 0.93rem;
    }
    .aluno-nome span {
        font-size: 0.95rem;
    }
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #312e81 0%, #3730a3 45%, #1e3a8a 100%);
    border-right: 1px solid rgba(226, 232, 240, 0.2);
    padding: 1.5rem 1.2rem;
    gap: 1.5rem;
}

.sidebar-header {
    display: grid;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    height: 44px;
    width: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--adtech-primary), var(--adtech-primary-600));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.brand-label {
    font-size: 0.8rem;
    color: #c7d2fe;
}

.brand-school {
    font-weight: 600;
    color: #ffffff;
}

.sidebar-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.75rem;
    width: fit-content;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.sidebar-menu {
    display: grid;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.menu-item,
.menu-group summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    color: #cbd5f5;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.menu-item i,
.menu-group summary i {
    font-size: 1.1rem;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-left: 4px solid #93c5fd;
    border-radius: 0 10px 10px 0;
}

.menu-sub a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
    border-left: 4px solid #93c5fd;
    border-radius: 0 8px 8px 0;
}

.menu-group summary.group-active {
    color: #ffffff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
    border-left: 4px solid #93c5fd;
    border-radius: 0 10px 10px 0;
}

.menu-group summary.group-active i {
    color: #ffffff;
}

.menu-item:hover,
.menu-group summary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.menu-group {
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.24);
    padding: 0.35rem;
    border: 1px solid rgba(226, 232, 240, 0.12);
}

.menu-group summary {
    list-style: none;
}

.menu-group summary::-webkit-details-marker {
    display: none;
}

.menu-sub {
    display: grid;
    gap: 0.35rem;
    padding: 0.2rem 0.75rem 0.75rem 2.2rem;
}

.menu-sub a,
.menu-sub-group summary {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

.menu-item-btn.menu-item-popover {
    justify-content: flex-start;
    color: #cbd5f5;
}

.menu-item-btn.menu-item-popover:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.menu-sub a:hover,
.menu-sub-group summary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.menu-item-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    color: #64748b;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

.menu-item-btn:hover {
    background: #eef2ff;
    color: #0f172a;
}

.menu-sub-group {
    display: grid;
    gap: 0.3rem;
}

.menu-sub-group summary {
    list-style: none;
    cursor: pointer;
}

.menu-sub-group summary::-webkit-details-marker {
    display: none;
}

.menu-sub-group a {
    padding-left: 1rem;
}

.sidebar-support {
    margin-top: auto;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    gap: 0.6rem;
}

.support-title {
    font-weight: 600;
}

.support-text {
    color: #64748b;
    font-size: 0.85rem;
}

.support-link {
    color: var(--adtech-primary);
    font-weight: 600;
    text-decoration: none;
}

.tenant-app aside {
    background: var(--adtech-surface);
}

.tenant-app nav a {
    transition: all 0.2s ease;
}

.tenant-app nav a:hover {
    background: var(--adtech-muted);
}

.tenant-app header {
    backdrop-filter: blur(12px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 2.5rem;
    background: #0b1b3a;
    color: #e2e8f0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.topbar-title {
    font-weight: 600;
}

.topbar-divider {
    width: 1px;
    height: 16px;
    background: rgba(148, 163, 184, 0.4);
}

.topbar-meta {
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.85rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-link {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
}

.topbar-link:hover {
    background: rgba(148, 163, 184, 0.3);
}

.icon-button {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    display: grid;
    place-items: center;
}

.icon-button i {
    font-size: 1.1rem;
}

.badge {
    /*position: absolute;*/
    top: -4px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.profile-menu {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    cursor: pointer;
    list-style: none;
}

.profile-button::-webkit-details-marker {
    display: none;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #1e293b;
    font-size: 0.7rem;
    font-weight: 700;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: 46px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 14px;
    padding: 0.6rem;
    min-width: 180px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
    display: grid;
    gap: 0.4rem;
    z-index: 10;
}

.profile-dropdown a {
    text-decoration: none;
    color: #0f172a;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.profile-action {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    text-align: left;
    font-size: 0.85rem;
    color: #0f172a;
    cursor: pointer;
}

.profile-action:hover {
    background: #f1f5f9;
}

.profile-dropdown a:hover {
    background: #f1f5f9;
}

.mobile-menu-drawer {
    display: none;
    position: relative;
}

.mobile-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.mobile-menu-trigger::-webkit-details-marker {
    display: none;
}

.mobile-menu-surface {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: min(340px, calc(100vw - 2rem));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    display: grid;
    gap: 0.65rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #312e81 0%, #3730a3 45%, #1e3a8a 100%);
    border: 1px solid rgba(226, 232, 240, 0.18);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
    z-index: 30;
}

.mobile-menu-surface .menu-item,
.mobile-menu-surface .menu-group summary {
    color: #cbd5f5;
}

.mobile-menu-surface .menu-item-btn {
    color: #cbd5e1;
}

.mobile-menu-surface .menu-item-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.mobile-menu-group {
    background: rgba(15, 23, 42, 0.24);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: #ffffff;
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.app-header p {
    color: #64748b;
    max-width: 32rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: #94a3b8;
}

.tenant-app .kt-btn-primary {
    background: linear-gradient(135deg, var(--adtech-primary), var(--adtech-primary-600));
    border: none;
}

.tenant-app .kt-btn-outline {
    border-color: #cbd5f5;
}

.app-main {
    padding: 2rem 2.5rem 2.5rem;
    display: grid;
    gap: 2rem;
    background: var(--adtech-page);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--adtech-surface);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 18px 32px rgba(148, 163, 184, 0.18);
    display: grid;
    gap: 0.6rem;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.85rem;
}

.stat-header i {
    font-size: 1.2rem;
    color: var(--adtech-primary-600);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

.stat-meta.positive {
    color: #16a34a;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card-panel {
    background: var(--adtech-surface);
    border-radius: 20px;
    padding: 1.6rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 20px 36px rgba(148, 163, 184, 0.2);
    display: grid;
    gap: 1.2rem;
}

.card-panel.span-2 {
    grid-column: span 2;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-header p {
    font-size: 0.85rem;
    color: #64748b;
}

.card-header a {
    color: var(--adtech-primary);
    font-size: 0.85rem;
    text-decoration: none;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.workflow-grid div {
    background: #f3f6ff;
    border-radius: 14px;
    padding: 0.9rem;
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
}

.workflow-grid div strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.workflow-highlight {
    background: #ffffff;
    border: 1px solid rgba(43, 92, 255, 0.2);
    box-shadow: 0 12px 24px rgba(43, 92, 255, 0.12);
}

.workflow-highlight strong {
    font-size: 0.95rem;
}

.workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.workflow-actions a {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(43, 92, 255, 0.12);
    color: #1f4fd1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
}

.workflow-actions a:hover {
    background: rgba(43, 92, 255, 0.2);
}

.workflow-grid strong {
    color: #0f172a;
    font-size: 1.1rem;
}

.shortcut-list {
    display: grid;
    gap: 0.7rem;
}

.shortcut-list a {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: #f3f6ff;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shortcut-list a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(148, 163, 184, 0.2);
}

.aparencia-popover {
    width: min(420px, calc(100vw - 2rem));
    max-height: min(88vh, 620px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    padding: 0;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
    inset: 0;
    margin: auto;
    overflow: hidden;
}

.configuracao-escola-popover {
    width: min(420px, calc(100vw - 2rem));
    max-height: min(88vh, 620px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    padding: 0;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
    inset: 0;
    margin: auto;
    overflow: hidden;
}

.aparencia-popover::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.configuracao-escola-popover::backdrop {
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
}

.aparencia-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.aparencia-popover-header p {
    margin: .2rem 0 0;
    color: #64748b;
    font-size: .85rem;
}

.aparencia-popover-body {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    overflow-y: auto;
}

.aparencia-popover-body p {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
}

@media (max-width: 640px) {
    .aparencia-popover,
    .configuracao-escola-popover {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
}

@media (max-width: 1200px) {
    .card-panel.span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 1024px) {
    .tenant-app {
        background: #f8fafc;
    }

    .topbar-left {
        gap: 0.65rem;
    }

    .mobile-menu-drawer {
        display: block;
    }
}

@media (max-width: 900px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-divider {
        display: none;
    }

    .topbar-title {
        width: 100%;
    }

    .topbar-meta {
        display: inline-flex;
    }
}

:root[data-tema="escuro"] .tenant-app {
    --adtech-primary: #4c7dff;
    --adtech-primary-600: #6fa0ff;
    --adtech-primary-soft: rgba(76, 125, 255, 0.18);
    --adtech-surface: #111827;
    --adtech-muted: #1f2937;
    --adtech-page: #0b1220;
    color: #e2e8f0;
    background: var(--adtech-page);
}

:root[data-tema="escuro"] .sidebar {
    background: #0f172a;
    border-right-color: rgba(148, 163, 184, 0.25);
}

:root[data-tema="escuro"] .sidebar-status {
    background: rgba(76, 125, 255, 0.2);
    color: #e2e8f0;
}

:root[data-tema="escuro"] .menu-item,
:root[data-tema="escuro"] .menu-group summary {
    color: #cbd5f5;
}

:root[data-tema="escuro"] .menu-item.active {
    background: rgba(248, 113, 113, 0.18) !important;
    color: #fca5a5 !important;
    border-left: 4px solid #fca5a5;
    border-radius: 0 10px 10px 0;
}

:root[data-tema="escuro"] .menu-sub a.active {
    background: rgba(248, 113, 113, 0.18) !important;
    color: #fca5a5 !important;
    border-left: 4px solid #fca5a5;
    border-radius: 0 10px 10px 0;
}

:root[data-tema="escuro"] .menu-group summary.group-active {
    color: #fca5a5 !important;
    background: rgba(248, 113, 113, 0.12);
    border-left: 4px solid #fca5a5;
    border-radius: 0 10px 10px 0;
}
:root[data-tema="escuro"] .menu-group summary.group-active i {
    color: #fca5a5 !important;
}

:root[data-tema="escuro"] .menu-group {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.2);
}

:root[data-tema="escuro"] .menu-sub a,
:root[data-tema="escuro"] .menu-sub-group summary {
    color: #94a3b8;
}

:root[data-tema="escuro"] .menu-sub a:hover,
:root[data-tema="escuro"] .menu-sub-group summary:hover {
    background: #1f2937;
    color: #e2e8f0;
}

:root[data-tema="escuro"] .sidebar-support,
:root[data-tema="escuro"] .menu-item.active {
    background: #1f2937;
}

:root[data-tema="escuro"] .topbar {
    background: #050814;
}

:root[data-tema="escuro"] .topbar-link,
:root[data-tema="escuro"] .icon-button,
:root[data-tema="escuro"] .profile-button {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.3);
}

:root[data-tema="escuro"] .app-header,
:root[data-tema="escuro"] .stat-card,
:root[data-tema="escuro"] .card-panel {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.2);
}

:root[data-tema="escuro"] .app-header p,
:root[data-tema="escuro"] .stat-header,
:root[data-tema="escuro"] .stat-meta,
:root[data-tema="escuro"] .card-header p,
:root[data-tema="escuro"] .workflow-grid div,
:root[data-tema="escuro"] .shortcut-list a {
    color: #cbd5f5;
}

:root[data-tema="escuro"] .workflow-grid div,
:root[data-tema="escuro"] .shortcut-list a {
    background: #1f2937;
}

:root[data-tema="escuro"] .workflow-grid div strong {
    color: #e2e8f0;
}

:root[data-tema="escuro"] .workflow-highlight {
    background: #0f172a;
    border-color: rgba(76, 125, 255, 0.3);
}

:root[data-tema="escuro"] .workflow-actions a {
    background: rgba(76, 125, 255, 0.2);
    color: #cbd5f5;
}

:root[data-tema="escuro"] .profile-dropdown,
:root[data-tema="escuro"] .profile-dropdown a,
:root[data-tema="escuro"] .profile-action {
    background: #111827;
    color: #e2e8f0;
}

:root[data-tema="escuro"] .profile-dropdown a:hover,
:root[data-tema="escuro"] .profile-action:hover {
    background: #1f2937;
}

/* ============================================================================
   Ajuste de contraste do menu lateral (tema claro)
   ============================================================================ */

:root:not([data-tema="escuro"]) .tenant-app .sidebar {
    background: linear-gradient(165deg, #1e3a8a 0%, #1d4ed8 46%, #0f766e 100%);
    border-right-color: rgba(226, 232, 240, 0.22);
}

:root:not([data-tema="escuro"]) .tenant-app .brand-label {
    color: #c7d2fe;
}

:root:not([data-tema="escuro"]) .tenant-app .brand-school {
    color: #ffffff;
}

:root:not([data-tema="escuro"]) .tenant-app .sidebar-status {
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
}

:root:not([data-tema="escuro"]) .tenant-app .menu-item,
:root:not([data-tema="escuro"]) .tenant-app .menu-group summary,
:root:not([data-tema="escuro"]) .tenant-app .menu-sub a,
:root:not([data-tema="escuro"]) .tenant-app .menu-sub-group summary {
    color: #dbeafe;
}

:root:not([data-tema="escuro"]) .tenant-app .menu-group {
    background: rgba(15, 23, 42, 0.2);
    border-color: rgba(226, 232, 240, 0.16);
}

:root:not([data-tema="escuro"]) .tenant-app .menu-item:hover,
:root:not([data-tema="escuro"]) .tenant-app .menu-group summary:hover,
:root:not([data-tema="escuro"]) .tenant-app .menu-sub a:hover,
:root:not([data-tema="escuro"]) .tenant-app .menu-sub-group summary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

:root:not([data-tema="escuro"]) .tenant-app .menu-item.active,
:root:not([data-tema="escuro"]) .tenant-app .menu-sub a.active,
:root:not([data-tema="escuro"]) .tenant-app .menu-group summary.group-active {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-left: 4px solid #93c5fd;
    border-radius: 0 10px 10px 0;
}

:root:not([data-tema="escuro"]) .tenant-app .menu-group summary.group-active i {
    color: #ffffff !important;
}

/* =============================================================================
   Anos Letivos — Lista + Detalhe
   ============================================================================= */

/* ── Page header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 2.5rem 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0.15rem 0;
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.page-header p {
    color: #64748b;
    font-size: 0.92rem;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

/* ── Button variants ─────────────────────────────────────── */
.qs-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.qs-btn-secondary:hover { background: #e2e8f0; }

.qs-btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
}

.qs-btn-success:hover { background: linear-gradient(135deg, #15803d, #166534); }

.qs-btn-sm {
    padding: .35rem .85rem;
    font-size: 0.85rem;
}

/* ── Alerts ──────────────────────────────────────────────── */
.form-alert {
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: .9rem;
    font-weight: 500;
    margin: 0 2.5rem .75rem;
    border-left: 4px solid;
}

.form-alert-error   { background: #fef2f2; border-color: #ef4444; color: #b91c1c; }
.form-alert-success { background: #f0fdf4; border-color: #22c55e; color: #15803d; }

/* ── Panel card ──────────────────────────────────────────── */
.panel-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(43,92,255,0.06);
    margin: .5rem 2.5rem 1.5rem;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
}

.panel-card-inner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

/* ── Form helpers ────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .75rem;
}

.field-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
}

.form-input {
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    padding: .5rem .75rem !important;
    font-size: .93rem;
    width: 100%;
    background: #fff;
    color: #1e293b;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--adtech-primary) !important;
    box-shadow: 0 0 0 3px var(--adtech-primary-soft) !important;
}

.form-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: .75rem;
    border-top: 1px solid #f1f5f9;
}

.form-card {
    max-width: 720px;
}

/* ── Loading & empty states ──────────────────────────────── */
.loading-state {
    color: #64748b;
    font-size: .95rem;
    padding: 2rem;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.empty-icon { margin-bottom: 1rem; }

.empty-state-inline {
    color: #94a3b8;
    font-size: .9rem;
    padding: 1.5rem 0;
    text-align: center;
}

/* ── Anos Letivos table ──────────────────────────────────── */
.al-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .95rem;
}

.al-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .7rem 1rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.al-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e293b;
    background: #fff;
}

.al-table tr:last-child td { border-bottom: none; }

.al-table-compact th,
.al-table-compact td { padding: .55rem .75rem; }

.al-row-active { background: #f0fdf4 !important; }
.al-row-inactive td { color: #94a3b8; }

.al-actions-col { width: 120px; text-align: center; }

.al-actions { display: flex; gap: .35rem; justify-content: center; align-items: center; }

.al-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
    padding: .3rem .5rem;
    transition: background .15s;
    text-decoration: none;
    background: #f1f5f9;
    color: #334155;
}

.al-btn:hover { background: #e2e8f0; }

.al-btn-icon { width: 32px; height: 32px; padding: 0; }

.al-btn-activar { color: #16a34a; background: #f0fdf4; }
.al-btn-activar:hover { background: #dcfce7; }

.al-btn-danger { color: #dc2626; background: #fef2f2; }
.al-btn-danger:hover { background: #fee2e2; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: .22em .8em;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.badge-success   { background: #dcfce7; color: #15803d; }
.badge-warning   { background: #fef9c3; color: #a16207; }
.badge-info      { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: #f1f5f9; color: #64748b; }
.badge-default   { background: #f1f5f9; color: #64748b; }

.al-code {
    font-family: 'Courier New', monospace;
    font-size: .82em;
    background: #f1f5f9;
    color: #334155;
    border-radius: 5px;
    padding: .15em .5em;
    border: 1px solid #e2e8f0;
}

.al-code-lg {
    font-size: 1rem;
    padding: .2em .65em;
}

/* ── Detalhe header ──────────────────────────────────────── */
.al-detalhe-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 2.5rem 1rem;
    flex-wrap: wrap;
}

.al-detalhe-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.al-meta-text {
    color: #64748b;
    font-size: .9rem;
}

.al-detalhe-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

/* ── Tabs ────────────────────────────────────────────────── */
.al-tabs {
    display: flex;
    gap: .3rem;
    padding: 0 2.5rem .25rem;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.al-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    border: none;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: #64748b;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.al-tab:hover { background: #f8fafc; color: #334155; }

.al-tab-active {
    background: #fff;
    color: var(--adtech-primary);
    border-bottom: 2px solid var(--adtech-primary);
    box-shadow: 0 -2px 8px rgba(43,92,255,.06);
}

.al-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--adtech-primary-soft);
    color: var(--adtech-primary);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

/* ── Section headers ─────────────────────────────────────── */
.al-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.al-section-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.al-form-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem;
}

/* ── Currículo resumo ────────────────────────────────────── */
.al-curriculo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.25rem;
}

.al-curriculo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.4rem 1rem;
    gap: .35rem;
}

.al-curriculo-valor {
    font-size: 2rem;
    font-weight: 800;
    color: var(--adtech-primary);
}

.al-curriculo-label {
    font-size: .82rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.al-curriculo-hint {
    font-size: .9rem;
    color: #64748b;
    margin-top: .5rem;
}

.al-curriculo-hint a {
    color: var(--adtech-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ── Button base + variants ──────────────────────────────── */
.qs-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: 8px;
    border: none;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s, opacity .15s;
    text-decoration: none;
    white-space: nowrap;
}

.qs-btn:active { transform: scale(0.97); }

.qs-btn:disabled,
.qs-btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.qs-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
}

.qs-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #1f4fd1, #1840c0); }

.qs-btn-ghost {
    background: transparent;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.qs-btn-ghost:hover { background: #f8fafc; }

.qs-btn-outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.qs-btn-outline:hover { background: #eff6ff; }

.qs-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.qs-btn-warning:hover:not(:disabled) { background: linear-gradient(135deg, #d97706, #b45309); }

/* ── Badge extra ─────────────────────────────────────────── */
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ── Modal global ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-container {
    background: var(--surface, #fff);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: .35rem;
    border-radius: 6px;
    color: #64748b;
    line-height: 1;
    transition: background .15s;
}

.modal-close:hover { background: #f1f5f9; }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* ── Toast sucesso ───────────────────────────────────────── */
.toast-sucesso {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #16a34a;
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 6px 20px rgba(22,163,74,.35);
    z-index: 2000;
    animation: toast-in .25s ease both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-header,
    .al-detalhe-header { padding: 1.25rem 1rem .75rem; }
    .panel-card { margin: .4rem 1rem 1rem; padding: 1rem; }
    .form-alert { margin: 0 1rem .5rem; }
    .al-tabs { padding: 0 1rem .25rem; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ─── Horário — grelha semanal ─────────────────────────────── */
.horario-grelha .tempo-col { min-width: 80px; }
.horario-grelha .tempo-ordem { font-weight: 600; font-size: .8rem; color: var(--muted-foreground); }
.horario-grelha .tempo-hora { font-size: .75rem; color: var(--muted-foreground); }
.horario-grelha .celula-ocupada { background: var(--accent); vertical-align: top; padding: .25rem; }
.horario-grelha .celula-livre { min-width: 100px; }
.atribuicao-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: .375rem; padding: .35rem .5rem; font-size: .8rem; }
.atribuicao-disciplina { font-weight: 600; color: var(--foreground); }
.atribuicao-professor { color: var(--muted-foreground); }
.atribuicao-sala { color: var(--muted-foreground); font-style: italic; }
.atribuicao-remover { position: absolute; top: .2rem; right: .2rem; background: none; border: none; cursor: pointer; color: var(--destructive); padding: 0; font-size: .75rem; }
.atribuicao-remover:hover { color: var(--destructive-foreground); }
