/* Faso Stock — styles partagés (identité visuelle "Aurora" + composants) */

:root {
    --fs-primary: #17b579;
    --fs-primary-dark: #0b6b45;
    --fs-primary-light: #e8f8f0;
    --fs-gradient: linear-gradient(135deg, #17b579, #0b6b45);
    --fs-accent: #f59e0b;
    --fs-accent-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);
    --fs-bg: #f6f7fb;
    --fs-surface: #ffffff;
    --fs-border: rgba(20, 40, 35, .08);
    --fs-text: #1a2027;
    --fs-text-muted: #8a93a3;
    --fs-danger: #dc2626;
    --fs-radius: 1.25rem;
    --fs-radius-sm: .7rem;
    --fs-shadow-brand: 0 8px 18px -6px rgba(11, 107, 69, .5);
    --fs-shadow-card: 0 12px 28px -14px rgba(20, 40, 35, .16);
    --fs-font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --fs-font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background:
        radial-gradient(1100px 520px at 10% -8%, rgba(23, 181, 121, .14), transparent 60%),
        radial-gradient(900px 480px at 94% 6%, rgba(139, 92, 246, .10), transparent 55%),
        radial-gradient(760px 520px at 46% 112%, rgba(245, 158, 11, .08), transparent 60%),
        var(--fs-bg);
    background-attachment: fixed;
    color: var(--fs-text);
    font-family: var(--fs-font-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fs-font-display);
}

/* ---------- Page de connexion ---------- */

.fs-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.fs-auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: 1.5rem;
    box-shadow: 0 24px 60px -20px rgba(11, 107, 69, .28);
    padding: 2.25rem 2rem;
}

.fs-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--fs-font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--fs-primary-dark);
    margin-bottom: .25rem;
}

.fs-logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--fs-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--fs-shadow-brand);
}

/* ---------- Connexion : mise en page "split-screen" avec le vrai logo ---------- */
/* Le logo est conçu pour un fond sombre (halos verts/rouges/or) — panneau de marque à
   gauche sur fond quasi noir, formulaire à droite sur le fond clair habituel de l'app. */

.fs-login-shell {
    min-height: 100vh;
    display: flex;
}

.fs-login-brand {
    flex: 1 1 50%;
    background: radial-gradient(circle at 30% 20%, #0f1a15 0%, #05070a 60%, #030405 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2.5rem 5.5rem;
    position: relative;
}

.fs-login-logo {
    width: 100%;
    max-width: 460px;
    height: auto;
}

.fs-login-tagline {
    color: rgba(255, 255, 255, .68);
    font-family: var(--fs-font-body);
    font-size: .95rem;
    max-width: 380px;
    margin: 1.5rem 0 0;
}

.fs-login-credit {
    position: absolute;
    bottom: 1.75rem;
    left: 0;
    right: 0;
    color: rgba(255, 255, 255, .38);
    font-size: .74rem;
    line-height: 1.6;
}

.fs-login-credit a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
}

.fs-login-credit a:hover {
    color: #fff;
    text-decoration: underline;
}

.fs-login-formside {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fs-bg);
    padding: 2rem 1.5rem;
}

.fs-login-card {
    box-shadow: var(--fs-shadow-card);
}

@media (max-width: 900px) {
    .fs-login-shell {
        flex-direction: column;
    }
    .fs-login-brand {
        padding: 2.5rem 1.5rem 3rem;
    }
    .fs-login-logo {
        max-width: 300px;
    }
    .fs-login-tagline {
        font-size: .85rem;
    }
    .fs-login-credit {
        position: static;
        margin-top: 1.75rem;
    }
    .fs-login-formside {
        padding: 2rem 1.25rem 3rem;
    }
}

/* ---------- Barre de navigation supérieure (flottante, en verre) ---------- */

