/* ==========================================================================
   BL-HOST — Design System
   --------------------------------------------------------------------------
   Thème officiel BL-Host pour PNLCS.

   Ce fichier est la SOURCE UNIQUE des couleurs, espacements, rayons et ombres
   de l'interface. Pour changer l'identité visuelle, modifier uniquement le
   bloc « 1. TOKENS » ci-dessous (ou themes/bl-host/theme.json pour piloter
   les mêmes valeurs depuis l'administration PNLCS).

   Sommaire
     1.  Tokens (couleurs, typo, espacements, rayons, ombres, transitions)
     2.  Thème clair
     3.  Base & reset
     4.  Utilitaires
     5.  Layout applicatif (sidebar / header / main / footer)
     6.  Composants — Button
     7.  Composants — Formulaires
     8.  Composants — Card / Panel
     9.  Composants — Badge & Label
     10. Composants — Table
     11. Composants — Alert & Toast
     12. Composants — Modal & Dropdown
     13. Composants — Tabs, Pagination, Tooltip, Avatar
     14. Composants — StatCard, ServerCard, ProductCard, InvoiceCard, TicketCard
     15. Composants — Progress, Loading / Skeleton, EmptyState
     16. Composants — Timeline & conversation (tickets)
     17. Checkout & panier
     18. Compatibilité PNLCS (classes historiques)
     19. Animations
     20. Responsive
     21. Impression
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */

:root {
    /* --- Marque ------------------------------------------------------- */
    --blh-brand-50:  #f5f3ff;
    --blh-brand-100: #ede9fe;
    --blh-brand-200: #ddd6fe;
    --blh-brand-300: #c4b5fd;
    --blh-brand-400: #a78bfa;
    --blh-brand-500: #8b5cf6;
    --blh-brand-600: #7c3aed;
    --blh-brand-700: #6d28d9;
    --blh-brand-800: #5b21b6;
    --blh-brand-900: #4c1d95;

    /* --- Neutres (échelle « ink ») ------------------------------------ */
    --blh-ink-950: #090917;
    --blh-ink-900: #0f0f23;
    --blh-ink-850: #161430;
    --blh-ink-800: #211e40;
    --blh-ink-700: #373060;
    --blh-ink-600: #475569;
    --blh-ink-500: #64748b;
    --blh-ink-400: #94a3b8;
    --blh-ink-300: #cbd5e1;
    --blh-ink-200: #e2e8f0;
    --blh-ink-100: #f1f5f9;
    --blh-ink-50:  #f8fafc;

    /* --- Rôles sémantiques -------------------------------------------- */
    --blh-background:     var(--theme-body-bg, var(--blh-ink-950));
    --blh-surface:        var(--theme-card-bg, var(--blh-ink-900));
    --blh-surface-raised: var(--blh-ink-850);
    --blh-surface-hover:  #1c1a3c;
    --blh-surface-sunken: rgba(9, 9, 23, .55);
    --blh-border:         var(--theme-border-color, var(--blh-ink-800));
    --blh-border-strong:  var(--blh-ink-700);
    --blh-text:           var(--theme-text-color, var(--blh-ink-200));
    --blh-text-strong:    var(--theme-heading-color, var(--blh-ink-50));
    --blh-text-muted:     var(--theme-muted-color, var(--blh-ink-400));
    /* #7d8da3 plutot que ink-500 (#64748b) : ce dernier ne donne que
       4,2:1 sur le fond, sous le minimum WCAG AA pour du petit texte. */
    --blh-text-faint:     #7d8da3;

    --blh-primary:        var(--theme-primary, var(--blh-brand-500));
    --blh-primary-hover:  var(--theme-primary-dark, var(--blh-brand-600));
    --blh-primary-soft:   rgba(139, 92, 246, .14);
    --blh-primary-ring:   rgba(139, 92, 246, .32);
    --blh-on-primary:     #ffffff;

    /* Dégradé des surfaces pleines portant du texte blanc.
       Il démarre à brand-600 (#7c3aed) et non à brand-500 : sur #8b5cf6 le
       texte blanc plafonne à 4,2:1, sous le minimum WCAG AA de 4,5:1, alors
       que #7c3aed atteint 5,7:1. La teinte reste celle de BL-Host. */
    --blh-primary-gradient: linear-gradient(to bottom right, var(--blh-brand-600), var(--blh-brand-800));

    --blh-success:        var(--theme-success, #34d399);
    --blh-success-soft:   rgba(52, 211, 153, .13);
    --blh-warning:        var(--theme-warning, #fbbf24);
    --blh-warning-soft:   rgba(251, 191, 36, .13);
    --blh-danger:         var(--theme-danger, #f87171);
    --blh-danger-soft:    rgba(248, 113, 113, .13);
    --blh-info:           var(--theme-info, #38bdf8);
    --blh-info-soft:      rgba(56, 189, 248, .13);

    --blh-link:           var(--theme-link-color, var(--blh-brand-400));
    --blh-link-hover:     var(--theme-link-hover-color, var(--blh-brand-300));

    /* --- Ambiance ------------------------------------------------------ */
    --blh-glow: radial-gradient(55% 45% at 50% -10%, rgba(124, 58, 237, .16), transparent 70%),
                radial-gradient(40% 40% at 100% 0%, rgba(139, 92, 246, .10), transparent 70%);
    --blh-grid: linear-gradient(to right, rgba(148, 163, 184, .05) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(148, 163, 184, .05) 1px, transparent 1px);
    --blh-overlay: var(--theme-overlay-bg, rgba(9, 9, 23, .82));

    /* --- Typographie ---------------------------------------------------- */
    --blh-font: var(--theme-font-family, 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif);
    --blh-font-display: var(--theme-heading-font-family, 'Orbitron', 'Inter', ui-sans-serif, system-ui, sans-serif);
    --blh-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --blh-text-xs:  12px;
    --blh-text-sm:  13px;
    --blh-text-base: 14px;
    --blh-text-md:  15px;
    --blh-text-lg:  17px;
    --blh-text-xl:  20px;
    --blh-text-2xl: 26px;
    --blh-text-3xl: 34px;
    --blh-leading: 1.6;

    /* --- Espacements ---------------------------------------------------- */
    --blh-space-1: 4px;
    --blh-space-2: 8px;
    --blh-space-3: 12px;
    --blh-space-4: 16px;
    --blh-space-5: 20px;
    --blh-space-6: 24px;
    --blh-space-8: 32px;
    --blh-space-10: 40px;
    --blh-space-12: 48px;

    /* --- Rayons ---------------------------------------------------------- */
    --blh-radius-sm: 8px;
    --blh-radius: 12px;
    --blh-radius-lg: 16px;
    --blh-radius-xl: 20px;
    --blh-radius-full: 9999px;

    /* --- Ombres ---------------------------------------------------------- */
    --blh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --blh-shadow: 0 8px 24px -12px rgba(0, 0, 0, .6);
    --blh-shadow-lg: 0 10px 40px -15px rgba(0, 0, 0, .6);
    --blh-shadow-primary: 0 0 0 1px rgba(139, 92, 246, .3), 0 0 32px -4px rgba(124, 58, 237, .45);

    /* --- Mouvement -------------------------------------------------------- */
    --blh-ease: cubic-bezier(.4, 0, .2, 1);
    --blh-duration-fast: .12s;
    --blh-duration: .18s;
    --blh-duration-slow: .3s;

    /* --- Gabarit ---------------------------------------------------------- */
    --blh-container: var(--theme-container-max-width, 1280px);
    --blh-sidebar-width: 264px;
    --blh-sidebar-collapsed: 76px;
    --blh-header-height: 62px;
    --blh-z-sidebar: 900;
    --blh-z-header: 950;
    --blh-z-dropdown: 1000;
    --blh-z-modal: 1100;
    --blh-z-toast: 1200;
}

/* --------------------------------------------------------------------------
   Alias de compatibilité PNLCS

   Le gabarit client d'origine déclarait ces variables dans son bloc <style>.
   Une quarantaine de vues non surchargées s'en servent encore, avec une
   valeur de repli claire (par ex. « var(--card, #fff) »). Sans ces alias,
   ces vues retomberaient sur leur repli et casseraient le fond sombre.

   Elles sont donc redéfinies ici, pointant vers les jetons BL-Host — un seul
   endroit à modifier pour changer l'identité visuelle.
   -------------------------------------------------------------------------- */

:root {
    --primary:       var(--blh-primary);
    --primary-light: var(--blh-primary-soft);
    --primary-dark:  var(--blh-primary-hover);
    --accent:        var(--blh-brand-400);
    --accent-dark:   var(--blh-brand-600);
    --danger:        var(--blh-danger);
    --warning:       var(--blh-warning);
    --success:       var(--blh-success);
    --info:          var(--blh-info);
    --bg:            var(--blh-background);
    --bg-alt:        var(--blh-surface-sunken);
    --card:          var(--blh-surface);
    --border:        var(--blh-border);
    --text:          var(--blh-text);
    --muted:         var(--blh-text-muted);
    --shadow:        var(--blh-shadow);
    --shadow-md:     var(--blh-shadow);
    --shadow-lg:     var(--blh-shadow-lg);
    --radius:        var(--blh-radius-lg);
    --radius-sm:     var(--blh-radius-sm);
}

/* ==========================================================================
   2. THÈME CLAIR
   L'interface BL-Host est sombre par défaut. Le mode clair reste disponible
   quand l'option « dark mode » est activée dans PNLCS : il ne fait que
   redéfinir les rôles sémantiques, jamais les composants.
   ========================================================================== */

[data-theme="light"] {
    --blh-background:     #f6f7fb;
    --blh-surface:        #ffffff;
    --blh-surface-raised: #f1f2f8;
    --blh-surface-hover:  #eceaf7;
    --blh-surface-sunken: #f8f9fc;
    --blh-border:         #e3e2ee;
    --blh-border-strong:  #cdcbe0;
    --blh-text:           #23233b;
    --blh-text-strong:    #0f0f23;
    --blh-text-muted:     #5c5b78;
    --blh-text-faint:     #6b6a85;   /* 5,2:1 sur blanc (#7c7b96 : 4,1:1) */

    --blh-primary:        #7c3aed;
    --blh-primary-hover:  #6d28d9;
    --blh-primary-soft:   rgba(124, 58, 237, .1);
    --blh-primary-ring:   rgba(124, 58, 237, .28);

    --blh-success:        #047857;   /* 5,5:1 sur blanc (#059669 : 3,8:1) */
    --blh-success-soft:   rgba(5, 150, 105, .1);
    --blh-warning:        #b45309;
    --blh-warning-soft:   rgba(180, 83, 9, .1);
    --blh-danger:         #dc2626;
    --blh-danger-soft:    rgba(220, 38, 38, .1);
    --blh-info:           #0369a1;
    --blh-info-soft:      rgba(3, 105, 161, .1);

    --blh-link:           #6d28d9;
    --blh-link-hover:     #5b21b6;

    --blh-glow: radial-gradient(55% 45% at 50% -10%, rgba(124, 58, 237, .07), transparent 70%);
    --blh-grid: linear-gradient(to right, rgba(100, 116, 139, .05) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(100, 116, 139, .05) 1px, transparent 1px);
    --blh-overlay: rgba(15, 15, 35, .45);

    --blh-shadow-sm: 0 1px 2px rgba(15, 15, 35, .06);
    --blh-shadow: 0 6px 20px -10px rgba(15, 15, 35, .18);
    --blh-shadow-lg: 0 18px 45px -20px rgba(15, 15, 35, .25);
    color-scheme: light;
}

:root { color-scheme: dark; }

/* ==========================================================================
   3. BASE & RESET
   ========================================================================== */

.blh-app,
.blh-app *,
.blh-app *::before,
.blh-app *::after { box-sizing: border-box; }

body.blh-app {
    margin: 0;
    min-height: 100vh;
    font-family: var(--blh-font);
    font-size: var(--blh-text-base);
    line-height: var(--blh-leading);
    color: var(--blh-text);
    background-color: var(--blh-background);
    background-image: var(--blh-glow);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.blh-app h1, .blh-app h2, .blh-app h3, .blh-app h4, .blh-app h5, .blh-app h6 {
    margin: 0;
    color: var(--blh-text-strong);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.blh-app p { margin: 0 0 var(--blh-space-3); }
.blh-app p:last-child { margin-bottom: 0; }

.blh-app a {
    color: var(--blh-link);
    text-decoration: none;
    transition: color var(--blh-duration) var(--blh-ease);
}
.blh-app a:hover { color: var(--blh-link-hover); }

.blh-app hr {
    border: 0;
    border-top: 1px solid var(--blh-border);
    margin: var(--blh-space-6) 0;
}

.blh-app code, .blh-app kbd, .blh-app pre, .blh-app samp { font-family: var(--blh-font-mono); }

.blh-app ::selection { background: var(--blh-brand-600); color: #fff; }

/* Focus visible — accessibilité clavier (WCAG 2.4.7) */
.blh-app :focus-visible {
    outline: 2px solid var(--blh-brand-400);
    outline-offset: 2px;
    border-radius: var(--blh-radius-sm);
}
.blh-app :focus:not(:focus-visible) { outline: none; }

/* Scrollbar */
.blh-app ::-webkit-scrollbar { width: 10px; height: 10px; }
.blh-app ::-webkit-scrollbar-track { background: transparent; }
.blh-app ::-webkit-scrollbar-thumb {
    background: var(--blh-ink-700);
    border: 2px solid transparent;
    background-clip: content-box;
    border-radius: var(--blh-radius-full);
}
.blh-app ::-webkit-scrollbar-thumb:hover { background: var(--blh-brand-700); background-clip: content-box; }
.blh-app { scrollbar-width: thin; scrollbar-color: var(--blh-ink-700) transparent; }

/* Lien d'évitement */
.blh-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: var(--blh-z-toast);
    padding: 10px 18px;
    background: var(--blh-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 var(--blh-radius) 0;
}
.blh-skip-link:focus { left: 0; color: #fff; }

/* ==========================================================================
   4. UTILITAIRES
   ========================================================================== */

.blh-container { width: 100%; max-width: var(--blh-container); margin: 0 auto; padding: 0 var(--blh-space-4); }
.blh-stack     { display: flex; flex-direction: column; gap: var(--blh-space-4); }
.blh-row       { display: flex; align-items: center; gap: var(--blh-space-3); }
.blh-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--blh-space-3); }
.blh-wrap      { flex-wrap: wrap; }
.blh-grow      { flex: 1 1 auto; min-width: 0; }
.blh-spacer    { margin-left: auto; }

.blh-grid      { display: grid; gap: var(--blh-space-4); }
.blh-grid-2    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blh-grid-3    { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.blh-grid-4    { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.blh-grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.blh-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

.blh-muted   { color: var(--blh-text-muted); }
.blh-faint   { color: var(--blh-text-faint); }
.blh-strong  { color: var(--blh-text-strong); font-weight: 600; }
.blh-mono    { font-family: var(--blh-font-mono); font-size: .92em; }
.blh-display { font-family: var(--blh-font-display); letter-spacing: .02em; }
.blh-xs      { font-size: var(--blh-text-xs); }
.blh-sm      { font-size: var(--blh-text-sm); }
.blh-lg      { font-size: var(--blh-text-lg); }
.blh-nowrap  { white-space: nowrap; }
.blh-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blh-right   { text-align: right; }
.blh-center  { text-align: center; }

.blh-text-success { color: var(--blh-success); }
.blh-text-warning { color: var(--blh-warning); }
.blh-text-danger  { color: var(--blh-danger); }
.blh-text-info    { color: var(--blh-info); }
.blh-text-primary { color: var(--blh-primary); }

.blh-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.blh-divider { height: 1px; background: var(--blh-border); border: 0; margin: var(--blh-space-4) 0; }

.blh-code {
    display: inline-block;
    padding: 2px 8px;
    background: var(--blh-surface-raised);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    font-family: var(--blh-font-mono);
    font-size: var(--blh-text-xs);
    color: var(--blh-brand-300);
}

/* Espacements ponctuels */
.blh-mt-0 { margin-top: 0 !important; }
.blh-mb-0 { margin-bottom: 0 !important; }
.blh-mb-2 { margin-bottom: var(--blh-space-2); }
.blh-mb-3 { margin-bottom: var(--blh-space-3); }
.blh-mb-4 { margin-bottom: var(--blh-space-4); }
.blh-mb-6 { margin-bottom: var(--blh-space-6); }
.blh-mb-8 { margin-bottom: var(--blh-space-8); }

/* ==========================================================================
   5. LAYOUT APPLICATIF
   ========================================================================== */

.blh-shell {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar ---------------------------------------------------------- */
.blh-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--blh-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--blh-surface);
    border-right: 1px solid var(--blh-border);
    z-index: var(--blh-z-sidebar);
    transition: transform var(--blh-duration-slow) var(--blh-ease);
}

.blh-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--blh-header-height);
    padding: 0 var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    flex-shrink: 0;
    color: var(--blh-text-strong);
}
.blh-sidebar__brand:hover { color: var(--blh-text-strong); }
.blh-sidebar__brand img { height: 30px; width: auto; display: block; }
.blh-sidebar__brand-name {
    font-family: var(--blh-font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.blh-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--blh-space-4) var(--blh-space-3) var(--blh-space-6);
}

.blh-sidebar__section {
    padding: var(--blh-space-5) var(--blh-space-3) var(--blh-space-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blh-text-faint);
}
.blh-sidebar__section:first-child { padding-top: var(--blh-space-1); }

.blh-sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--blh-radius-sm);
    color: var(--blh-text-muted);
    font-size: var(--blh-text-sm);
    font-weight: 500;
    transition: background var(--blh-duration) var(--blh-ease),
                color var(--blh-duration) var(--blh-ease);
}
.blh-sidebar__link i,
.blh-sidebar__link svg {
    flex-shrink: 0;
    width: 18px;
    font-size: 17px;
    text-align: center;
    opacity: .85;
}
.blh-sidebar__link:hover {
    background: var(--blh-surface-hover);
    color: var(--blh-text-strong);
}
.blh-sidebar__link.is-active {
    background: var(--blh-primary-soft);
    color: var(--blh-brand-300);
    font-weight: 600;
}
.blh-sidebar__link.is-active::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: var(--blh-radius-full);
    background: var(--blh-brand-400);
}
.blh-sidebar__link.is-active i,
.blh-sidebar__link.is-active svg { opacity: 1; }

.blh-sidebar__count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--blh-radius-full);
    font-size: 11px;
    font-weight: 700;
    background: var(--blh-surface-raised);
    color: var(--blh-text-muted);
}
.blh-sidebar__count--danger  { background: var(--blh-danger-soft);  color: var(--blh-danger); }
.blh-sidebar__count--warning { background: var(--blh-warning-soft); color: var(--blh-warning); }
.blh-sidebar__count--info    { background: var(--blh-info-soft);    color: var(--blh-info); }

