/* Painéis lado a lado na administração */
.admin-panels-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 1024px) {
    .admin-panels-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
        display: block;
        width: 100%;
    }
    .data-table thead {
        display: none;
    }
    .data-table tr {
        margin-bottom: 1.5rem;
        background: #fff;
        border-radius: 0.7rem;
        box-shadow: 0 2px 8px rgba(109,40,217,0.04);
        padding: 1rem;
    }
    .data-table td {
        padding: 0.7rem 1rem;
        border: none;
        position: relative;
    }
    .data-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #6d28d9;
        display: block;
        margin-bottom: 0.3rem;
    }
}
/* ==============================================
   ESTILOS PARA A PÁGINA DE LOGIN
   (Adicione esta seção ao seu style.css se não existir)
   ============================================== */

body.login-page {
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #1e293b;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    width: 100%;
    max-width: 420px;
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.card-header img {
    width: 80px;
    margin-bottom: 1rem;
}

.card-header h1 {
    font-size: 1.75rem;
    color: #f8fafc;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 18px;
    height: 18px;
    z-index: 2; /* Garante que o ícone fique acima do input */
}

/* --- A CORREÇÃO PRINCIPAL ESTÁ AQUI --- */
.login-card .form-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem; /* << AUMENTA O PADDING ESQUERDO */
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.5);
    color: #1e293b;
    transition: all 0.2s;
    position: relative; /* Necessário para z-index funcionar corretamente em alguns navegadores */
}

.login-card .form-input::placeholder {
    color: #6b7280;
}

.login-card .form-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.8);
    border-color: #6d28d9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.3);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    width: 20px;
    height: 20px;
    z-index: 2;
}

#icon-eye-slash { display: none; }

.submit-button {
    width: 100%;
    padding: 0.8rem 1rem;
    /* ... resto dos estilos do botão ... */
}

/* ==============================================
   1. VARIÁVEIS GLOBAIS E RESET
   ============================================== */
:root {
    --cor-primaria: #6d28d9;
    --cor-primaria-escura: #5b21b6;
    --cor-fundo-pagina: #f3f4f6;
    --cor-painel: #ffffff;
    --cor-texto-principal: #1f2937;
    --cor-texto-secundario: #6b7280;
    --cor-borda: #d1d5db;
    --cor-sucesso: #10b981;
    --cor-erro: #ef4444;
    --cor-fundo-editavel: #fefce8;

    --fonte-principal: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --raio-borda: 0.75rem;
    --sombra-suave: 0 4px 12px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--fonte-principal);
    background-color: var(--cor-fundo-pagina);
    color: var(--cor-texto-principal);
    line-height: 1.6;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==============================================
   2. CABEÇALHO PRINCIPAL E NAVEGAÇÃO
   ============================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background-color: var(--cor-painel);
    border-bottom: 1px solid var(--cor-borda);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-logo { display: flex; align-items: center; gap: 1rem; }
