body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #191919;
    color: #fff;
}

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

/* Header */
header.dashboard-header {
    text-align: center;
    padding-bottom: 1.4rem;
    border-bottom: 3px solid #FFD700;
    margin-bottom: 20px;
}
header.dashboard-header h1 {
    color: #191919;
    background: #FFD700;
    display: inline-block;
    padding: 8px 28px 8px 18px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 2.1rem;
}

/* KPIs */
.row.kpis {
    background: #111;
    padding: 34px 18px 24px 18px;
    border-radius: 22px;
    margin-bottom: 36px;
    box-shadow: 0 10px 36px #0004;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}
.kpi-card {
    background: #191919;
    border-radius: 18px;
    box-shadow: 0 4px 16px #23232344;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 210px;
    max-width: 260px;
    margin: 12px 4px;
    padding: 30px 20px 18px 20px;
    border-top: 5px solid #FFD700;
    transition: transform .18s, box-shadow .18s;
    position: relative;
}
.kpi-card:hover {
    transform: translateY(-7px) scale(1.03);
    box-shadow: 0 12px 36px #ffd70066;
}
.kpi-icon {
    font-size: 2.7rem;
    margin-bottom: 14px;
    color: #FFD700;
    animation: bounce 1.4s infinite alternate;
}
.kpi-card.kpi-green .kpi-icon { color: #18A75C; }
.kpi-card.kpi-yellow .kpi-icon { color: #FFD700; }
.kpi-card.kpi-red .kpi-icon { color: #e74c3c; }
.kpi-value {
    font-size: 2.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-align: center;
    word-break: break-all;
}
.kpi-label {
    font-size: 1.1rem;
    color: #eee;
    text-align: center;
    font-weight: 500;
}

@media (max-width: 900px) {
    .row.kpis {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .kpi-card {
        width: 100%;
        min-width: unset;
        max-width: unset;
        margin: 8px 0;
    }
}
@media (max-width: 600px) {
    .kpi-value {
        font-size: 1.25rem;
    }
    .kpi-icon {
        font-size: 2rem;
    }
    .kpi-card {
        padding: 18px 8px 10px 8px;
    }
}

/* Animation pour les icônes KPI */
@keyframes bounce {
    0%   { transform: translateY(0);}
    100% { transform: translateY(-6px);}
}

/* Graphiques */
.row.graphs {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
}
.col {
    flex: 1 1 calc(50% - 18px);
    background: #222;
    padding: 18px;
    border-radius: 13px;
    box-shadow: 0 0 10px #0002;
    margin-bottom: 8px;
    min-width: 320px;
    color: #fff;
}
#graph_journalier, #graph_30jours, #graph_paiements, #graph_topproduits {
    background: #222;
    border-radius: 13px;
    box-shadow: 0 0 12px #0002;
    padding: 25px 10px 10px 10px;
    min-height: 210px;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #FFD700;
}

@media (max-width: 800px) {
    .row.graphs, .row.tables {
        flex-direction: column;
        gap: 12px;
    }
    .col {
        min-width: unset;
        width: 100%;
        margin-bottom: 0;
    }
}

/* Tableaux */
.row.tables {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
}
.stocks-table, .ventes-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 10px;
    font-size: 1rem;
}
.stocks-table th, .stocks-table td,
.ventes-table th, .ventes-table td {
    padding: 9px 12px;
    border: 1px solid #FFD70033;
    text-align: center;
}
.stocks-table th, .ventes-table th {
    background: #FFD700;
    color: #191919;
    font-weight: bold;
    letter-spacing: 1px;
}
.stocks-table tr:nth-child(even),
.ventes-table tr:nth-child(even) {
    background: #f7f7f7;
    color: #191919;
}
.stocks-table td, .ventes-table td {
    color: #191919;
}

.table-responsive {
    overflow-x: auto;
}

.loader {
    text-align: center;
    color: #FFD700;
    font-size: 1.15em;
    margin-top: 30px;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin: 30px 0;
}

::-webkit-scrollbar {
    height: 10px;
    background: #FFD70022;
}
::-webkit-scrollbar-thumb {
    background: #FFD700cc;
    border-radius: 10px;
}

.row.tables {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 18px;
}
.row.tables .col {
    width: 100%;
    flex: unset;
    min-width: unset;
    max-width: unset;
    margin: 0;

.element-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.element-title i {
    color: #FFD700;
    font-size: 1.2em;
    margin-right: 5px;
}