.blh-sidebar__footer {
    flex-shrink: 0;
    padding: var(--blh-space-3);
    border-top: 1px solid var(--blh-border);
}

/* Encart solde / crédit */
.blh-sidebar__credit {
    display: block;
    padding: 12px 14px;
    margin-bottom: var(--blh-space-2);
    border-radius: var(--blh-radius);
    border: 1px solid var(--blh-border);
    background: linear-gradient(160deg, var(--blh-primary-soft), transparent 70%);
}
.blh-sidebar__credit-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--blh-text-faint);
}
.blh-sidebar__credit-value {
    margin-top: 2px;
    font-size: var(--blh-text-lg);
    font-weight: 700;
    color: var(--blh-text-strong);
}

/* --- Zone principale --------------------------------------------------- */
.blh-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--blh-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header ------------------------------------------------------------ */
.blh-header {
    position: sticky;
    top: 0;
    z-index: var(--blh-z-header);
    height: var(--blh-header-height);
    display: flex;
    align-items: center;
    gap: var(--blh-space-3);
    padding: 0 var(--blh-space-6);
    background: color-mix(in srgb, var(--blh-background) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--blh-border);
}

.blh-header__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface);
    color: var(--blh-text);
    font-size: 19px;
    cursor: pointer;
}

.blh-header__title {
    font-size: var(--blh-text-md);
    font-weight: 600;
    color: var(--blh-text-strong);
    letter-spacing: -.01em;
}

.blh-header__actions { display: flex; align-items: center; gap: var(--blh-space-2); margin-left: auto; }

.blh-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface);
    color: var(--blh-text-muted);
    font-size: 17px;
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-icon-btn:hover {
    color: var(--blh-text-strong);
    border-color: var(--blh-border-strong);
    background: var(--blh-surface-hover);
}
.blh-icon-btn__dot {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 8px;
    height: 8px;
    border-radius: var(--blh-radius-full);
    background: var(--blh-danger);
    box-shadow: 0 0 0 2px var(--blh-surface);
}
.blh-icon-btn__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--blh-radius-full);
    background: var(--blh-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid var(--blh-background);
}

