/* =====================================================
   COLÉGIO HENRIQUES — STYLE PROFISSIONAL
   Base visual + Login + Dashboard + Abas + Cards
===================================================== */

/* ==============================
   BASE GLOBAL
============================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1d4ed8;
    --primary-dark: #0f172a;
    --primary-soft: #eff6ff;

    --secondary: #0f766e;
    --secondary-soft: #ecfdf5;

    --gold: #f59e0b;
    --gold-soft: #fffbeb;

    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --success: #16a34a;
    --success-soft: #f0fdf4;

    --warning: #f59e0b;
    --warning-soft: #fffbeb;

    --info: #2563eb;
    --info-soft: #eff6ff;

    --bg-login: #e0f2fe;
    --bg-dashboard: #f1f5f9;

    --card: #ffffff;
    --field: #f8fafc;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --shadow-xs: 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 10px 26px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);

    --gradient-primary: linear-gradient(135deg, #2563eb, #1e3a8a);
    --gradient-dark: linear-gradient(135deg, #0f172a, #1e293b);
    --gradient-success: linear-gradient(135deg, #16a34a, #14532d);
    --gradient-danger: linear-gradient(135deg, #dc2626, #7f1d1d);
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg-dashboard);
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

.screen {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    color: var(--primary-dark);
    letter-spacing: -0.025em;
}

strong {
    font-weight: 900;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==============================
   BOTÕES
============================== */

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    font-size: 14px;
    transition:
            transform 0.15s ease,
            opacity 0.15s ease,
            filter 0.15s ease,
            box-shadow 0.15s ease,
            background 0.15s ease;
}

button:hover {
    filter: brightness(0.98);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    min-height: 44px;
    border-radius: 999px;
    padding: 12px 18px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}

.btn-primary {
    color: #ffffff;
    background: var(--gradient-primary);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
    color: var(--primary-dark);
    background: #ffffff;
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.btn-danger {
    color: #ffffff;
    background: var(--gradient-danger);
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.18);
}

.btn-danger:hover {
    filter: brightness(0.95);
}

/* ==============================
   FORMULÁRIOS
============================== */

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--field);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition:
            background 0.15s ease,
            border-color 0.15s ease,
            box-shadow 0.15s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

@media (min-width: 900px) {
    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =====================================================
   LOGIN
===================================================== */

body.login-page {
    background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 30%),
            radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.28), transparent 32%),
            linear-gradient(180deg, #f8fafc 0%, #e0f2fe 45%, #bfdbfe 100%);
}

.login-screen {
    max-width: 480px;
    padding: 26px 18px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-top-visual {
    min-height: 42vh;
    padding-top: 34px;
    background:
            radial-gradient(circle at 80% 20%, rgba(255,255,255,.75), transparent 18%),
            radial-gradient(circle at 20% 75%, rgba(255,255,255,.55), transparent 16%);
}

.login-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-logo-wrap,
.login-logo,
.brand-logo {
    width: 78px;
    height: 78px;
}

.login-logo,
.brand-logo {
    object-fit: contain;
    background: #ffffff;
    padding: 9px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-brand-text h1,
.brand h1 {
    font-size: 30px;
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.9px;
    color: var(--primary-dark);
}

.login-brand-text p,
.brand p {
    margin-top: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

.login-intro {
    margin-top: 34px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-xs);
}

.login-intro h2 {
    margin: 0;
    font-size: 23px;
    color: var(--primary-dark);
    font-weight: 950;
}

.login-intro p {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.login-bottom-card,
.auth-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 34px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.75);
    margin-bottom: 18px;
    animation: fadeLoginCard 0.22s ease;
}

.login-title {
    font-size: 30px;
    font-weight: 950;
    color: var(--primary);
    margin-bottom: 16px;
    letter-spacing: -0.7px;
}

.login-helper {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.auth-card-header {
    margin-bottom: 18px;
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 950;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.auth-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

body.login-page .btn-primary,
body.login-page .btn-secondary {
    width: 100%;
}

.btn-link-cadastro {
    margin-top: 12px;
}

@keyframes fadeLoginCard {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 430px) {
    .login-screen {
        padding-left: 16px;
        padding-right: 16px;
    }

    .login-bottom-card,
    .auth-card {
        border-radius: 30px;
        padding: 22px;
    }

    .login-title {
        font-size: 27px;
    }

    .auth-card h2 {
        font-size: 21px;
    }

    .login-intro {
        border-radius: 22px;
        padding: 16px;
    }
}

/* =====================================================
   DASHBOARD
===================================================== */

body.dashboard-page {
    background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28%),
            radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 28%),
            linear-gradient(180deg, #f8fafc 0%, #eef3fb 100%);
}

.dashboard-screen {
    max-width: 1320px;
    width: 100%;
    padding: 22px;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 1320px;
    margin: 0 auto 20px;
    padding: 12px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(248, 250, 252, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand h1 {
    font-size: 25px;
}

.brand p {
    color: var(--muted);
}

.dashboard-header .btn-secondary {
    width: auto;
    min-width: auto;
    padding: 10px 15px;
    border-radius: 999px;
}

/* Áreas por perfil */
#area-admin,
#area-professor,
#area-aluno,
#area-secretaria,
#area-director {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#area-admin.hidden,
#area-professor.hidden,
#area-aluno.hidden,
#area-secretaria.hidden,
#area-director.hidden {
    display: none !important;
}

/* ==============================
   ABAS DO DASHBOARD
============================== */

.dashboard-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 9px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 4px 14px;
    margin-bottom: 18px;
    background: transparent;
    border: none;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.dashboard-tabs::-webkit-scrollbar {
    height: 5px;
}

.dashboard-tabs::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 999px;
}

.dashboard-tabs::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.dashboard-tab-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-soft);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.dashboard-tab-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 950;
}

