:root {
    --primary-color: #1b3324;    
    --secondary-color: #d4af37;  
    --bg-light: #f8f9fa; /* Fundo branco/luz sólido */
    --white: #ffffff; /* Fundo branco opaco para caixas */
    --text-dark: #2f3542; /* Chumbo limpo */
    --text-gray: #747d8c; 
    --danger: #ff4757;           
    --success: #2ed573;          
    --border-radius: 12px;
    --border: #dcdde1; /* Borda leve cinza */
    --border-subtle: #f1f2f6;

    /* Sombras FLAT/Limpa, removendo toda menção a vidro 3D pesado */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 4px 20px rgba(0, 0, 0, 0.08); /* Sombra difusa e limpa apenas */
    --tr: all 0.3s ease;
}

body.dark-mode {
    --bg-light: #0d0f0e;
    --white: rgba(26, 29, 28, 0.5); /* Fundo glass escuro */
    --text-dark: #f5f5f7;
    --text-gray: #a1a1a6;
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.6);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* --- EFEITOS PARALLAX --- */
.parallax-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-light);
    transition: background-color 0.4s ease;
}

.p-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    transition: transform 0.1s linear;
}

.p-blob.blob1 {
    width: 600px; height: 600px;
    background: var(--secondary-color); /* Dourado */
    top: -150px; left: -150px;
}

.p-blob.blob2 {
    width: 500px; height: 500px;
    background: var(--primary-color); /* Verde */
    bottom: -100px; right: -100px;
}

.p-blob.blob3 {
    width: 300px; height: 300px;
    background: #00b894; /* Tom de verde mais vivo */
    top: 40%; left: 60%;
    opacity: 0.15;
}
@media (max-width: 768px) {
    .p-blob.blob1 { width: 300px; height: 300px; top: -100px; left: -100px; }
    .p-blob.blob2 { width: 250px; height: 250px; bottom: -50px; right: -50px; }
    .glass-panel { padding: 1.5rem; }
}

/* Glassmorphism Liquid Glass */
.glass-panel, section {
    background: var(--white);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), var(--shadow-glass);
    border-radius: var(--border-radius);
    transition: var(--tr);
}

.glass-panel {
    padding: 2.5rem;
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.anim-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botão Flutuante de Tema */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    font-size: 1.2rem;
    transition: var(--tr);
}
.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

body:not(.dark-mode) .theme-toggle .fa-moon { display: block; }
body:not(.dark-mode) .theme-toggle .fa-sun { display: none; }
body.dark-mode .theme-toggle .fa-moon { display: none; }
body.dark-mode .theme-toggle .fa-sun { display: block; color: #f1c40f; }

/* Filter escuro sobre logos da base no modo branco purificado */
body:not(.dark-mode) .login-header img { filter: brightness(0); }
body:not(.dark-mode) .parallax-bg { background: var(--bg-light); }
body:not(.dark-mode) .p-blob { display: none !important; }

/* --- RESET E BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER E LOGO --- */
.logo-container {
    background-color: var(--white);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border-bottom: 3px solid var(--secondary-color);
}

.logo-main {
    max-height: 60px;
    transition: transform 0.3s ease;
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 15px;
    flex: 1;
}

@media (max-width: 600px) {
    .container {
        margin: 1rem auto;
        padding: 0 12px;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

header h2 { color: var(--secondary-color); font-weight: 300; }

/* --- GRID E SEÇÕES --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--tr);
}
section:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

section h3 {
    margin-bottom: 1.2rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

/* --- FORMULÁRIOS --- */
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border);
    background-color: rgba(0,0,0,0.2);
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 16px; /* Evita zoom automático no iOS */
    transition: all 0.3s ease;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}

button.btn-main {
    width: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, #15261b 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: var(--tr);
    box-shadow: 0 4px 0 #0a140d, 0 8px 15px rgba(0,0,0,0.3);
    position: relative;
    top: 0;
}

button.btn-main:hover { 
    filter: brightness(1.1); 
    top: -2px; 
    box-shadow: 0 6px 0 #0a140d, 0 12px 20px rgba(0,0,0,0.4); 
}

button.btn-main:active {
    top: 2px;
    box-shadow: 0 2px 0 #0a140d, 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.05s ease;
}

/* --- MODAIS 3D --- */
.confirm-modal {
    transform-style: preserve-3d;
    perspective: 1000px;
}
.modal-icon i {
    transform: translateZ(40px);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}
.confirm-modal h3, .confirm-modal p {
    transform: translateZ(20px);
}
.modal-buttons {
    transform: translateZ(10px);
}

/* --- PAGINAÇÃO --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-pag {
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--border);
    color: var(--text-dark);
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-pag:hover:not(.disabled) { border-color: var(--secondary-color); color: var(--secondary-color); }
.btn-pag.disabled { opacity: 0.3; cursor: not-allowed; }

/* --- RODAPÉ INSTITUCIONAL --- */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-gray);
    font-size: 12px;
}

footer strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.version-tag {
    display: block;
    margin-top: 5px;
    opacity: 0.5;
    font-family: monospace;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 850px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    header { flex-direction: column; text-align: center; gap: 15px; }
}