/* ========================================
   DASHBOARD RESPONSIVE - ADMIN & SELLER
   ======================================== */

/* Conteneur principal du dashboard */
.dashboard-container {
    padding: 1.5rem;
}

@media (max-width: 767px) {
    .dashboard-container {
        padding: 1rem 0.5rem;
    }
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Cartes de statistiques */
.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-title {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin: 0.5rem 0;
}

.stat-card-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change.positive {
    color: #28a745;
}

.stat-card-change.negative {
    color: #dc3545;
}

@media (max-width: 767px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .stat-card-title {
        font-size: 0.75rem;
    }
}

/* Graphiques */
.chart-container {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-wrapper {
    position: relative;
    height: 350px;
}

@media (max-width: 991px) {
    .chart-wrapper {
        height: 300px;
    }
}

@media (max-width: 767px) {
    .chart-container {
        padding: 1rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        width: 100%;
    }

    .chart-controls .btn,
    .chart-controls .form-select {
        flex: 1;
        min-width: 0;
    }

    .chart-wrapper {
        height: 250px;
    }

    .chart-title {
        font-size: 1.1rem;
    }
}

/* Grille de graphiques */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 991px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Widgets du dashboard */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 991px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

/* Liste d'activités récentes */
.activity-list {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.activity-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #adb5bd;
}

@media (max-width: 767px) {
    .activity-list {
        padding: 1rem;
    }

    .activity-item {
        padding: 0.75rem 0;
    }

    .activity-icon {
        width: 35px;
        height: 35px;
        margin-right: 0.75rem;
    }

    .activity-title {
        font-size: 0.9rem;
    }

    .activity-description {
        font-size: 0.8rem;
    }
}

/* Tableau de bord de commandes */
.orders-summary {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-status-chart {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.order-status-item {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.order-status-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.order-status-label {
    font-size: 0.875rem;
    color: #6c757d;
}

@media (max-width: 767px) {
    .orders-summary {
        padding: 1rem;
    }

    .order-status-chart {
        flex-direction: column;
        gap: 0.5rem;
    }

    .order-status-item {
        padding: 0.75rem;
    }

    .order-status-value {
        font-size: 1.25rem;
    }
}

/* Top produits */
.top-products {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-item:last-child {
    border-bottom: none;
}

.product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.product-sales {
    font-size: 0.875rem;
    color: #6c757d;
}

.product-revenue {
    font-weight: 700;
    color: #28a745;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .top-products {
        padding: 1rem;
    }

    .product-item {
        padding: 0.75rem 0;
    }

    .product-image {
        width: 40px;
        height: 40px;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-sales {
        font-size: 0.8rem;
    }

    .product-revenue {
        font-size: 0.9rem;
    }
}

/* Filtres de période */
.period-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.period-filters .btn {
    flex: 1;
    min-width: 0;
}

@media (max-width: 575px) {
    .period-filters {
        flex-wrap: wrap;
    }

    .period-filters .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

/* Export et actions rapides */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    background: white;
    text-align: left;
    transition: all 0.2s;
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--primary-color, #f27a1a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.quick-action-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.quick-action-description {
    font-size: 0.875rem;
    color: #6c757d;
}

@media (max-width: 991px) {
    .quick-action-btn {
        min-width: calc(50% - 0.375rem);
    }
}

@media (max-width: 575px) {
    .quick-actions {
        flex-direction: column;
    }

    .quick-action-btn {
        min-width: 100%;
    }
}