/* Recherche */
.blh-search {
    position: relative;
    flex: 0 1 340px;
    min-width: 0;
}
.blh-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface);
    color: var(--blh-text);
    font-size: var(--blh-text-sm);
    font-family: inherit;
    transition: border-color var(--blh-duration) var(--blh-ease), box-shadow var(--blh-duration) var(--blh-ease);
}
.blh-search input::placeholder { color: var(--blh-text-faint); }
.blh-search input:focus {
    outline: none;
    border-color: var(--blh-primary);
    box-shadow: 0 0 0 3px var(--blh-primary-ring);
}
.blh-search__icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blh-text-faint);
    font-size: 15px;
    pointer-events: none;
}

/* Bouton utilisateur */
.blh-userbtn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 36px;
    padding: 0 10px 0 6px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface);
    color: var(--blh-text);
    font-size: var(--blh-text-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-userbtn:hover { border-color: var(--blh-border-strong); background: var(--blh-surface-hover); color: var(--blh-text-strong); }
.blh-userbtn i.ri-arrow-down-s-line { font-size: 15px; color: var(--blh-text-faint); }

/* --- Contenu ----------------------------------------------------------- */
.blh-content {
    flex: 1;
    width: 100%;
    max-width: var(--blh-container);
    margin: 0 auto;
    padding: var(--blh-space-6);
}

.blh-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--blh-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--blh-space-6);
}
.blh-page-title {
    font-size: var(--blh-text-2xl);
    font-weight: 700;
    color: var(--blh-text-strong);
    letter-spacing: -.02em;
}
.blh-page-subtitle {
    margin-top: 5px;
    font-size: var(--blh-text-sm);
    color: var(--blh-text-muted);
}
.blh-page-actions { display: flex; align-items: center; gap: var(--blh-space-2); flex-wrap: wrap; }

.blh-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--blh-space-4);
    font-size: var(--blh-text-sm);
    font-weight: 500;
    color: var(--blh-text-muted);
}
.blh-back:hover { color: var(--blh-brand-300); }

.blh-section-title {
    display: flex;
    align-items: center;
    gap: var(--blh-space-2);
    margin-bottom: var(--blh-space-4);
    font-size: var(--blh-text-md);
    font-weight: 600;
    color: var(--blh-text-strong);
}

/* --- Footer applicatif -------------------------------------------------- */
.blh-appfooter {
    padding: var(--blh-space-5) var(--blh-space-6);
    border-top: 1px solid var(--blh-border);
    color: var(--blh-text-faint);
    font-size: var(--blh-text-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-4);
    flex-wrap: wrap;
}
.blh-appfooter a { color: var(--blh-text-muted); }
.blh-appfooter a:hover { color: var(--blh-brand-300); }
.blh-appfooter__links { display: flex; gap: var(--blh-space-4); flex-wrap: wrap; }

/* Bandeau d'usurpation d'identité (impersonation) */
.blh-impersonate {
    position: sticky;
    top: 0;
    z-index: var(--blh-z-toast);
    padding: 9px 16px;
    text-align: center;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    color: #1a1200;
    background: var(--blh-warning);
}
.blh-impersonate a { color: #1a1200; text-decoration: underline; }

/* ==========================================================================
   6. COMPOSANTS — BUTTON
   ========================================================================== */

.blh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--blh-radius);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-btn i, .blh-btn svg { font-size: 16px; flex-shrink: 0; }

.blh-btn:disabled,
.blh-btn.is-disabled,
.blh-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

.blh-btn--primary {
    background-image: var(--blh-primary-gradient);
    color: var(--blh-on-primary);
    box-shadow: var(--blh-shadow-primary);
}
.blh-btn--primary:hover {
    color: var(--blh-on-primary);
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.blh-btn--primary:active { transform: translateY(0); filter: brightness(.96); }

.blh-btn--secondary {
    border-color: var(--blh-border-strong);
    background: color-mix(in srgb, var(--blh-surface-raised) 70%, transparent);
    color: var(--blh-text-strong);
}
.blh-btn--secondary:hover {
    border-color: color-mix(in srgb, var(--blh-primary) 60%, transparent);
    background: var(--blh-surface-hover);
    color: var(--blh-text-strong);
}

.blh-btn--ghost { color: var(--blh-text-muted); background: transparent; }
.blh-btn--ghost:hover { color: var(--blh-text-strong); background: var(--blh-surface-hover); }

.blh-btn--outline {
    border-color: var(--blh-border-strong);
    background: transparent;
    color: var(--blh-text);
}
.blh-btn--outline:hover { border-color: var(--blh-primary); color: var(--blh-brand-300); background: var(--blh-primary-soft); }

.blh-btn--success { background: var(--blh-success); color: #06251a; }
.blh-btn--success:hover { color: #06251a; filter: brightness(1.08); }
.blh-btn--danger  { background: var(--blh-danger);  color: #2b0808; }
.blh-btn--danger:hover { color: #2b0808; filter: brightness(1.08); }
.blh-btn--warning { background: var(--blh-warning); color: #2a1c00; }
.blh-btn--warning:hover { color: #2a1c00; filter: brightness(1.08); }

.blh-btn--danger-soft { background: var(--blh-danger-soft); color: var(--blh-danger); border-color: color-mix(in srgb, var(--blh-danger) 35%, transparent); }
.blh-btn--danger-soft:hover { background: color-mix(in srgb, var(--blh-danger) 22%, transparent); color: var(--blh-danger); }

.blh-btn--xs { padding: 4px 10px; font-size: var(--blh-text-xs); border-radius: var(--blh-radius-sm); gap: 5px; }
.blh-btn--xs i, .blh-btn--xs svg { font-size: 13px; }
.blh-btn--sm { padding: 6px 13px; font-size: var(--blh-text-sm); border-radius: var(--blh-radius-sm); }
.blh-btn--sm i, .blh-btn--sm svg { font-size: 15px; }
.blh-btn--lg { padding: 13px 26px; font-size: var(--blh-text-md); border-radius: var(--blh-radius); }
.blh-btn--block { width: 100%; }

.blh-btn-group { display: inline-flex; gap: var(--blh-space-2); flex-wrap: wrap; }

/* État de chargement */
.blh-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.blh-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 15px; height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: blh-spin .6s linear infinite;
}

/* ==========================================================================
   7. COMPOSANTS — FORMULAIRES
   ========================================================================== */

.blh-field { margin-bottom: var(--blh-space-4); }
.blh-field:last-child { margin-bottom: 0; }

.blh-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    color: var(--blh-text-strong);
}
.blh-label .blh-required { color: var(--blh-danger); margin-left: 2px; }

.blh-hint { margin-top: 6px; font-size: var(--blh-text-xs); color: var(--blh-text-faint); }
.blh-error { margin-top: 6px; font-size: var(--blh-text-xs); color: var(--blh-danger); display: flex; align-items: center; gap: 5px; }

.blh-input,
.blh-select,
.blh-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--blh-border-strong);
    border-radius: var(--blh-radius);
    background: color-mix(in srgb, var(--blh-surface) 85%, transparent);
    color: var(--blh-text-strong);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    line-height: 1.45;
    transition: border-color var(--blh-duration) var(--blh-ease),
                box-shadow var(--blh-duration) var(--blh-ease),
                background var(--blh-duration) var(--blh-ease);
}
.blh-textarea { min-height: 120px; resize: vertical; }

.blh-input::placeholder,
.blh-textarea::placeholder { color: var(--blh-text-faint); }

.blh-input:hover:not(:disabled),
.blh-select:hover:not(:disabled),
.blh-textarea:hover:not(:disabled) { border-color: var(--blh-ink-600); }

.blh-input:focus,
.blh-select:focus,
.blh-textarea:focus {
    outline: none;
    border-color: var(--blh-primary);
    box-shadow: 0 0 0 3px var(--blh-primary-ring);
}

.blh-input:disabled,
.blh-select:disabled,
.blh-textarea:disabled {
    opacity: .55;
    cursor: not-allowed;
    background: var(--blh-surface-sunken);
}

.blh-input.is-invalid,
.blh-select.is-invalid,
.blh-textarea.is-invalid { border-color: var(--blh-danger); }
.blh-input.is-invalid:focus { box-shadow: 0 0 0 3px var(--blh-danger-soft); }

.blh-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 15px;
}
.blh-select option { background: var(--blh-surface); color: var(--blh-text-strong); }

/* Groupe input + bouton */
.blh-input-group { display: flex; }
.blh-input-group .blh-input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.blh-input-group .blh-btn  { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.blh-input-group__addon {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--blh-border-strong);
    border-left: 0;
    border-radius: 0 var(--blh-radius) var(--blh-radius) 0;
    background: var(--blh-surface-raised);
    color: var(--blh-text-muted);
    font-size: var(--blh-text-sm);
    white-space: nowrap;
}

/* Checkbox & radio */
.blh-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 9px;
    font-size: var(--blh-text-sm);
    color: var(--blh-text);
    cursor: pointer;
    user-select: none;
}
.blh-check input[type="checkbox"],
.blh-check input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    border: 1.5px solid var(--blh-border-strong);
    border-radius: 5px;
    background: var(--blh-surface);
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-check input[type="radio"] { border-radius: 50%; }
.blh-check input:hover { border-color: var(--blh-primary); }
.blh-check input:checked {
    background-color: var(--blh-primary);
    border-color: var(--blh-primary);
}
.blh-check input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}
.blh-check input[type="radio"]:checked {
    box-shadow: inset 0 0 0 3.5px var(--blh-surface);
}
.blh-check input:focus-visible { outline: 2px solid var(--blh-brand-400); outline-offset: 2px; }
.blh-check input:disabled { opacity: .5; cursor: not-allowed; }

/* Interrupteur */
.blh-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--blh-text-sm); }
.blh-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.blh-switch__track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: var(--blh-radius-full);
    background: var(--blh-ink-700);
    transition: background var(--blh-duration) var(--blh-ease);
    flex-shrink: 0;
}
.blh-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--blh-duration) var(--blh-ease);
}
.blh-switch input:checked + .blh-switch__track { background: var(--blh-primary); }
.blh-switch input:checked + .blh-switch__track::after { transform: translateX(18px); }
.blh-switch input:focus-visible + .blh-switch__track { outline: 2px solid var(--blh-brand-400); outline-offset: 2px; }

