:root {
            --primary: #0039ba;
            --primary-light: #eef2ff;
            --secondary: #3f37c9;
            --success: #10b981;
            --info: #4895ef;
            --warning: #fa6621;
            --danger: #c80028;
            --dark: #1e293b;
            --light: #f8fafc;
            --gray: #64748b;
            --gray-light: #cbd5e1;
            --border: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --radius: 8px;
            --radius-lg: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            
            color: var(--dark);
            line-height: 1.6;
        }

        .main-content {
            padding: 1.5rem;
        }

      /* ===== HEADER ===== */
.dashboard-header {
    
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    border-bottom: 2px solid #64748b4f;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.dashboard-title-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-title .icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    
}

.dashboard-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;

}

.dashboard-title p {
    margin: 4px 0 0 0;
    color: var(--gray-500);
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    font-size: 14px;;
}

/* ===== FILTERS ===== */
.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 1200px) {
    .filters-section {
        width: 100%;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 2px solid var(--gray-100);
    }
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.filter-input {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    background: white;
    color: var(--gray-700);
    min-width: 140px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-dash {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary-dash {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary-dash:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-outline-dash {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-dash:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

        /* Stats Grid - Compacto com 6 cards na mesma linha */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-card {
            background: white;
            border-radius: var(--radius);
            padding: 1rem;
            box-shadow: var(--shadow);
            border-left: 4px solid var(--card-color);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .stat-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.75rem;
        }

        .stat-card-title {
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--gray);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-card-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--card-bg);
            color: var(--card-color);
            font-size: 1rem;
        }

        .stat-card-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--dark);
            margin-bottom: 0.25rem;
        }

        .stat-card-footer {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: var(--gray);
        }

        .trend-up {
            color: #10b981;
            font-weight: 500;
        }

        .trend-down {
            color: var(--danger);
            font-weight: 500;
        }

        /* Charts Section */
        .charts-section {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .chart-card {
            background: white;
            border-radius: var(--radius);
            padding: 1.25rem;
            box-shadow: var(--shadow);
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1.25rem;
        }

        .chart-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 0.25rem;
        }

        .chart-subtitle {
            font-size: 0.875rem;
            color: var(--gray);
        }

        .chart-container {
            height: 250px;
            position: relative;
        }

        .chart-container-small {
            height: 200px;
            position: relative;
        }

        /* Ranking Container */
        .ranking-container {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            max-height: 200px;
            overflow-y: auto;
            padding-right: 0.5rem;
        }

        .ranking-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem;
            border-radius: var(--radius);
            background-color: var(--light);
            transition: all 0.2s ease;
        }

        .ranking-item:hover {
            background-color: var(--primary-light);
        }

        .ranking-item.top-1 {
            background: linear-gradient(90deg, rgba(255, 217, 0, 0.219) 0%, rgba(255, 217, 0, 0.103) 100%);
            border-left: 3px solid gold;
        }

        .ranking-item.top-2 {
            background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, rgba(192, 192, 192, 0.05) 100%);
            border-left: 3px solid silver;
        }

        .ranking-item.top-3 {
            background: linear-gradient(90deg, rgba(253, 134, 15, 0.322) 0%, rgba(205, 127, 50, 0.103) 100%);
            border-left: 3px solid #f5891e;
        }

        .rank-position {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background-color: white;
            font-weight: 700;
            color: var(--dark);
            font-size: 0.75rem;
            box-shadow: var(--shadow);
        }

        .peca-info {
            flex: 1;
        }

        .peca-nome {
            font-weight: 600;
            margin-bottom: 0.15rem;
            font-size: 0.875rem;
        }

        .peca-detalhes {
            display: flex;
            gap: 0.75rem;
            font-size: 0.75rem;
            color: var(--gray);
        }

        .progress-container {
            width: 80px;
        }

        .progress-bar {
            height: 6px;
            background-color: var(--border);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background-color: var(--primary);
            border-radius: 3px;
            transition: width 0.5s ease;
        }

        .ranking-total {
            text-align: center;
            padding: 0.75rem;
            font-size: 0.75rem;
            color: var(--gray);
            border-top: 1px solid var(--border);
            margin-top: 0.5rem;
        }

        /* Grid Layouts */
        .grid-2 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        /* Three Column Grid - Altura reduzida com scroll */
        .three-column-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .three-column-grid .chart-card {
            height: 350px;
            display: flex;
            flex-direction: column;
        }

        .three-column-grid .chart-header {
            margin-bottom: 1rem;
        }

        .three-column-grid .table-responsive,
        .three-column-grid .activity-feed {
            flex: 1;
            overflow-y: auto;
            max-height: 250px;
        }

        /* Tables */
        .table-responsive {
            overflow-x: auto;
        }

        .custom-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.875rem;
        }

        .custom-table th {
            background-color: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
            text-align: left;
            padding: 0.75rem 1rem;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: sticky;
            top: 0;
        }

        .custom-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
        }

        .custom-table tr:hover {
            background-color: var(--primary-light);
        }

        /* Badges */
        .badge-custom {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            text-align: center;
        }

        .badge-primary {
            background-color: var(--primary-light);
            color: var(--primary);
        }

        .badge-success {
            background-color: rgba(16, 185, 129, 0.1);
            color: #10b981;
        }

        .badge-warning {
            background-color: rgba(245, 158, 11, 0.1);
            color: #f59e0b;
        }

        .badge-danger {
            background-color: rgba(239, 68, 68, 0.1);
            color: #ef4444;
        }

        .badge-info {
            background-color: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
        }

        /* Progress Bars */
        .progress-custom {
            height: 8px;
            background-color: var(--border);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-bar-custom {
            height: 50%;
            background-color: var(--success);
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        /* Activity Feed */
        .activity-feed {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            padding-right: 0.5rem;
        }

        .activity-item {
            display: flex;
            gap: 0.75rem;
            padding: 0.75rem;
            border-radius: var(--radius);
            background-color: var(--light);
            transition: all 0.2s ease;
        }

        .activity-item:hover {
            background-color: var(--primary-light);
        }

        .activity-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }

        .activity-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .activity-avatar-badge {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--warning);
            color: white;
            font-weight: 700;
            font-size: 0.75rem;
            flex-shrink: 0;
        }

        .activity-content {
            flex: 1;
        }

        .activity-text {
            margin-bottom: 0.25rem;
            font-weight: 500;
            font-size: 0.875rem;
        }

        .activity-meta {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: var(--gray);
        }

        /* Empty States */
        .empty-state {
            text-align: center;
            padding: 1.5rem 1rem;
            color: var(--gray);
        }

        .empty-state i {
            font-size: 2rem;
            margin-bottom: 0.75rem;
            color: var(--gray-light);
        }

        .empty-state h3 {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            color: var(--gray);
        }

        .empty-state p {
            font-size: 0.875rem;
        }

        .no-data {
            text-align: center;
            padding: 1.5rem;
            color: var(--gray);
        }

        .no-data i {
            font-size: 2rem;
            margin-bottom: 0.75rem;
            color: var(--gray-light);
        }

        .no-data p {
            font-size: 0.875rem;
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .stats-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 992px) {
            .three-column-grid {
                grid-template-columns: 1fr;
            }
            
            .three-column-grid .chart-card {
                height: auto;
            }
        }

        @media (max-width: 768px) {
            .dashboard-header {
                flex-direction: column;
                align-items: stretch;
            }
            
            .filters-section {
                flex-direction: column;
                align-items: stretch;
            }
            
            .filter-group {
                width: 100%;
            }
            
            .filter-input {
                width: 100%;
            }
            
            #customDateRange {
                flex-direction: column;
                align-items: stretch;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .charts-section, .grid-2 {
                grid-template-columns: 1fr;
            }
            
            .main-content {
                padding: 1rem;
            }
        }

        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }
            
            .chart-container, .chart-container-small {
                height: 200px;
            }
            
            .activity-item {
                flex-direction: column;
                text-align: center;
            }
            
            .activity-avatar, .activity-avatar-badge {
                align-self: center;
            }
        }

        /* Scrollbar Styling */
        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: var(--light);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--gray-light);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--gray);
        }