.dashboard-tab-btn.active {
    background: var(--gradient-primary);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.dashboard-tab-btn.active span {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.dashboard-tab-btn:hover {
    transform: translateY(-1px);
}

/* Conteúdo das abas */
.dashboard-tab-content {
    display: none !important;
}

.dashboard-tab-content.active {
    display: block !important;
}

/* Bloqueio seguro por data attributes */
body.dashboard-page [data-tab-perfil] {
    display: none !important;
}

body.dashboard-page [data-tab-perfil].active {
    display: block !important;
}

/* ==============================
   GRUPOS E CARDS
============================== */

.dashboard-section-group {
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 30px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(8px);
}

.dashboard-section-title {
    margin: 0 0 18px;
    padding: 0 4px 14px;
    border-bottom: 1px solid #dbe4f0;
}

.dashboard-section-title h2 {
    margin: 0;
    font-size: 20px;
    color: var(--primary-dark);
    font-weight: 950;
}

.dashboard-section-title p {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 16px;
    overflow: hidden;
}

.dashboard-section-group .dashboard-card:last-child {
    margin-bottom: 0;
}

.dashboard-card > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 13px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--primary-dark);
    font-size: 21px;
    line-height: 1.2;
    font-weight: 950;
}

.dashboard-card > h2::before {
    content: "";
    width: 8px;
    height: 25px;
    border-radius: 999px;
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.dashboard-card > p {
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* Botões no dashboard */
body.dashboard-page .dashboard-card > button,
body.dashboard-page .dashboard-card > .btn-primary,
body.dashboard-page .dashboard-card > .btn-secondary {
    margin-top: 8px;
    margin-bottom: 8px;
}

body.dashboard-page .dashboard-card button + button {
    margin-left: 6px;
}

.card-header-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.card-header-between h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 950;
}

.card-header-between p {
    margin-top: 5px;
    font-size: 13px;
}

@media (min-width: 768px) {
    body.dashboard-page .btn-primary,
    body.dashboard-page .btn-secondary,
    body.dashboard-page .btn-danger,
    body.dashboard-page button {
        width: auto;
        min-width: 140px;
    }

    body.dashboard-page .dashboard-card > button,
    body.dashboard-page .dashboard-card > .btn-primary,
    body.dashboard-page .dashboard-card > .btn-secondary {
        width: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 165px;
    }
}

@media (max-width: 760px) {
    .dashboard-screen {
        padding: 16px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 14px;
    }

    .brand h1 {
        font-size: 22px;
    }

    .dashboard-section-group {
        padding: 15px;
        border-radius: 24px;
    }

    .dashboard-card {
        padding: 18px;
        border-radius: 22px;
    }

    .card-header-between {
        flex-direction: column;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-row button,
    .actions-row .btn-primary,
    .actions-row .btn-secondary,
    .actions-row .btn-danger {
        width: 100%;
    }
}

/* =====================================================
   RESULTADOS / LISTAS — PROFISSIONAL
===================================================== */

.info-box {
    position: relative;
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 6px solid var(--primary);
    border-radius: 20px;
    padding: 16px 17px;
    margin-bottom: 13px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.info-box:last-child {
    margin-bottom: 0;
}

.info-box strong {
    display: block;
    padding-right: 18px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
    letter-spacing: -0.015em;
}

.info-box span,
.info-box p,
.info-box small {
    display: block;
    margin-top: 6px;
    color: #475569;
    font-size: 12.8px;
    line-height: 1.6;
}

.info-box button {
    margin-top: 12px;
    margin-right: 6px;
}

.info-box::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 17px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #cbd5e1;
    opacity: 0.9;
}

.estado-presente,
.estado-aprovado {
    border-left-color: var(--success);
    background: linear-gradient(135deg, #ffffff, var(--success-soft));
}

.estado-atraso,
.estado-recurso {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, #ffffff, var(--warning-soft));
}

.estado-falta,
.estado-reprovado {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, #ffffff, var(--danger-soft));
}

.estado-justificada {
    border-left-color: var(--info);
    background: linear-gradient(135deg, #ffffff, var(--info-soft));
}

.estado-presente::after,
.estado-aprovado::after {
    background: var(--success);
}

.estado-atraso::after,
.estado-recurso::after {
    background: var(--warning);
}

.estado-falta::after,
.estado-reprovado::after {
    background: var(--danger);
}

.estado-justificada::after {
    background: var(--info);
}

/* ==============================
   CONTAINERS DE RESULTADOS
============================== */

#lista-calendario-trimestres,
#lista-cursos,
#lista-disciplinas,
#lista-plano-curricular,
#lista-turmas,
#lista-horarios,
#lista-professores,
#lista-alunos,
#lista-usuarios,
#lista-solicitacoes,
#lista-liberacoes-academicas,
#lista-auditoria,
#relatorio-presencas,
#lista-aulas-professor,
#alunos-aula-professor,
#grelha-notas-professor,
#relatorio-professor-presencas,
#relatorio-professor-notas,
#perfil-completo-aluno,
#lista-notificacoes-aluno,
#lista-horario-aluno,
#lista-presencas-aluno,
#lista-notas-aluno,
#boletim-aluno,
#resultado-aluno,
#resultado-final-aluno,
#historico-academico-aluno,
#resultado-pesquisa-aluno,
#resumo-director,
#relatorio-turmas-director,
#relatorio-professores-director,
#relatorio-academico-director,
#lista-materiais-professor,
#lista-materiais-aluno,
#financeiro-dividas-turma,
#financeiro-alunos-divida,
#financeiro-pagamentos-recentes {
    margin-top: 18px;
    padding: 15px;
    background: rgba(248, 250, 252, 0.88);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

#lista-calendario-trimestres:empty,
#lista-cursos:empty,
#lista-disciplinas:empty,
#lista-plano-curricular:empty,
#lista-turmas:empty,
#lista-horarios:empty,
#lista-professores:empty,
#lista-alunos:empty,
#lista-usuarios:empty,
#lista-solicitacoes:empty,
#lista-liberacoes-academicas:empty,
#lista-auditoria:empty,
#relatorio-presencas:empty,
#lista-aulas-professor:empty,
#alunos-aula-professor:empty,
#grelha-notas-professor:empty,
#relatorio-professor-presencas:empty,
#relatorio-professor-notas:empty,
#perfil-completo-aluno:empty,
#lista-notificacoes-aluno:empty,
#lista-horario-aluno:empty,
#lista-presencas-aluno:empty,
#lista-notas-aluno:empty,
#boletim-aluno:empty,
#resultado-aluno:empty,
#resultado-final-aluno:empty,
#historico-academico-aluno:empty,
#resultado-pesquisa-aluno:empty,
#resumo-director:empty,
#relatorio-turmas-director:empty,
#relatorio-professores-director:empty,
#relatorio-academico-director:empty,
#lista-materiais-professor:empty,
#lista-materiais-aluno:empty,
#financeiro-dividas-turma:empty,
#financeiro-alunos-divida:empty,
#financeiro-pagamentos-recentes:empty {
    display: none;
}

/* =====================================================
   TABELAS — PROFISSIONAL
===================================================== */

.table-responsive,
.tabela-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
}

.table,
.tabela-relatorio,
.tabela-notas-professor,
.tabela-director-turmas,
.tabela-director-professores,
.tabela-director-academico,
.tabela-plano-curricular,
.financeiro-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    font-size: 13px;
    box-shadow: var(--shadow-xs);
}

.tabela-director-turmas {
    min-width: 900px;
}

.tabela-director-professores {
    min-width: 980px;
}

.tabela-director-academico {
    min-width: 1050px;
}

.table thead th,
.tabela-relatorio thead th,
.tabela-notas-professor thead th,
.tabela-director-turmas thead th,
.tabela-director-professores thead th,
.tabela-director-academico thead th,
.tabela-plano-curricular thead th,
.financeiro-table thead th {
    background: var(--gradient-dark);
    color: #ffffff;
    padding: 13px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    white-space: nowrap;
    border-bottom: 1px solid #1e293b;
}

.table tbody td,
.tabela-relatorio tbody td,
.tabela-notas-professor tbody td,
.tabela-director-turmas tbody td,
.tabela-director-professores tbody td,
.tabela-director-academico tbody td,
.tabela-plano-curricular tbody td,
.financeiro-table tbody td {
    padding: 13px 14px;
    color: #334155;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    line-height: 1.45;
}

.table tbody tr:last-child td,
.tabela-relatorio tbody tr:last-child td,
.tabela-notas-professor tbody tr:last-child td,
.tabela-director-turmas tbody tr:last-child td,
.tabela-director-professores tbody tr:last-child td,
.tabela-director-academico tbody tr:last-child td,
.tabela-plano-curricular tbody tr:last-child td,
.financeiro-table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:nth-child(even) td,
.tabela-relatorio tbody tr:nth-child(even) td,
.tabela-notas-professor tbody tr:nth-child(even) td,
.tabela-director-turmas tbody tr:nth-child(even) td,
.tabela-director-professores tbody tr:nth-child(even) td,
.tabela-director-academico tbody tr:nth-child(even) td,
.tabela-plano-curricular tbody tr:nth-child(even) td,
.financeiro-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.table tbody tr:hover td,
.tabela-relatorio tbody tr:hover td,
.tabela-notas-professor tbody tr:hover td,
.tabela-director-turmas tbody tr:hover td,
.tabela-director-professores tbody tr:hover td,
.tabela-director-academico tbody tr:hover td,
.tabela-plano-curricular tbody tr:hover td,
.financeiro-table tbody tr:hover td {
    background: #eff6ff;
}

.table td strong,
.tabela-relatorio td strong,
.tabela-notas-professor td strong,
.tabela-director-turmas td strong,
.tabela-director-professores td strong,
.tabela-director-academico td strong,
.tabela-plano-curricular td strong,
.financeiro-table td strong {
    color: #0f172a;
    font-weight: 950;
}

.table small,
.tabela-relatorio small,
.tabela-notas-professor small,
.tabela-director-turmas small,
.tabela-director-professores small,
.tabela-director-academico small,
.tabela-plano-curricular small,
.financeiro-table small {
    color: #64748b;
    font-size: 12px;
}

/* Botões dentro de tabelas */
.table button,
.tabela-relatorio button,
.tabela-notas-professor button,
.tabela-director-turmas button,
.tabela-director-professores button,
.tabela-director-academico button,
.tabela-plano-curricular button,
.financeiro-table button {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    margin: 2px;
    min-width: auto;
}

/* ==============================
   VALORES E CORES
============================== */

.numero-verde,
.fin-valor-pago {
    color: #15803d !important;
    font-weight: 950;
}

.numero-amarelo,
.fin-valor-pendente {
    color: #b45309 !important;
    font-weight: 950;
}

.numero-vermelho,
.fin-valor-atrasado {
    color: #b91c1c !important;
    font-weight: 950;
}

.valor-destaque {
    color: #1d4ed8;
    font-weight: 950;
}

.text-muted {
    color: var(--muted);
}

/* =====================================================
   BADGES / ETIQUETAS
===================================================== */

.badge,
.badge-auditoria,
.badge-login,
.badge-criar,
.badge-editar,
.badge-apagar,
.badge-justificar,
.badge-relatorio,
.badge-default,
.badge-senha-pendente,
.badge-senha-definida {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-default {
    background: #f1f5f9;
    color: #334155;
}

.badge-login {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-criar {
    background: #f0fdf4;
    color: #15803d;
}

.badge-editar {
    background: #fffbeb;
    color: #b45309;
}

.badge-apagar {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-justificar {
    background: #f5f3ff;
    color: #6d28d9;
}

.badge-relatorio {
    background: #ecfeff;
    color: #0e7490;
}

.badge-senha-pendente {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.badge-senha-definida {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* =====================================================
   AUDITORIA — RESUMO E FILTROS
===================================================== */

.auditoria-resumo-grid,
.resumo-grid,
.cards-resumo {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.auditoria-card,
.resumo-card,
.card-resumo {
    position: relative;
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.auditoria-card::before,
.resumo-card::before,
.card-resumo::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--primary);
}

.auditoria-card span,
.resumo-card span,
.card-resumo span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 9px;
}

.auditoria-card strong,
.resumo-card strong,
.card-resumo strong {
    display: block;
    color: var(--primary-dark);
    font-size: 23px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.auditoria-descricao {
    max-width: 420px;
    line-height: 1.55;
}

/* =====================================================
   FICHA DO ALUNO / ABAS INTERNAS
===================================================== */

.ficha-aluno,
.secretaria-ficha,
.aluno-ficha-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-xs);
}

.ficha-header,
.aluno-ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    background: var(--gradient-dark);
    color: #ffffff;
    margin-bottom: 18px;
}

.ficha-header h2,
.aluno-ficha-header h2,
.ficha-header h3,
.aluno-ficha-header h3 {
    color: #ffffff;
    margin-bottom: 6px;
}

.ficha-header p,
.aluno-ficha-header p {
    color: #cbd5e1;
    font-size: 13px;
}

.ficha-meta,
.aluno-ficha-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ficha-meta span,
.aluno-ficha-meta span {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.ficha-tabs,
.aluno-tabs,
.secretaria-tabs-internas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    padding: 8px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ficha-tabs button,
.aluno-tabs button,
.secretaria-tabs-internas button {
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 950;
    min-width: auto;
}

.ficha-tabs button.active,
.aluno-tabs button.active,
.secretaria-tabs-internas button.active {
    background: var(--gradient-primary);
    color: #ffffff;
    border-color: transparent;
}

/* =====================================================
   NOTAS / PRESENÇAS / AULAS
===================================================== */

.aula-card,
.presenca-card,
.nota-card {
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
}

.aula-card h3,
.presenca-card h3,
.nota-card h3 {
    font-size: 16px;
    font-weight: 950;
    margin-bottom: 7px;
}

.aula-card p,
.presenca-card p,
.nota-card p {
    font-size: 13px;
}

.estado-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.estado-pill.presente {
    background: #f0fdf4;
    color: #15803d;
}

.estado-pill.atraso {
    background: #fffbeb;
    color: #b45309;
}

.estado-pill.falta {
    background: #fef2f2;
    color: #b91c1c;
}

.estado-pill.justificada {
    background: #eff6ff;
    color: #1d4ed8;
}

/* =====================================================
   EMPTY STATES / MENSAGENS
===================================================== */

.empty-state,
.financeiro-empty-state {
    padding: 26px 18px;
    border-radius: 22px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    text-align: center;
}

.empty-state strong,
.financeiro-empty-state strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
    margin-bottom: 7px;
}

.empty-state span,
.financeiro-empty-state span {
    display: block;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

/* =====================================================
   RESPONSIVIDADE DAS LISTAS E TABELAS
===================================================== */

@media (max-width: 900px) {
    .auditoria-resumo-grid,
    .resumo-grid,
    .cards-resumo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ficha-header,
    .aluno-ficha-header {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    #lista-calendario-trimestres,
    #lista-cursos,
    #lista-disciplinas,
    #lista-plano-curricular,
    #lista-turmas,
    #lista-horarios,
    #lista-professores,
    #lista-alunos,
    #lista-usuarios,
    #lista-solicitacoes,
    #lista-liberacoes-academicas,
    #lista-auditoria,
    #relatorio-presencas,
    #lista-aulas-professor,
    #alunos-aula-professor,
    #grelha-notas-professor,
    #relatorio-professor-presencas,
    #relatorio-professor-notas,
    #perfil-completo-aluno,
    #lista-notificacoes-aluno,
    #lista-horario-aluno,
    #lista-presencas-aluno,
    #lista-notas-aluno,
    #boletim-aluno,
    #resultado-aluno,
    #resultado-final-aluno,
    #historico-academico-aluno,
    #resultado-pesquisa-aluno,
    #resumo-director,
    #relatorio-turmas-director,
    #relatorio-professores-director,
    #relatorio-academico-director,
    #lista-materiais-professor,
    #lista-materiais-aluno,
    #financeiro-dividas-turma,
    #financeiro-alunos-divida,
    #financeiro-pagamentos-recentes {
        padding: 11px;
        border-radius: 18px;
    }

    .info-box {
        padding: 15px;
        border-radius: 18px;
    }

    .info-box button {
        width: 100%;
        margin-right: 0;
    }

    .auditoria-resumo-grid,
    .resumo-grid,
    .cards-resumo {
        grid-template-columns: 1fr;
    }

    .table,
    .tabela-relatorio,
    .tabela-notas-professor,
    .tabela-director-turmas,
    .tabela-director-professores,
    .tabela-director-academico,
    .tabela-plano-curricular,
    .financeiro-table {
        min-width: 720px;
        font-size: 12px;
    }
}

/* =====================================================
   PARTE 3 — MÓDULOS ESPECIAIS, FINANCEIRO, MATERIAIS
   ACÇÕES, IMPRESSÃO E AJUSTES FINAIS
===================================================== */

/* =====================================================
   FINANCEIRO — PAINEL PROFISSIONAL
===================================================== */

.financeiro-hero {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 22px;
    padding: 28px;
    margin-bottom: 22px;
    border-radius: 30px;
    background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 34%),
            linear-gradient(135deg, #0f172a, #1e293b 58%, #0f172a);
    color: #ffffff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.financeiro-hero h2 {
    margin: 8px 0 8px;
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -0.05em;
    color: #ffffff;
}

.financeiro-hero p {
    max-width: 760px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.65;
}

.financeiro-label,
.financeiro-section-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.financeiro-hero-box {
    min-width: 260px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.financeiro-hero-box strong {
    font-size: 28px;
    font-weight: 950;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: -0.04em;
}

.financeiro-hero-box span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.financeiro-filtros-card {
    border-top: 5px solid var(--primary);
}

.financeiro-actions {
    margin-top: 8px;
}

.financeiro-alerta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 16px;
    padding: 16px 17px;
    border-radius: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.financeiro-alerta strong {
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 950;
}

.financeiro-alerta span {
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
}

.financeiro-resumo-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.financeiro-card {
    position: relative;
    overflow: hidden;
    padding: 19px;
    min-height: 136px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-xs);
}

.financeiro-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: #64748b;
}

.financeiro-card.principal::before {
    background: #2563eb;
}

.financeiro-card.pago::before {
    background: #16a34a;
}

.financeiro-card.pendente::before {
    background: #f59e0b;
}

.financeiro-card.atrasado::before {
    background: #dc2626;
}

.financeiro-card.divida::before {
    background: #7c2d12;
}

.financeiro-card.registos::before {
    background: #475569;
}

.financeiro-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.financeiro-card strong {
    display: block;
    color: #0f172a;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}

.financeiro-card small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.financeiro-grid-secundario {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: start;
}

.financeiro-section-card {
    border: 1px solid #e2e8f0;
}

.financeiro-section-card .financeiro-section-label {
    background: #eff6ff;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.financeiro-aluno-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-xs);
}

.financeiro-aluno-card strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
    margin-bottom: 5px;
}

.financeiro-aluno-card span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
}

.financeiro-aluno-valores {
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.financeiro-aluno-valores b {
    color: #0f172a;
    font-weight: 950;
}

/* Acções de mensalidade */
.acoes-mensalidade {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.acoes-mensalidade .btn-secondary {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 999px;
    white-space: nowrap;
    min-height: 34px;
}

/* =====================================================
   MATERIAIS DA TURMA
===================================================== */

.material-card,
.material-item,
.material-professor-card,
.material-aluno-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 6px solid var(--primary);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.material-card:last-child,
.material-item:last-child,
.material-professor-card:last-child,
.material-aluno-card:last-child {
    margin-bottom: 0;
}

.material-card h3,
.material-item h3,
.material-professor-card h3,
.material-aluno-card h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 950;
}

.material-card p,
.material-item p,
.material-professor-card p,
.material-aluno-card p {
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.material-meta,
.material-info,
.material-detalhes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.material-meta span,
.material-info span,
.material-detalhes span {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 800;
}

.material-acoes,
.material-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.material-acoes button,
.material-actions button {
    min-height: 36px;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 12px;
    min-width: auto;
}

.badge-material,
.badge-material-ficheiro,
.badge-material-link,
.badge-material-aviso {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-material-ficheiro {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-material-link {
    background: #ecfdf5;
    color: #047857;
}

.badge-material-aviso {
    background: #fffbeb;
    color: #b45309;
}

/* =====================================================
   RECUPERAÇÃO / DEFINIÇÃO DE SENHA
===================================================== */

.senha-page,
body.senha-page {
    background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30%),
            linear-gradient(180deg, #f8fafc 0%, #dbeafe 100%);
}

.senha-card,
.definir-senha-card,
.recuperar-senha-card {
    max-width: 520px;
    width: calc(100% - 32px);
    margin: 48px auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 32px;
    padding: 30px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-lg);
}

.senha-card h1,
.definir-senha-card h1,
.recuperar-senha-card h1,
.senha-card h2,
.definir-senha-card h2,
.recuperar-senha-card h2 {
    font-size: 25px;
    font-weight: 950;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.senha-card p,
.definir-senha-card p,
.recuperar-senha-card p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

/* =====================================================
   DOCUMENTOS / IMPRESSÕES INTERNAS
===================================================== */

.documento-card,
.relatorio-card,
.impressao-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow-xs);
}

.documento-header,
.relatorio-header,
.impressao-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border-radius: 22px;
    background: var(--gradient-dark);
    color: #ffffff;
    margin-bottom: 18px;
}

.documento-header h2,
.relatorio-header h2,
.impressao-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 950;
}

.documento-header p,
.relatorio-header p,
.impressao-header p {
    color: #cbd5e1;
    font-size: 13px;
}

.documento-logo,
.relatorio-logo,
.impressao-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #ffffff;
    padding: 7px;
    border-radius: 18px;
}

.documento-actions,
.relatorio-actions,
.impressao-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* =====================================================
   DIRECTOR — RESUMOS E PAINÉIS
===================================================== */

.director-resumo-grid,
.director-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.director-card,
.director-resumo-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.director-card::before,
.director-resumo-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--primary);
}

