/* ==========================================================================
   1. STRUCTURE & ÉTATS GÉNÉRAUX
   ========================================================================== */

   .mrd_main-wrapper {
    font-family: 'Roboto', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased; /* Pour un rendu plus net sur Chrome/Safari */
    -moz-osx-font-smoothing: grayscale; /* Pour un rendu plus net sur Firefox Mac */
    width: 100%;
}

.mrd-loading {
    opacity: 0.4 !important;
    filter: blur(4px) !important;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* ==========================================================================
   2. LIGNES DE COMPTEURS (HEADER)
   ========================================================================== */
.mrd_row-container {
    display: flex;
    flex-direction: row;
    align-items: center; 
    gap: 12px;
    margin-bottom: 8px;
}

.mrd_render-stock {
    width: 100px;
    display: flex;
    justify-content: flex-end; 
    flex-shrink: 0;
}

.mrd_label-text {
    font-size: 13px;
    color: #444;
    font-weight: 500;
}

/* ==========================================================================
   3. BARRE DE FILTRES (SELECTS FLOW)
   ========================================================================== */
.mrd_filter-bar {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    align-items: center;
}

.mrd_filter-bar select, 
.mrd_filter-bar input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    background-color: #fff;
    color: #333;
    outline: none;
    font-size: 13px;
    transition: all 0.2s;
}

.mrd_filter-bar select:focus, 
.mrd_filter-bar input[type="text"]:focus {
    border-color: #1f2a5f;
    box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.1);
}

.mrd_date-badge {
    background: #1f2a5f;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   4. TABLEAU DE STOCK (HOVER & TOTAUX)
   ========================================================================== */
.mrd_stock-table {
    width: 100%;
    border-collapse: collapse;
}

.mrd_stock-table th, 
.mrd_stock-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.mrd_header-row {
    background-color: #1f2a5f !important;
    color: white;
}

/* --- EFFET HOVER --- */
.mrd_stock-table tr:not(.mrd_total-row):not(.mrd_logo-row):not(.mrd_header-row):hover {
    background-color: #1f2a5f !important;
    cursor: pointer;
    color: #ffffff !important; /* Texte en blanc */
}

/* --- ALIGNEMENT DES TOTAUX --- */
.mrd_total-row {
    background-color: #eeeff4;
    font-weight: bold;
}

.mrd_total-label {
    text-align: right !important; /* Force l'alignement à droite */
    padding-right: 20px !important;
}

.col-auto-shrink {
    width: 1%;
    white-space: nowrap;
    padding-right: 20px !important;
}

.col-stock-cell {
    text-align: right;
    width: 100px;
    font-weight: bold;
}

/* ==========================================================================
   5. BOUTONS CHIFFRES
   ========================================================================== */
.mrd_digit-wrapper {
    display: inline-flex !important;
    gap: 3px !important;
    justify-content: flex-end;
}

/* .digit-btn-tiny {
    width: 22px; height: 22px;
    background: #4a4a4a; 
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    position: relative; flex-shrink: 0; 
    border: 1px solid #333;
    box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #888;
}

.digit-btn-tiny::before {
    content: ''; position: absolute; 
    width: 12px; height: 14px;
    background: #383838; 
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 1;
} */

.digit-btn-tiny {
    width: 22px; 
    height: 22px;
    background: #1f2a5f; /* Ton bleu ici */
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    position: relative; 
    flex-shrink: 0; 
    border: 1px solid #10183d; /* Un bord encore plus sombre */
    box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #1f2a5f; /* L'anneau extérieur passe au bleu aussi */
}

.digit-btn-tiny::before {
    content: ''; 
    position: absolute; 
    width: 12px; 
    height: 14px;
    background: #2a3a7a; /* Un bleu légèrement plus clair pour l'hexagone central */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 1;
}

.digit-btn-tiny span {
    font-family: "Consolas", monospace; 
    font-size: 12px; font-weight: bold; color: #fff; z-index: 2;
}

/* Le conteneur du message d'erreur */
.mrd_no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #fdfdfd;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-top: 20px;
    color: #666;
}

.mrd_no-results i {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
}

.mrd_no-results p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Le bouton de reset spécifique dans le message */
.mrd_reset-btn {
    background-color: #1f2a5f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.mrd_reset-btn:hover {
    background-color: #006666;
}


/* 1. On fixe la barre de filtres tout en haut */
.mrd_filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: white; /* Obligatoire pour ne pas voir le texte défiler derrière */
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

/* 2. On fixe l'en-tête du tableau juste en dessous de la barre de filtres */
/* La valeur 'top' doit correspondre à la hauteur approximative de ta barre de filtres */
.mrd_header-row th {
    position: sticky;
    top: 60px; /* Ajuste cette valeur selon la hauteur réelle de tes filtres */
    z-index: 90;
    background-color: #1f2a5f !important; /* On réaffirme le Teal */
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Petite ombre pour l'effet de flottement */
}

/* 3. On s'assure que le conteneur ne coupe pas le sticky */
.mrd_main-wrapper {
    overflow: visible; 
}

#mrd_table-container {
    overflow: visible;
}


/* Fond de la modale ********************************************************************************************************/
.mrd-modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(31, 42, 95, 0.9); /* Ton bleu foncé avec transparence */
}

/* L'image au centre */
.mrd-modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    margin-top: 5%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: white;
    padding: 10px;
}

/* Texte sous l'image */
#mrd_caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: white;
    padding: 15px 0;
    font-size: 20px;
    font-family: 'Roboto', sans-serif;
}

/* Bouton fermer */
.mrd-close {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}