/* Configurações Globais */
:root {
    /* Paleta Deep Purple */
    --primary: #6366f1;         /* Roxo Indigo */
    --primary-hover: #4f46e5;
    --secondary: #a855f7;       /* Roxo Vibrante */
    --dark-purple: #1e1b4b;     /* Roxo quase preto para Sidebar */
    --accent: #f472b6;          /* Rosa para detalhes de destaque */
    
    /* Cores de Fundo e Texto */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Estados */
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* Telas (Navegação) */
.full-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

#app-screen {
    display: flex;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Login Box */
.login-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 { margin-bottom: 0.5rem; color: var(--primary); }
.login-box p { color: var(--text-muted); margin-bottom: 2rem; }

input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

nav { flex: 1; }

.nav-item {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    border: none;
    background: transparent;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.nav-item.active, .nav-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

/* Conteúdo Principal */
.content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Botões */
.btn-main, .btn-add {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-main:hover { background: var(--primary-dark); }

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: auto;
}

/* Tabela Moderna */
.table-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f1f5f9;
    text-align: left;
    padding: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

.filter-bar {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.presence-toggle {
    display: flex;
    gap: 15px;
    font-weight: 600;
}

.actions-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-success {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-card .label { color: var(--text-muted); font-size: 0.9rem; display: block; }
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--primary); }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-ok { background: #dcfce7; color: #166534; }
.status-alert { background: #fee2e2; color: #991b1b; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #eff6ff;
}

/* --- RESPONSIVIDADE (MOBILE FIRST) --- */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px; /* Remove a largura lateral */
    }

    /* Sidebar vira Tab Bar Inferior */
    .sidebar {
        width: 100%;
        height: 65px;
        flex-direction: row;
        bottom: 0;
        left: 0;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
    }

    .brand {
        display: none; /* Esconde a logo na barra inferior */
    }

    nav {
        display: flex;
        width: 100%;
        justify-content: space-around;
        margin: 0;
    }

    .nav-item {
        margin-bottom: 0;
        padding: 0.5rem;
        font-size: 0.75rem;
        text-align: center;
        flex: 1;
        border-radius: 0;
    }

    /* Ajuste do Conteúdo Principal */
    .content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 80px; /* Espaço para não cobrir o conteúdo com a barra */
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        width: 100%;
    }

    .btn-main, .btn-add, .btn-outline {
        width: 100%; /* Botões ocupam largura total no mobile */
    }

    /* Tabelas com Scroll Horizontal no Mobile */
    .table-wrapper {
        overflow-x: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos do Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}





/* Sidebar com Gradiente Moderno */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-purple) 0%, #312e81 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    border: none;
}

.brand {
    font-size: 1.6rem;
    letter-spacing: -1px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-item {
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(10px);
    transform: translateX(5px);
}

/* Cards com Sombra Suave (Efeito Flutuante) */
.table-wrapper, .stat-card, .modal-card {
    border: none;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
}

/* Botões com Gradiente */
.btn-main, .btn-add, .btn-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}




.full-screen {
    background: radial-gradient(circle at top left, #4f46e5, #1e1b4b);
}

.login-box {
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px; /* Espaço entre ícone e texto */
}

.nav-item i {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

/* Efeito visual no ícone quando ativo */
.nav-item.active i {
    color: var(--secondary);
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.4));
}


.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f1f5f9;
}

.btn-icon i {
    width: 16px;
    height: 16px;
}