.director-card span,
.director-resumo-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.director-card strong,
.director-resumo-card strong {
    display: block;
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 950;
}

/* =====================================================
   AJUSTES DE BOTÕES EM ÁREAS GRANDES
===================================================== */

.dashboard-card .btn-primary,
.dashboard-card .btn-secondary,
.dashboard-card .btn-danger,
.info-box .btn-primary,
.info-box .btn-secondary,
.info-box .btn-danger {
    box-shadow: var(--shadow-xs);
}

.dashboard-card .btn-primary:hover,
.dashboard-card .btn-secondary:hover,
.dashboard-card .btn-danger:hover,
.info-box .btn-primary:hover,
.info-box .btn-secondary:hover,
.info-box .btn-danger:hover {
    transform: translateY(-1px);
}

/* Botões em sequência */
.button-group,
.botoes-acoes,
.acoes-linha {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* =====================================================
   SCROLLBAR PROFISSIONAL
===================================================== */

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #f1f5f9;
}

*::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* =====================================================
   PRINT GLOBAL
===================================================== */

@media print {
    body {
        background: #ffffff !important;
    }

    .dashboard-header,
    .dashboard-tabs,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    button,
    .actions-row,
    .documento-actions,
    .relatorio-actions,
    .impressao-actions {
        display: none !important;
    }

    .dashboard-screen,
    .dashboard-section-group,
    .dashboard-card {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    .dashboard-tab-content {
        display: block !important;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }
}

/* =====================================================
   RESPONSIVIDADE FINAL
===================================================== */

@media (max-width: 1200px) {
    .financeiro-resumo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .financeiro-grid-secundario {
        grid-template-columns: 1fr;
    }

    .director-resumo-grid,
    .director-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .financeiro-hero {
        flex-direction: column;
        padding: 22px;
    }

    .financeiro-hero-box {
        min-width: 100%;
    }

    .financeiro-resumo-grid {
        grid-template-columns: 1fr;
    }

    .financeiro-aluno-card {
        flex-direction: column;
    }

    .financeiro-aluno-valores {
        text-align: left;
        min-width: 100%;
    }

    .director-resumo-grid,
    .director-cards-grid {
        grid-template-columns: 1fr;
    }

    .documento-header,
    .relatorio-header,
    .impressao-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-group,
    .botoes-acoes,
    .acoes-linha,
    .material-acoes,
    .material-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group button,
    .botoes-acoes button,
    .acoes-linha button,
    .material-acoes button,
    .material-actions button {
        width: 100%;
    }

    .senha-card,
    .definir-senha-card,
    .recuperar-senha-card {
        margin: 28px auto;
        padding: 24px;
        border-radius: 28px;
    }
}

@media (max-width: 480px) {
    .financeiro-hero h2 {
        font-size: 25px;
    }

    .financeiro-hero-box strong {
        font-size: 23px;
    }

    .dashboard-tab-btn {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 12px;
    }

    .dashboard-tab-btn span {
        min-width: 22px;
        height: 22px;
        font-size: 10px;
    }

    input,
    select,
    textarea {
        border-radius: 16px;
        padding: 12px 14px;
    }
}

/* =====================================================
   CORRECÇÃO — ABAS INTERNAS DA FICHA DO ALUNO
===================================================== */

.ficha-tabs,
.secretaria-tabs-internas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.ficha-tabs button,
.secretaria-tabs-internas button {
    border: none;
    background: #e2e8f0;
    color: #0f172a;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ficha-tabs button:hover,
.secretaria-tabs-internas button:hover {
    background: #cbd5e1;
}

.ficha-tabs button.active,
.secretaria-tabs-internas button.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.ficha-tab-content {
    display: none;
    margin-top: 18px;
}

.ficha-tab-content.active {
    display: block;
}

.secretaria-ficha {
    margin-top: 18px;
}

.ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border-radius: 20px;
    margin-bottom: 18px;
}

.ficha-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
}

