/* =====================================================
   SISTEMA DE GESTÃO - CSS PRINCIPAL
   ===================================================== */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #0EA5E9;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --dark: #1E293B;
    --dark-light: #334155;
    --gray: #64748B;
    --gray-light: #94A3B8;
    --light: #F1F5F9;
    --white: #FFFFFF;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--dark-light);
}

.sidebar-logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.sidebar-menu {
    padding: 20px 0;
}

.menu-label {
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 20px;
    letter-spacing: 0.05em;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-light);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--dark-light);
    color: var(--white);
}

.menu-item.active {
    background: var(--dark-light);
    color: var(--white);
    border-left-color: var(--primary);
}

.menu-item i {
    font-size: 1.2rem;
    width: 24px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--white);
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

/* Content Area */
.content {
    padding: 30px;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-icon.blue { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-icon.green { background: linear-gradient(135deg, var(--success), #34D399); }
.stat-icon.yellow { background: linear-gradient(135deg, var(--warning), #FBBF24); }
.stat-icon.red { background: linear-gradient(135deg, var(--danger), #F87171); }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background: #F8FAFC;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-light);
    color: var(--dark);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.form-select {
    appearance: none;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: #E2E8F0; color: #475569; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--success); }
.alert-warning { background: #FEF3C7; color: #92400E; border-left: 4px solid var(--warning); }
.alert-danger { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--danger); }
.alert-info { background: #DBEAFE; color: #1E40AF; border-left: 4px solid var(--secondary); }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =====================================================
   CHARTS
   ===================================================== */
.chart-container {
    position: relative;
    height: 300px;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: var(--dark);
}

.login-logo p {
    color: var(--gray);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray); }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}
