/* style.css - MN Projects Dark Glass Theme (V3 Stable) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Cores Base */
    --bg-dark: #05070a;      /* Fundo quase preto */
    --brand-red: #D94032;    /* Vermelho do Logo (Neon) */
    --brand-cream: #f2f0e4;  /* Off-white do Logo */
    
    /* Cores de Texto */
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(20, 25, 35, 0.7); /* Fundo dos cards */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
    --neon-glow: 0 0 15px rgba(217, 64, 50, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(217, 64, 50, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(30, 58, 138, 0.1) 0%, transparent 40%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Interno */
body.internal-page {
    padding-top: 100px;
    display: block;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    padding-bottom: 50px;
}

/* --- COMPONENTES GLOBAIS --- */

/* Glass Card */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header Fixo */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(5, 7, 10, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

/* Links do Header */
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
    letter-spacing: 1px;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--brand-red);
    text-shadow: 0 0 10px rgba(217, 64, 50, 0.4);
}

/* Menu Dropdown */
.user-menu {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #0f141f;
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 2000;
    margin-top: 15px;
    overflow: visible;
}

.dropdown-content::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.user-menu:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-content a:hover {
    background: rgba(217, 64, 50, 0.1);
    color: var(--brand-red);
}

/* --- BOTÕES E INPUTS --- */
.btn-neon {
    background: var(--brand-red);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    display: inline-block;
    text-align: center;
}
.btn-neon:hover {
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.input-group { margin-bottom: 20px; position: relative; }
.input-label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

.input-glass {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}
.input-glass:focus {
    border-color: var(--brand-red);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 10px rgba(217, 64, 50, 0.2);
}

/* --- TABELAS --- */
.table-container { overflow-x: auto; margin-top: 20px; }
.glass-table { width: 100%; border-collapse: collapse; color: var(--text-main); }
.glass-table th, .glass-table td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.glass-table th { background: rgba(217, 64, 50, 0.1); color: var(--brand-red); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; }
.glass-table tr:hover { background: rgba(255, 255, 255, 0.02); }

.action-btn { padding: 5px 10px; border-radius: 4px; text-decoration: none; font-size: 0.8rem; margin-right: 5px; border: 1px solid rgba(255,255,255,0.1); }
.btn-edit { color: #4fd1c5; background: rgba(79, 209, 197, 0.1); }
.btn-del { color: #fc8181; background: rgba(252, 129, 129, 0.1); }

/* --- DASHBOARD & UTILS --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
.widget-title { color: var(--brand-red); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.stat-number { font-size: 2.5rem; font-weight: 700; color: white; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* Agenda List */
.agenda-item { display: flex; gap: 15px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.agenda-date { background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 6px; text-align: center; min-width: 50px; }
.day { font-size: 1.2rem; font-weight: bold; display: block; }
.month { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); }

/* --- RESPONSIVIDADE MOBILE --- */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    body.internal-page { padding-top: 80px; padding-bottom: 90px; }
    .container { padding: 0 15px; max-width: 100%; }
    .glass-header { padding: 0 20px; height: 70px; }
    .glass-header .nav-links { display: none; }
    .glass-header .logo span { font-size: 1.2rem !important; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 20px; }
    .glass-panel[style*="span 2"] { grid-column: span 1 !important; }
    .stat-number { font-size: 2rem; }
    
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
        background: rgba(5, 7, 10, 0.95); backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255, 255, 255, 0.1); z-index: 1000;
        justify-content: space-around; align-items: center; padding-bottom: 10px;
    }
    .mobile-nav-item { color: var(--text-muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; font-size: 0.7rem; gap: 5px; transition: 0.3s; }
    .mobile-nav-item i { font-size: 1.2rem; margin-bottom: 2px; }
    .mobile-nav-item.active { color: var(--brand-red); text-shadow: 0 0 10px rgba(217, 64, 50, 0.4); }
    input, select, textarea { font-size: 16px !important; }
    .table-container { width: 100%; overflow-x: scroll; -webkit-overflow-scrolling: touch; }
}

/* --- SCROLLBAR CUSTOMIZADA (CORRIGIDA) --- */

/* IMPORTANTE: Aplicar APENAS no body e elementos específicos para evitar bugs de renderização */
body::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.modal-box::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.modal-box::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: var(--bg-dark); /* Fundo sólido para estabilidade */
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.modal-box::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 1px solid var(--bg-dark); /* Borda para separação */
}

/* Efeito Hover na Barra */
body::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.modal-box::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: var(--brand-red);
    box-shadow: 0 0 10px var(--brand-red);
}

/* Suporte Firefox */
body, .table-container, .modal-box, textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-dark);
}

/* --- APAGUE ISTO SE QUISER A BARRA PADRÃO DO NAVEGADOR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); 
}

/* --- TOAST NOTIFICATIONS (CORRIGIDO: Topo Direito e Sobreposto) --- */
.toast-container {
    position: fixed !important; /* Garante que FLUTUE sobre a página */
    top: 20px !important;       /* Distância do topo */
    right: 20px !important;     /* Distância da direita */
    z-index: 999999;            /* Garante que fique acima de TUDO (menus, modais) */
    
    display: flex;
    flex-direction: column;     /* Um embaixo do outro */
    align-items: flex-end;      /* FORÇA o alinhamento à direita */
    gap: 10px;
    
    pointer-events: none;       /* Permite clicar no site através da área transparente */
    width: auto;                /* Não ocupa a largura toda */
    max-width: 100%;
}

.toast {
    pointer-events: auto;       /* Permite interagir com o balão */
    background: #1a202c;        /* Fundo escuro sólido */
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 5px solid;     /* Faixa colorida */
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 350px;
    font-size: 0.9rem;
    font-weight: 500;
    
    /* Animação: Entra da direita */
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Classe que torna visível */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Cores */
.toast.success { border-color: #48bb78; }
.toast.success i { color: #48bb78; font-size: 1.2rem; }

.toast.error { border-color: #fc8181; }
.toast.error i { color: #fc8181; font-size: 1.2rem; }

.toast.info { border-color: #63b3ed; }
.toast.info i { color: #63b3ed; font-size: 1.2rem; }

/* Mobile: Ajuste para não sair da tela */
@media (max-width: 768px) {
    .toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        align-items: center; /* No celular centraliza */
    }
    .toast {
        width: 100%;
        max-width: 100%;
    }
}


/* --- FORMULÁRIOS GLOBAIS (GLASS DARK) --- */
/* Aplica a todos os inputs, selects e textareas automaticamente */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea,
.input-glass {
    width: 100%;
    background-color: rgba(20, 25, 35, 0.6) !important; /* Fundo Escuro Translúcido */
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff !important; /* Texto Branco */
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none; /* Remove estilo nativo feio do navegador */
    appearance: none;
}

/* Foco (Ao clicar) */
input:focus, select:focus, textarea:focus {
    border-color: var(--brand-red);
    background-color: rgba(20, 25, 35, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(217, 64, 50, 0.1);
}

/* CORREÇÃO DA LISTA BRANCA (SELECT) */
/* Isso força as opções da lista a serem escuras */
select option {
    background-color: #101e2b; /* Fundo Sólido Escuro */
    color: white;
    padding: 10px;
}

/* Labels (Títulos dos campos) */
label, .input-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Painéis de Vidro Padrão */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}