:root {
    --matvet-primary: #007087;
    --matvet-primary-dark: #005c70;
    --matvet-primary-soft: #e8f4f6;
    --matvet-success: #198754;
    --matvet-danger: #dc3545;
    --matvet-warning: #f0ad4e;
    --ds360-bg: #f4f7f9;
    --ds360-card: #ffffff;
    --ds360-border: #e4e9ed;
    --ds360-text: #1f2d33;
    --ds360-muted: #6c7a80;
    --ds360-radius: 16px;
}


/* ============================================================
   PAGE
   ============================================================ */

html,
body {
    background: var(--ds360-bg);
}


.ds360-dashboard {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    color: var(--ds360-text);
}


/* ============================================================
   HEADER
   ============================================================ */

.ds360-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}


.ds360-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
}


.ds360-subtitle {
    margin-top: 4px;
    color: var(--ds360-muted);
    font-size: 14px;
}


/* ============================================================
   FILTRES
   ============================================================ */

.ds360-filters {
    background: var(--ds360-card);
    border: 1px solid var(--ds360-border);
    border-radius: var(--ds360-radius);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}


.ds360-filter-item {
    min-width: 180px;
}


.ds360-filter-label {
    font-size: 12px;
    color: var(--ds360-muted);
    margin-bottom: 5px;
}


/* ============================================================
   KPI
   ============================================================ */

.ds360-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}


.ds360-kpi-card {
    background: var(--ds360-card);
    border: 1px solid var(--ds360-border);
    border-radius: var(--ds360-radius);
    padding: 20px;
    min-height: 135px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}


    .ds360-kpi-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: var(--matvet-primary);
    }


.ds360-kpi-label {
    color: var(--ds360-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    white-space: nowrap;
}


/*
   IMPORTANT :
   - nowrap empêche "DA" de passer à la ligne
   - clamp adapte la taille progressivement
   - la taille minimum descend à 16px si nécessaire
*/
.ds360-kpi-value {
    font-size: clamp(16px, 1.55vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.35px;
    color: var(--ds360-text);
    white-space: nowrap;
    max-width: 100%;
}


.ds360-kpi-detail {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ds360-muted);
}


.ds360-kpi-highlight {
    color: var(--matvet-primary);
}


/* ============================================================
   PANELS
   ============================================================ */

.ds360-panel {
    background: var(--ds360-card);
    border: 1px solid var(--ds360-border);
    border-radius: var(--ds360-radius);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    min-width: 0;
}


.ds360-panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--ds360-border);
    font-size: 15px;
    font-weight: 600;
}


.ds360-panel-body {
    padding: 18px;
}


.ds360-panel-body-no-padding {
    padding: 0;
}


/* ============================================================
   LAYOUT BAS
   ============================================================ */

.ds360-two-columns {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-top: 24px;
}


/* ============================================================
   DEVEXPRESS AJUSTEMENTS
   ============================================================ */

.ds360-dashboard .matvet-button-primary {
    background-color: var(--matvet-primary) !important;
    border-color: var(--matvet-primary) !important;
}


    .ds360-dashboard .matvet-button-primary:hover {
        background-color: var(--matvet-primary-dark) !important;
        border-color: var(--matvet-primary-dark) !important;
    }


/* ============================================================
   RESPONSIVE - GRAND ÉCRAN / SIDEBAR VISIBLE
   ============================================================ */

/*
   Entre 1500px et 1301px :
   les cartes restent en 4 colonnes,
   mais les grands montants diminuent.
*/
@media (max-width: 1500px) {

    .ds360-kpi-value {
        font-size: 20px;
    }

    .ds360-kpi-card {
        padding: 18px;
    }
}


/*
   Écrans un peu plus serrés.
*/
@media (max-width: 1350px) {

    .ds360-kpi-value {
        font-size: 17px;
    }

    .ds360-kpi-label {
        font-size: 11px;
    }

    .ds360-kpi-detail {
        font-size: 12px;
    }
}


/* ============================================================
   RESPONSIVE - TABLETTE
   ============================================================ */

@media (max-width: 1200px) {

    .ds360-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    /*
       Les cartes étant maintenant deux fois plus larges,
       on peut agrandir de nouveau les montants.
    */
    .ds360-kpi-value {
        font-size: 23px;
    }


    .ds360-kpi-label {
        font-size: 12px;
    }


    .ds360-kpi-detail {
        font-size: 13px;
    }


    .ds360-two-columns {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   RESPONSIVE - PETITE TABLETTE
   ============================================================ */

@media (max-width: 900px) {

    .ds360-dashboard {
        padding: 18px;
    }


    .ds360-header {
        align-items: flex-start;
    }


    .ds360-filters {
        width: 100%;
        justify-content: flex-start;
    }


    .ds360-kpi-value {
        font-size: 21px;
    }
}


/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 768px) {

    .ds360-dashboard {
        padding: 14px;
    }


    .ds360-header {
        flex-direction: column;
        align-items: stretch;
    }


    .ds360-title {
        font-size: 25px;
    }


    .ds360-filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }


    .ds360-filter-item {
        width: 100%;
        min-width: 0;
    }


    .ds360-kpi-grid {
        grid-template-columns: 1fr;
    }


    /*
       Une seule carte par ligne :
       le montant peut redevenir confortable.
    */
    .ds360-kpi-value {
        font-size: 24px;
        white-space: nowrap;
    }


    .ds360-kpi-card {
        min-height: 125px;
        padding: 18px;
    }


    .ds360-two-columns {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 18px;
    }


    .ds360-panel-body {
        padding: 14px;
    }
}


/* ============================================================
   RESPONSIVE - PETIT MOBILE
   ============================================================ */

@media (max-width: 480px) {

    .ds360-dashboard {
        padding: 10px;
    }


    .ds360-title {
        font-size: 22px;
    }


    .ds360-subtitle {
        font-size: 12px;
    }


    .ds360-kpi-card {
        padding: 16px;
        min-height: 115px;
    }


    .ds360-kpi-value {
        font-size: 20px;
        letter-spacing: -0.5px;
    }


    .ds360-kpi-detail {
        font-size: 12px;
    }


    .ds360-panel-header {
        padding: 14px;
        font-size: 14px;
    }
}
