/* AFC Discount : même mécanisme qu'ecard_fusion (custom.css) — la couleur
   primaire de Velzon est remplacée par l'orange du logo, le bleu de la
   vague sert de couleur d'information. Barre latérale et barre du haut
   claires (data-sidebar="light"). */
:root {
  --vz-primary: #f2711c;
  --vz-primary-rgb: 242, 113, 28;
  --vz-primary-text-emphasis: #b04f0e;
  --vz-primary-bg-subtle: #fdeee3;
  --vz-primary-border-subtle: #f8c39d;
  --vz-link-color: #b04f0e;
  --vz-link-color-rgb: 176, 79, 14;
  --vz-link-hover-color: #8a3d0a;
  --vz-link-hover-color-rgb: 138, 61, 10;

  /* Les boutons d'action (Nouveau, Enregistrer, Valider) sont en btn-success :
     alignés sur l'orange du logo, comme le vert chez eCard. */
  --vz-success: #f2711c;
  --vz-success-rgb: 242, 113, 28;
  --vz-success-text-emphasis: #b04f0e;
  --vz-success-bg-subtle: #fdeee3;
  --vz-success-border-subtle: #f8c39d;

  --vz-info: #0b5fa5;
  --vz-info-rgb: 11, 95, 165;
  --vz-info-text-emphasis: #084a80;
  --vz-info-bg-subtle: #e6f0f9;
  --vz-info-border-subtle: #9fc3e6;
}
/* Statuts oui/non dans les listes */
.badge-oui { background: #e6f4ec; color: #1f8a4c; }
.badge-non { background: #f3f5f8; color: #66717d; }

/* ------------------------------------------------------------------ Caisse (POS) */
.pos-toolbar { display: flex; gap: .75rem; align-items: stretch; flex-wrap: wrap; }
.pos-boutique { display: flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--vz-border-color); border-radius: .6rem; padding: 0 .5rem 0 .75rem; color: var(--vz-primary); min-width: 200px; }
.pos-boutique i { font-size: 1.15rem; }
.pos-boutique .form-select { box-shadow: none; padding-left: .25rem; }
.pos-scan { position: relative; flex: 1; min-width: 260px; }
.pos-scan i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--vz-primary); }
.pos-scan .form-control { padding-left: 2.9rem; padding-right: 3.6rem; height: 52px; border-radius: .6rem; border: 2px solid var(--vz-primary-border-subtle); font-size: 1.05rem; }
.pos-scan .form-control:focus { border-color: var(--vz-primary); box-shadow: 0 0 0 .25rem rgba(var(--vz-primary-rgb), .15); }
.pos-scan kbd { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); background: var(--vz-light); color: var(--vz-secondary-color); border: 1px solid var(--vz-border-color); border-radius: .3rem; font-size: .7rem; padding: .1rem .4rem; }