.ficha-header p {
    margin: 6px 0 0;
    color: #cbd5e1;
}

.ficha-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.ficha-meta span {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .ficha-header {
        flex-direction: column;
    }

    .ficha-tabs,
    .secretaria-tabs-internas {
        flex-direction: column;
    }

    .ficha-tabs button,
    .secretaria-tabs-internas button {
        width: 100%;
        text-align: left;
    }
}

/* =====================================================
   FASE 14 — PARTE 1
   PADRONIZAÇÃO PROFISSIONAL DA ÁREA ADMIN
===================================================== */

#area-admin {
    animation: fadeInAdmin 0.35s ease;
}

@keyframes fadeInAdmin {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho interno das secções do Admin */
#area-admin .dashboard-section,
#area-admin [data-tab-perfil="admin"] {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

#area-admin [data-tab-perfil="admin"] h2,
#area-admin [data-tab-perfil="admin"] h3 {
    color: #0f172a;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

#area-admin [data-tab-perfil="admin"] p {
    color: #64748b;
    line-height: 1.7;
}

/* Abas do Admin */
#area-admin .tabs,
#area-admin .dashboard-tabs,
#area-admin .tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 20px;
}

#area-admin [data-tab-btn-perfil="admin"] {
    border: none;
    background: #e2e8f0;
    color: #0f172a;
    padding: 11px 17px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
}