/* Cores específicas para o tema Roxo/Rosa */
.btn-icon.edit { color: var(--primary); }
.btn-icon.edit:hover { background: #e0e7ff; color: var(--primary-dark); }

.btn-icon.delete { color: var(--danger); }
.btn-icon.delete:hover { background: #fee2e2; transform: scale(1.1); }

/* Badge de Turma Estilizada */
.badge-turma {
    background: #f3e8ff;
    color: var(--secondary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Efeito de destaque nas linhas da tabela */
tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f5f3ff; /* Um roxo bem clarinho */
}

/* Badge de Status Ativo (Roxo) */
.status-ok {
    background: #ede9fe;
    color: var(--secondary);
    border: 1px solid #ddd6fe;
}

/* Grid de Estatísticas Moderno */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i { width: 28px; height: 28px; color: white; }

/* Cores dos Ícones com Gradientes */
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-icon.indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.stat-icon.pink { background: linear-gradient(135deg, #f472b6, #db2777); }

.stat-info { text-align: left; }
.stat-info .label { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.stat-info .value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text-main); }

.modal-card.wide { max-width: 850px; }
.form-container { display: flex; gap: 2rem; margin-top: 1rem; }
.form-sidebar { width: 200px; }
.form-content { flex: 1; }

.photo-upload {
    width: 150px; height: 150px; background: #f1f5f9; border: 2px dashed var(--border);
    border-radius: 20px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; margin-bottom: 1rem; position: relative; overflow: hidden;
}
.photo-upload img { width: 100%; height: 100%; object-fit: cover; }

.tabs-nav { display: flex; gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
    padding: 0.5rem 1rem; border: none; background: none; cursor: pointer;
    color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.modal-card.wide { max-width: 900px; width: 95%; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.btn-photo {
    margin-top: 10px; padding: 6px 12px; font-size: 0.75rem;
    border: 1px solid var(--primary); color: var(--primary);
    background: white; border-radius: 6px; cursor: pointer;
}

.tab-content textarea { width: 100%; border-radius: 8px; border: 1px solid var(--border); padding: 0.5rem; }

/* Badge de Aniversário na Lista */
.aluno-info-chamada {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bday-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fdf2f8; /* Rosa bem claro */
    color: #db2777;    /* Rosa escuro */
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #fbcfe8;
    width: fit-content;
    animation: pulse-bday 2s infinite;
}

@keyframes pulse-bday {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.nome-aluno-lista {
    font-weight: 600;
}

.stat-icon.pink-light {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
}

.dashboard-secondary-grid { margin-bottom: 2rem; }
.bday-list-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.bday-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
}

.bday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    min-width: 220px;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.bday-item:hover { transform: translateY(-3px); border-color: var(--secondary); }

.bday-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; overflow: hidden;
}

.bday-day {
    background: #fdf2f8; color: #db2777;
    padding: 4px 8px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 700;
}

.bday-list {
    display: flex;
    gap: 12px;
    overflow-x: auto; /* Scroll horizontal se houver muitos */
    padding: 10px 5px;
}

.bday-item {
    min-width: 200px;
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bday-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    overflow: hidden;
}

.bday-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bday-name { display: block; font-size: 0.85rem; font-weight: 600; }
.bday-sub { font-size: 0.75rem; color: var(--text-muted); }
.bday-day { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: #db2777; background: #fdf2f8; padding: 4px 8px; border-radius: 8px; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease-out forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { transform: translateX(20px); opacity: 0; }
}

.confirm-card {
    max-width: 400px;
    text-align: center;
    padding: 2.5rem;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    background: #fee2e2;
    color: var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.confirm-icon i { width: 32px; height: 32px; }

.btn-danger-confirm {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-confirm:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.confirm-footer {
    justify-content: center;
    gap: 1rem;
}

/* Fundo Radial Profundo */
.full-screen {
    background: radial-gradient(circle at center, #6366f1 0%, #1e1b4b 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container de Login */
.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* Logo Circular AE */
.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto -40px; /* Sobrepõe a caixa de login */
    position: relative;
    z-index: 10;
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border: 4px solid white;
}

/* Glassmorphism Box */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 60px 40px 30px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-box h1 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 5px;
}

.login-box h1 span { color: var(--secondary); }

.login-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* Campos de Entrada */
.input-wrapper {
    text-align: left;
    margin-bottom: 15px;
}

.input-wrapper label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-left: 5px;
    display: block;
    margin-bottom: 5px;
}

.login-box input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.3s;
}

.login-box input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Botão Premium */
.btn-login-premium {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
}

.btn-login-premium:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
}

/* Crédito Sonne Sistemas */
.developer-credit {
    margin-top: 30px;
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}
/* Ajuste do Fundo das Páginas Internas */
.content {
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    background: #f1f5f9; /* Fundo cinza azulado claro para destacar os cartões */
    min-height: 100vh;
}

/* Estilo de Cartão Flutuante para as Seções */
.page-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 24px; /* Bordas bem arredondadas como na tela de login */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    animation: fadeInPage 0.4s ease-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cabeçalhos dentro das seções */
.page-section header h2 {
    color: var(--dark-purple);
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Tabelas dentro dos cartões flutuantes */
.table-wrapper {
    background: white;
    border-radius: 18px;
    margin-top: 1.5rem;
    overflow: hidden;
}

/* Ajuste nos Cards de Estatísticas para combinar */
.stat-card {
    border-radius: 24px;
    border: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.06);
}