.fs-topbar-wrap {
    padding: 18px 28px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.fs-topbar {
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px;
    box-shadow: 0 8px 30px -8px rgba(20, 40, 35, .12);
}

.fs-topbar .navbar-brand {
    font-family: var(--fs-font-display);
    font-weight: 800;
    color: var(--fs-primary-dark) !important;
}

.fs-topbar .nav-link {
    color: var(--fs-text-muted);
    font-weight: 600;
    border-radius: 999px;
    padding: .5rem .95rem;
}

.fs-topbar .nav-link.active {
    background: var(--fs-gradient);
    color: #fff !important;
    box-shadow: var(--fs-shadow-brand);
}

.fs-store-badge {
    background: linear-gradient(135deg, #fef3e2, #fde3c2);
    color: #92400e;
    font-weight: 700;
}

.fs-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

/* ---------- Page de vente (POS) ---------- */

.fs-pos-search .form-control {
    border-radius: 999px 0 0 999px;
    border-color: var(--fs-border);
}

.fs-pos-search .btn {
    border-radius: 0 999px 999px 0;
    background: var(--fs-gradient);
    color: #fff;
    border: none;
    box-shadow: var(--fs-shadow-brand);
}

.fs-category-chip {
    border-radius: 999px;
    border: none;
    background: #eef0f5;
    color: var(--fs-text-muted);
    font-weight: 600;
}

.fs-category-chip[data-cat="Boissons"] { background: #e0f2fe; color: #0369a1; }
.fs-category-chip[data-cat="Épicerie"] { background: #dcfce7; color: #15803d; }
.fs-category-chip[data-cat="Hygiène"] { background: #fae8ff; color: #9333ea; }
.fs-category-chip[data-cat="Ménage"] { background: #fef3c7; color: #b45309; }

/* L'état actif l'emporte toujours sur la couleur de catégorie (règle déclarée après). */
.fs-category-chip.active {
    background: var(--fs-gradient);
    color: #fff;
    box-shadow: var(--fs-shadow-brand);
}

.fs-product-card {
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    background: var(--fs-surface);
    box-shadow: var(--fs-shadow-card);
    transition: box-shadow .15s ease, transform .15s ease;
    height: 100%;
}

.fs-product-card:hover {
    box-shadow: 0 16px 34px -14px rgba(20, 40, 35, .22);
    transform: translateY(-2px);
}

.fs-product-card.fs-out-of-stock {
    opacity: .6;
}

.fs-category-tag {
    font-size: .72rem;
    font-weight: 700;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--fs-primary-light);
    color: var(--fs-primary-dark);
}

.fs-category-tag[data-cat="Boissons"] { background: #e0f2fe; color: #0369a1; }
.fs-category-tag[data-cat="Épicerie"] { background: #dcfce7; color: #15803d; }
.fs-category-tag[data-cat="Hygiène"] { background: #fae8ff; color: #9333ea; }
.fs-category-tag[data-cat="Ménage"] { background: #fef3c7; color: #b45309; }

.fs-product-name {
    font-family: var(--fs-font-display);
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.3;
}

.fs-product-price {
    font-family: var(--fs-font-display);
    color: var(--fs-primary-dark);
    font-weight: 800;
    font-size: 1.15rem;
}

.fs-stock-pill {
    font-size: .72rem;
}

.fs-stock-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fs-primary);
    margin-right: 4px;
}

.fs-stock-low {
    color: var(--fs-danger) !important;
    font-weight: 700;
}

.fs-stock-low .fs-stock-dot {
    background: var(--fs-danger) !important;
}

/* Stock à zéro dans un contexte d'entrée : neutre, ce n'est pas une anomalie
   (article pas encore approvisionné dans cette boutique). */
.fs-stock-neutral {
    color: var(--fs-text-muted) !important;
}

.fs-stock-neutral .fs-stock-dot {
    background: #c3c9d1;
}

.fs-badge-gros {
    background: var(--fs-accent-gradient);
    color: #fff;
    font-weight: 700;
}

.fs-badge-rupture {
    background: #fdecec;
    color: var(--fs-danger);
    font-weight: 700;
}

.fs-stepper {
    display: flex;
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius-sm);
    overflow: hidden;
}

.fs-stepper button {
    width: 34px;
    border: none;
    background: transparent;
    color: var(--fs-text-muted);
    font-weight: 700;
}

.fs-stepper button:hover {
    background: var(--fs-primary-light);
    color: var(--fs-primary-dark);
}

.fs-stepper input {
    flex: 1;
    border: none;
    border-left: 1px solid var(--fs-border);
    border-right: 1px solid var(--fs-border);
    text-align: center;
    font-weight: 700;
    min-width: 0;
}

.fs-stepper input:focus {
    outline: none;
    box-shadow: none;
}

.fs-btn-gradient {
    background: var(--fs-gradient);
    color: #fff;
    border: none;
    font-weight: 700;
    box-shadow: var(--fs-shadow-brand);
}

.fs-btn-gradient:hover {
    color: #fff;
    filter: brightness(1.05);
}

.fs-btn-gradient:disabled {
    background: #d7e3da;
    box-shadow: none;
    color: #fff;
}

.fs-cart-panel {
    border: 1px solid var(--fs-border);
    border-radius: 1.5rem;
    background: var(--fs-surface);
    box-shadow: 0 20px 44px -18px rgba(20, 40, 35, .16);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fs-cart-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--fs-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--fs-shadow-brand);
}

.fs-cart-lines {
    flex: 1;
    overflow-y: auto;
    max-height: 46vh;
}

.fs-cart-qty {
    width: 56px;
}

/* Champ de rabais sur le prix unitaire d'une ligne du panier (droit "rabais", voir
   vente.js) — un peu plus large que la quantité pour un montant en FCFA. */
.fs-cart-price {
    width: 84px;
    display: inline-block;
}

.fs-cart-empty {
    color: var(--fs-text-muted);
    text-align: center;
    padding: 2.5rem 1rem;
}

.fs-cart-total {
    font-family: var(--fs-font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--fs-primary-dark);
}

.fs-pay-method {
    border-radius: var(--fs-radius-sm) !important;
    border-color: var(--fs-border) !important;
    color: var(--fs-text-muted);
    font-weight: 600;
    font-size: .78rem;
    padding: .4rem .5rem;
}

.fs-pay-method i {
    font-size: .85rem;
}

.fs-pay-method:hover {
    color: var(--fs-text-muted);
}

.btn-check:checked + .fs-pay-method {
    background: var(--fs-gradient) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: var(--fs-shadow-brand);
}

.fs-versement-input,
.fs-reste-value {
    font-family: var(--fs-font-display);
    font-size: 1.15rem;
    font-weight: 800;
    padding: .55rem .8rem;
    height: auto;
}

.fs-reste-value {
    border: 1px solid #fbd0d0;
    background: #fdecec;
    border-radius: var(--fs-radius-sm);
    color: var(--fs-danger);
    display: flex;
    align-items: center;
}

.fs-reste-value.fs-reste-zero {
    border-color: var(--fs-border);
    background: transparent;
    color: var(--fs-text);
}

.fs-reste-value.fs-reste-change {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.fs-credit-alert {
    background: linear-gradient(135deg, #fef3e2, #fdedd3);
    border: 1px solid #f6dfb3;
    color: #92400e;
    border-radius: var(--fs-radius-sm);
}

.fs-btn-proforma {
    border: 1.5px dashed rgba(20, 40, 35, .18);
    color: var(--fs-text-muted);
    font-weight: 600;
    background: transparent;
    border-radius: var(--fs-radius-sm);
}

.fs-btn-proforma:hover {
    color: var(--fs-text-muted);
    border-color: rgba(20, 40, 35, .3);
}

.fs-scroll-x {
    overflow-x: auto;
}

/* ---------- Bascule grille / tableau ---------- */

.fs-view-toggle .fs-view-btn {
    border: 1px solid var(--fs-border);
    background: var(--fs-surface);
    color: var(--fs-text-muted);
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-view-toggle .fs-view-btn:first-of-type {
    border-radius: 999px 0 0 999px;
}

.fs-view-toggle .fs-view-btn:last-of-type {
    border-radius: 0 999px 999px 0;
}

.btn-check:checked + .fs-view-btn {
    background: var(--fs-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--fs-shadow-brand);
    z-index: 1;
}

/* ---------- Bascule période (rapports) ---------- */

.fs-period-tabs .fs-period-btn {
    border: 1px solid var(--fs-border);
    background: var(--fs-surface);
    color: var(--fs-text-muted);
    font-weight: 600;
    font-size: .78rem;
    padding: .38rem .9rem;
}

.fs-period-tabs .fs-period-btn:first-of-type {
    border-radius: 999px 0 0 999px;
}

.fs-period-tabs .fs-period-btn:last-of-type {
    border-radius: 0 999px 999px 0;
}

.btn-check:checked + .fs-period-btn {
    background: var(--fs-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--fs-shadow-brand);
    z-index: 1;
}

/* ---------- Vue tableau des articles ---------- */

.fs-table-card {
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: var(--fs-shadow-card);
    overflow: hidden;
}

.fs-table-card table {
    margin-bottom: 0;
}

.fs-table-card thead th {
    border-bottom: 1px solid var(--fs-border);
    border-top: none;
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fs-text-muted);
    padding: .9rem 1rem;
    white-space: nowrap;
}

.fs-table-card tbody td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--fs-border);
    vertical-align: middle;
}

.fs-table-card tbody tr:last-child td {
    border-bottom: none;
}

.fs-table-card tbody tr:hover {
    background: var(--fs-primary-light);
}

.fs-table-card tbody tr.fs-out-of-stock {
    opacity: .55;
}

.fs-stepper-sm button {
    width: 26px;
    font-size: .82rem;
}

.fs-stepper-sm input {
    font-size: .82rem;
    padding: 0;
}

/* ---------- Champs select cherchables (Tom Select, façon Select2) ---------- */

.ts-wrapper.form-select,
.ts-control {
    border-radius: var(--fs-radius-sm) !important;
    border-color: var(--fs-border) !important;
    background-color: var(--fs-surface) !important;
    box-shadow: none !important;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.focus.form-select {
    border-color: var(--fs-primary) !important;
    box-shadow: 0 0 0 .2rem rgba(23, 181, 121, .15) !important;
}

.ts-dropdown {
    border-radius: var(--fs-radius-sm);
    border-color: var(--fs-border);
    box-shadow: var(--fs-shadow-card);
    font-family: var(--fs-font-body);
}

.ts-dropdown .option.active {
    background: var(--fs-primary-light);
    color: var(--fs-primary-dark);
}

.ts-dropdown .option[data-selected] {
    background: var(--fs-gradient);
    color: #fff;
}

/* ---------- Reçu imprimable ---------- */

.fs-receipt {
    background: #fff;
    color: #1a2027;
    margin: 0 auto;
    font-family: var(--fs-font-body);
}

.fs-receipt .fs-receipt-shop {
    font-family: var(--fs-font-display);
    font-weight: 800;
    text-align: center;
}

.fs-receipt hr {
    border: none;
    border-top: 1px dashed rgba(20, 40, 35, .25);
    margin: .6rem 0;
}

.fs-receipt table {
    width: 100%;
    border-collapse: collapse;
}

.fs-receipt th,
.fs-receipt td {
    padding: .2rem 0;
    text-align: left;
}

.fs-receipt .text-end {
    text-align: right;
}

/* Format ticket 80mm : étroit, esprit imprimante thermique */
.fs-receipt-ticket {
    width: 300px;
    font-size: .8rem;
    padding: 1rem .75rem;
    box-shadow: 0 8px 24px -10px rgba(20, 40, 35, .25);
}

.fs-receipt-ticket .fs-receipt-shop {
    font-size: 1rem;
}

/* Formats A5 / A4 : mise en page facture classique */
.fs-receipt-a5,
.fs-receipt-a4 {
    width: 100%;
    max-width: 480px;
    font-size: .85rem;
    padding: 1.75rem;
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius-sm);
}

.fs-receipt-a4 {
    max-width: 560px;
}

.fs-receipt-a5 .fs-receipt-shop,
.fs-receipt-a4 .fs-receipt-shop {
    font-size: 1.15rem;
    text-align: left;
}

.fs-receipt-total-row {
    font-family: var(--fs-font-display);
    font-weight: 800;
    font-size: 1.05rem;
}

/* ---------- Gestion des catégories ---------- */

.fs-scope-badge {
    background: var(--fs-primary-light);
    color: var(--fs-primary-dark);
    font-weight: 700;
    font-size: .72rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.fs-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
    cursor: pointer;
}

.fs-switch .form-check-input:checked {
    background-color: var(--fs-primary);
    border-color: var(--fs-primary);
}

.fs-row-disabled {
    opacity: .55;
}

.fs-badge-disabled {
    background: #fdecec;
    color: var(--fs-danger);
    font-weight: 700;
    font-size: .68rem;
}

/* Ligne d'un enregistrement système (ex. magasin principal) : léger fond distinctif, pas
   d'opacité réduite (contrairement à .fs-row-disabled) puisqu'il reste pleinement actif. */
.fs-row-system {
    background: var(--fs-bg);
}

/* ---------- Aperçu du logo (modale "Entête d'impression" de magasins.php) ---------- */

.fs-logo-preview {
    width: 72px;
    height: 72px;
    border-radius: var(--fs-radius-sm);
    border: 1.5px dashed var(--fs-border);
    background: var(--fs-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 1.5rem;
}

.fs-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- Vue galerie (vignettes d'articles — vente.php, stock.php) ---------- */
/* Troisième mode d'affichage, en plus de grille/tableau : une vignette carrée par
   article, avec un aperçu agrandi ("picture-in-picture") au survol prolongé — voir
   attachGalleryHoverPreview() dans vente.js/stock.js. */

.fs-gallery-card {
    cursor: pointer;
    text-align: center;
    user-select: none;
}

.fs-gallery-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--fs-radius-sm);
    background: var(--fs-bg);
    border: 1px solid var(--fs-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fs-gallery-card:hover .fs-gallery-thumb {
    border-color: var(--fs-primary);
    box-shadow: 0 0 0 .15rem rgba(23, 181, 121, .15);
}

.fs-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fs-gallery-thumb .bi-image {
    font-size: 1.8rem;
    color: var(--fs-text-muted);
}

.fs-gallery-label {
    font-size: .78rem;
    font-weight: 600;
    margin-top: .45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-gallery-meta {
    font-size: .72rem;
    color: var(--fs-text-muted);
}

.fs-gallery-thumb.fs-stock-low { border-color: var(--fs-danger); }

/* Élément flottant UNIQUE et partagé (créé une fois en JS, repositionné à chaque survol)
   — l'aperçu agrandi qui apparaît après 1,5s de survol d'une vignette. */
.fs-pip-preview {
    position: fixed;
    z-index: 2000;
    width: 260px;
    height: 260px;
    border-radius: var(--fs-radius);
    box-shadow: 0 20px 50px -12px rgba(20, 40, 35, .35);
    border: 3px solid var(--fs-surface);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: scale(.92);
    transition: opacity .18s ease, transform .18s ease;
    background: var(--fs-surface);
}

.fs-pip-preview.show {
    opacity: 1;
    transform: scale(1);
}

.fs-pip-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Validation d'un champ Tom Select (ex. rôle utilisateur) : même rouge que .is-invalid
   sur un <input>, appliqué au wrapper puisque le <select> d'origine est masqué. */
.ts-wrapper.is-invalid > .ts-control {
    border-color: var(--fs-danger) !important;
}

/* ---------- Gestion des articles (produits & variantes) ---------- */

.fs-chip-toggle {
    border-radius: 999px;
    border: 1px solid var(--fs-border);
    background: var(--fs-surface);
    color: var(--fs-text-muted);
    font-weight: 600;
    font-size: .82rem;
    padding: .4rem .9rem;
}

.fs-chip-toggle.active {
    background: var(--fs-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--fs-shadow-brand);
}

.fs-chip-add-input {
    max-width: 160px;
}

.fs-variant-preview {
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius-sm);
    background: var(--fs-bg);
    padding: .6rem .8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .84rem;
}

.fs-variant-code {
    font-weight: 700;
    color: var(--fs-primary-dark);
}

.fs-produit-card {
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    background: var(--fs-surface);
    box-shadow: var(--fs-shadow-card);
    overflow: hidden;
}

.fs-produit-header {
    background: var(--fs-primary-light);
    padding: .85rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ---------- Tableau de bord ---------- */

.fs-stat-card {
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: var(--fs-shadow-card);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.fs-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

.fs-stat-icon-primary { background: var(--fs-gradient); }
.fs-stat-icon-accent { background: var(--fs-accent-gradient); }
.fs-stat-icon-danger { background: linear-gradient(135deg, #f87171, #dc2626); }
.fs-stat-icon-info { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.fs-stat-value {
    font-family: var(--fs-font-display);
    font-weight: 800;
    font-size: 1.55rem;
    line-height: 1.15;
}

.fs-stat-label {
    color: var(--fs-text-muted);
    font-size: .8rem;
}

/* ---------- Cartes du hub Paramètres ---------- */

.fs-settings-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: var(--fs-shadow-card);
    padding: 1.2rem;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fs-settings-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--fs-shadow-brand);
    color: inherit;
}

.fs-settings-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.fs-alert-card {
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: var(--fs-shadow-card);
    height: 100%;
}

.fs-alert-card-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--fs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fs-urgency-high { background: #fdecec; color: var(--fs-danger); }
.fs-urgency-medium { background: #fef3e2; color: #b45309; }
.fs-urgency-low { background: var(--fs-primary-light); color: var(--fs-primary-dark); }

/* ---------- Transferts de stock ---------- */

.fs-direction-btn {
    border-radius: var(--fs-radius-sm) !important;
    border-color: var(--fs-border) !important;
    color: var(--fs-text-muted);
    font-weight: 600;
    padding: .65rem .5rem;
}

.btn-check:checked + .fs-direction-btn {
    background: var(--fs-gradient) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: var(--fs-shadow-brand);
}

.fs-article-card {
    cursor: pointer;
}

.fs-stock-mini-row {
    display: flex;
    justify-content: space-between;
    font-size: .76rem;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--fs-border);
}

.fs-stock-mini-row:last-child {
    border-bottom: none;
}

.fs-table-row-clickable {
    cursor: pointer;
}

.fs-table-row-clickable:hover {
    background: var(--fs-primary-light);
}

.fs-stock-available {
    border: 1px solid var(--fs-border);
    background: var(--fs-bg);
    border-radius: var(--fs-radius-sm);
    padding: .6rem .9rem;
    font-weight: 700;
}

/* ---------- Compte client / statut des factures ---------- */

.fs-row-unpaid { background: #fdecec; }
.fs-row-unpaid:hover { background: #fbdede; }
.fs-row-partial { background: #fef3e2; }
.fs-row-partial:hover { background: #fdebcf; }

.fs-badge-payee { background: var(--fs-primary-light); color: var(--fs-primary-dark); font-weight: 700; }
.fs-badge-partielle { background: #fef3e2; color: #b45309; font-weight: 700; }
.fs-badge-impayee { background: #fdecec; color: var(--fs-danger); font-weight: 700; }

/* ---------- Rapports ---------- */

.fs-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    height: 190px;
    padding: 28px 4px 0;
}

.fs-chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.fs-chart-bar {
    width: 100%;
    max-width: 38px;
    border-radius: 4px 4px 0 0;
    background: var(--fs-gradient);
    position: relative;
    transition: filter .15s ease;
    cursor: default;
}

.fs-chart-bar:hover {
    filter: brightness(1.08);
}

.fs-chart-bar-value {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .68rem;
    font-weight: 700;
    color: var(--fs-text-muted);
    white-space: nowrap;
}

.fs-chart-bar-label {
    margin-top: .5rem;
    font-size: .72rem;
    color: var(--fs-text-muted);
}

.fs-hbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.fs-hbar-label {
    width: 150px;
    font-size: .82rem;
    color: var(--fs-text-muted);
    flex-shrink: 0;
}

.fs-hbar-track {
    flex: 1;
    background: var(--fs-bg);
    border-radius: 999px;
    height: 16px;
    overflow: hidden;
}

.fs-hbar-fill {
    height: 100%;
    border-radius: 999px;
}

.fs-hbar-value {
    width: 100px;
    text-align: right;
    font-size: .82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.fs-bestseller-card {
    background: linear-gradient(135deg, var(--fs-primary-light), #fff);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    padding: 1.25rem;
}

@media print {
    body * {
        visibility: hidden;
    }

    #receiptPrintArea,
    #receiptPrintArea * {
        visibility: visible;
    }

    #receiptPrintArea {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }

    .fs-receipt {
        box-shadow: none !important;
        border: none !important;
    }
}
