/* ==================== CONFIGURAÇÃO DO DESIGN SYSTEM ==================== */
:root {
    /* Paleta de Cores Oficial IFMSA & SCOME */
    --primary: #1d3768;
    --primary-light: #2c4e8c;
    --primary-dark: #0f2042;
    --primary-rgb: 29, 55, 104;
    
    /* Cores de Apoio e Acentos (Valor padrão que será sobrescrito dinamicamente) */
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-gradient: linear-gradient(135deg, var(--primary), var(--accent));
    --accent-cyan: #06b6d4;
    
    /* Estados de Feedback */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-text: #065f46;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #92400e;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-text: #991b1b;
    
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    
    /* Cores de Fundo e Estrutura */
    --bg-body: #f3f5f9;
    --bg-sidebar: #1d3768;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar-active: rgba(255, 255, 255, 0.15);
    
    /* Cores de Cartões (Glassmorphism) */
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-card: rgba(255, 255, 255, 0.6);
    --border-color: rgba(226, 232, 240, 0.8);
    
    /* Cores de Texto */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    /* Outros */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.06), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== TEMAS DINÂMICOS POR PAPEL / COMITÊ ==================== */
body.theme-admin {
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
}
body.theme-scome {
    --accent: #2563eb;
    --accent-light: #60a5fa;
}
body.theme-scoph {
    --accent: #f97316;
    --accent-light: #fdba74;
}
body.theme-scora {
    --accent: #ef4444;
    --accent-light: #fca5a5;
}
body.theme-scorp {
    --accent: #10b981;
    --accent-light: #6ee7b7;
}
body.theme-scope {
    --accent: #06b6d4;
    --accent-light: #67e8f9;
}
body.theme-score {
    --accent: #6366f1;
    --accent-light: #818cf8;
}

/* ==================== CONFIGURAÇÕES GERAIS E RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(at 0% 0%, rgba(243, 244, 246, 0.5) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(29, 55, 104, 0.03) 0px, transparent 50%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: var(--transition);
}

/* Scrollbar Customizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== COMPONENTES DE UTILIDADE ==================== */
.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-md { gap: 16px; }
.p-none { padding: 0 !important; }
.mt-xs { margin-top: 8px; }
.mt-sm { margin-top: 16px; }
.max-h-xs { max-height: 200px; }
.border-standard { border: 1px solid var(--border-color); border-radius: var(--radius-sm); }

/* Badges e Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.725rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background-color: var(--success-light); color: var(--success-text); }
.badge-warning { background-color: var(--warning-light); color: var(--warning-text); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-text); }
.badge-info { background-color: var(--info-light); color: #0369a1; }

/* Botões Modernos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(29, 55, 104, 0.15);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(29, 55, 104, 0.25);
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--text-white);
    border-color: var(--danger);
}

.btn-info {
    background-color: var(--info);
    color: var(--text-white);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}
.btn-info:hover {
    background-color: #0284c7;
    transform: translateY(-1px);
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.725rem;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Glassmorphism Cards */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-md);
}

/* ==================== TELA DE LOGIN COM CREDENCIAIS ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
    text-align: center;
}

.logo-wrapper {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    box-shadow: 0 8px 24px rgba(29, 55, 104, 0.25);
    transition: var(--transition);
}

.logo-icon {
    font-size: 28px;
    color: var(--text-white);
}

.login-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.login-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 4px;
}

.login-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Inputs de Login Estilizados com Ícones */
.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.form-control.pl-icon {
    padding-left: 46px;
}

