/* =====================================================================
   PMS — UI global + fiche_ventes + stats_ventes
   FICHIER COMPLET — VERSION UNIFIÉE
   ===================================================================== */

/* ====== Commun sélection/édition ====== */
.editable.selected:not(.editing),
.editable-date.selected:not(.editing),
.editable-select.selected:not(.editing){
    background-color:#e3f2fd;
}

td,th{ position:relative; }

/* ====== Colonnes redimensionnables ====== */
th.resizable{ position:relative; }
th.resizable .resizer,
.col-resize-handle{
    position:absolute; right:0; top:0;
    width:5px; height:100%;
    cursor:col-resize; user-select:none; z-index:10;
}

/* ====== États non éditables / verrouillés ====== */
td.disabled-edit{
    background:#e9ecef !important;
    color:#6c757d !important;
    cursor:not-allowed !important;
}
td.disabled-edit:after{ display:none !important; } /* masque l’icône ✏️ */
.non-editable{ cursor:not-allowed !important; opacity:.6; }
.non-editable:after{ content:'🔒'; position:absolute; top:2px; right:2px; }

/* ====== Cartes, badges, stocks ====== */
.card{ border-radius:.375rem; box-shadow:0 2px 4px rgba(0,0,0,.05); margin-bottom:1.5rem; }
.stock-badge{ bottom:-1.2rem; left:0; font-size:.75rem; }
.stock-zero{ background:#ffcccc; color:#990000; font-weight:bold; }
.stock-low { background:#fff0cc; color:#996600; font-weight:bold; }
.stock-ok  { background:#e6ffcc; color:#336600; }

/* ====== Groupes ingrédients ====== */
.ingredients-group{
    border-left:4px solid #0d6efd;
    padding-left:10px;
    background:#f8f9fa;
    font-size:1.1em; letter-spacing:.5px;
}

/* ====== Tables et hover ====== */
table th,table td{ vertical-align:middle; }
.table-hover>tbody>tr:hover{ background-color:rgba(13,110,253,.05); }

/* ====== Animations ====== */
.badge-animated{ animation:pulse 2s infinite; }
@keyframes pulse{ 0%{opacity:1} 50%{opacity:.7} 100%{opacity:1} }

/* ====== Impression ====== */
.print-only{ display:none; }
@media print{
    .no-print{ display:none !important; }
    .print-only{ display:block; }
    .container{ width:100%; max-width:100%; }
    body{ font-size:12px; }
    table{ border-collapse:collapse; width:100%; }
    table,th,td{ border:1px solid #666; }
    thead{ display:table-header-group; }
    tr{ page-break-inside:avoid; }
    .print-only h2{
        font-size:18px; text-align:center; margin-bottom:5px;
        border-bottom:2px solid #333; padding-bottom:5px;
    }
    .print-only p{
        text-align:center; font-size:14px; font-style:italic; margin-bottom:15px;
    }
}

/* ====== Mise en avant succès (auto-select unité) ====== */
@keyframes highlightSuccess{
    0%{background-color:transparent}
    30%{background-color:rgba(25,135,84,.2)}
    100%{background-color:transparent}
}
.border-success{ animation:highlightSuccess 1.5s ease; }

/* ====== index.php : scroll + barre de progression + navbar ====== */
html{ scroll-behavior:smooth; }
#progress-bar{
    position:fixed; top:0; left:0; height:6px; background:#673a1c; width:0; z-index:3000;
}
nav.navbar-custom.fixed-top{
    position:fixed; top:0; left:0; width:100%;
    padding:1rem; transition:padding .3s, box-shadow .3s; z-index:2000;
}
nav.navbar-custom.fixed-top.navbar-shrink{
    padding:.5rem; box-shadow:0 2px 4px rgba(0,0,0,.1);
}
main{ margin-top:0; }

/* ====== Hero (déclaration 1 — sera surchargée par la 2) ====== */
#hero{
    position:relative; height:100vh;
    background-image:url('assets/img/crepe_et_galette/fond/take_away-02.webp');
    background-size:auto 120%; background-repeat:no-repeat; background-position:center;
    display:flex; align-items:center; justify-content:center;
    color:#fff; text-shadow:0 2px 4px rgba(0,0,0,.25); overflow:hidden;
}
#hero .overlay{ position:absolute; inset:0; background:rgba(0,0,0,.4); }
#hero .content{ position:relative; z-index:1; text-align:center; }
.cookie-regular{ font-family:'Cookie', cursive; }
#hero .content h1{ font-size:clamp(4rem,10vw,9rem); color:#fff; margin:0; }
#hero .content .small-text{ font-size:clamp(1rem,3vw,2rem); position:absolute; top:70%; right:0; }
#hero .content h2{ font-size:clamp(2rem,6vw,4rem); margin-top:.5rem; }

/* ====== Menu vitrine ====== */
.menu-global{
    background:#fff9f2; padding:3rem 1rem; border-radius:2rem; margin:2rem;
    font-family:'DynaPuff', cursive;
}
.menu-header{ display:flex; flex-direction:column; align-items:center; margin-bottom:1rem; }
.menu-grid{
    display:grid; grid-template-columns:repeat(auto-fit, minmax(250px,1fr));
    gap:2rem; justify-items:stretch; align-items:stretch;
}
.menu-container{ display:flex; flex-direction:column; height:100%; align-items:stretch; }
.menu-column{
    display:flex; flex-direction:column; height:100%; background:#fff; border-radius:1rem;
    padding:2rem; box-shadow:0 0 15px rgba(0,0,0,.05); width:100%;
}
.icon-wrapper-large{
    position:relative; width:130px; height:130px;
    background-image:url('assets/img/menu/arriere-plan.png');
    background-size:contain; background-repeat:no-repeat; background-position:center;
    display:flex; align-items:center; justify-content:center; margin-bottom:1rem;
}
.icon-wrapper-large img{ width:80px; height:80px; object-fit:contain; display:block; transform:translate(4px,-6px); }
.menu-title{
    font-size:2rem; font-weight:bold;
    text-shadow:-3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff, 3px 3px 0 #fff, 0 0 4px #fff;
    margin-bottom:1rem; text-align:center;
}
.menu-title.galettes{ color:#a46842; }
.menu-title.crepes  { color:#e89c3d; }
.menu-title.formules{ color:#003f5d; }
.menu-title.boissons{ color:#003f5d; }
.menu-title.fraiches{ color:#50a9d4; }
.menu-title.supplement{ color:#e58686; }
.menu-title.reduction { color:#777; }
.menu-main-title{ font-size:3rem; text-align:center; margin-bottom:3rem; color:#a35e2d; }
.menu-list li{ position:relative; padding-left:2.5rem; margin-bottom:1rem; }
.menu-list li::before{
    content:''; position:absolute; left:0; top:.2rem; width:28px; height:28px;
    background-image:url('assets/img/menu/puce-recette.png'); background-size:contain; background-repeat:no-repeat;
}

/* ====== Prix/Ventes — tables et chips ====== */
.col-lg-6,.card-prix{ overflow:visible; }
.ing-row{ position:relative; z-index:1; }
.ing-row td[colspan="6"]>.ing-pane{ margin-left:0; }

.price-table{ table-layout:fixed; }              /* unique, pas de doublon */
.price-table td,.price-table th{ overflow:hidden; text-overflow:ellipsis; }
.price-table thead th{ border-bottom:2px solid rgba(0,0,0,.06); }

/* Ligne meta compacte sous le nom */
.price-table .d-flex.gap-2>*{ flex:0 0 auto; }
.price-table small.text-muted{ white-space:nowrap; }

.price-hero{
    background:linear-gradient(90deg,rgba(13,110,253,.10),rgba(13,110,253,.02));
    border:1px solid rgba(13,110,253,.15); border-radius:.75rem;
}
.sticky-save{
    position:sticky; top:.5rem; z-index:1030;
    background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,255,255,.92));
    backdrop-filter:blur(4px); border:1px solid rgba(0,0,0,.06);
    border-radius:.75rem; padding:.6rem .75rem;
}
.cat-header td{
    background:linear-gradient(90deg,rgba(13,110,253,.08),rgba(13,110,253,0));
    border-left:4px solid rgba(13,110,253,.45);
}

/* pill-cat — scoping prix/ventes */
.stats-ventes .pill-cat{
    display:inline-block; padding:.25rem .6rem; border-radius:9999px;
    font-weight:600; font-size:.9rem; background:rgba(13,110,253,.12);
    border:1px solid rgba(13,110,253,.35);
}
.stats-ventes .pill-cat .cat-dot{
    display:inline-block; width:.75rem; height:.75rem; border-radius:50%;
    margin-right:.35rem; vertical-align:middle; background:rgba(13,110,253,1);
    border:1px solid rgba(0,0,0,.08);
}

.recette-dot{ display:inline-block; width:.6rem; height:.6rem; border-radius:50%; margin-right:.4rem; position:relative; top:-1px; border:1px solid rgba(0,0,0,.12); }
.chip{
    display:inline-block; padding:.15rem .5rem; border-radius:.5rem;
    border:1px solid var(--bs-border-color); font-weight:600; font-size:.85rem; background:var(--bs-body-bg);
}
.chip-neutral{ background:rgba(108,117,125,.06); color:#495057; border-color:rgba(108,117,125,.25); }
.chip-pos{ background:rgba(25,135,84,.10); color:#0f5132; border-color:rgba(25,135,84,.35); }
.chip-mid{ background:rgba(255,193,7,.12); color:#664d03; border-color:rgba(255,193,7,.35); }
.chip-neg{ background:rgba(220,53,69,.10); color:#842029; border-color:rgba(220,53,69,.35); }

.marge-row-ok { --row-bg:rgba(25,135,84,.05); }
.marge-row-mid{ --row-bg:rgba(255,193,7,.05); }
.marge-row-low{ --row-bg:rgba(220,53,69,.05); }
.marge-row-ok td,.marge-row-mid td,.marge-row-low td{ background:var(--row-bg); }

.cell-cost { background:rgba(108,117,125,.08); }
.cell-me   { background:rgba(13,110,253,.06); }
.cell-mp   { background:rgba(255,193,7,.10); }
.cell-price{ background:rgba(13,110,253,.08); }
.marge-row-ok  .cell-mp{ background:rgba(25,135,84,.15); }
.marge-row-mid .cell-mp{ background:rgba(255,193,7,.15); }
.marge-row-low .cell-mp{ background:rgba(220,53,69,.15); }

.cell-me .form-control,
.cell-mp .form-control,
.cell-price .form-control{ background:rgba(255,255,255,.85); border-color:rgba(0,0,0,.12); }
.cell-mp .input-group-text{ background:rgba(255,255,255,.85); border-color:rgba(0,0,0,.12); }

.price-input:focus{ box-shadow:0 0 0 .2rem rgba(13,110,253,.15); }
.open-inline .bi{ transition:transform .15s ease; }     /* unique, pas de doublon */
.recipe-row.open .open-inline .bi{ transform:rotate(90deg); }
.ing-pane{ padding:.5rem .5rem; background:#f8fafc; border-left:3px solid rgba(13,110,253,.35); }
.ing-q,.new-ing-q{ max-width:110px; display:inline-block; }
.new-card .card-header{ display:flex; align-items:center; gap:.5rem; }
.badge-select{ cursor:pointer; }
.ing-pane small{ opacity:.7; }
.add-ing-row{ white-space:nowrap; }

/* ====== Cartes recette — hauteur uniforme + état actif ====== */
:root{ --recipe-btn-h:13rem; }
@media (min-width:576px){ :root{ --recipe-btn-h:13.5rem; } }
@media (min-width:768px){ :root{ --recipe-btn-h:14rem; } }
@media (min-width:992px){ :root{ --recipe-btn-h:14.5rem; } }

.recipe-card .card{ height:100%; }
.recipe-card .card-body{ display:flex; flex-direction:column; }
.recipe-card .recipe-btn{
    height:var(--recipe-btn-h); padding:0; border:0; background:transparent;
    text-align:center; overflow:hidden;
}
.recipe-card .recipe-core{
    width:100%; height:100%;
    border:2px solid var(--bs-primary); border-radius:.5rem;
    background-color:var(--bs-body-bg);
    transition:background-color .15s ease, color .15s ease, border-color .15s ease;
}
.recipe-card .recipe-btn.is-active .recipe-core{
    background-color:var(--bs-primary); border-color:var(--bs-primary); color:#fff;
}
.recipe-card .recipe-btn.is-active .recipe-price{ color:#fff; }
.recipe-card .recipe-head{ min-height:3.6rem; }
.recipe-card .recipe-name{
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
    overflow:hidden; line-height:1.2; font-size:1rem; font-weight:600;
}
.recipe-card .recipe-cat{
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1;
    overflow:hidden; line-height:1.2; font-size:.875rem; opacity:.9;
}
.recipe-card .recipe-price{ font-size:1.05rem; }
.recipe-card .recipe-badge{
    position:absolute; top:.5rem; right:.5rem;
    padding:.35rem .55rem; font-weight:600; z-index:1;
}
.recipe-card .controls{ min-height:4.5rem; }
.recipe-card .btn{
    min-height:120px; display:flex; flex-direction:column; justify-content:center;
}

/* ====== Ombres custom ====== */
.shadow-custom{ box-shadow:0 4px 6px rgba(0,0,0,.3); transition:box-shadow .2s ease; }
.shadow-custom:hover{ box-shadow:0 6px 10px rgba(0,0,0,.4); }
.shadow-custom_light{ box-shadow:0 4px 6px rgba(0,0,0,.2); transition:box-shadow .2s ease; }
.shadow-custom_light:hover{ box-shadow:0 6px 10px rgba(0,0,0,.3); }

/* ====== fiche_ventes — UI polish ====== */
.card-header{ letter-spacing:.2px; }
.nav-tabs .nav-link{ font-weight:600; }
.nav-tabs .nav-link.active{ box-shadow:inset 0 -2px 0 var(--bs-primary); }
.btn.shadow-custom{ border-radius:.6rem; }
.alert-autohide{ opacity:1; transition:opacity .4s ease; }
.alert-autohide.is-hiding{ opacity:0; }
#form-defaults.card{ border-color:var(--bs-primary); }
#form-defaults .card-header{ border-bottom:1px dashed rgba(0,0,0,.08); }
#form-vente .form-label{ font-weight:600; font-size:.92rem; }
#form-vente .form-text{ font-size:.85rem; }
#warning-production,
#ajout-ventes .text-danger.ms-2{
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.25rem .5rem; border-radius:.5rem; background:rgba(220,53,69,.08);
}
.table.align-middle>tbody>tr>td,
.table.align-middle>thead>tr>th{ vertical-align:middle; }
.table thead th small{ font-weight:400; color:var(--bs-secondary-color); }
.lots-wrap{ white-space:normal; word-break:break-word; line-height:1.25; }
.bulk-toolbar,.card.p-2.bg-light{ position:sticky; top:.75rem; z-index:7; }
.pagination .page-link{ padding:.4rem .65rem; }
.recap-grid{ display:grid; grid-template-columns:1fr; gap:.35rem; }
@media (min-width:576px){ .recap-grid{ grid-template-columns:1fr 1fr; } }
.recap-chip{
    display:flex; justify-content:space-between; gap:.75rem;
    padding:.35rem .6rem; border:1px solid var(--bs-border-color);
    border-radius:.5rem; background:var(--bs-light);
    font-size:.92rem; font-weight:600;
}
.recap-chip .qty{ opacity:.8; font-weight:700; }
:root{ --sepia-ink:#704214; --sepia-paper:#F7EFE5; }

/* ===== Archives — header sticky lisible sur scroll ===== */
.table-archives thead{ background:transparent; color:inherit; }
.table-archives thead th{
    position:sticky; top:0; z-index:7;
    background:var(--sepia-paper);
    color:var(--sepia-ink);
    border-bottom:1px solid var(--sepia-ink);
    background-clip:padding-box;
}
.badge-archive{ background:var(--sepia-paper); color:var(--sepia-ink); border:1px solid var(--sepia-ink); }
.period-pill{
    display:inline-block; padding:.25rem .6rem; border-radius:9999px;
    background:var(--bs-gray-100); border:1px dashed var(--bs-border-color);
    font-size:.85rem; font-weight:600;
}

/* ====== anomalies_stocks ====== */
.anoms-hero{
    background:linear-gradient(90deg, rgba(13,110,253,.08), rgba(13,110,253,.02));
    border:1px solid var(--bs-border-color); border-radius:.5rem;
}
.anoms-table thead th{ background:var(--bs-light); border-bottom:2px solid var(--bs-border-color); }
.cat-colored{ border-left:4px solid var(--cat-br, rgba(13,110,253,.35)); }
.cat-colored td{ background-image:linear-gradient(0deg, var(--cat-bg, transparent), var(--cat-bg, transparent)); }

/* pill-cat — scoping anomalies */
.anoms-table .pill-cat{
    display:inline-block; padding:.2rem .55rem; border-radius:9999px;
    font-weight:600; font-size:.8rem; line-height:1;
    color:var(--bs-body-color);
    background:var(--cat-pill, rgba(13,110,253,.12));
    border:1px solid var(--cat-br, rgba(13,110,253,.35));
    vertical-align:middle;
}
.cat-dot{
    display:inline-block; width:.75rem; height:.75rem; border-radius:50%;
    margin-right:.35rem; border:1px solid rgba(0,0,0,.1); vertical-align:middle;
}
.ecart-chip{
    display:inline-block; min-width:4.5rem; text-align:right;
    padding:.15rem .4rem; border-radius:.35rem;
    background:var(--bs-body-bg); border:1px solid var(--bs-border-color);
}
.ecart-chip.pos{        background:rgba(25,135,84,.08); color:#146c43; border-color:rgba(25,135,84,.25); }
.ecart-chip.neg{        background:rgba(220,53,69,.08); color:#b02a37; border-color:rgba(220,53,69,.25); }
.ecart-chip.pos-strong{ background:rgba(25,135,84,.15); color:#0f5132; border-color:rgba(25,135,84,.35); }
.ecart-chip.neg-strong{ background:rgba(220,53,69,.15); color:#842029; border-color:rgba(220,53,69,.35); }
.legend-chip{
    padding:.25rem .5rem; border:1px dashed var(--bs-border-color);
    border-radius:.5rem; background:var(--bs-light);
}

/* ====== Hero (déclaration 2 — override avec URL absolue) ====== */
#hero{
    background-image:url('https://lechilltruck.fr/assets/img/crepe_et_galette/fond/take_away-02.webp');
}

/* ===== Sous-table ingrédients ===== */
.ing-table{ table-layout:fixed; }
.ing-table .form-control,
.ing-table .form-select{ width:100%; min-width:0; }

/* Colonne Actions collante à droite */
.ing-table .sticky-col{
    position:sticky; right:0;
    background:#f8fafc; z-index:2;
    box-shadow:-1px 0 0 rgba(0,0,0,.06);
}

/* Évite que le commentaire force la largeur */
.ing-table td:nth-child(4) input{ min-width:0; }

/* Compaction verticale */
.ing-table td,.ing-table th{ padding-top:.35rem; padding-bottom:.35rem; }

/* ===== Mise en évidence recette ouverte — JAUNE ===== */
.recipe-row.open td{
    background:rgba(255,193,7,.50);
    transition:background .15s ease;
}
.recipe-row.open{ border-left:4px solid rgba(255,193,7,.75); }
.recipe-row.open + .ing-row .ing-pane,
.ing-row.open .ing-pane{
    background:linear-gradient(90deg, rgba(255,193,7,.18), rgba(255,193,7,.06));
    border-left:4px solid rgba(255,193,7,.75);
    transition:background .2s ease;
}
.recipe-row.open + .ing-row .ing-table,
.ing-row.open .ing-table{
    background-color:rgba(255,193,7,.12);
    border-radius:.25rem;
}
.recipe-row.open + .ing-row .ing-table .sticky-col,
.ing-row.open .ing-table .sticky-col{
    background-color:rgba(255,193,7,.12);
    box-shadow:-1px 0 0 rgba(255,193,7,.35);
}
.recipe-row.open .open-inline{
    background:rgba(255,193,7,.18);
    border-color:rgba(255,193,7,.45);
}
.recipe-row.open .btn-save-recipe{
    background:rgba(25,135,84,.12);
    border-color:rgba(25,135,84,.35);
}

/* Colonne toggle compacte + pile d’actions */
.toggle-cell{ width:56px; padding:4px 2px; vertical-align:middle; }
.toggle-cell .btn{ width:100%; padding:.25rem 0; }
.action-stack{
    display:grid; grid-auto-rows:28px; row-gap:6px; justify-items:center;
}
.btn-icon{
    width:28px; height:28px; padding:0;
    display:flex; align-items:center; justify-content:center;
}

/* =========================================================
   PMS — Statistiques des ventes (scopé .stats-ventes)
   ========================================================= */

/* Variables marque si absentes */
:root{
    --brand1: var(--chill-primary,  #ff7a00);
    --brand2: var(--chill-secondary,#d8a16f);
    --accent: var(--chill-accent,   #6b3f21);
}

/* Fond et encre uniquement sur la page stats */
.stats-ventes{
    --ink:#f4efe9;
    --muted:#c8b8aa;
    --bg:#0b0e14;
    --panel:#121827cc;
    --card:rgba(255,255,255,0.06);
    --stroke:rgba(255,255,255,0.10);
    --shadow:0 10px 30px rgba(0,0,0,.35);
    color:var(--ink);
    background:
            radial-gradient(1200px 600px at 10% -10%, color-mix(in oklab, var(--brand1) 18%, transparent), transparent 60%),
            radial-gradient(900px 500px  at 110% 20%, color-mix(in oklab, var(--brand2) 16%, transparent), transparent 60%),
            linear-gradient(180deg, #0a0d13 0%, var(--bg) 100%);
}
.stats-ventes a{ color:var(--brand2); }
.stats-ventes .container-xl{ max-width:1400px; }

/* Hero / filtres */
.stats-ventes .hero{
    background:linear-gradient(135deg,
    color-mix(in oklab, var(--brand1) 28%, transparent),
    color-mix(in oklab, var(--brand2) 22%, transparent));
    border:1px solid var(--stroke);
    border-radius:20px;
    padding:18px;
    backdrop-filter:blur(8px);
    box-shadow:var(--shadow);
}
.stats-ventes .hero h1{ font-size:1.6rem; margin:0; }
.stats-ventes .hero .period{ color:var(--muted); font-size:.95rem; }

/* Grids */
.stats-ventes .grid-4{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
@media (max-width:1200px){ .stats-ventes .grid-4{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px){  .stats-ventes .grid-4{ grid-template-columns:1fr; } }
.stats-ventes .grid-2{ display:grid; grid-template-columns:1.2fr .8fr; gap:14px; }
@media (max-width:1100px){ .stats-ventes .grid-2{ grid-template-columns:1fr; } }

/* Cards / KPI */
.stats-ventes .cardx{
    background:var(--card);
    border:1px solid var(--stroke);
    border-radius:16px;
    padding:14px;
    box-shadow:var(--shadow);
}
.stats-ventes .cardx h6{ color:var(--muted); margin:0 0 6px 0; font-weight:600; font-size:.9rem; }
.stats-ventes .cardx .big{ font-size:1.4rem; font-weight:700; }
.stats-ventes .kpi{ display:flex; align-items:center; gap:10px; }
.stats-ventes .kpi .dot{ width:10px; height:10px; border-radius:50%; }
.stats-ventes .kpi .dot.ok{ background:var(--brand1); }
.stats-ventes .kpi .dot.warn{ background:var(--brand2); }
.stats-ventes .kpi .dot.danger{ background:var(--accent); }

/* Sections / titres / surfaces */
.stats-ventes .section{ margin-top:18px; }
.stats-ventes .section .title{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.stats-ventes .title h3{ font-size:1.1rem; margin:0; }
.stats-ventes .surface{
    background:var(--panel);
    border:1px solid var(--stroke);
    border-radius:18px;
    padding:14px;
    box-shadow:var(--shadow);
}
.stats-ventes .sticky-top-bar{ position:sticky; top:10px; z-index:20; }
.stats-ventes .search{ max-width:320px; }

/* Pills (onglets) */
.stats-ventes .pills{
    display:flex; gap:8px; flex-wrap:wrap;
    background: rgba(66, 49, 14, 0.99);
    border:1px solid var(--stroke);
    border-radius:999px; padding:6px;
}
.stats-ventes .pill{
    border:none; background:transparent; color:var(--muted);
    padding:8px 12px; border-radius:999px; cursor:pointer;
}
.stats-ventes .pill.active{
    color:#001;
    background:linear-gradient(135deg,var(--brand2),var(--brand1));
    font-weight:700;
}
.stats-ventes .tabs-panel{ display:none; }
.stats-ventes .tabs-panel.active{ display:block; }

/* Inputs et canvas */
.stats-ventes .input-inline{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.stats-ventes .input-inline input[type="date"],
.stats-ventes .input-inline input[type="text"]{
    background:rgba(255,255,255,.08);
    border:1px solid var(--stroke);
    color:var(--ink);
    border-radius:10px; padding:8px 10px; outline:none;
}
.stats-ventes .input-inline button{
    border:none; border-radius:10px; padding:10px 14px; font-weight:700; color:#001;
    background:linear-gradient(135deg,var(--brand2),var(--brand1));
    box-shadow:var(--shadow); cursor:pointer;
}
.stats-ventes canvas{
    background:rgba(255,255,255,.03);
    border:1px solid var(--stroke);
    border-radius:12px; padding:8px;
}

/* Tables génériques en mode stats */
.stats-ventes .tablex{ width:100%; border-collapse:separate; border-spacing:0; color:var(--ink); font-size:.92rem; }
.stats-ventes .tablex thead th{
    position:sticky; top:0; z-index:5;
    background:var(--panel);
    border-bottom:1px solid var(--stroke);
    padding:10px; text-align:left;
    backdrop-filter:blur(6px);
}
.stats-ventes .tablex td{ padding:10px; border-bottom:1px dashed var(--stroke); }
.stats-ventes .tablex tr:hover td{ background:rgba(255,255,255,.04); }
.stats-ventes .badge-soft{
    padding:.2rem .5rem; border-radius:999px; font-size:.75rem;
    border:1px solid var(--stroke); color:var(--muted);
}
.stats-ventes tfoot th,.stats-ventes tfoot td{ background:rgba(255,255,255,.06); }

/* ==== fiche_ventes — lisibilité Archives sur fond sombre ==== */
.stats-ventes .table-archives tbody tr,
.stats-ventes .table-archives tbody td,
.stats-ventes .table-archives tbody th{
    color:var(--ink) !important;
    opacity:1 !important;
}

/* Si des classes Bootstrap grisent encore le texte */
.stats-ventes .table-archives .text-muted{
    color:var(--ink) !important;
    opacity:1 !important;
}

/* ==== fiche_ventes — N° vente en texte clair ==== */
.stats-ventes .tablex td:nth-child(11),
.stats-ventes .tablex th:nth-child(11),
.stats-ventes .table-archives td:nth-child(10),
.stats-ventes .table-archives th:nth-child(10){
    color:var(--ink) !important;
    opacity:1 !important;
}

/* ==== Modales — fond personnalisé #e19613cc opacité 0.95 ==== */
.stats-ventes .modal-content{
    background:rgba(225,150,19,0.95); /* #e19613cc */
    color:#001;
    border:1px solid var(--stroke);
    border-radius:14px;
    box-shadow:var(--shadow);
}
.stats-ventes .modal-header,
.stats-ventes .modal-footer{ border-color:var(--stroke); }
.stats-ventes .modal .form-control,
.stats-ventes .modal .form-select{
    background:rgba(255,255,255,.08);
    border:1px solid var(--stroke);
    color:#001;
}
.stats-ventes .modal .form-control::placeholder{ color:rgba(0,0,0,0.6); }
.stats-ventes .modal .btn-close{ filter:none; opacity:.9; }
.stats-ventes .modal .btn-close:hover{ opacity:1; }
.stats-ventes .modal .btn-primary{
    background:linear-gradient(135deg, var(--brand2), var(--brand1));
    border:0; color:#001; font-weight:700;
}
.stats-ventes .modal .btn-secondary{
    background:transparent; border:1px solid var(--stroke); color:var(--ink);
}

/* --- Modal : texte blanc partout --- */
.modal-content {
    color: #fff !important;
    background-color: #1e1e1f !important; /* fond sombre */
}

/* Inputs, selects */
.modal-content .form-control,
.modal-content .form-select {
    color: #fff !important;
    background-color: #2b2b2c !important;
    border-color: #555 !important;
}

.modal-content .form-control::placeholder {
    color: #ccc !important;
}

.modal-content .form-label,
.modal-content h3,
.modal-content h5,
.modal-content .modal-title {
    color: #fff !important;
}

/* --- CROIX DE FERMETURE (blanche) --- */
.modal-content .btn-close {
    filter: invert(1) brightness(200%); /* rend l’icône blanche */
    opacity: 1 !important;              /* la rend bien visible */
}

.modal-content .btn-close:hover {
    filter: invert(1) brightness(250%);
    opacity: 1 !important;
}
.ventes-table-wrapper {
    border-radius: 12px;
}

/* --- Pagination : chiffres noirs --- */

/* Liens de pagination */
.pagination .page-link {
    color: #000 !important;          /* texte noir */
    background-color: #fff !important;
    border-color: #ddd !important;
}

/* Survol */
.pagination .page-link:hover {
    color: #000 !important;
    background-color: #f2f2f2 !important;
    border-color: #bbb !important;
}

/* Page active */
.pagination .page-item.active .page-link {
    color: #000 !important;
    background-color: #e2e2e2 !important;
    border-color: #aaa !important;
}

/* Page désactivée */
.pagination .page-item.disabled .page-link {
    color: #666 !important;
    background-color: #fff !important;
}

/* Ellipses "…" */
.pagination .page-item.disabled .page-link span,
.pagination .page-link span {
    color: #000 !important;
}

