/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E VARIÁVEIS
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700&display=swap");

:root {
    /* Cores do Tema Escuro (Padrão) */
    --bg-deep: #050505;
    --bg-card: #111111;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1a0b2e 0%, #000000 80%);
    
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Cores de Status e Ação */
    --neon-green: #00ff9d; 
    --neon-pink: #ff007c;
    --neon-purple: #7b2cbf;
    --neon-cyan: #00f0ff;
    --neon-yellow: #ffb74d;
    
    /* Texto */
    --text-main: #ffffff;
    --text-dim: #888888;
}

/* Reset Básico */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    background-color: var(--bg-deep);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    font-family: "Space Grotesk", sans-serif;
    padding: 15px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Container Principal */
.app-container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 10px;
}

/* ==========================================================================
   2. CABEÇALHO E NAVEGAÇÃO
   ========================================================================== */
.header-area {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
    
    /* Mobile: Empilha */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.header-title { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.header-title span { color: var(--neon-green); }

/* Área dos Botões (PDF, Tema, Sair) */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
}

.btn-control {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    min-width: 44px;
}
.btn-control:hover { border-color: var(--neon-green); color: var(--neon-green); }

/* Desktop: Botões vão para a direita */
@media (min-width: 768px) {
    .header-area { display: block; }
    .controls { position: absolute; top: 0; right: 0; }
}

/* Menu de Abas */
.nav-menu { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.nav-link { 
    text-decoration: none; color: var(--text-dim); padding: 10px 20px; 
    border: 1px solid var(--border-light); border-radius: 6px; 
    font-weight: 700; text-transform: uppercase; transition: 0.3s; 
}
.nav-link:hover, .nav-link.active { 
    background: rgba(0, 255, 157, 0.1); 
    color: var(--neon-green); border-color: var(--neon-green); 
}

/* ==========================================================================
   3. FORMULÁRIOS E INPUTS
   ========================================================================== */
/* Estilo Global para Inputs */
.input-dark, .input-modal, .input-login, select.input-dark {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    margin-bottom: 10px;
}
.input-dark:focus, .input-login:focus { 
    border-color: var(--neon-green); 
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.1); 
}

/* Filtros (Inputs pequenos na mesma linha) */
.filter-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.filter-row .input-dark { width: auto; text-align: center; margin-bottom: 0; }

/* Cartões (Login, Upload) */
.upload-card, .login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 25px;
    margin: 0 auto 30px auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    width: 100%; max-width: 500px;
    position: relative; overflow: hidden;
}

/* Linha Neon Decorativa */
.login-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-purple));
}

/* Botão Principal Neon */
.btn-neon {
    width: 100%; padding: 12px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    font-weight: 700; text-transform: uppercase;
    cursor: pointer; border-radius: 6px; transition: 0.3s;
    margin-top: 10px;
}
.btn-neon:hover { background: var(--neon-green); color: #000; }

/* Upload Input Wrapper */
.file-input-wrapper input {
    width: 100%; padding: 10px; background: #000;
    border: 1px dashed var(--border-light); color: #fff;
    border-radius: 6px; margin-bottom: 15px;
}

/* ==========================================================================
   4. TABELAS
   ========================================================================== */
.desktop-view { overflow-x: auto; }

table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card); border-radius: 10px;
    overflow: hidden; margin-top: 10px;
}
th { 
    text-align: left; padding: 15px; 
    background: rgba(255,255,255,0.05); color: var(--neon-purple); 
    text-transform: uppercase; font-size: 0.8rem; white-space: nowrap; 
}
td { padding: 15px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }

.ponto-item { 
    display: inline-flex; align-items: center; margin-right: 8px; 
    background: rgba(127,127,127,0.1); padding: 2px 6px; 
    border-radius: 4px; font-family: monospace; font-size: 0.9rem; 
}

/* Botões Pequenos (Tabela) */
.btn-mini {
    background: transparent; border: 1px solid #555; color: #888;
    padding: 4px 8px; font-size: 0.7rem; cursor: pointer;
    margin-left: 5px; border-radius: 4px; text-transform:uppercase; transition:0.2s;
}
.btn-mini:hover { border-color: var(--text-main); color: var(--text-main); }

