/* ==============================
   STYLES - TABLEAU DE BORD ADMIN
   ============================== */

/* ======= BASE ======= */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f9fafb;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

/* ======= TITRE PRINCIPAL ======= */
.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #E60000;
    text-align: left;
    margin-bottom: 25px;
}

/* =============================
   CARDS DES STATISTIQUES GLOBALES
   ============================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.stat-card.highlight {
    background: #E60000;
    color: #fff;
}

.stat-card.highlight h3 {
    color: #fff;
}

.stat-card.highlight p {
    color: #fff;
}

/* ===========================
   GRAPHIQUE DES VENTES
   =========================== */
.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-container h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* ==============================
   TABLES PRODUITS + COMMANDES
   ============================== */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Bloc pour chaque section */
.stat-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.stat-section h2 {
    font-size: 18px;
    color: #E60000;
    margin-bottom: 15px;
    text-align: left;
}

/* Table générale */
.stat-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stat-section thead {
    background: #E60000;
    color: #fff;
}

.stat-section thead th {
    text-align: left;
    padding: 10px;
}

.stat-section tbody tr {
    border-bottom: 1px solid #eee;
}

.stat-section tbody tr:nth-child(even) {
    background: #fafafa;
}

.stat-section tbody td {
    padding: 10px;
    color: #333;
}

/* ==============================
   STATUS COMMANDES
   ============================== */
.stat-section td:nth-child(4) {
    font-weight: bold;
}

td.status-pending {
    color: #ff9800;
}

td.status-processing {
    color: #03a9f4;
}

td.status-completed {
    color: #4caf50;
}

td.status-cancelled {
    color: #f44336;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 22px;
        text-align: center;
    }

    .stat-card p {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .chart-container {
        padding: 15px;
    }
}