.header-logo img { width: 48px; height: 48px; object-fit: contain; }
.header-logo div h1 { font-size: 1.5rem; color: var(--cor-primaria); margin: 0; line-height: 1.2; }
.header-logo div span { font-size: 0.9rem; color: var(--cor-texto-secundario); }
.header-nav { display: flex; gap: 0.5rem; }
.nav-link {
    text-decoration: none;
    color: var(--cor-texto-principal);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    border-radius: 8px;
}
.nav-link:hover { background-color: #f3f4f6; color: var(--cor-primaria); }
.nav-link.active { color: var(--cor-primaria); border-bottom-color: var(--cor-primaria); font-weight: 600; }
.header-user { display: flex; align-items: center; gap: 1rem; }
.logout-button {
    text-decoration: none;
    background-color: #f3f4f6;
    color: var(--cor-primaria);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.logout-button:hover { background-color: var(--cor-primaria-escura); color: #fff; }

/* ==============================================
   3. LAYOUT E PÁGINAS INTERNAS
   ============================================== */
.app-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.admin-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 { color: var(--cor-texto-principal); }

/* ==============================================
   4. CARDS E PAINÉIS
   ============================================== */
.controls-panel {
    background-color: var(--cor-painel);
    border-radius: var(--raio-borda);
    box-shadow: var(--sombra-suave);
    padding: 2rem;
    position: sticky;
    top: calc(75px + 2rem);
    height: calc(100vh - 75px - 4rem);
    overflow-y: auto;
}
.panel-header { text-align: center; margin-bottom: 2rem; }
.panel-header h1 { font-size: 1.75rem; color: var(--cor-texto-principal); }
.panel-header p { color: var(--cor-texto-secundario); margin-top: 0.5rem; }
.control-section { margin-bottom: 2rem; }
.control-section h2 {
    font-size: 0.95rem; font-weight: 600; color: var(--cor-primaria);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem;
    border-bottom: 2px solid var(--cor-primaria); padding-bottom: 0.25rem;
}
.card, .form-card, .list-card, .no-content-card {
    background-color: var(--cor-painel);
    border-radius: var(--raio-borda);
    padding: 2rem;
    box-shadow: var(--sombra-suave);
    border: 1px solid #e5e7eb;
}
.card h2, .form-card h2, .list-card h2 { font-size: 1.5rem; margin-top: 0; margin-bottom: 1.5rem; }
.no-content-card { text-align: center; padding: 3rem; }
.no-content-card h3 { margin-top: 0; margin-bottom: 0.5rem; }
.no-content-card p { color: var(--cor-texto-secundario); margin-bottom: 1.5rem; }
.no-content-card a { color: var(--cor-primaria); font-weight: 600; }

/* ==============================================
   5. FORMULÁRIOS, BOTÕES E TABELAS
   ============================================== */
.form-group { margin-bottom: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.controls-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
label { font-weight: 600; font-size: 0.9rem; color: #374151; display: block; margin-bottom: 0.5rem; }
input[type="text"], input[type="password"], select, textarea {
    width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--cor-borda);
    border-radius: 8px; background-color: #f9fafb; font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}
textarea { min-height: 100px; resize: vertical; }
.gerar-button {
    display: inline-block; padding: 0.8rem 1.5rem; font-size: 1rem; font-weight: 600;
    color: #fff; background: var(--cor-primaria); border: none;
    border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s; cursor: pointer; text-align: center;
}
.gerar-button:hover:not(:disabled) { background: var(--cor-primaria-escura); transform: translateY(-1px); }
.gerar-button:disabled { background: #cbd5e1; color: #888; cursor: not-allowed; }
.data-table { width: 100%; border-collapse: collapse; overflow: hidden; }
.data-table th, .data-table td {
    padding: 1rem 1.25rem; text-align: left;
    border-bottom: 1px solid #e5e7eb; vertical-align: middle;
}
.data-table th {
    background-color: #f9fafb; font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--cor-texto-secundario);
}
.data-table tr:hover { background-color: #f5f3ff; }
.data-table tfoot td { font-weight: bold; background-color: #f9fafb; }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell .action-button {
    background: none; border: none; cursor: pointer; padding: 0.5rem; font-size: 1.3rem;
    margin-left: 0.5rem; transition: transform 0.2s, color 0.2s;
    color: #9ca3af; text-decoration: none; display: inline-block; vertical-align: middle;
}
.actions-cell .action-button:hover { transform: scale(1.15); color: var(--cor-primaria); }
.actions-cell .action-button[title*="Excluir"]:hover { color: var(--cor-erro); }

/* ==============================================
   6. CONTEÚDO ESPECÍFICO (PROVA, SPINNER, ETC)
   ============================================== */
.edit-hint { background-color: #f0fdf4; color: #14532d; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.9rem; text-align: center; margin-bottom: 1.5rem; }
.info-box { background-color: #f5f3ff; border-left: 4px solid var(--cor-primaria); padding: 1rem 1.5rem; margin-bottom: 1.5rem; border-radius: 0.5rem; display: none; }
.placeholder-text { text-align: center; padding: 3rem 1rem; color: var(--cor-texto-secundario); }
[contenteditable="true"] { background-color: var(--cor-fundo-editavel); padding: 0.25rem 0.5rem; border-radius: 4px; border-bottom: 2px dashed #eab308; cursor: text; }
.questao ol { list-style: upper-alpha; margin: 1rem 0 0 1.4rem; padding:0; }
.questao li { margin: 0 0 0.55rem 0; padding: 0; }
/* Removido pseudo-elemento duplicador de marcador para evitar A) A) */
.spinner-overlay {
    position: fixed; inset: 0; background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px); display: none; justify-content: center;
    align-items: center; flex-direction: column; z-index: 9999;
}
.spinner-overlay p { color: white; font-size: 1.1rem; margin-top: 1rem; }
.spinner {
    width: 60px; height: 60px; border: 7px solid #e5e7eb;
    border-top: 7px solid var(--cor-primaria); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.message { padding: 1rem; margin-bottom: 1.5rem; border-radius: 0.5rem; text-align: center; font-weight: 500; }
.message.success { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.message.error { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ==============================================
   7. ÁREA DO ALUNO
   ============================================== */
body.student-area { display: flex; justify-content: center; align-items: flex-start; padding: 2rem; }
.prova-container, .student-panel, .resultado-card {
    max-width: 800px;
    width: 100%;
    background: #fff;
    border-radius: var(--raio-borda);
    box-shadow: var(--sombra-suave);
}
.student-panel, .resultado-card { padding: 3rem; text-align: center; }
.prova-header { padding: 2rem; border-bottom: 1px solid #e5e7eb; }
.prova-body { padding: 2rem; }
.questao-interativa { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px dashed #d1d5db; }
.questao-interativa:last-child { border-bottom: none; }
.alternativas-lista { list-style-type: none; padding: 0; margin-top: 1rem; }
.alternativas-lista li { margin-bottom: 0.75rem; }
.alternativas-lista label {
    display: flex; align-items: center; gap: 0.75rem; padding: 1rem;
    border: 1px solid #d1d5db; border-radius: 0.5rem;
    cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.alternativas-lista label:hover { background-color: #f9fafb; }
.alternativas-lista input[type="radio"] { accent-color: var(--cor-primaria); width: 1.2em; height: 1.2em; }
.alternativas-lista input[type="radio"]:checked + span { font-weight: 600; }
.resultado-card .nota { font-size: 4rem; font-weight: 700; margin: 1rem 0; color: var(--cor-primaria); }

/* ==============================================
   8. RESPONSIVIDADE
   ============================================== */
@media (max-width: 1024px) {
    .app-container, .admin-grid { grid-template-columns: 1fr; }
    .controls-panel { position: static; height: auto; top: unset; }
}
@media (max-width: 768px) {
    .main-header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .page-container, .app-container { padding: 1rem; }
    .form-grid, .controls-grid { grid-template-columns: 1fr; }
}

/* ==============================================
   9. ESTILOS DE IMPRESSÃO
   ============================================== */
@media print {
    body * { visibility: hidden; }
    .printable-area, .printable-area * { visibility: visible; }
    .printable-area {
        position: absolute;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 900px;
        margin: 20mm auto;
        background: #fff;
        box-shadow: 0 0 0.5cm #eee;
        border-radius: 8px;
        padding: 2rem;
    }
    body { background-color: #fff !important; }
    .print-header { display: block !important; text-align: center; margin-bottom: 2rem; border-bottom: 2px solid #333; padding-bottom: 1rem; background: #f9fafb; border-radius: 8px 8px 0 0; }
    .print-header h2 { font-size: 20pt; font-weight: bold; color: #333; margin-bottom: 0.5rem; }
    .print-header p { font-size: 12pt; color: #555; margin: 0.2rem 0; }
    .data-table { font-size: 11pt; box-shadow: none; border-radius: 6px; overflow: hidden; margin-top: 1rem; }
    .data-table th, .data-table td, .data-table tfoot td { border: 1px solid #bbb; color: #222; padding: 0.7rem 1rem; }
    .data-table thead th { background-color: #e0e7ff !important; color: #222; font-size: 12pt; }
    .data-table tfoot td { background: #f3f4f6 !important; color: #333; font-size: 12pt; }
    .data-table tr:nth-child(even) { background: #f9fafb; }
    .data-table tr:hover { background: #e0e7ff; }
    .data-table td { font-size: 11pt; }
    .data-table th { font-size: 12pt; }
    .data-table tfoot td { font-size: 12pt; font-weight: bold; }
    .data-table tr { page-break-inside: avoid; visibility: visible !important; }
    .data-table td, .data-table th, .data-table tfoot td { visibility: visible !important; }
}
.print-header { display: none; }
.back-link { text-decoration: none; color: var(--cor-texto-secundario); display: block; margin-bottom: 0.5rem; }
.back-link:hover { color: var(--cor-primaria); }
.subtitle { margin-top: -1.2rem; color: var(--cor-texto-secundario); font-weight: 500; } 

/* ==============================================
   10. APRIMORAMENTOS DE RESPONSIVIDADE MOBILE
   ============================================== */

/* Tipografia fluida geral */
html {
    font-size: clamp(14px, 1.6vw, 16px);
}

/* Ajuste de títulos */
h1, .page-header h1 {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

/* Grids mais flexíveis (evita quebra esquisita em tablets) */
.admin-panels-grid,
.app-container,
.admin-grid {
    grid-template-columns: minmax(0, 420px) 1fr;
}

@media (max-width: 1100px) {
    .admin-panels-grid,
    .app-container,
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Melhora painel lateral em mobile */
.controls-panel {
    height: auto;
    max-height: unset;
    padding: 1.5rem 1.25rem;
}

/* Ajustes de tabela: alternativa responsiva com scroll horizontal (fallback) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive::-webkit-scrollbar {
    height: 8px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 20px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #ede9fe;
}

/* Botões de ação maiores para toque */
.actions-cell .action-button {
    padding: 0.75rem;
    font-size: 1.35rem;
}

/* Área clicável ampliada em dispositivos touch */
@media (hover: none) {
    .action-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Login card otimizado para telas muito pequenas */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.4rem;
        max-width: 94%;
    }
    .login-card .form-input {
        font-size: 0.95rem;
        padding: 0.75rem 0.75rem 0.75rem 2.6rem;
    }
    .password-toggle {
        right: 0.6rem;
    }
}

/* Reduz espaçamentos gerais em mobile */
@media (max-width: 640px) {
    .page-container,
    .app-container {
        padding: 0.75rem;
    }
    .panel-header h1 {
        font-size: 1.25rem;
    }
    .controls-panel {
        padding: 1.25rem 1rem;
    }
    .data-table th, .data-table td {
        padding: 0.75rem 0.9rem;
    }
}

/* Micro-breakpoint para aparelhos muito estreitos */
@media (max-width: 360px) {
    .login-card {
        padding: 1.6rem 1rem;
    }
    .header-logo div h1 {
        font-size: 1.1rem;
    }
    .nav-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }
}

/* Melhora legibilidade de inputs em telas com zoom */
input, select, textarea {
    font-size: 1rem;
    -webkit-text-size-adjust: 100%;
}

/* Scroll suave para painéis longos em mobile */
@media (max-width: 768px) {
    .controls-panel,
    .student-panel,
    .resultado-card,
    .prova-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Acessibilidade: reduz intensidade de animações se usuário preferir */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .spinner {
        display: none;
    }
}

/* Melhor foco visível para acessibilidade */
:focus-visible {
    outline: 3px solid #6d28d9;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Botões principais com variação de tamanho em telas muito pequenas */
@media (max-width: 480px) {
    .gerar-button,
    .logout-button {
        width: 100%;
        display: inline-flex;
        justify-content: center;
        font-size: 0.95rem;
        padding: 0.85rem 1rem;
    }
}

/* Campos editáveis: menos padding em telas estreitas */
@media (max-width: 500px) {
    [contenteditable="true"] {
        padding: 0.2rem 0.4rem;
    }
}

/* Espaço entre linhas de questões em mobile */
@media (max-width: 600px) {
    .questao-interativa {
        margin-bottom: 1.75rem;
        padding-bottom: 1.1rem;
    }
}

/* Ajuste de modal (se houver) – garante centralização em telas pequenas */
.modal {
    max-width: 600px;
    width: 100%;
}
@media (max-width: 640px) {
    .modal {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
}

/* Aumenta área tocável dos radios/opções de prova */
.alternativas-lista label {
    min-height: 48px;
}

/* Evita quebra estranha em headings longos */
h1, h2, h3 {
    overflow-wrap: anywhere;
}

/* Prevenção: imagens fluidas (caso adicione no futuro) */
img, video {
    max-width: 100%;
    height: auto;
}

/* Ajuste fino: ação primária mais destacada em mobile */
@media (max-width: 480px) {
    .gerar-button {
        font-weight: 600;
        letter-spacing: 0.25px;
    }
}

/* Corrige possíveis overflows horizontais por longas strings */
body {
    overflow-x: hidden;
}

/* ==============================================
   11. APRIMORAMENTOS ESPECÍFICOS DO PAINEL ADMIN
   ============================================== */
.admin-panels-grid { align-items: start; }
.admin-grid > .admin-panels-grid { grid-column: 1 / -1; width:100%; }

/* Badges de perfil e turma */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    line-height: 1;
    border: 1px solid #c7d2fe;
}
.badge--admin { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.badge--professor { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.badge--aluno { background:#f5f3ff; color:#5b21b6; border-color:#ddd6fe; }
.badge--turma { background:#fff7ed; color:#9a3412; border-color:#fed7aa; }

/* Mensagens aprimoradas */
#message-container .message { animation: fadeSlide 0.3s ease; }
@keyframes fadeSlide { from { opacity:0; transform: translateY(-6px);} to { opacity:1; transform: translateY(0);} }

/* Modal genérico reutilizável */
.modal-overlay {
    position: fixed; inset:0; display:none; justify-content:center; align-items:center;
    background: rgba(15,23,42,0.45); backdrop-filter: blur(4px);
    z-index: 10000; padding: 2rem 1rem; overflow-y:auto;
}
.modal-overlay.is-open { display:flex; }
.modal-window {
    background:#fff; width:100%; max-width:520px; border-radius:1rem; padding:2rem 2rem 1.7rem;
    box-shadow:0 8px 32px -4px rgba(15,23,42,0.25), 0 2px 8px rgba(15,23,42,0.08);
    position:relative; animation: popScale .28s ease;
}
@keyframes popScale { from { opacity:0; transform: translateY(12px) scale(.96);} to { opacity:1; transform: translateY(0) scale(1);} }
.modal-window h2 { margin-top:0; font-size:1.3rem; }
.modal-close-btn { position:absolute; top:.75rem; right:.75rem; background:none; border:none; font-size:1.4rem; cursor:pointer; color:#64748b; }
.modal-close-btn:hover { color:#0f172a; }

/* Form dentro de modal */
.modal-form .form-group { margin-bottom:1rem; }
.modal-actions { display:flex; gap:.75rem; margin-top:1rem; }
.btn-secondary {
    background:#f1f5f9; color:#334155; border:1px solid #e2e8f0; padding:.7rem 1.2rem; font-weight:600; border-radius:8px; cursor:pointer; transition:.2s;
}
.btn-secondary:hover { background:#e2e8f0; }

/* Botões de ação refinados */
.actions-cell .action-button { position:relative; }
.actions-cell .action-button:focus-visible { outline:2px solid var(--cor-primaria); outline-offset:2px; border-radius:6px; }
.actions-cell .action-button[title*="Excluir"] { color:#dc2626; }
.actions-cell .action-button[title*="Excluir"]:hover { color:#b91c1c; }

/* Estado hover linha tabela */
.data-table tbody tr { transition: background-color .15s; }

/* Compactação em telas médias */
@media (max-width: 1180px) {
    .data-table th, .data-table td { padding: 0.75rem 0.85rem; }
}

/* Reestrutura mobile com rótulos automáticos */
@media (max-width: 760px) {
    .data-table tbody tr { box-shadow:0 2px 6px rgba(15,23,42,0.08); border:1px solid #e2e8f0; }
    .data-table td { background:#fff; border:none; }
    .data-table td[data-label] { padding-top:.55rem; }
}

/* Scroll suave para listagem longa */
.list-card { position:relative; }
.list-card table { width:100%; }

/* Loading inline (poderá ser usado futuramente) */
.inline-spinner { width:18px; height:18px; border:3px solid #e2e8f0; border-top-color: var(--cor-primaria); border-radius:50%; animation: spin .75s linear infinite; display:inline-block; vertical-align:middle; }

/* Melhor percepção de foco em inputs obrigatórios vazios (progressivo) */
input:required:invalid:not(:focus), select:required:invalid:not(:focus) { border-color:#fca5a5; }

/* Turma modal ajustes de tabela */
#turma-modal-content table { border-collapse: collapse; width:100%; margin-top:.5rem; }
#turma-modal-content th, #turma-modal-content td { padding:.55rem .75rem; border-bottom:1px solid #e2e8f0; font-size:.9rem; }
#turma-modal-content th { background:#f1f5f9; text-align:left; font-weight:600; }

/* Utility helpers */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.flex { display:flex; }
.gap-sm { gap:.5rem; }
.justify-between { justify-content: space-between; }
.text-right { text-align:right; }

/* Animação leve de entrada para linhas novas */
@keyframes rowFlash { from { background:#faf5ff; } to { background:transparent; } }
tr.row-added { animation: rowFlash 2.4s ease forwards; }

/* ==============================================
     12. GERADOR DE PROVAS (LAYOUT & COMPONENTES)
     ============================================== */
.generator-layout { display:grid; grid-template-columns: 380px 1fr; gap:2rem; align-items:start; max-width:1500px; margin:0 auto; padding:2rem; }
@media (max-width:1100px){ .generator-layout { grid-template-columns:1fr; padding:1.5rem; } }
@media (max-width:640px){ .generator-layout { padding:1rem; gap:1.25rem; } }

.controls-panel h1 { font-size:1.9rem; letter-spacing:-0.5px; }
.controls-panel p { font-size:.95rem; }

/* Seções enumeradas visuais */
.control-section { position:relative; padding-top:.25rem; }
.control-section > h2 { display:flex; align-items:center; gap:.6rem; }
.control-section > h2::before { content:""; width:10px; height:10px; border-radius:50%; background:var(--cor-primaria); box-shadow:0 0 0 4px rgba(109,40,217,.18); }

/* Textarea principal */
#chat-input { min-height:120px; resize:vertical; font-family:inherit; line-height:1.45; }
#chat-input:focus { box-shadow:0 0 0 3px rgba(109,40,217,.25); }

/* Área de questões */
.content-area .card:first-of-type { position:relative; }
#questoes-container { display:flex; flex-direction:column; gap:1.5rem; }
.questao { background:#fff; border:1px solid #e5e7eb; border-radius:.85rem; padding:1.25rem 1.4rem 1.15rem; box-shadow:0 2px 6px rgba(0,0,0,0.04); position:relative; }
.questao h4 { margin:0 0 .75rem; font-size:1.02rem; line-height:1.35; }
.questao h4[contenteditable="true"] { cursor:text; }
.questao ol.alternativas, .questao ol.alternativas-lista, .questao ol.alternativas-lista li { margin:0; padding:0; }
.questao ol.alternativas { list-style-type:upper-alpha; margin-left:1.4rem; display:flex; flex-direction:column; gap:.4rem; }
.questao ol.alternativas li { padding:.4rem .55rem; border-radius:.5rem; transition:background-color .18s; }
.questao ol.alternativas li[contenteditable="true"] { cursor:text; }
.questao ol.alternativas li:hover { background:#f5f3ff; }
.questao .gabarito-info { margin-top:.8rem; font-size:.85rem; background:#f5f3ff; padding:.5rem .75rem; border-radius:.5rem; color:#4c1d95; }
.questao .gabarito-info span[contenteditable="true"] { cursor:text; }

/* Habilidade box */
.habilidade-box { background:#f0fdfa; border:1px solid #99f6e4; padding:.75rem 1rem; border-radius:.7rem; font-size:.9rem; margin-bottom:1rem; color:#065f46; display:none; }
.habilidade-box strong { color:#0f766e; }

/* Export buttons refinados */
.export-buttons { display:flex; gap:.75rem; margin-top:1.25rem; flex-wrap:wrap; }
.export-buttons button { flex:1 1 200px; background:var(--cor-primaria); color:#fff; border:none; padding:.85rem 1.1rem; border-radius:.65rem; font-weight:600; cursor:pointer; transition:.22s; }
.export-buttons button:disabled { background:#cbd5e1; color:#475569; cursor:not-allowed; }
.export-buttons button:not(:disabled):hover { background:var(--cor-primaria-escura); transform:translateY(-2px); }

/* Skeleton carregamento */
.skeleton-container { display:flex; flex-direction:column; gap:1rem; }
.skeleton { background:linear-gradient(110deg,#f4f4f5 8%,#e5e7eb 18%,#f4f4f5 33%); background-size:200% 100%; animation:shine 1.2s linear infinite; border-radius:6px; }
.skeleton-line { height:14px; }
.skeleton-lg { height:24px; border-radius:8px; }
@keyframes shine { to { background-position-x:-200%; } }

/* Contenteditable foco e feedback */
[contenteditable="true"]:focus { outline:2px solid var(--cor-primaria); outline-offset:2px; background:#fefce8; }
[contenteditable="true"] { transition:background-color .15s, outline-color .15s; }

/* Placeholder de boas-vindas ajuste */
.placeholder-text h3 { margin:0 0 .5rem; }
.placeholder-text p { margin:0; }

/* Responsividade fina */
@media (max-width:880px){
    .controls-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:600px){
    .controls-grid { grid-template-columns:1fr; }
    .questao { padding:1rem 1rem .9rem; }
    .controls-panel h1 { font-size:1.5rem; }
    .export-buttons button { flex:1 1 100%; }
}

