/* Matrice Distribution — finition SaaS */

.sd-matrix-modern .tabulator {
    font-family: var(--font-base) !important;
    font-size: 0.86rem !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
}

/* En-têtes plus légers et moins administratifs. */
.sd-matrix-modern .tabulator-header,
.sd-matrix-modern .tabulator-header .tabulator-col {
    background: #faf7f2 !important;
}

.sd-matrix-modern .tabulator-header .tabulator-col-title {
    font-family: var(--font-base) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    color: var(--text) !important;
}

/* Lignes aérées avec séparateurs très discrets. */
.sd-matrix-modern .tabulator-row {
    border-bottom: 1px solid rgba(231, 222, 212, 0.6) !important;
}

.sd-matrix-modern .tabulator-cell {
    font-family: var(--font-base) !important;
    font-size: 0.86rem !important;
    font-weight: 400 !important;
    font-variant-numeric: tabular-nums;
}

.sd-matrix-modern .tabulator-cell.sd-weekday {
    font-weight: 600 !important;
}

/* La couleur remplit à nouveau toute la cellule. */
.sd-matrix-modern .sd-matrix-heat,
.sd-matrix-modern .sd-matrix-total-value {
    margin: -0.65rem -0.75rem !important;
    padding: 0.65rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    font-family: var(--font-base) !important;
    font-size: 0.86rem !important;
    line-height: 1 !important;
}

.sd-matrix-modern .sd-matrix-heat {
    font-weight: 500 !important;
}

.sd-matrix-modern .sd-matrix-total-value {
    font-weight: 600 !important;
}

/* Totaux beige chaud, sans gris froid. */
.sd-matrix-modern .tabulator-cell.sd-matrix-subtotal,
.sd-matrix-modern .tabulator-col.sd-matrix-subtotal {
    background: #f1ebe3 !important;
}

.sd-matrix-modern .tabulator-cell.sd-matrix-overall-total,
.sd-matrix-modern .tabulator-col.sd-matrix-overall-total {
    background: #faf5ee !important;
    font-weight: 600 !important;
}

/* Seulement un scroll horizontal discret. */
.sd-matrix-modern .tuco-grid-scroll {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.sd-matrix-modern .tabulator-tableHolder {
    max-height: none !important;
    overflow-y: hidden !important;
}

/* Heatmap sans espaces entre les lignes */
.sd-matrix-modern .tabulator-row {
    border-bottom: 0 !important;
}

.sd-matrix-modern .tabulator-cell.sd-matrix-heat-cell,
.sd-matrix-modern .tabulator-cell.sd-matrix-subtotal,
.sd-matrix-modern .tabulator-cell.sd-matrix-overall-total {
    position: relative !important;
    padding: 0 !important;
}

.sd-matrix-modern .tabulator-cell.sd-matrix-heat-cell .sd-matrix-heat,
.sd-matrix-modern .tabulator-cell.sd-matrix-subtotal .sd-matrix-total-value,
.sd-matrix-modern .tabulator-cell.sd-matrix-overall-total .sd-matrix-total-value {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 0.45rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Matrice beige : typographie légère */
#p32-card-matrix {
    font-weight: 500 !important;
}

.sd-matrix-modern .tabulator {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
}

.sd-matrix-modern .tabulator-header .tabulator-col-title {
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.sd-matrix-modern .tabulator-cell,
.sd-matrix-modern .tabulator-cell.sd-weekday,
.sd-matrix-modern .sd-matrix-heat,
.sd-matrix-modern .sd-matrix-total-value {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
}

.sd-matrix-modern .tabulator-cell.sd-matrix-subtotal,
.sd-matrix-modern .tabulator-col.sd-matrix-subtotal {
    background: #eee5db !important;
    font-weight: 400 !important;
}