#area-admin [data-tab-btn-perfil="admin"]:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

#area-admin [data-tab-btn-perfil="admin"].active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

/* Conteúdo das abas */
#area-admin [data-tab-perfil="admin"] {
    display: none;
}

#area-admin [data-tab-perfil="admin"].active {
    display: block;
}

/* Formulários do Admin */
#area-admin .form-grid,
#area-admin .grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

#area-admin .field,
#area-admin .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#area-admin label {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

#area-admin input,
#area-admin select,
#area-admin textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#area-admin textarea {
    min-height: 95px;
    resize: vertical;
}

#area-admin input:focus,
#area-admin select:focus,
#area-admin textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Botões do Admin */
#area-admin .actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

#area-admin .btn-primary,
#area-admin .btn-secondary,
#area-admin .btn-danger {
    border: none;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
}

#area-admin .btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
}

#area-admin .btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

#area-admin .btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
}

#area-admin .btn-primary:hover,
#area-admin .btn-secondary:hover,
#area-admin .btn-danger:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

/* Listas e resultados do Admin */
#area-admin .info-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #2563eb;
    border-radius: 18px;
    padding: 16px 18px;
    margin: 12px 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

#area-admin .info-box strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 6px;
}

#area-admin .info-box span {
    display: block;
    color: #475569;
    font-size: 13px;
    line-height: 1.65;
}

