/* Contaí - Estilos Principais */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #00D4AA;
    --primary-light: #E6FFFA;
    --red-primary: #FF6B6B;
    --red-light: #FFE8E8;
    --blue-primary: #4A90E2;
    --blue-light: #E8F4FF;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 14px;
}

/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 28px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.logo svg {
    height: 36px;
    width: auto;
    max-width: 160px;
}

.logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
    max-width: 200px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00D4AA 0%, #00F2C5 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.profile-selector {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 32px;
}

.nav-group-title {
    padding: 0 20px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.nav-item:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-green);
    border-left-color: var(--primary-green);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 4px 0 0 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.2;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-content {
    padding: 24px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.success {
    border-left: 4px solid var(--primary-green);
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
}

.stat-card.danger {
    border-left: 4px solid var(--red-primary);
    background: linear-gradient(135deg, var(--white) 0%, var(--red-light) 100%);
}

.stat-card.info {
    border-left: 4px solid var(--blue-primary);
    background: linear-gradient(135deg, var(--white) 0%, var(--blue-light) 100%);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
}

.stat-card.success .stat-icon {
    background: var(--primary-green);
    color: white;
}

.stat-card.danger .stat-icon {
    background: var(--red-primary);
    color: white;
}

.stat-card.info .stat-icon {
    background: var(--blue-primary);
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: 8px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--primary-green);
}

.stat-change.negative {
    color: var(--red-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: #00A142;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 200, 81, 0.1);
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background: var(--primary-light);
    color: var(--primary-green);
}

.badge-warning {
    background: #FEF3C7;
    color: #D97706;
}

.badge-info {
    background: var(--blue-light);
    color: var(--blue-primary);
}

/* Alert */
.alert {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: var(--primary-light);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.alert-danger {
    background: var(--red-light);
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.alert-warning {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #D97706;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--gray-200);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-logo svg {
    height: 60px;
    width: auto;
    max-width: 200px;
}

.login-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    max-width: 250px;
}

.login-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-green);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 16px;
    margin: 0;
}

/* Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.w-full { width: 100%; }
.mb-3 { margin-bottom: 28px; }
.mt-4 { margin-top: 40px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px;
    }
    
    .header {
        padding: 16px 20px;
        min-height: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .user-info {
        display: none;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-header {
        padding: 20px;
    }
}
/* Profile Switcher no Header */
.profile-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.profile-switcher:hover {
    background: var(--gray-100);
}

.profile-switcher-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
    white-space: nowrap;
}

.profile-selector-header {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    min-width: 200px;
    outline: none;
}

.profile-selector-header:focus {
    outline: none;
}

/* User Menu e Dropdown */
.user-menu {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--gray-50);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 1000;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-green), #00A142);
    color: white;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-dropdown-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.user-dropdown-email {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.2;
    margin-top: 2px;
}

.user-dropdown-profile {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.user-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--gray-500);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .profile-switcher {
        display: none;
    }
    
    .user-dropdown {
        min-width: 260px;
        right: -10px;
    }
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }
    
    .user-dropdown {
        min-width: 240px;
        right: -20px;
    }
    
    .user-dropdown-header {
        padding: 16px;
    }
    
    .user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
/* ADICIONE ESTE CSS NO FINAL DO style.css para ocultar o debug box */

#profile-debug {
    display: none !important;
}
/* ===== SELETOR DE PERFIL ===== */
.profile-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.profile-switcher:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.profile-switcher-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
    white-space: nowrap;
}

.profile-selector-header {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    min-width: 180px;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.profile-selector-header:hover {
    background: var(--gray-100);
}

.profile-selector-header:focus {
    background: var(--white);
    box-shadow: 0 0 0 2px var(--primary-green);
}

/* ===== MENU DO USUÁRIO ===== */
.user-menu {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    padding: 8px;
}

.user-menu:hover {
    background: var(--gray-50);
}

.user-menu-arrow {
    margin-left: 8px;
    font-size: 12px;
    color: var(--gray-500);
    transition: var(--transition);
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-green), #00A142);
    color: white;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-dropdown-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.user-dropdown-email {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.2;
    margin-top: 2px;
}

.user-dropdown-profile {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-section {
    padding: 0 8px;
}

.user-dropdown-section-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.user-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--gray-500);
}