/* Cartes-options radio (cycles de facturation, moyens de paiement…) */
.blh-option-grid { display: grid; gap: var(--blh-space-3); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.blh-option {
    position: relative;
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius);
    background: var(--blh-surface-sunken);
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-option:hover { border-color: var(--blh-border-strong); background: var(--blh-surface-hover); }
.blh-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.blh-option.is-selected,
.blh-option:has(input:checked) {
    border-color: var(--blh-primary);
    background: var(--blh-primary-soft);
    box-shadow: 0 0 0 1px var(--blh-primary);
}
.blh-option:has(input:focus-visible) { outline: 2px solid var(--blh-brand-400); outline-offset: 2px; }
.blh-option__title { font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-option__price { font-size: var(--blh-text-lg); font-weight: 700; color: var(--blh-text-strong); }
.blh-option__meta  { margin-top: 3px; font-size: var(--blh-text-xs); color: var(--blh-text-muted); text-transform: capitalize; }
.blh-option__save {
    display: inline-block;
    margin-top: 7px;
    padding: 2px 7px;
    border-radius: var(--blh-radius-full);
    background: var(--blh-success-soft);
    color: var(--blh-success);
    font-size: 10.5px;
    font-weight: 700;
}

/* ==========================================================================
   8. COMPOSANTS — CARD / PANEL
   ========================================================================== */

.blh-card {
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: color-mix(in srgb, var(--blh-surface) 72%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: var(--blh-shadow-lg);
    overflow: hidden;
}

.blh-card--flat { box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--blh-surface); }
.blh-card--solid { background: var(--blh-surface); backdrop-filter: none; -webkit-backdrop-filter: none; }

.blh-card--interactive { transition: transform var(--blh-duration) var(--blh-ease), border-color var(--blh-duration) var(--blh-ease), box-shadow var(--blh-duration) var(--blh-ease); }
.blh-card--interactive:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--blh-primary) 45%, transparent);
    box-shadow: var(--blh-shadow-lg), 0 0 30px -18px var(--blh-primary);
}

.blh-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-3);
    padding: 15px var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    flex-wrap: wrap;
}
.blh-card__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    color: var(--blh-text-strong);
}
.blh-card__title i { color: var(--blh-text-muted); font-size: 17px; }
.blh-card__body   { padding: var(--blh-space-5); }
.blh-card__body--flush { padding: 0; }
.blh-card__footer {
    padding: 14px var(--blh-space-5);
    border-top: 1px solid var(--blh-border);
    background: var(--blh-surface-sunken);
}

/* Liste clé/valeur */
.blh-detail-list { list-style: none; margin: 0; padding: 0; }
.blh-detail-list > li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--blh-space-4);
    padding: 10px 0;
    border-bottom: 1px solid var(--blh-border);
    font-size: var(--blh-text-sm);
}
.blh-detail-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.blh-detail-list > li:first-child { padding-top: 0; }
.blh-detail-list .key { color: var(--blh-text-muted); flex-shrink: 0; }
.blh-detail-list .val { color: var(--blh-text-strong); font-weight: 500; text-align: right; word-break: break-word; }

/* ==========================================================================
   9. COMPOSANTS — BADGE & LABEL
   ========================================================================== */

.blh-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--blh-radius-full);
    border: 1px solid transparent;
    font-size: var(--blh-text-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--blh-surface-raised);
    color: var(--blh-text-muted);
}
.blh-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.blh-badge--plain::before { display: none; }

.blh-badge--success { background: var(--blh-success-soft); color: var(--blh-success); border-color: color-mix(in srgb, var(--blh-success) 25%, transparent); }
.blh-badge--warning { background: var(--blh-warning-soft); color: var(--blh-warning); border-color: color-mix(in srgb, var(--blh-warning) 25%, transparent); }
.blh-badge--danger  { background: var(--blh-danger-soft);  color: var(--blh-danger);  border-color: color-mix(in srgb, var(--blh-danger) 25%, transparent); }
.blh-badge--info    { background: var(--blh-info-soft);    color: var(--blh-info);    border-color: color-mix(in srgb, var(--blh-info) 25%, transparent); }
.blh-badge--primary { background: var(--blh-primary-soft); color: var(--blh-brand-300); border-color: color-mix(in srgb, var(--blh-primary) 30%, transparent); }
.blh-badge--neutral { background: var(--blh-surface-raised); color: var(--blh-text-muted); border-color: var(--blh-border); }

.blh-badge--pop {
    background-image: var(--blh-primary-gradient);
    color: #fff;
    border: 0;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 12px;
    box-shadow: var(--blh-shadow-primary);
}
.blh-badge--pop::before { display: none; }

/* Puce d'état animée */
.blh-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blh-text-faint);
    flex-shrink: 0;
}
.blh-dot--live { background: var(--blh-success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--blh-success) 60%, transparent); animation: blh-ping 2s var(--blh-ease) infinite; }
.blh-dot--warning { background: var(--blh-warning); }
.blh-dot--danger  { background: var(--blh-danger); }

/* ==========================================================================
   10. COMPOSANTS — TABLE
   ========================================================================== */

.blh-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.blh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--blh-text-sm);
}
.blh-table th {
    padding: 11px var(--blh-space-5);
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--blh-text-faint);
    background: var(--blh-surface-sunken);
    border-bottom: 1px solid var(--blh-border);
    white-space: nowrap;
}
.blh-table td {
    padding: 13px var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    color: var(--blh-text);
    vertical-align: middle;
}
.blh-table tbody tr:last-child td { border-bottom: 0; }
.blh-table tbody tr { transition: background var(--blh-duration-fast) var(--blh-ease); }
.blh-table tbody tr:hover { background: var(--blh-surface-hover); }
.blh-table a { font-weight: 500; }
.blh-table .blh-num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--blh-text-strong); }
[dir="rtl"] .blh-table th { text-align: right; }

/* Cartes empilées sur mobile : voir §20 */

/* ==========================================================================
   11. COMPOSANTS — ALERT & TOAST
   ========================================================================== */

.blh-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    margin-bottom: var(--blh-space-4);
    border: 1px solid var(--blh-border);
    border-left-width: 3px;
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    font-size: var(--blh-text-sm);
    color: var(--blh-text);
}
.blh-alert i { font-size: 18px; flex-shrink: 0; line-height: 1.35; }
.blh-alert__body { flex: 1; min-width: 0; }
.blh-alert__title { font-weight: 600; color: var(--blh-text-strong); margin-bottom: 2px; }
.blh-alert__close {
    background: none;
    border: 0;
    color: var(--blh-text-faint);
    font-size: 17px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.blh-alert__close:hover { color: var(--blh-text-strong); }

.blh-alert--success { border-left-color: var(--blh-success); background: var(--blh-success-soft); }
.blh-alert--success i { color: var(--blh-success); }
.blh-alert--warning { border-left-color: var(--blh-warning); background: var(--blh-warning-soft); }
.blh-alert--warning i { color: var(--blh-warning); }
.blh-alert--danger  { border-left-color: var(--blh-danger);  background: var(--blh-danger-soft); }
.blh-alert--danger i  { color: var(--blh-danger); }
.blh-alert--info    { border-left-color: var(--blh-info);    background: var(--blh-info-soft); }
.blh-alert--info i    { color: var(--blh-info); }

.blh-alert ul { margin: 4px 0 0; padding-left: 18px; }

/* Toasts */
.blh-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--blh-z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.blh-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid var(--blh-border);
    border-left: 3px solid var(--blh-primary);
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    box-shadow: var(--blh-shadow-lg);
    font-size: var(--blh-text-sm);
    color: var(--blh-text);
    animation: blh-slide-in var(--blh-duration-slow) var(--blh-ease);
}
.blh-toast.is-leaving { animation: blh-slide-out var(--blh-duration-slow) var(--blh-ease) forwards; }
.blh-toast--success { border-left-color: var(--blh-success); }
.blh-toast--success i { color: var(--blh-success); }
.blh-toast--danger  { border-left-color: var(--blh-danger); }
.blh-toast--danger i { color: var(--blh-danger); }
.blh-toast--warning { border-left-color: var(--blh-warning); }
.blh-toast--warning i { color: var(--blh-warning); }
.blh-toast--info    { border-left-color: var(--blh-info); }
.blh-toast--info i  { color: var(--blh-info); }
.blh-toast i { font-size: 18px; flex-shrink: 0; }

/* ==========================================================================
   12. COMPOSANTS — MODAL & DROPDOWN
   ========================================================================== */

.blh-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--blh-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--blh-space-4);
    background: var(--blh-overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: blh-fade-in var(--blh-duration) var(--blh-ease);
}
.blh-modal {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: var(--blh-surface);
    box-shadow: var(--blh-shadow-lg);
    animation: blh-scale-in var(--blh-duration-slow) var(--blh-ease);
    overflow: hidden;
}
.blh-modal--lg { max-width: 760px; }
.blh-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-3);
    padding: var(--blh-space-4) var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
}
.blh-modal__title { font-size: var(--blh-text-md); font-weight: 600; color: var(--blh-text-strong); }
.blh-modal__body { padding: var(--blh-space-5); overflow-y: auto; }
.blh-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--blh-space-2);
    padding: var(--blh-space-4) var(--blh-space-5);
    border-top: 1px solid var(--blh-border);
    background: var(--blh-surface-sunken);
}

/* Dropdown */
.blh-dropdown { position: relative; }
.blh-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 216px;
    padding: 6px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    box-shadow: var(--blh-shadow-lg);
    z-index: var(--blh-z-dropdown);
    animation: blh-drop-in var(--blh-duration) var(--blh-ease);
}
.blh-dropdown__menu--left { right: auto; left: 0; }
.blh-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 11px;
    border: 0;
    border-radius: var(--blh-radius-sm);
    background: none;
    color: var(--blh-text);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--blh-duration-fast) var(--blh-ease), color var(--blh-duration-fast) var(--blh-ease);
}
.blh-dropdown__item i { font-size: 16px; color: var(--blh-text-faint); flex-shrink: 0; }
.blh-dropdown__item:hover { background: var(--blh-surface-hover); color: var(--blh-text-strong); }
.blh-dropdown__item:hover i { color: var(--blh-brand-400); }
.blh-dropdown__item--danger { color: var(--blh-danger); }
.blh-dropdown__item--danger i { color: var(--blh-danger); }
.blh-dropdown__item--danger:hover { background: var(--blh-danger-soft); color: var(--blh-danger); }
.blh-dropdown__sep { height: 1px; margin: 5px 0; background: var(--blh-border); }
.blh-dropdown__header {
    padding: 9px 11px;
    border-bottom: 1px solid var(--blh-border);
    margin-bottom: 5px;
}
.blh-dropdown__header strong { display: block; font-size: var(--blh-text-sm); color: var(--blh-text-strong); }
.blh-dropdown__header span { display: block; font-size: var(--blh-text-xs); color: var(--blh-text-faint); word-break: break-all; }

/* ==========================================================================
   13. COMPOSANTS — TABS, PAGINATION, TOOLTIP, AVATAR
   ========================================================================== */

.blh-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--blh-border);
    margin-bottom: var(--blh-space-5);
    overflow-x: auto;
    scrollbar-width: none;
}
.blh-tabs::-webkit-scrollbar { display: none; }
.blh-tab {
    position: relative;
    padding: 10px 15px;
    border: 0;
    background: none;
    color: var(--blh-text-muted);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--blh-duration) var(--blh-ease);
}
.blh-tab:hover { color: var(--blh-text-strong); }
.blh-tab.is-active { color: var(--blh-brand-300); font-weight: 600; }
.blh-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--blh-brand-400);
}