.btn-add-time { border-color: var(--neon-green); color: var(--neon-green); font-weight:bold; }
.btn-add-time:hover { background: var(--neon-green); color: #000; }

.btn-trash {
    background: transparent; border: none; color: #666;
    cursor: pointer; font-size: 1rem; margin-left: 5px; transition: 0.2s;
}
.btn-trash:hover { color: var(--neon-pink); transform: scale(1.2); }

/* Badges */
.badge-status { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; display:inline-block; min-width: 60px; text-align:center;}
.st-falta { background: rgba(255, 0, 124, 0.15); color: var(--neon-pink); border: 1px solid var(--neon-pink); }
.st-just { background: rgba(0, 240, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.st-folga { background: rgba(123, 44, 191, 0.15); color: #d2a8ff; border: 1px solid #d2a8ff; }

/* Resumo do Topo */
.resumo-card { 
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; 
    background: var(--bg-card); padding: 20px; border-radius: 12px; 
    margin-bottom: 20px; border: 1px solid var(--border-light); text-align: center; 
}
.res-val { font-size: 1.4rem; font-weight: bold; color: var(--text-main); }
.res-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; }
.dia-semana { display:inline-block; width: 40px; font-size: 0.8rem; color: var(--text-dim); }

/* ==========================================================================
   5. MODAIS
   ========================================================================== */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px); z-index: 1000;
    justify-content: center; align-items: center; padding: 20px;
}
.modal-content {
    background: var(--bg-card); border: 1px solid var(--border-light);
    padding: 25px; border-radius: 12px; width: 100%; max-width: 400px;
    text-align: center; position: relative; animation: slideDown 0.3s ease;
}
@keyframes slideDown { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

.modal-title { color: var(--text-main); margin-bottom: 20px; font-size: 1.2rem; text-transform: uppercase; }
.modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; color: #555; font-size: 1.5rem; cursor: pointer; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-confirm { flex: 1; background: var(--neon-green); color: #000; font-weight: bold; padding: 12px; border: none; border-radius: 6px; cursor: pointer; text-transform: uppercase; }
.btn-cancel { flex: 1; background: transparent; border: 1px solid #555; color: #aaa; padding: 12px; border-radius: 6px; cursor: pointer; text-transform: uppercase; }
.btn-delete { flex: 1; background: rgba(255, 0, 124, 0.2); border: 1px solid var(--neon-pink); color: var(--neon-pink); padding: 12px; border-radius: 6px; cursor: pointer; text-transform: uppercase; font-weight:bold;}

/* ==========================================================================
   6. TEMA CLARO
   ========================================================================== */
body.light-mode {
    --bg-deep: #f4f6f9; --bg-card: #ffffff; --bg-gradient: none; --border-light: #ddd;
    --text-main: #333; --text-dim: #666;
    --neon-green: #00994d; --neon-pink: #d6004c; --neon-purple: #6200ea;
}
body.light-mode .input-dark, body.light-mode select.input-dark, body.light-mode .input-login, body.light-mode .input-modal { 
    background: #fff; color: #333; border: 1px solid #ccc; 
}
body.light-mode .btn-control { border-color: #ccc; color: #333; background: #fff; }

/* Página de Login Full */
.login-body {
    display: flex; justify-content: center; align-items: center;
    height: 100vh; margin: 0;
    background: radial-gradient(circle at 50% 50%, #1a0b2e 0%, #000000 90%);
}

.msg-box { margin-top: 15px; padding: 10px; border-radius: 6px; font-size: 0.9rem; text-align: center; }
.msg-success { background: rgba(0, 255, 157, 0.1); color: var(--neon-green); border: 1px solid var(--neon-green); }
.msg-error { background: rgba(255, 0, 124, 0.1); color: var(--neon-pink); border: 1px solid var(--neon-pink); }

/* --- ALERTA DE MARCAÇÃO ÍMPAR (ERRO) --- */
.st-impar { 
    background: rgba(255, 165, 0, 0.15); 
    color: #ffb74d; /* Laranja Claro */
    border: 1px solid #ffb74d; 
}

/* Linha da tabela com erro fica levemente alaranjada */
tr.row-error td {
    background: rgba(255, 165, 0, 0.05);
}

/* Ícone de alerta */
.icon-warn { margin-left: 5px; color: #ffb74d; font-weight: bold; cursor: help; }





/* --- ESTILO DO MENU DROPDOWN --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none; /* Escondido por padrão */
    position: absolute;
    right: 0;
    top: 110%; /* Fica logo abaixo do botão */
    background-color: var(--bg-card);
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.8);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

/* Mostra o menu quando tem a classe 'show' */
.dropdown-menu.show { display: block; }

/* Itens do Menu */
.dropdown-item {
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
    font-size: 0.95rem;
}

.dropdown-item:last-child { border-bottom: none; }

.dropdown-item:hover {
    background-color: rgba(0, 255, 157, 0.1);
    color: var(--neon-green);
    padding-left: 20px; /* Efeito de deslize */
}

/* Ajuste para tema claro */
body.light-mode .dropdown-menu { 
    background: #fff; border-color: #ccc; box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
}
body.light-mode .dropdown-item { 
    color: #333; border-bottom: 1px solid #eee; 
}
body.light-mode .dropdown-item:hover { 
    background-color: #f0f0f0; color: var(--neon-cyan); 
}

/* Animação suave */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Adicione no final do seu style.css */
.badge-atraso {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4d4d; /* Vermelho claro */
    border: 1px solid #ff4d4d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 5px;
    display: inline-block;
}

/* --- DASHBOARD (HOME) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
}

.stat-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--text-main);
}

.stat-info p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Área Principal dividida */
.main-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Esquerda maior, direita menor */
    gap: 20px;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shortcut-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.shortcut-btn:hover {
    background: rgba(0, 255, 157, 0.05);
    color: var(--neon-green);
    border-color: var(--neon-green);
    padding-left: 20px;
}

/* Mobile */
@media (max-width: 800px) {
    .main-content-grid { grid-template-columns: 1fr; }
}