/* ===== NOTIFICAÇÕES ===== */
.profile-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    cursor: pointer;
}

.profile-notification.success {
    background: var(--primary-green);
    color: white;
}

.profile-notification.error {
    background: var(--red-primary);
    color: white;
}

/* ===== LOADING OVERLAY ===== */
.profile-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .profile-switcher {
        display: none;
    }
    
    .user-dropdown {
        min-width: 280px;
        right: -10px;
    }
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }
    
    .user-dropdown {
        min-width: 260px;
        right: -20px;
    }
    
    .user-dropdown-header {
        padding: 16px;
    }
    
    .user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .profile-notification {
        max-width: 320px;
        right: 10px;
        top: 10px;
    }
}
/* Adicione estes estilos ao final do seu style.css */

/* ===== GRÁFICOS E CHARTS ===== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    max-height: 300px !important;
}

/* Responsividade para gráficos */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .chart-container canvas {
        max-height: 250px !important;
    }
}

/* Animações suaves para os cards de estatísticas */
.stat-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay nas animações dos cards */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading state para gráficos */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: var(--gray-50);
    border-radius: 8px;
    color: var(--gray-500);
}

.chart-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects para cards com gráficos */
.card:hover .chart-container {
    transform: scale(1.01);
    transition: transform 0.3s ease;
}

/* Customização para tooltips dos gráficos */
.chartjs-tooltip {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Estilos para botões de filtro de período */
.period-buttons {
    display: flex;
    gap: 8px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 8px;
}

.period-buttons .btn {
    border-radius: 6px;
    transition: all 0.2s ease;
}

.period-buttons .btn.active {
    background: var(--primary-green);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 212, 170, 0.3);
}

/* Melhorias na tabela de transações */
.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
    transform: translateX(2px);
}