/* Box Informativo de Credenciais */
.test-credentials-box {
    margin-top: 20px;
    background: rgba(29, 55, 104, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.775rem;
}

.test-credentials-box summary {
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    outline: none;
    user-select: none;
}

.credentials-lists {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
}

.cred-item {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.cred-item code {
    background: #cbd5e1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
}

.login-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* ==================== LAYOUT DA APLICAÇÃO GERAL ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.brand-logo {
    width: 40px;
    height: 40px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-dark);
    transition: var(--transition);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: var(--text-white);
}

.brand-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Widget do Usuário Logado */
.user-profile-widget {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.user-profile-widget .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.user-profile-widget .user-info h4 {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.user-profile-widget .role-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(255,255,255,0.15);
    font-weight: 600;
    text-transform: uppercase;
}

/* Menus de Navegação */
.sidebar-menu {
    flex-grow: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-item a i {
    width: 20px;
    font-size: 16px;
    text-align: center;
}

.menu-item:hover a {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.menu-item.active a {
    background: var(--accent-gradient);
    color: var(--text-white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ÁREA DE CONTEÚDO */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* TOPBAR */
.topbar {
    height: 80px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    flex-shrink: 0;
}

.topbar h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.date-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--text-white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Corpo do Conteúdo */
.content-body {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Responsive Sidebar Mobile Trigger */
@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .sidebar-menu {
        overflow-y: visible;
        padding: 10px;
    }
    .sidebar-menu ul {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    .menu-item a {
        padding: 8px 12px;
        white-space: nowrap;
    }
    .app-layout {
        height: auto;
        overflow: auto;
    }
    .main-content {
        overflow: visible;
    }
    .content-body {
        padding: 20px;
    }
    .topbar {
        padding: 0 20px;
    }
}

/* ==================== DASHBOARD E METRICAS ==================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.metric-card {
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.green-accent .metric-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.purple-accent .metric-icon { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.orange-accent .metric-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.blue-accent .metric-icon { background: rgba(59, 130, 246, 0.1); color: var(--accent); }

.metric-info h3 {
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.metric-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}

/* LAYOUT DE DUAS COLUNAS */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

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

.dashboard-panel {
    border-radius: var(--radius-md);
    padding: 24px;
}

.panel {
    border-radius: var(--radius-md);
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabelas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-minimal th {
    font-size: 0.725rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1.5px solid var(--border-color);
}

.table-minimal td {
    padding: 14px 16px;
    font-size: 0.825rem;
    border-bottom: 1px solid var(--border-color);
}

.table-minimal tbody tr:last-child td {
    border-bottom: none;
}

.table-standard th {
    font-size: 0.775rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    background-color: rgba(0,0,0,0.01);
    padding: 16px 24px;
    border-bottom: 2px solid var(--border-color);
}

.table-standard td {
    padding: 18px 24px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-standard tbody tr {
    transition: var(--transition);
}

.table-standard tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.015);
}

/* Liderança (Leaderboard) */
.leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.leaderboard-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.7);
}

.leaderboard-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}

.rank-1 { background-color: #fef08a; color: #854d0e; }
.rank-2 { background-color: #e2e8f0; color: #475569; }
.rank-3 { background-color: #ffedd5; color: #c2410c; }
.rank-other { background-color: #f1f5f9; color: var(--text-muted); }

.leaderboard-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--primary);
}

.leaderboard-points {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--accent);
}

/* Barra de Pesquisa */
.search-bar-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.search-bar-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--text-white);
    font-size: 0.85rem;
    transition: var(--transition);
}

.search-bar-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.action-buttons-group {
    display: flex;
    gap: 12px;
}

/* ==================== APROVAÇÕES DIRETOR ==================== */
.approvals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.approval-card {
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 4px solid var(--warning);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.approval-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

.approval-student-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.approval-student-info span {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.approval-event-info {
    padding: 12px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approval-event-name {
    font-size: 0.825rem;
    font-weight: 600;
    max-width: 70%;
}

.approval-event-points {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
}

.approval-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================== CENTRAL DE CERTIFICAÇÃO ==================== */
.certification-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

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

.selector-sidebar {
    padding: 20px;
}

.report-viewer {
    min-height: 500px;
}

/* Documento de Impressão */
.cert-doc {
    background: #ffffff;
    color: #000000;
    padding: 50px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.cert-doc::before {
    content: "IFMSA";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 120px;
    font-weight: 900;
    color: rgba(29, 55, 104, 0.015);
    z-index: 0;
    pointer-events: none;
}

.cert-doc-header {
    text-align: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.cert-doc-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cert-doc-header h3 {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
    margin-top: 4px;
}

.cert-doc-header p {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

.cert-doc-student-info {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 18px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.cert-doc-student-info .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.cert-doc-student-info .info-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

.points-highlight {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary);
}

.cert-doc-table-wrapper {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.cert-doc-table-wrapper h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 700;
}

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

.cert-doc-table th {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 0.725rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #475569;
}

.cert-doc-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    font-size: 0.775rem;
    color: #1e293b;
}

.cert-doc-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.signature-line {
    width: 250px;
    margin-bottom: 24px;
}

.signature-line .line {
    border-top: 1px solid #475569;
    margin-bottom: 8px;
}

.signature-line p {
    font-size: 0.725rem;
    color: #475569;
    line-height: 1.3;
}

.verification-notice {
    font-size: 0.625rem;
    color: #94a3b8;
    max-width: 500px;
}

/* Impressão */
@media print {
    body * { visibility: hidden; }
    #certification-document, #certification-document * { visibility: visible; }
    #certification-document {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
}

/* ==================== PORTAL ALUNO MEU PAINEL ==================== */
.student-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

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

.student-score-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
}

.points-gauge-container {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.points-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 6px solid var(--border-card);
    animation: pulseGlow 3s infinite;
}

.points-number {
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--text-white);
    line-height: 1;
}

.points-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.student-profile-summary h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 800;
}

.stu-meta {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stu-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stu-stat-box {
    padding: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.stu-stat-box.green { background-color: var(--success-light); color: var(--success-text); }
.stu-stat-box.orange { background-color: var(--warning-light); color: var(--warning-text); }

.stu-stat-box .stat-num {
    font-size: 1.6rem;
    font-weight: 800;
}

.stu-stat-box .stat-lbl {
    font-size: 0.725rem;
    font-weight: 600;
}

.helper-box {
    padding: 20px;
    background: rgba(29, 55, 104, 0.03);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    font-size: 0.825rem;
}

.helper-box.info {
    border-left-color: var(--info);
    background: var(--info-light);
    color: #0369a1;
}

.helper-box h4 {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.helper-box.info h4 { color: #0369a1; }
.helper-box p { color: #475569; line-height: 1.5; }

/* ==================== PORTAL ALUNO - VAGAS E PRÓXIMOS EVENTOS ==================== */
.upcoming-events-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.events-filter-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.events-filter-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.events-status-indicator {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
}

.events-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.event-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 5px solid var(--accent);
    transition: var(--transition);
}

.event-card.event-happening { border-top-color: var(--info); }
.event-card.event-upcoming { border-top-color: var(--accent); }
.event-card.event-finished { border-top-color: var(--text-muted); }

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.event-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card-tag { align-self: flex-start; }

.event-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.event-card-date {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
}

.event-card-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.points-tag {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent);
}

.points-tag span {
    font-size: 0.675rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Barra de Progresso de Vagas Ocupadas */
.vagas-progress-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vagas-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
}

.vagas-progress-track {
    width: 100%;
    height: 8px;
    background-color: #cbd5e1;
    border-radius: 100px;
    overflow: hidden;
}

.vagas-progress-fill {
    height: 100%;
    background-color: var(--success);
    border-radius: 100px;
    transition: width 0.5s ease-out;
}

.vagas-progress-fill.warning { background-color: var(--warning); }
.vagas-progress-fill.danger { background-color: var(--danger); }

/* ==================== FORMULÁRIOS E MODAIS ==================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-md { flex: 1; }

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--text-white);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control.text-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.775rem;
    line-height: 1.4;
}

.required { color: var(--danger); }

/* Modais */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-card.modal-lg { max-width: 750px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-modal-btn:hover { color: var(--danger); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== ESTADO VAZIO ==================== */
.empty-state {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(29, 55, 104, 0.05);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.empty-state p {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.5;
}

/* ==================== ANIMAÇÕES ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 10px 30px rgba(29, 55, 104, 0.25); }
    100% { box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
}

.animate-fade-in {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==================== NOTIFICAÇÕES FLUTUANTES (TOASTS) ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 25px rgba(29, 55, 104, 0.12);
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 0.825rem;
    font-weight: 600;
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon {
    font-size: 18px;
}
.toast-success .toast-icon { color: var(--success); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
    flex-grow: 1;
    line-height: 1.4;
}

.toast-close {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    transition: var(--transition);
    user-select: none;
    line-height: 1;
}

.toast-close:hover {
    color: var(--danger);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}