.blh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: var(--blh-space-6);
}
.blh-pagination a,
.blh-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface);
    color: var(--blh-text-muted);
    font-size: var(--blh-text-sm);
    font-weight: 500;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-pagination a:hover { border-color: var(--blh-primary); color: var(--blh-brand-300); background: var(--blh-primary-soft); }
.blh-pagination .is-active,
.blh-pagination [aria-current="page"] {
    background: var(--blh-primary);
    border-color: var(--blh-primary);
    color: #fff;
}
.blh-pagination .is-disabled { opacity: .4; pointer-events: none; }

.blh-tooltip { position: relative; display: inline-flex; }
.blh-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    border-radius: var(--blh-radius-sm);
    background: var(--blh-ink-800);
    border: 1px solid var(--blh-border-strong);
    color: var(--blh-ink-100);
    font-size: var(--blh-text-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--blh-duration) var(--blh-ease), transform var(--blh-duration) var(--blh-ease);
    z-index: var(--blh-z-dropdown);
}
.blh-tooltip:hover::after,
.blh-tooltip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.blh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: var(--blh-radius-full);
    background-image: var(--blh-primary-gradient);
    color: #fff;
    font-size: var(--blh-text-xs);
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    overflow: hidden;
}
.blh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.blh-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.blh-avatar--lg { width: 44px; height: 44px; font-size: var(--blh-text-md); }
.blh-avatar--staff { background-image: linear-gradient(to bottom right, #22d3ee, #0369a1); }

/* ==========================================================================
   14. COMPOSANTS MÉTIER
   ========================================================================== */

/* --- StatCard ---------------------------------------------------------- */
.blh-stats { display: grid; gap: var(--blh-space-4); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: var(--blh-space-6); }

.blh-stat {
    position: relative;
    display: block;
    padding: var(--blh-space-5);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: color-mix(in srgb, var(--blh-surface) 72%, transparent);
    box-shadow: var(--blh-shadow);
    overflow: hidden;
    transition: transform var(--blh-duration) var(--blh-ease), border-color var(--blh-duration) var(--blh-ease);
}
a.blh-stat:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--blh-primary) 45%, transparent);
    color: inherit;
}
.blh-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: var(--blh-radius);
    background: var(--blh-primary-soft);
    color: var(--blh-brand-300);
    font-size: 19px;
}
.blh-stat__icon--success { background: var(--blh-success-soft); color: var(--blh-success); }
.blh-stat__icon--warning { background: var(--blh-warning-soft); color: var(--blh-warning); }
.blh-stat__icon--danger  { background: var(--blh-danger-soft);  color: var(--blh-danger); }
.blh-stat__icon--info    { background: var(--blh-info-soft);    color: var(--blh-info); }
.blh-stat__value {
    font-size: var(--blh-text-3xl);
    font-weight: 700;
    line-height: 1.05;
    color: var(--blh-text-strong);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.blh-stat__value--sm { font-size: var(--blh-text-xl); }
.blh-stat__label {
    margin-top: 6px;
    font-size: var(--blh-text-xs);
    font-weight: 500;
    color: var(--blh-text-muted);
}
.blh-stat__meta { margin-top: 10px; font-size: var(--blh-text-xs); color: var(--blh-text-faint); display: flex; align-items: center; gap: 5px; }
.blh-stat--alert { border-color: color-mix(in srgb, var(--blh-warning) 40%, transparent); }
.blh-stat--alert .blh-stat__value { color: var(--blh-warning); }
.blh-stat--critical { border-color: color-mix(in srgb, var(--blh-danger) 40%, transparent); }
.blh-stat--critical .blh-stat__value { color: var(--blh-danger); }

/* Bandeau d'accueil */
.blh-hero-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-5);
    flex-wrap: wrap;
    padding: var(--blh-space-6);
    margin-bottom: var(--blh-space-6);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(124, 58, 237, .18), transparent 60%),
        color-mix(in srgb, var(--blh-surface) 72%, transparent);
    overflow: hidden;
}
.blh-hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--blh-grid);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 70% 90% at 90% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 90% 50%, black, transparent);
    pointer-events: none;
}
.blh-hero-panel > * { position: relative; z-index: 1; }
.blh-hero-panel__title { font-size: var(--blh-text-xl); font-weight: 700; color: var(--blh-text-strong); }
.blh-hero-panel__subtitle { margin-top: 5px; font-size: var(--blh-text-sm); color: var(--blh-text-muted); }

/* --- ServerCard & monitoring ------------------------------------------- */
.blh-server-card { display: flex; flex-direction: column; height: 100%; }
.blh-server-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--blh-space-3);
    padding: var(--blh-space-5) var(--blh-space-5) var(--blh-space-4);
}
.blh-server-card__name { font-size: var(--blh-text-md); font-weight: 600; color: var(--blh-text-strong); }
.blh-server-card__domain { margin-top: 3px; font-size: var(--blh-text-xs); color: var(--blh-text-muted); font-family: var(--blh-font-mono); word-break: break-all; }
.blh-server-card__specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: var(--blh-space-3);
    padding: var(--blh-space-4) var(--blh-space-5);
    border-top: 1px solid var(--blh-border);
    background: var(--blh-surface-sunken);
}
.blh-spec__label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blh-text-faint); }
.blh-spec__value { margin-top: 3px; font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }

.blh-metrics { display: grid; gap: var(--blh-space-5); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.blh-metric__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--blh-space-3); margin-bottom: 8px; }
.blh-metric__label { display: flex; align-items: center; gap: 7px; font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-metric__label i { color: var(--blh-text-muted); font-size: 16px; }
.blh-metric__value { font-size: var(--blh-text-sm); color: var(--blh-text-muted); font-variant-numeric: tabular-nums; }
.blh-metric__value strong { color: var(--blh-text-strong); }
.blh-metric--empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px dashed var(--blh-border-strong);
    border-radius: var(--blh-radius);
    color: var(--blh-text-faint);
    font-size: var(--blh-text-xs);
}
.blh-metric--empty i { font-size: 15px; }

/* Graphe en barres (données réelles uniquement) */
.blh-sparkbars { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 10px; }
.blh-sparkbars__bar {
    flex: 1;
    min-width: 2px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, var(--blh-brand-700), var(--blh-brand-400));
    opacity: .85;
}

