:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --dark: #0F172A;
    --light: #F8FAFC;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --danger: #EF4444;
    --warning: #F59E0B;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--text-main);
    line-height: 1.6;
}

/* Authentication Page Styles */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    position: relative;
    overflow: hidden;
}

/* Background Animated Blobs */
.auth-page::before, .auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    animation: blob-bounce 8s infinite alternate;
}
.auth-page::before {
    background: rgba(79, 70, 229, 0.3);
    top: -100px;
    left: -100px;
}
.auth-page::after {
    background: rgba(16, 185, 129, 0.2);
    bottom: -150px;
    right: -50px;
    animation-delay: 2s;
}

@keyframes blob-bounce {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(30px, 30px); }
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-header .icon-container {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Buttons */
.auth-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-portal {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.btn-portal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-portal i {
    font-size: 20px;
    color: var(--primary);
}

/* Form Styles */
.hidden {
    display: none !important;
}

.auth-form {
    text-align: left;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-link {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-link:hover {
    color: var(--primary);
}

/* Dashboard Layout Structure */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-header i {
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 24px;
    color: var(--dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Modals */
.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: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

/* =====================================================================
   RESPONSIVIDADE (Celulares e Tablets)
   ===================================================================== */

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 900px) {
    /* Layout Base */
    .dashboard-layout {
        flex-direction: column;
    }
    
    /* Sidebar flutuante no celular */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Conteúdo Principal */
    .main-content {
        padding: 15px;
        width: 100%;
    }
    
    /* Botão de Menu */
    .mobile-menu-btn {
        display: inline-block;
    }
    
    /* Top Bar */
    .top-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .page-title {
        display: flex;
        align-items: center;
    }
    
    /* Tabelas Responsivas */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    table {
        min-width: 600px; /* Garante que não esmague no celular */
    }
    
    /* Glass Panels */
    .glass-panel {
        padding: 20px;
    }
    
    /* Outros Ajustes */
    .auth-container {
        padding: 20px;
        margin: 15px;
        width: auto;
    }

    /* Grids (Dashboard) */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