/* Badges com animação */
.badge {
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* Empty state melhorado */
.empty-state {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsividade aprimorada */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-content {
        padding: 20px;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .chart-container canvas {
        filter: brightness(0.9);
    }
}
/* ===== RESPONSIVIDADE MOBILE COMPLETA - SEM ALTERAR DESKTOP ===== */
/* Adicione este CSS ao final do seu style.css existente */

/* ===== VARIÁVEIS MOBILE ===== */
:root {
    --mobile-xs: 320px;
    --mobile-sm: 375px;
    --mobile-md: 414px;
    --mobile-lg: 480px;
    --tablet: 768px;
}

/* ===== BASE MOBILE (até 767px) ===== */
@media (max-width: 767px) {
    /* RESET PARA MOBILE */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    html {
        -webkit-text-size-adjust: 100%;
    }
    
    body {
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
    }
    
    /* SIDEBAR MOBILE */
    .sidebar {
        width: 280px;
        max-width: calc(100vw - 40px);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar-header {
        padding: 16px 20px;
    }
    
    .logo svg {
        max-width: 140px;
        height: 32px;
    }
    
    .nav-group-title {
        font-size: 11px;
        padding: 8px 20px 6px;
    }
    
    .nav-item {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .nav-item i {
        width: 18px;
        font-size: 16px;
    }
    
    /* MAIN CONTENT MOBILE */
    .main-content {
        margin-left: 0;
    }
    
    /* HEADER MOBILE */
    .header {
        padding: 12px 16px;
        min-height: 60px;
        flex-wrap: nowrap;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        flex-shrink: 0;
    }
    
    .menu-toggle {
        display: flex;
        width: 40px;
        height: 40px;
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: var(--gray-600);
    }
    
    .page-title {
        font-size: 20px;
        line-height: 1.2;
    }
    
    .page-subtitle {
        font-size: 13px;
        margin-top: 2px;
    }
    
    /* USER MENU MOBILE */
    .user-info {
        display: none;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .user-dropdown {
        position: fixed;
        top: 70px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        min-width: auto;
    }
    
    .user-dropdown-header {
        padding: 16px 20px;
    }
    
    .user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .user-dropdown-name {
        font-size: 15px;
    }
    
    .user-dropdown-email {
        font-size: 12px;
    }
    
    .user-dropdown-item {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 44px;
    }
    
    /* PROFILE SWITCHER OCULTO */
    .profile-switcher {
        display: none !important;
    }
    
    /* PAGE CONTENT MOBILE */
    .page-content {
        padding: 16px;
    }
    
    /* PAGE HEADER MOBILE */
    .page-header {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 24px;
        align-items: flex-start !important;
    }
    
    .page-header > div:first-child {
        width: 100%;
    }
    
    .page-header > div:first-child > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* CARDS MOBILE */
    .card {
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .card-title {
        font-size: 16px;
        width: 100%;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .card-content {
        padding: 20px;
    }
    
    /* STATS GRID MOBILE */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .stat-card {
        padding: 20px;
        text-align: center;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-header {
        justify-content: center;
        margin-bottom: 12px;
    }
    
    .stat-title {
        font-size: 13px;
        justify-content: center;
    }
    
    .stat-icon {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    /* GRIDS MOBILE */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* BOTÕES MOBILE */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .card-content .btn:not(.btn-sm):not(.btn-outline) {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    /* FORMULÁRIOS MOBILE */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Previne zoom no iOS */
        border-radius: 8px;
        min-height: 44px;
    }
    
    select.form-control {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 12px center;
        background-repeat: no-repeat;
        background-size: 16px;
        padding-right: 40px;
    }
    
    /* TABELAS MOBILE */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .table th {
        font-size: 11px;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    
    /* Primeira coluna sticky */
    .table th:first-child,
    .table td:first-child {
        position: sticky;
        left: 0;
        background: var(--white);
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    }
    
    .table th:first-child {
        background: var(--gray-50);
        z-index: 3;
    }
    
    /* Scrollbar customizada */
    .table-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: var(--gray-100);
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: var(--gray-400);
        border-radius: 2px;
    }
    
    /* BADGES MOBILE */
    .badge {
        padding: 3px 8px;
        font-size: 11px;
        border-radius: 4px;
        font-weight: 600;
    }
    
    /* ALERTS MOBILE */
    .alert {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    /* NOTIFICAÇÕES MOBILE */
    .profile-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    /* EMPTY STATE MOBILE */
    .empty-state {
        padding: 32px 20px;
        text-align: center;
    }
    
    .empty-state i {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .empty-state h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .empty-state p {
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    /* GRÁFICOS MOBILE */
    .chart-container {
        height: 250px;
    }
    
    .chart-container canvas {
        max-height: 250px !important;
    }
    
    /* COMPONENTES ESPECÍFICOS MOBILE */
    
    /* Lista de Categorias */
    .categoria-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 8px;
        background: var(--gray-50);
    }
    
    .categoria-item > div:first-child {
        width: 100%;
    }
    
    .categoria-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Cards de Meta */
    .meta-card {
        padding: 20px;
    }
    
    .meta-card .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Lista de Mercado */
    .listas-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .lista-card {
        padding: 20px;
    }
    
    .item-card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
        padding: 16px;
    }
    
    .item-card > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Perfis Grid */
    .perfis-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* ===== MOBILE EXTRA SMALL (até 374px) ===== */
@media (max-width: 374px) {
    .sidebar {
        width: calc(100vw - 30px);
        max-width: 250px;
    }
    
    .header {
        padding: 10px 12px;
        min-height: 56px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .user-dropdown {
        right: 5px;
        left: 5px;
        top: 60px;
    }
    
    .profile-notification {
        right: 5px;
        left: 5px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .chart-container canvas {
        max-height: 200px !important;
    }
}

/* ===== MOBILE SMALL (375px - 413px) ===== */
@media (min-width: 375px) and (max-width: 413px) {
    .page-header > div:first-child > div {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .card-actions {
        width: auto;
        justify-content: flex-end;
    }
}

/* ===== MOBILE LARGE (414px - 479px) ===== */
@media (min-width: 414px) and (max-width: 479px) {
    .page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
    
    .page-header .btn {
        width: auto;
        flex-shrink: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .categoria-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .categoria-item > div:first-child {
        flex: 1;
    }
    
    .categoria-actions {
        width: auto;
        flex-shrink: 0;
    }
}

/* ===== MOBILE LANDSCAPE (480px - 767px) ===== */
@media (min-width: 480px) and (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .listas-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .perfis-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .chart-container {
        height: 280px;
    }
    
    .chart-container canvas {
        max-height: 280px !important;
    }
}

/* ===== LANDSCAPE MOBILE ESPECÍFICO ===== */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 8px 16px;
        min-height: 48px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .page-subtitle {
        display: none;
    }
    
    .page-content {
        padding: 12px 16px;
    }
    
    .card-header {
        padding: 12px 16px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .sidebar {
        width: 200px;
        max-width: 200px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .nav-group-title {
        padding: 6px 12px 4px;
        font-size: 10px;
    }
    
    .user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        line-height: 1.2;
    }
    
    .user-name {
        font-size: 11px;
        font-weight: 500;
    }
    
    .user-role {
        font-size: 10px;
        color: var(--gray-500);
    }
}

/* ===== OTIMIZAÇÕES DE TOQUE ===== */
@media (max-width: 767px) {
    /* Áreas de toque adequadas */
    .btn,
    .nav-item,
    .user-dropdown-item,
    .form-control {
        min-height: 44px;
    }
    
    .btn-sm {
        min-height: 36px;
    }
    
    /* Feedback visual para toque */
    .btn:active,
    .nav-item:active,
    .user-dropdown-item:active {
        transform: scale(0.98);
        opacity: 0.8;
        transition: all 0.1s ease;
    }
    
    /* Prevenir seleção de texto em elementos interativos */
    .btn,
    .nav-item,
    .user-dropdown-item,
    .menu-toggle {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* ===== SCROLL OTIMIZADO ===== */
@media (max-width: 767px) {
    .page-content,
    .sidebar,
    .table-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== OVERLAY PARA SIDEBAR ===== */
@media (max-width: 767px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar.open ~ .sidebar-overlay,
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* ===== ANIMAÇÕES MOBILE ===== */
@media (max-width: 767px) {
    .sidebar {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .user-dropdown {
        transition: all 0.2s ease;
    }
    
    .card {
        animation: fadeInUp 0.4s ease;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Reduzir animações se preferência for por menos movimento */
    @media (prefers-reduced-motion: reduce) {
        .sidebar,
        .card,
        .btn:hover,
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ===== UTILITY CLASSES MOBILE ===== */
@media (max-width: 767px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .mobile-no-padding {
        padding: 0 !important;
    }
    
    .mobile-small-text {
        font-size: 12px !important;
    }
    
    .mobile-hide-scrollbar {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .mobile-hide-scrollbar::-webkit-scrollbar {
        display: none;
    }
}

/* ===== DARK MODE MOBILE ===== */
@media (max-width: 767px) and (prefers-color-scheme: dark) {
    .table th:first-child,
    .table td:first-child {
        box-shadow: 2px 0 4px rgba(255,255,255,0.1);
    }
    
    .sidebar-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* ===== PRINT MOBILE ===== */
@media print {
    .sidebar,
    .menu-toggle,
    .user-dropdown,
    .btn,
    .card-actions,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .card {
        break-inside: avoid;
        margin-bottom: 10px !important;
    }
    
    .table {
        min-width: auto !important;
    }
    
    .table th:first-child,
    .table td:first-child {
        position: static !important;
        box-shadow: none !important;
    }
}

/* ===== ACESSIBILIDADE ===== */
@media (max-width: 767px) {
    /* Foco visível */
    .btn:focus,
    .nav-item:focus,
    .form-control:focus,
    .menu-toggle:focus {
        outline: 2px solid var(--primary-green);
        outline-offset: 2px;
    }
    
    /* Screen reader only */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    /* Contraste melhorado */
    .badge,
    .stat-title,
    .form-label {
        font-weight: 600;
    }
}

/* ===== iOS ESPECÍFICO ===== */
@supports (-webkit-touch-callout: none) {
    .form-control,
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select {
        font-size: 16px; /* Previne zoom */
    }
    
    .sidebar,
    .page-content,
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
}