/* --- ProductCard -------------------------------------------------------- */
.blh-products { display: grid; gap: var(--blh-space-5); grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.blh-product {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--blh-space-6) var(--blh-space-5) var(--blh-space-5);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: color-mix(in srgb, var(--blh-surface) 72%, transparent);
    box-shadow: var(--blh-shadow);
    transition: transform var(--blh-duration) var(--blh-ease), border-color var(--blh-duration) var(--blh-ease), box-shadow var(--blh-duration) var(--blh-ease);
}
.blh-product:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--blh-primary) 45%, transparent);
    box-shadow: var(--blh-shadow-lg), 0 0 34px -20px var(--blh-primary);
}
.blh-product--featured {
    border-color: color-mix(in srgb, var(--blh-primary) 55%, transparent);
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(124, 58, 237, .16), transparent 65%),
        color-mix(in srgb, var(--blh-surface) 80%, transparent);
    box-shadow: var(--blh-shadow-lg), 0 0 40px -22px var(--blh-primary);
}
.blh-product__badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
}
.blh-product__tier {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--blh-text-faint);
}
.blh-product__name {
    margin-top: 5px;
    font-size: var(--blh-text-lg);
    font-weight: 700;
    color: var(--blh-text-strong);
}
.blh-product__desc {
    margin-top: 8px;
    font-size: var(--blh-text-sm);
    color: var(--blh-text-muted);
    line-height: 1.6;
}
.blh-product__price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: var(--blh-space-5) 0 var(--blh-space-4);
    padding-bottom: var(--blh-space-4);
    border-bottom: 1px solid var(--blh-border);
}
.blh-product__amount {
    font-size: var(--blh-text-3xl);
    font-weight: 700;
    color: var(--blh-text-strong);
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}
.blh-product__cycle { font-size: var(--blh-text-sm); color: var(--blh-text-muted); }
.blh-product__setup { margin-top: 6px; font-size: var(--blh-text-xs); color: var(--blh-text-faint); }
.blh-product__features { list-style: none; margin: 0 0 var(--blh-space-5); padding: 0; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.blh-product__features li { display: flex; align-items: flex-start; gap: 9px; font-size: var(--blh-text-sm); color: var(--blh-text); }
.blh-product__features i { color: var(--blh-success); font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.blh-product__meta {
    display: flex;
    align-items: center;
    gap: var(--blh-space-3);
    flex-wrap: wrap;
    margin-bottom: var(--blh-space-4);
    font-size: var(--blh-text-xs);
    color: var(--blh-text-muted);
}
.blh-product__meta span { display: inline-flex; align-items: center; gap: 5px; }

/* --- InvoiceCard / TicketCard (listes mobiles & résumés) ----------------- */
.blh-list-card {
    display: flex;
    align-items: center;
    gap: var(--blh-space-4);
    padding: 14px var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    transition: background var(--blh-duration-fast) var(--blh-ease);
}
.blh-list-card:last-child { border-bottom: 0; }
.blh-list-card:hover { background: var(--blh-surface-hover); }
.blh-list-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface-raised);
    color: var(--blh-text-muted);
    font-size: 17px;
}
.blh-list-card__main { flex: 1; min-width: 0; }
.blh-list-card__title { font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-list-card__meta { margin-top: 2px; font-size: var(--blh-text-xs); color: var(--blh-text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.blh-list-card__side { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

/* ==========================================================================
   15. PROGRESS, LOADING / SKELETON, EMPTYSTATE
   ========================================================================== */

.blh-progress {
    height: 8px;
    border-radius: var(--blh-radius-full);
    background: var(--blh-surface-raised);
    overflow: hidden;
}
.blh-progress__bar {
    height: 100%;
    border-radius: var(--blh-radius-full);
    background: linear-gradient(90deg, var(--blh-brand-500), var(--blh-brand-400));
    transition: width .5s var(--blh-ease);
}
.blh-progress__bar--success { background: linear-gradient(90deg, #059669, var(--blh-success)); }
.blh-progress__bar--warning { background: linear-gradient(90deg, #d97706, var(--blh-warning)); }
.blh-progress__bar--danger  { background: linear-gradient(90deg, #dc2626, var(--blh-danger)); }

/* Étapes (checkout) */
.blh-steps { display: flex; align-items: center; gap: 0; margin-bottom: var(--blh-space-6); overflow-x: auto; scrollbar-width: none; }
.blh-steps::-webkit-scrollbar { display: none; }
.blh-step { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.blh-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--blh-border-strong);
    background: var(--blh-surface);
    color: var(--blh-text-faint);
    font-size: var(--blh-text-xs);
    font-weight: 700;
    flex-shrink: 0;
}
.blh-step__label { font-size: var(--blh-text-sm); font-weight: 500; color: var(--blh-text-faint); white-space: nowrap; }
.blh-step__sep { width: 34px; height: 1px; background: var(--blh-border); margin: 0 11px; flex-shrink: 0; }
.blh-step.is-active .blh-step__num { border-color: var(--blh-primary); background: var(--blh-primary); color: #fff; box-shadow: 0 0 0 3px var(--blh-primary-ring); }
.blh-step.is-active .blh-step__label { color: var(--blh-text-strong); font-weight: 600; }
.blh-step.is-done .blh-step__num { border-color: var(--blh-success); background: var(--blh-success-soft); color: var(--blh-success); }
.blh-step.is-done .blh-step__label { color: var(--blh-text-muted); }

/* Skeleton */
.blh-skeleton {
    border-radius: var(--blh-radius-sm);
    background: linear-gradient(90deg, var(--blh-surface-raised) 25%, var(--blh-surface-hover) 37%, var(--blh-surface-raised) 63%);
    background-size: 400% 100%;
    animation: blh-shimmer 1.4s ease-in-out infinite;
}
.blh-skeleton--text { height: 11px; margin-bottom: 8px; }
.blh-skeleton--title { height: 18px; width: 48%; margin-bottom: 14px; }
.blh-skeleton--block { height: 88px; }

.blh-spinner {
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2px solid var(--blh-border-strong);
    border-top-color: var(--blh-primary);
    border-radius: 50%;
    animation: blh-spin .6s linear infinite;
}

/* EmptyState */
.blh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--blh-space-12) var(--blh-space-5);
    text-align: center;
}
.blh-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
    border-radius: var(--blh-radius);
    background: var(--blh-surface-raised);
    color: var(--blh-text-faint);
    font-size: 25px;
}
.blh-empty__title { font-size: var(--blh-text-md); font-weight: 600; color: var(--blh-text-strong); }
.blh-empty__text { font-size: var(--blh-text-sm); color: var(--blh-text-muted); max-width: 420px; }
.blh-empty .blh-btn { margin-top: var(--blh-space-4); }

/* ==========================================================================
   16. TIMELINE & CONVERSATION (TICKETS)
   ========================================================================== */

.blh-thread { display: flex; flex-direction: column; gap: var(--blh-space-4); }

.blh-message {
    display: flex;
    gap: var(--blh-space-3);
}
.blh-message__bubble {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: var(--blh-surface);
    overflow: hidden;
}
.blh-message--staff .blh-message__bubble {
    border-color: color-mix(in srgb, var(--blh-primary) 35%, transparent);
    background: linear-gradient(150deg, var(--blh-primary-soft), transparent 55%), var(--blh-surface);
}
.blh-message__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-3);
    flex-wrap: wrap;
    padding: 10px var(--blh-space-4);
    border-bottom: 1px solid var(--blh-border);
    font-size: var(--blh-text-xs);
}
.blh-message__author { font-weight: 600; color: var(--blh-text-strong); display: flex; align-items: center; gap: 7px; }
.blh-message__date { color: var(--blh-text-faint); }
.blh-message__body {
    padding: var(--blh-space-4);
    font-size: var(--blh-text-sm);
    line-height: 1.7;
    color: var(--blh-text);
    white-space: pre-wrap;
    word-break: break-word;
}
.blh-message__attachment {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 var(--blh-space-4) var(--blh-space-4);
    padding: 7px 12px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm);
    background: var(--blh-surface-sunken);
    font-size: var(--blh-text-xs);
    font-weight: 500;
}

/* ==========================================================================
   17. CHECKOUT & PANIER
   ========================================================================== */

.blh-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--blh-space-6); align-items: start; }
.blh-summary { position: sticky; top: calc(var(--blh-header-height) + var(--blh-space-4)); }

.blh-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--blh-space-4);
    padding: 9px 0;
    font-size: var(--blh-text-sm);
    color: var(--blh-text-muted);
}
.blh-summary__row span:last-child { color: var(--blh-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.blh-summary__row--discount span:last-child { color: var(--blh-success); }
.blh-summary__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--blh-space-4);
    padding-top: var(--blh-space-4);
    margin-top: var(--blh-space-2);
    border-top: 1px solid var(--blh-border);
    font-size: var(--blh-text-md);
    font-weight: 600;
    color: var(--blh-text-strong);
}
.blh-summary__total strong { font-size: var(--blh-text-xl); font-variant-numeric: tabular-nums; }

.blh-cart-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--blh-space-4);
    padding: var(--blh-space-4) 0;
    border-bottom: 1px solid var(--blh-border);
}
.blh-cart-item:last-child { border-bottom: 0; }
.blh-cart-item__name { font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-cart-item__meta { margin-top: 4px; font-size: var(--blh-text-xs); color: var(--blh-text-muted); }

/* ==========================================================================
   18. COMPATIBILITÉ PNLCS
   Restyle les classes historiques utilisées par les vues non surchargées,
   afin qu'aucune page ne conserve l'ancien rendu clair.
   ========================================================================== */

.blh-app .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--blh-radius);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-app .btn-primary,
.blh-app .btn-accent {
    background-image: var(--blh-primary-gradient);
    background-color: transparent;
    border-color: transparent;
    color: #fff;
    box-shadow: var(--blh-shadow-primary);
}
.blh-app .btn-primary:hover,
.blh-app .btn-accent:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.blh-app .btn-default,
.blh-app .btn-outline,
.blh-app .btn-secondary {
    border-color: var(--blh-border-strong);
    background: color-mix(in srgb, var(--blh-surface-raised) 70%, transparent);
    color: var(--blh-text-strong);
}
.blh-app .btn-default:hover,
.blh-app .btn-outline:hover,
.blh-app .btn-secondary:hover {
    border-color: color-mix(in srgb, var(--blh-primary) 60%, transparent);
    background: var(--blh-surface-hover);
    color: var(--blh-text-strong);
}
.blh-app .btn-success { background: var(--blh-success); color: #06251a; border-color: transparent; }
.blh-app .btn-danger  { background: var(--blh-danger);  color: #2b0808; border-color: transparent; }
.blh-app .btn-warning { background: var(--blh-warning); color: #2a1c00; border-color: transparent; }
.blh-app .btn-info    { background: var(--blh-info);    color: #04212f; border-color: transparent; }
.blh-app .btn-success:hover, .blh-app .btn-danger:hover,
.blh-app .btn-warning:hover, .blh-app .btn-info:hover { filter: brightness(1.08); }
.blh-app .btn-sm { padding: 6px 13px; font-size: var(--blh-text-sm); border-radius: var(--blh-radius-sm); }
.blh-app .btn-xs { padding: 4px 10px; font-size: var(--blh-text-xs); border-radius: var(--blh-radius-sm); }
.blh-app .btn-lg { padding: 13px 26px; font-size: var(--blh-text-md); }
.blh-app .btn:disabled, .blh-app .btn.submitting { opacity: .5; cursor: not-allowed; }
.blh-app .btn-group { display: inline-flex; gap: var(--blh-space-2); flex-wrap: wrap; }

/* Cartes & panneaux historiques */
.blh-app .card,
.blh-app .panel,
.blh-app .well,
.blh-app .pn-card {
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: color-mix(in srgb, var(--blh-surface) 72%, transparent);
    box-shadow: var(--blh-shadow-lg);
    color: var(--blh-text);
    overflow: hidden;
}
.blh-app .card-header,
.blh-app .panel-heading,
.blh-app .pn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--blh-space-3);
    flex-wrap: wrap;
    padding: 15px var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    background: transparent;
    font-size: var(--blh-text-sm);
    font-weight: 600;
    color: var(--blh-text-strong);
}
.blh-app .card-body,
.blh-app .panel-body,
.blh-app .pn-card-body { padding: var(--blh-space-5); }
.blh-app .pn-card-body-flush { padding: 0; }
.blh-app .pn-card-title { font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }

/* Formulaires historiques */
.blh-app .form-control,
.blh-app input[type="text"],
.blh-app input[type="email"],
.blh-app input[type="password"],
.blh-app input[type="number"],
.blh-app input[type="tel"],
.blh-app input[type="url"],
.blh-app input[type="search"],
.blh-app input[type="date"],
.blh-app input[type="datetime-local"],
.blh-app select,
.blh-app textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--blh-border-strong);
    border-radius: var(--blh-radius);
    background: color-mix(in srgb, var(--blh-surface) 85%, transparent);
    color: var(--blh-text-strong);
    font-family: inherit;
    font-size: var(--blh-text-sm);
    line-height: 1.45;
    transition: border-color var(--blh-duration) var(--blh-ease), box-shadow var(--blh-duration) var(--blh-ease);
}
.blh-app input[type="checkbox"],
.blh-app input[type="radio"] { width: auto; accent-color: var(--blh-primary); }
.blh-app input::placeholder, .blh-app textarea::placeholder { color: var(--blh-text-faint); }
.blh-app .form-control:focus,
.blh-app input:focus, .blh-app select:focus, .blh-app textarea:focus {
    outline: none;
    border-color: var(--blh-primary);
    box-shadow: 0 0 0 3px var(--blh-primary-ring);
}
.blh-app select option { background: var(--blh-surface); color: var(--blh-text-strong); }
.blh-app .form-group { margin-bottom: var(--blh-space-4); }
.blh-app .form-label,
.blh-app .control-label,
.blh-app label { font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-app .help-block { font-size: var(--blh-text-xs); color: var(--blh-text-faint); margin-top: 5px; }
.blh-app .input-group { display: flex; }
.blh-app .input-group-addon {
    display: inline-flex; align-items: center; padding: 0 14px;
    border: 1px solid var(--blh-border-strong); background: var(--blh-surface-raised);
    color: var(--blh-text-muted); font-size: var(--blh-text-sm);
}

/* Tables historiques */
.blh-app .pn-table,
.blh-app .table-themed,
.blh-app .data-table,
.blh-app table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--blh-text-sm);
    color: var(--blh-text);
}
.blh-app .pn-table th,
.blh-app .table-themed th,
.blh-app .data-table th,
.blh-app table.table th {
    padding: 11px var(--blh-space-5);
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--blh-text-faint);
    background: var(--blh-surface-sunken);
    border-bottom: 1px solid var(--blh-border);
    white-space: nowrap;
}
.blh-app .pn-table td,
.blh-app .table-themed td,
.blh-app .data-table td,
.blh-app table.table td {
    padding: 13px var(--blh-space-5);
    border-bottom: 1px solid var(--blh-border);
    vertical-align: middle;
}
.blh-app .pn-table tbody tr:hover,
.blh-app .table-themed tbody tr:hover,
.blh-app .data-table tbody tr:hover { background: var(--blh-surface-hover); }
.blh-app .pn-table tbody tr:last-child td { border-bottom: 0; }