#area-admin .estado-presente {
    border-left-color: #16a34a;
}

#area-admin .estado-falta {
    border-left-color: #dc2626;
}

#area-admin .estado-recurso {
    border-left-color: #f59e0b;
}

#area-admin .estado-justificada {
    border-left-color: #2563eb;
}

/* Tabelas do Admin */
#area-admin .table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

#area-admin table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

#area-admin thead {
    background: #0f172a;
    color: #ffffff;
}

#area-admin th {
    padding: 13px 12px;
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#area-admin td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    vertical-align: top;
}

#area-admin tbody tr:nth-child(even) td {
    background: #f8fafc;
}

#area-admin tbody tr:hover td {
    background: #eff6ff;
}

/* Gestão de utilizadores */
#lista-usuarios .badge-senha-pendente,
#lista-professores .badge-senha-pendente {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

#lista-usuarios .badge-senha-definida,
#lista-professores .badge-senha-definida {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

/* Auditoria */
#area-admin #lista-auditoria .info-box {
    border-left-color: #6366f1;
}

#area-admin #lista-auditoria strong {
    color: #1e1b4b;
}

/* Estados vazios */
#area-admin .empty-state,
#area-admin .admin-empty-state {
    text-align: center;
    padding: 32px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    color: #64748b;
}