.pos-categories { display: flex; gap: .5rem; flex-wrap: wrap; }
.pos-cat-btn { --cat: #7f8c8d; border: 1.5px solid color-mix(in srgb, var(--cat) 35%, transparent); background: #fff; color: var(--cat); border-radius: 999px; padding: .35rem .9rem; font-size: .8rem; font-weight: 600; letter-spacing: .01em; transition: all .12s; display: inline-flex; align-items: center; gap: .3rem; }
.pos-cat-btn:hover { background: color-mix(in srgb, var(--cat) 10%, #fff); }
.pos-cat-btn.active { background: var(--cat); color: #fff; border-color: var(--cat); box-shadow: 0 4px 12px color-mix(in srgb, var(--cat) 35%, transparent); }

.pos-product-card { --cat: #7f8c8d; position: relative; height: 100%; background: #fff; border: 1px solid var(--vz-border-color); border-radius: .85rem; overflow: hidden; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; user-select: none; }
.pos-product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(23, 33, 43, .10); border-color: color-mix(in srgb, var(--cat) 45%, transparent); }
.pos-product-card:active { transform: scale(.97); }
.pos-product-card.is-added { animation: pos-pulse .45s ease; }
@keyframes pos-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--vz-primary-rgb), .55); } 100% { box-shadow: 0 0 0 16px rgba(var(--vz-primary-rgb), 0); } }
.pos-product-card.is-rupture { opacity: .6; }
.pos-product-thumb { position: relative; height: 84px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--cat) 18%, #fff), color-mix(in srgb, var(--cat) 6%, #fff)); border-bottom: 3px solid var(--cat); }
.pos-product-thumb span { font-size: 1.5rem; font-weight: 700; color: var(--cat); letter-spacing: .05em; }
.pos-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-product-thumb .pos-add { position: absolute; right: .5rem; bottom: .4rem; font-size: 1.5rem; color: var(--vz-primary); opacity: 0; transition: opacity .12s, transform .12s; transform: scale(.7); }
.pos-product-card:hover .pos-add { opacity: 1; transform: scale(1); }
.pos-product-body { padding: .6rem .75rem .7rem; }
.pos-product-name { font-weight: 600; font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pos-product-meta { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin: .3rem 0 .35rem; font-size: .7rem; }
.pos-product-cat { color: var(--cat); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-stock { color: var(--vz-secondary-color); white-space: nowrap; }
.pos-stock-vide { color: var(--vz-danger); font-weight: 700; }
.pos-product-price { font-size: 1.05rem; font-weight: 700; color: var(--vz-primary); }

.pos-cart { border: none; border-radius: .9rem; overflow: hidden; box-shadow: 0 8px 30px rgba(23, 33, 43, .10); }
.pos-cart-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; background: linear-gradient(135deg, #0b5fa5, #17212b); color: #fff; }
.pos-cart-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
.pos-cart-sub { font-size: .75rem; opacity: .8; }
.pos-cart-lines { max-height: 300px; overflow-y: auto; }
.pos-cart-empty { text-align: center; padding: 2.2rem 1rem; color: var(--vz-secondary-color); font-size: .85rem; }
.pos-cart-empty i { display: block; font-size: 2.4rem; margin-bottom: .3rem; color: var(--vz-primary-border-subtle); }
.pos-cart-row { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem 1rem; border-bottom: 1px solid var(--vz-border-color); }
.pos-cart-row:last-child { border-bottom: none; }
.pos-cart-lib { font-weight: 600; font-size: .85rem; line-height: 1.2; }
.pos-cart-unit { color: var(--vz-secondary-color); font-size: .75rem; }
.pos-cart-total { font-weight: 700; font-size: .9rem; min-width: 74px; text-align: right; }
.pos-qty-pill { display: inline-flex; align-items: center; border: 1px solid var(--vz-border-color); border-radius: 999px; overflow: hidden; background: #fff; }
.pos-qty-pill button { border: none; background: transparent; width: 30px; height: 30px; line-height: 1; color: var(--vz-primary); font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.pos-qty-pill button:hover { background: var(--vz-primary-bg-subtle); }
.pos-qty-pill span { min-width: 28px; text-align: center; font-weight: 700; font-size: .9rem; }
.pos-cart-foot { background: #f8f9fb; border-top: 1px solid var(--vz-border-color); }
.pos-summary-row { display: flex; justify-content: space-between; align-items: center; padding: .2rem 0; font-size: .88rem; color: var(--vz-secondary-color); }
.pos-remise { max-width: 110px; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; margin: .5rem -1rem .25rem; padding: .6rem 1rem; background: var(--vz-primary-bg-subtle); color: var(--vz-primary); font-weight: 700; }
.pos-total span:first-child { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.pos-total span:last-child { font-size: 1.55rem; }
.pos-label { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--vz-secondary-color); margin-bottom: .4rem; }
.pos-pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.pos-pay-method { text-align: center; padding: .55rem .25rem; border: 1.5px solid var(--vz-border-color); border-radius: .6rem; cursor: pointer; font-size: .78rem; font-weight: 600; background: #fff; transition: all .12s; }
.pos-pay-method i { display: block; font-size: 1.4rem; margin-bottom: .15rem; color: var(--vz-secondary-color); }
.btn-check:checked + .pos-pay-method { border-color: var(--vz-primary); background: var(--vz-primary-bg-subtle); color: var(--vz-primary); box-shadow: 0 0 0 .2rem rgba(var(--vz-primary-rgb), .12); }
.btn-check:checked + .pos-pay-method i { color: var(--vz-primary); }
.pos-recu { font-weight: 700; font-size: 1.3rem; }
.pos-rapides { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.pos-rapide { border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pos-monnaie { display: flex; justify-content: space-between; align-items: baseline; padding: .45rem .75rem; margin-top: .5rem; background: #e6f4ec; color: #1f8a4c; border-radius: .5rem; font-size: .85rem; }
.pos-monnaie strong { font-size: 1.15rem; }
.pos-encaisser { font-weight: 700; font-size: 1.05rem; padding: .8rem; border-radius: .7rem; box-shadow: 0 6px 18px rgba(var(--vz-primary-rgb), .3); }
.pos-encaisser:disabled { box-shadow: none; }
.pos-encaisser kbd { background: rgba(255, 255, 255, .25); border-radius: .3rem; font-size: .7rem; padding: .1rem .35rem; margin-left: .35rem; }
#posCartePanel { background: #fff; }
body.pos-fullscreen #page-topbar .navbar-header { min-height: 54px; }

/* ------------------------------------------------------------------ Tableau de bord */
.dash-kpi { --kpi: #f2711c; position: relative; overflow: hidden; height: 100%; border-radius: .9rem; padding: 1rem 1.1rem; color: #fff; background: linear-gradient(135deg, var(--kpi), color-mix(in srgb, var(--kpi) 70%, #17212b)); box-shadow: 0 8px 22px color-mix(in srgb, var(--kpi) 35%, transparent); transition: transform .12s; }
.dash-kpi:hover { transform: translateY(-2px); }
.dash-kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.dash-kpi-icon { position: absolute; right: 1rem; top: .9rem; width: 40px; height: 40px; border-radius: .7rem; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.dash-kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .9; font-weight: 600; padding-right: 48px; }
.dash-kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin: .3rem 0 .35rem; font-variant-numeric: tabular-nums; }
.dash-evo { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(255, 255, 255, .22); }
.dash-evo.down { background: rgba(23, 33, 43, .35); }
.dash-evo-txt { font-size: .7rem; opacity: .85; margin-left: .3rem; }
.dash-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: .55rem; margin-right: .55rem; background: color-mix(in srgb, var(--acc) 15%, #fff); color: var(--acc); font-size: 1.05rem; vertical-align: middle; }
.card .card-header .card-title { display: flex; align-items: center; }
.dash-periode .btn { border-radius: 999px; }
.dash-suivre .list-group-item { border-left: 3px solid transparent; }
.dash-suivre .list-group-item.est-danger { border-left-color: var(--vz-danger); background: #fff5f5; }
.dash-suivre .list-group-item.est-info { border-left-color: var(--vz-info); }
.dash-suivre .list-group-item.est-warning { border-left-color: #d68910; background: #fffaf0; }
.dash-suivre .list-group-item.est-success { border-left-color: #1f8a4c; background: #f3faf6; }
.pos-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #17212b; color: #fff; padding: .7rem 1.1rem; border-radius: .7rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 600; z-index: 2000; opacity: 0; transition: opacity .15s, transform .15s; display: flex; align-items: center; gap: .5rem; }
.pos-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pos-toast i { color: #f2711c; font-size: 1.3rem; }
.pos-product-card.is-rupture { cursor: not-allowed; }
.pos-product-card.is-rupture .pos-add { display: none; }
.pos-product-card.is-sans-prix { opacity: .55; cursor: not-allowed; }
.pos-product-card.is-sans-prix .pos-add { display: none; }
.pos-sans-prix { display: inline-block; font-size: .72rem; font-weight: 700; color: #c0392b; background: #fdecea; border-radius: 999px; padding: .1rem .55rem; letter-spacing: .04em; text-transform: uppercase; }

/* Factures fournisseurs : statut de règlement */
.badge-partiel { background: #fff4e0; color: #b35c00; }

/* Cartes de montants (factures, règlements) : fond clair, liseré coloré, chiffres lisibles */
.kpi-solde { --acc: #0b5fa5; height: 100%; border-radius: .8rem; border: 1px solid #e9ebec; border-left: 5px solid var(--acc); background: #fff; padding: .9rem 1.1rem; }
.kpi-solde .kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #66717d; font-weight: 600; margin-bottom: .25rem; }
.kpi-solde .kpi-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; color: var(--acc); font-variant-numeric: tabular-nums; }
.kpi-solde.kpi-ok { --acc: #1f8a4c; }
.kpi-solde.kpi-du { --acc: #d23c3c; }
.kpi-solde.kpi-neutre { --acc: #66717d; }

/* Messages flash : le succès reste vert (l'orange « success » est réservé aux boutons) */
.alert.alert-success { --vz-alert-color: #146c43; --vz-alert-bg: #e6f4ec; --vz-alert-border-color: #b7dfc7; --vz-alert-link-color: #0f5132; color: #146c43; background-color: #e6f4ec; border-color: #b7dfc7; }
.alert.alert-success .btn-close { filter: none; }
.alert.alert-success .ri-checkbox-circle-line { color: #1f8a4c; }