/* Badges & labels historiques */
.blh-app .badge,
.blh-app .label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: var(--blh-radius-full);
    font-size: var(--blh-text-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--blh-surface-raised);
    color: var(--blh-text-muted);
}
.blh-app .badge-active, .blh-app .badge-paid, .blh-app .badge-completed, .blh-app .badge-closed,
.blh-app .label-active, .blh-app .label-success {
    background: var(--blh-success-soft); color: var(--blh-success);
    border-color: color-mix(in srgb, var(--blh-success) 25%, transparent);
}
.blh-app .badge-pending, .blh-app .badge-draft, .blh-app .badge-customer-reply,
.blh-app .label-pending, .blh-app .label-warning {
    background: var(--blh-warning-soft); color: var(--blh-warning);
    border-color: color-mix(in srgb, var(--blh-warning) 25%, transparent);
}
.blh-app .badge-suspended, .blh-app .badge-unpaid, .blh-app .badge-overdue,
.blh-app .badge-terminated, .blh-app .badge-cancelled, .blh-app .badge-fraud,
.blh-app .badge-collections, .blh-app .label-suspended, .blh-app .label-terminated,
.blh-app .label-cancelled, .blh-app .label-danger {
    background: var(--blh-danger-soft); color: var(--blh-danger);
    border-color: color-mix(in srgb, var(--blh-danger) 25%, transparent);
}
.blh-app .badge-open, .blh-app .badge-refunded, .blh-app .label-info, .blh-app .label-primary {
    background: var(--blh-info-soft); color: var(--blh-info);
    border-color: color-mix(in srgb, var(--blh-info) 25%, transparent);
}

/* Alertes historiques */
.blh-app .alert, .blh-app .pn-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    margin-bottom: var(--blh-space-4);
    border: 1px solid var(--blh-border);
    border-left-width: 3px;
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    font-size: var(--blh-text-sm);
    color: var(--blh-text);
}
.blh-app .alert-success, .blh-app .pn-alert-success { border-left-color: var(--blh-success); background: var(--blh-success-soft); color: var(--blh-success); }
.blh-app .alert-danger,  .blh-app .pn-alert-error   { border-left-color: var(--blh-danger);  background: var(--blh-danger-soft);  color: var(--blh-danger); }
.blh-app .alert-warning, .blh-app .pn-alert-warning { border-left-color: var(--blh-warning); background: var(--blh-warning-soft); color: var(--blh-warning); }
.blh-app .alert-info,    .blh-app .pn-alert-info    { border-left-color: var(--blh-info);    background: var(--blh-info-soft);    color: var(--blh-info); }

/* Divers historiques */
.blh-app .page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--blh-space-4); flex-wrap: wrap; margin-bottom: var(--blh-space-6);
    border: 0; padding: 0;
}
.blh-app .page-header h1 { font-size: var(--blh-text-2xl); font-weight: 700; color: var(--blh-text-strong); }
.blh-app .pn-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--blh-space-4); flex-wrap: wrap; margin-bottom: var(--blh-space-6); }
.blh-app .pn-page-title { font-size: var(--blh-text-2xl); font-weight: 700; color: var(--blh-text-strong); letter-spacing: -.02em; }
.blh-app .pn-page-subtitle { margin-top: 5px; font-size: var(--blh-text-sm); color: var(--blh-text-muted); }
.blh-app .pn-section-title { font-size: var(--blh-text-md); font-weight: 600; color: var(--blh-text-strong); margin-bottom: var(--blh-space-4); }
.blh-app .pn-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--blh-space-4); font-size: var(--blh-text-sm); color: var(--blh-text-muted); }
.blh-app .pn-back svg { width: 15px; height: 15px; }
.blh-app .pn-back:hover { color: var(--blh-brand-300); }
.blh-app .text-muted { color: var(--blh-text-muted) !important; }
.blh-app .text-success { color: var(--blh-success) !important; }
.blh-app .text-danger  { color: var(--blh-danger) !important; }
.blh-app .text-warning { color: var(--blh-warning) !important; }
.blh-app .text-info    { color: var(--blh-info) !important; }
.blh-app .text-primary { color: var(--blh-brand-300) !important; }
.blh-app .text-sm { font-size: var(--blh-text-sm); }
.blh-app .link { color: var(--blh-link); }
.blh-app .mb-16 { margin-bottom: var(--blh-space-4); }
.blh-app .mb-24 { margin-bottom: var(--blh-space-6); }
.blh-app .pn-code {
    display: inline-block; padding: 2px 8px;
    background: var(--blh-surface-raised); border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-sm); font-family: var(--blh-font-mono);
    font-size: var(--blh-text-xs); color: var(--blh-brand-300);
}
.blh-app .pn-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--blh-space-5); }
.blh-app .pn-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--blh-space-4); margin-bottom: var(--blh-space-6); }
.blh-app .pn-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--blh-space-5); }
.blh-app .pn-actions { display: flex; gap: var(--blh-space-2); flex-wrap: wrap; }
.blh-app .pn-detail-list { list-style: none; margin: 0; padding: 0; }
.blh-app .pn-detail-list > li {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--blh-space-4); padding: 10px 0; border-bottom: 1px solid var(--blh-border);
    font-size: var(--blh-text-sm);
}
.blh-app .pn-detail-list > li:last-child { border-bottom: 0; }
.blh-app .pn-detail-list .key { color: var(--blh-text-muted); }
.blh-app .pn-detail-list .val { color: var(--blh-text-strong); font-weight: 500; text-align: right; }
.blh-app .pn-empty { padding: var(--blh-space-12) var(--blh-space-5); text-align: center; color: var(--blh-text-muted); }
.blh-app .pn-empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .6; }
.blh-app .pn-progress-wrap { height: 8px; border-radius: var(--blh-radius-full); background: var(--blh-surface-raised); overflow: hidden; }
.blh-app .pn-progress-fill { height: 100%; border-radius: var(--blh-radius-full); }
.blh-app .pn-welcome {
    display: flex; align-items: center; justify-content: space-between; gap: var(--blh-space-5);
    flex-wrap: wrap; padding: var(--blh-space-6); margin-bottom: var(--blh-space-6);
    border: 1px solid var(--blh-border); border-radius: var(--blh-radius-lg);
    background: radial-gradient(120% 140% at 0% 0%, rgba(124, 58, 237, .18), transparent 60%), color-mix(in srgb, var(--blh-surface) 72%, transparent);
}
.blh-app .pn-popular {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    padding: 4px 12px; border-radius: var(--blh-radius-full);
    background-image: var(--blh-primary-gradient);
    color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.blh-app .pn-product-card { position: relative; display: flex; flex-direction: column; padding: var(--blh-space-6) var(--blh-space-5) var(--blh-space-5); }
.blh-app .pn-product-card.featured { border-color: color-mix(in srgb, var(--blh-primary) 55%, transparent); }
.blh-app .pn-product-price { font-size: var(--blh-text-2xl); font-weight: 700; color: var(--blh-text-strong); }
.blh-app .pn-product-price .cycle { font-size: var(--blh-text-sm); font-weight: 400; color: var(--blh-text-muted); }
.blh-app .modal-overlay { position: fixed; inset: 0; z-index: var(--blh-z-modal); display: flex; align-items: center; justify-content: center; background: var(--blh-overlay); }
.blh-app .modal-content { border: 1px solid var(--blh-border); border-radius: var(--blh-radius-lg); background: var(--blh-surface); box-shadow: var(--blh-shadow-lg); }
.blh-app .modal-header, .blh-app .modal-footer { padding: var(--blh-space-4) var(--blh-space-5); border-color: var(--blh-border); }
.blh-app .modal-body { padding: var(--blh-space-5); }
.blh-app .nav-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--blh-border); margin-bottom: var(--blh-space-5); list-style: none; padding: 0; }
.blh-app .pagination { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: var(--blh-space-6); list-style: none; padding: 0; }
.blh-app .pagination a, .blh-app .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid var(--blh-border); border-radius: var(--blh-radius-sm);
    background: var(--blh-surface); color: var(--blh-text-muted); font-size: var(--blh-text-sm);
}
.blh-app .pagination a:hover { border-color: var(--blh-primary); color: var(--blh-brand-300); }

/* --- Passerelles de paiement (client/invoices/show) ----------------------
   .gw-panel { display:none } est indispensable au fonctionnement des onglets
   de paiement : sans lui, tous les formulaires de passerelle s'afficheraient
   en même temps. Ces règles reprennent celles du gabarit PNLCS d'origine. */
.blh-app .gw-tabs { display: flex; flex-wrap: wrap; gap: var(--blh-space-2); margin-bottom: var(--blh-space-5); }
.blh-app .gw-tab {
    padding: 8px 18px;
    border: 1px solid var(--blh-border-strong);
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    color: var(--blh-text-muted);
    font-size: var(--blh-text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-app .gw-tab:hover { border-color: var(--blh-primary); color: var(--blh-brand-300); }
.blh-app .gw-tab.active {
    background-image: var(--blh-primary-gradient);
    border-color: transparent;
    color: #fff;
}
.blh-app .gw-panel { display: none; }
.blh-app .gw-panel.active { display: block; }
.blh-app .gw-form-box {
    padding: 18px;
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius);
    background: var(--blh-surface-sunken);
}
/* Les formulaires injectés par les modules de passerelle héritent du thème. */
.blh-app .gw-form-box input,
.blh-app .gw-form-box select,
.blh-app .gw-form-box textarea { background: var(--blh-surface); }

/* --- Autres classes du gabarit d'origine --------------------------------- */
.blh-app .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--blh-space-3); }
@media (max-width: 600px) { .blh-app .form-grid-2 { grid-template-columns: 1fr; } }
.blh-app .form-hint { font-size: var(--blh-text-xs); color: var(--blh-text-faint); margin-top: 4px; }
.blh-app .req { color: var(--blh-danger); margin-left: 2px; }
.blh-app .mt-16 { margin-top: var(--blh-space-4); }
.blh-app .mt-24 { margin-top: var(--blh-space-6); }
.blh-app .flex { display: flex; }
.blh-app .gap-8 { gap: var(--blh-space-2); }
.blh-app .items-center { align-items: center; }