/* Responsivo */
@media (max-width: 900px) {
    #area-admin .form-grid,
    #area-admin .grid-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    #area-admin [data-tab-btn-perfil="admin"] {
        width: 100%;
        text-align: left;
    }

    #area-admin .tabs,
    #area-admin .dashboard-tabs,
    #area-admin .tab-buttons {
        flex-direction: column;
    }

    #area-admin .actions-row {
        flex-direction: column;
    }

    #area-admin .btn-primary,
    #area-admin .btn-secondary,
    #area-admin .btn-danger {
        width: 100%;
    }

    #area-admin [data-tab-perfil="admin"] {
        padding: 18px;
    }
}

/* =====================================================
   MÓDULO 1 — NOTIFICAÇÃO FORTE
===================================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-notificacoes {
    position: relative;
}

.contador-notificacoes {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.painel-notificacoes {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.painel-notificacoes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.painel-notificacoes-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 900;
}

.painel-notificacoes-header p {
    margin: 6px 0 0;
    color: #64748b;
}

.painel-notificacoes-accoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notificacao-card {
    border: 1px solid #e2e8f0;
    border-left: 6px solid #2563eb;
    border-radius: 18px;
    padding: 16px 18px;
    margin: 12px 0;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.notificacao-card.urgente {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.notificacao-card.importante {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.notificacao-card.normal {
    border-left-color: #2563eb;
}

.notificacao-card.lida {
    opacity: 0.68;
}

.notificacao-topo {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.notificacao-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
}

.notificacao-card p {
    margin: 8px 0;
    color: #475569;
    line-height: 1.6;
}

.notificacao-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.notificacao-meta span {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
    border-radius: 999px;
}

.notificacao-accoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.alerta-notificacao-forte {
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 16px 35px rgba(220, 38, 38, 0.28);
}

.alerta-notificacao-forte.importante {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.alerta-notificacao-forte strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.alerta-notificacao-forte span {
    display: block;
    line-height: 1.6;
}

@media (max-width: 800px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions,
    .painel-notificacoes-header,
    .painel-notificacoes-accoes {
        width: 100%;
        flex-direction: column;
    }

    .header-actions button,
    .painel-notificacoes-accoes button {
        width: 100%;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.text-muted {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}


/* =====================================================
   OPTIMIZAÇÃO VISUAL GLOBAL
   Estende a linguagem visual do Financeiro (cartões com
   destaque de cor, tabelas, grelhas de estatística) para
   todo o sistema — Turmas, Alunos, Cursos, Professores,
   Auditoria, Direcção, Promoção, etc. Apenas apresentação:
   nenhuma regra de negócio, rota ou nome de função muda.
===================================================== */

