:root {
    --primary: #f58220;
    --primary-light: #ff9844;
    --primary-dark: #e06c00;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
    
    --success: #10b981;
    --success-bg: #d1fae5;
    --info: #0ea5e9;
    --info-bg: #e0f2fe;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Background Glows */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}
.glow-top-left {
    top: -10%;
    left: -5%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(245,130,32,0.15) 0%, rgba(255,255,255,0) 70%);
}
.glow-bottom-right {
    bottom: -10%;
    right: -5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0,166,81,0.1) 0%, rgba(255,255,255,0) 70%);
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}
.logo-wrapper {
    width: 65px;
    height: 45px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.navbar-brand:hover .logo-wrapper {
    transform: translateY(-2px);
}

/* Menu de navegação */
.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
}
.nav-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-btn {
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}
.nav-btn i {
    font-size: 1.1rem;
    color: var(--primary);
}
.nav-btn:hover,
.nav-btn.active {
    background: rgba(245, 130, 32, 0.1);
    color: var(--primary);
}
.nav-btn:hover i,
.nav-btn.active i {
    color: var(--primary-dark);
}

/* Dropdowns */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    z-index: 1000;
    padding: 0.5rem 0;
    border-top: 3px solid var(--primary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}
.nav-item.open .dropdown-content,
.nav-item:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
}
.dropdown-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}
.dropdown-item:hover {
    background: rgba(245, 130, 32, 0.1);
    color: var(--primary);
}

/* Dropdowns Pesquisáveis */
.dropdown-searchable .dropdown-content {
    min-width: 320px;
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
}
.dropdown-search {
    position: sticky;
    top: 0;
    background: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}
.dropdown-search-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    outline: none;
}
.dropdown-items {
    max-height: 380px;
    overflow-y: auto;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem;
    width: 100%;
    flex: 1;
}
.page-header {
    margin-bottom: 2rem;
}
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.highlight-text {
    color: var(--primary);
}
.page-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Glass Card */
.glass-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Título e Tabela Modernos */
.table-container {
    width: 100%;
    display: none;
    padding-bottom: 1rem;
}
.table-container.active {
    display: block;
}

/* NOVO: Estilo melhorado para o título da tabela (ex: 4º Ano) */
.table-section-title {
    margin: 0 0 1rem 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, rgba(245,130,32,0.1) 0%, rgba(255,255,255,0) 100%);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.admin-table th {
    background: rgba(248, 250, 252, 0.8);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}
.admin-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

/* NOVO: Efeito ao passar o rato nas linhas */
.admin-table tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.6);
}

.disciplina-nome {
    font-weight: 500;
}

/* NOVO: Botões da Tabela Melhorados */
.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.btn-doc-info {
    background: var(--info-bg);
    color: var(--info);
}
.btn-doc-info:hover {
    background: var(--info);
    color: white;
    transform: translateY(-2px);
}
.btn-doc-success {
    background: var(--success-bg);
    color: var(--success);
}
.btn-doc-success:hover {
    background: var(--success);
    color: white;
    transform: translateY(-2px);
}

.doc-unavailable {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f1f5f9;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}

/* NOVO: Estado Vazio e Loading */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state .empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}
.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.loading-area {
    text-align: center;
    padding: 4rem 2rem;
}
.spin-anim { 
    animation: spin 1s linear infinite; 
    display: inline-block; 
    font-size: 2.5rem; 
    color: var(--primary); 
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* FAB Button */
.fab-button {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    text-decoration: none;
    z-index: 10;
}
.fab-button:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

/* Footer */
.footer {
    background: var(--text-main);
    color: #94a3b8;
    margin-top: auto;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 1.25rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-logo { font-size: 1.4rem; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.footer-tagline { font-size: 0.8rem; color: #64748b; line-height: 1.5; margin: 0; }
.footer-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.footer-badge {
    background: rgba(245,130,32,0.12);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}
.footer-col h4 {
    color: #e2e8f0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 0.75rem;
}
.footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--primary); }
.footer-col a i { margin-right: 0.4rem; }
.footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 0 0 1rem; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #475569;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* Animações GERAIS */
.slide-up {
    animation: slideUp 0.5s ease forwards;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .navbar-container { padding: 0.75rem 1rem; }
    .nav-menu { order: 3; width: 100%; margin-top: 1rem; }
    .nav-container { justify-content: center; }
    
    .table-section-title {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}