.blh-app .pn-amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--blh-space-2); margin-bottom: var(--blh-space-4); }
.blh-app .pn-amount-btn {
    padding: 10px;
    border: 1px solid var(--blh-border-strong);
    border-radius: var(--blh-radius);
    background: var(--blh-surface);
    color: var(--blh-text-strong);
    font-size: var(--blh-text-md);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-app .pn-amount-btn:hover,
.blh-app .pn-amount-btn.selected {
    border-color: var(--blh-primary);
    background: var(--blh-primary-soft);
    color: var(--blh-brand-300);
}

.blh-app .pn-aff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--blh-space-4); margin-bottom: var(--blh-space-6); }
.blh-app .pn-aff-stat { text-align: center; padding: var(--blh-space-5); }
.blh-app .pn-aff-val { font-size: var(--blh-text-2xl); font-weight: 700; color: var(--blh-text-strong); letter-spacing: -.02em; }
.blh-app .pn-aff-lbl {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--blh-text-muted);
}

.blh-app .pn-cart-grid,
.blh-app .pn-checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--blh-space-6); align-items: start; }
@media (max-width: 1100px) {
    .blh-app .pn-cart-grid,
    .blh-app .pn-checkout-grid { grid-template-columns: minmax(0, 1fr); }
}
.blh-app .pn-order-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--blh-space-4);
    padding: 9px 0;
    font-size: var(--blh-text-sm);
    border-bottom: 1px solid var(--blh-border);
}
.blh-app .pn-order-row:last-of-type { border-bottom: 0; font-weight: 700; color: var(--blh-text-strong); }
.blh-app .pn-order-row .key { color: var(--blh-text-muted); }
.blh-app .pn-pay-option {
    display: flex;
    align-items: center;
    gap: var(--blh-space-3);
    padding: 13px 16px;
    margin-bottom: var(--blh-space-2);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius);
    background: var(--blh-surface-sunken);
    cursor: pointer;
    transition: all var(--blh-duration) var(--blh-ease);
}
.blh-app .pn-pay-option:hover { border-color: var(--blh-border-strong); }
.blh-app .pn-pay-option.selected {
    border-color: var(--blh-primary);
    background: var(--blh-primary-soft);
}
.blh-app .pn-msg {
    padding: var(--blh-space-4);
    margin-bottom: var(--blh-space-4);
    border: 1px solid var(--blh-border);
    border-radius: var(--blh-radius-lg);
    background: var(--blh-surface);
}
.blh-app .pn-msg.staff { border-color: color-mix(in srgb, var(--blh-primary) 35%, transparent); background: linear-gradient(150deg, var(--blh-primary-soft), transparent 55%), var(--blh-surface); }
.blh-app .pn-msg-head { display: flex; justify-content: space-between; gap: var(--blh-space-3); flex-wrap: wrap; margin-bottom: var(--blh-space-3); font-size: var(--blh-text-xs); }
.blh-app .pn-msg-author { font-weight: 600; color: var(--blh-text-strong); }
.blh-app .pn-msg-date { color: var(--blh-text-faint); }
.blh-app .pn-msg-body { font-size: var(--blh-text-sm); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.blh-app .pn-label { display: block; margin-bottom: 6px; font-size: var(--blh-text-sm); font-weight: 600; color: var(--blh-text-strong); }
.blh-app .pn-input { width: 100%; padding: 10px 14px; border: 1px solid var(--blh-border-strong); border-radius: var(--blh-radius); background: var(--blh-surface); color: var(--blh-text-strong); font-family: inherit; font-size: var(--blh-text-sm); }
.blh-app .pn-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 18px; border: 1px solid var(--blh-border-strong); border-radius: var(--blh-radius);
    background: var(--blh-surface-raised); color: var(--blh-text-strong);
    font-family: inherit; font-size: var(--blh-text-sm); font-weight: 600;
    text-decoration: none; cursor: pointer; transition: all var(--blh-duration) var(--blh-ease);
}
.blh-app .pn-btn:hover { border-color: var(--blh-primary); color: var(--blh-brand-300); }
.blh-app .pn-btn-primary {
    background-image: var(--blh-primary-gradient);
    border-color: transparent; color: #fff; box-shadow: var(--blh-shadow-primary);
}
.blh-app .pn-btn-primary:hover { color: #fff; filter: brightness(1.08); }
.blh-app .pn-welcome-credit { text-align: right; }
.blh-app .pn-welcome-credit .credit-lbl { font-size: var(--blh-text-xs); color: var(--blh-text-faint); }
.blh-app .pn-welcome-credit .credit-val { font-size: var(--blh-text-xl); font-weight: 700; color: var(--blh-text-strong); }
.blh-app .pn-stat { padding: var(--blh-space-5); display: block; }
.blh-app .pn-stat-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-bottom: 14px;
    border-radius: var(--blh-radius); background: var(--blh-primary-soft); color: var(--blh-brand-300);
}
.blh-app .pn-stat-icon svg { width: 19px; height: 19px; }
.blh-app .pn-stat-icon-green  { background: var(--blh-success-soft); color: var(--blh-success); }
.blh-app .pn-stat-icon-orange { background: var(--blh-warning-soft); color: var(--blh-warning); }
.blh-app .pn-stat-icon-red    { background: var(--blh-danger-soft);  color: var(--blh-danger); }
.blh-app .pn-stat-val { font-size: var(--blh-text-3xl); font-weight: 700; color: var(--blh-text-strong); line-height: 1.05; }
.blh-app .pn-stat-lbl { margin-top: 6px; font-size: var(--blh-text-xs); color: var(--blh-text-muted); }
.blh-app .pn-back svg { width: 15px; height: 15px; }

/* ==========================================================================
   19. ANIMATIONS
   ========================================================================== */

@keyframes blh-spin      { to { transform: rotate(360deg); } }
@keyframes blh-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes blh-fade-up   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blh-scale-in  { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes blh-drop-in   { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blh-slide-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes blh-slide-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes blh-shimmer   { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes blh-ping {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blh-success) 55%, transparent); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.blh-animate-in { animation: blh-fade-up var(--blh-duration-slow) var(--blh-ease) both; }
.blh-delay-1 { animation-delay: .05s; }
.blh-delay-2 { animation-delay: .1s; }
.blh-delay-3 { animation-delay: .15s; }
.blh-delay-4 { animation-delay: .2s; }

/* Respect des préférences système : aucune animation imposée. */
@media (prefers-reduced-motion: reduce) {
    .blh-app *,
    .blh-app *::before,
    .blh-app *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .blh-card--interactive:hover,
    .blh-product:hover,
    a.blh-stat:hover,
    .blh-btn--primary:hover { transform: none; }
}

/* ==========================================================================
   20. RESPONSIVE
   Points de rupture : 1280 / 1024 / 900 / 768 / 560 / 400
   ========================================================================== */

@media (max-width: 1280px) {
    .blh-content { padding: var(--blh-space-5); }
}

@media (max-width: 1100px) {
    .blh-checkout { grid-template-columns: minmax(0, 1fr); }
    .blh-summary { position: static; }
    .blh-grid-main { grid-template-columns: minmax(0, 1fr); }
    .blh-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    :root { --blh-sidebar-width: 240px; }
    .blh-search { flex-basis: 220px; }
}

/* Bascule mobile : la sidebar devient un panneau coulissant */
@media (max-width: 900px) {
    .blh-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: min(300px, 86vw);
    }
    .blh-sidebar.is-open { transform: translateX(0); box-shadow: var(--blh-shadow-lg); }
    .blh-main { margin-left: 0; }
    .blh-header__toggle { display: inline-flex; }
    .blh-backdrop {
        position: fixed;
        inset: 0;
        z-index: calc(var(--blh-z-sidebar) - 1);
        background: var(--blh-overlay);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        animation: blh-fade-in var(--blh-duration) var(--blh-ease);
    }
    .blh-grid-3, .blh-grid-2 { grid-template-columns: minmax(0, 1fr); }
    [dir="rtl"] .blh-sidebar { transform: translateX(100%); }
    [dir="rtl"] .blh-sidebar.is-open { transform: translateX(0); }
}

@media (max-width: 768px) {
    .blh-content { padding: var(--blh-space-4); }
    .blh-header { padding: 0 var(--blh-space-4); }
    .blh-search { display: none; }
    .blh-page-title { font-size: var(--blh-text-xl); }
    .blh-stat__value { font-size: var(--blh-text-2xl); }
    .blh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blh-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blh-app .pn-2col { grid-template-columns: minmax(0, 1fr); }

    /* Tables en cartes empilées */
    .blh-table--stack thead { display: none; }
    .blh-table--stack tbody tr {
        display: block;
        padding: var(--blh-space-4) var(--blh-space-4);
        border-bottom: 1px solid var(--blh-border);
    }
    .blh-table--stack tbody td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--blh-space-4);
        padding: 5px 0;
        border: 0;
        text-align: right;
    }
    .blh-table--stack tbody td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: var(--blh-text-xs);
        font-weight: 600;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--blh-text-faint);
        text-align: left;
    }

    .blh-modal { max-height: calc(100vh - 32px); }
    .blh-toasts { top: auto; bottom: 12px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 560px) {
    .blh-stats { grid-template-columns: minmax(0, 1fr); }
    .blh-grid-4, .blh-grid-3, .blh-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .blh-products { grid-template-columns: minmax(0, 1fr); }
    .blh-page-header { flex-direction: column; align-items: stretch; }
    .blh-page-actions .blh-btn,
    .blh-page-actions .btn { flex: 1 1 auto; justify-content: center; }
    /* Cibles tactiles ≥ 40px */
    .blh-btn, .blh-app .btn { min-height: 40px; }
    .blh-icon-btn { width: 40px; height: 40px; }
    .blh-appfooter { flex-direction: column; align-items: flex-start; gap: var(--blh-space-2); }
    .blh-app .pn-product-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
    .blh-content { padding: var(--blh-space-3); }
    .blh-header { padding: 0 var(--blh-space-3); gap: var(--blh-space-2); }
    .blh-userbtn span.blh-userbtn__name { display: none; }
    .blh-card__body, .blh-app .pn-card-body { padding: var(--blh-space-4); }
    .blh-table th, .blh-table td { padding-left: var(--blh-space-4); padding-right: var(--blh-space-4); }
}

/* Aucun débordement horizontal, quelle que soit la largeur */
.blh-app { overflow-x: hidden; }
.blh-app img, .blh-app svg, .blh-app video { max-width: 100%; }
.blh-app pre { overflow-x: auto; }

/* ==========================================================================
   21. IMPRESSION
   ========================================================================== */

@media print {
    .blh-sidebar, .blh-header, .blh-appfooter, .blh-toasts,
    .blh-page-actions, .blh-backdrop { display: none !important; }
    .blh-main { margin-left: 0; }
    body.blh-app { background: #fff; color: #000; }
    .blh-card, .blh-app .pn-card { border-color: #ddd; box-shadow: none; background: #fff; }
}