/* Motion respeitosa: quem prefere menos animação, recebe menos animação */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Transição suave sempre que uma aba do dashboard é aberta */
@keyframes dashTabIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-tab-content.active {
    animation: dashTabIn 0.32s ease;
}

/* Elevação suave ao passar o rato — sensação profissional e viva */
.dashboard-card,
.info-box,
.financeiro-card,
.financeiro-aluno-card,
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
}

.info-box:hover,
.financeiro-aluno-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-dark);
}

/* Botões: transições consistentes em todo o sistema */
.btn-primary,
.btn-secondary,
.btn-danger,
button {
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

/* Acessibilidade: foco visível ao navegar por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =====================================================
   STATS-GRID / STAT-CARD
   Usado em Auditoria, Direcção e outros resumos.
   Aplica a mesma linguagem visual dos cartões do
   Financeiro (barra de destaque, tipografia, hierarquia).
===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card > span {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-card > strong {
    display: block;
    color: var(--primary-dark);
    font-size: 26px;
    font-weight: 950;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.stat-card > small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

/* =====================================================
   LISTAS "lista-*" (Turmas, Alunos, Cursos, Professores,
   Disciplinas, Solicitações, Usuários, Auditoria,
   Horários, Liberações, Plano Curricular, etc.)

   Convenção já existente no projecto: todo container de
   lista usa id="lista-...". Aproveitamos isso para dar a
   todas as listas o mesmo tratamento em grelha responsiva
   do Financeiro — compacto no desktop, uma coluna no
   telemóvel — sem tocar em nenhum HTML/JS individual.
===================================================== */

[id^="lista-"] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 760px) {
    [id^="lista-"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    [id^="lista-"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

[id^="lista-"] > .info-box {
    margin-bottom: 0;
}

/* Estados únicos (carregando / vazio / erro) ocupam a largura toda */
[id^="lista-"] > .info-box:only-child {
    grid-column: 1 / -1;
}

/* Se algum container "lista-*" receber uma tabela em vez de cartões
   (ex.: Plano Curricular, Auditoria, relatórios), a tabela — e o seu
   wrapper .table-responsive — ocupam sempre a largura toda da grelha,
   nunca ficando espremidas numa única coluna. */
[id^="lista-"] > table,
[id^="lista-"] > div > table,
[id^="lista-"] > .table-responsive {
    grid-column: 1 / -1;
}

/* Compactação leve do info-box para caber melhor em grelha */
.info-box {
    padding: 15px 16px;
}

@media (max-width: 480px) {
    .info-box {
        padding: 13px 14px;
        border-radius: 16px;
    }

    .stat-card {
        padding: 15px 15px 13px;
    }

    .stat-card > strong {
        font-size: 22px;
    }
}