/* =========================================================
   POS Cloud — Styles globaux (refonte 2026-04-25, design Figma Make)
   - Tokens light/dark + accent personnalisable (--primary)
   - Class names existants préservés (.btn, .card, .pill, .topbar, etc.)
   - Police Inter, coins arrondis, ombres douces
   ========================================================= */

@import url('https://rsms.me/inter/inter.css');

:root {
  /* ---- Palette ---- */
  --background:    #F5F7FA;
  --foreground:    #1E293B;
  --surface:       #FCFDFE;
  --surface-h:     #FFFFFF;
  --card:          #FFFFFF;
  --txt-2:         #64748B;
  --txt-3:         #94A3B8;
  --primary:       #3B82F6;
  --primary-fg:    #FFFFFF;
  --primary-deep:  #2563EB;
  --secondary:     #EEF2F6;
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --muted:         #EEF2F6;
  --border:        #E1E7EF;
  --input-bg:      #FAFBFC;
  --topbar-bg:     #FFFFFF;
  --statusbar-bg:  #FCFDFE;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 6px rgba(15,23,42,.08);
  --shadow-lg: 0 10px 20px rgba(15,23,42,.10);
  --shadow-xl: 0 20px 40px rgba(15,23,42,.12);

  /* ---- Radii ---- */
  --radius:    .75rem;     /* 12px */
  --radius-lg: 1rem;       /* 16px */
  --radius-md: .625rem;    /* 10px */
  --radius-sm: .5rem;      /* 8px */

  /* ---- Compat (legacy class refs) ---- */
  --c-bg:           var(--background);
  --c-bg-gradient:  var(--background);
  --c-surface:      var(--card);
  --c-surface-flat: var(--card);
  --c-input-bg:     var(--input-bg);
  --c-input-border: var(--border);
  --c-topbar:       var(--topbar-bg);
  --c-topbar-border:var(--border);
  --c-statusbar:    var(--statusbar-bg);
  --c-text:         var(--foreground);
  --c-text-muted:   var(--txt-3);
  --c-text-dim:     var(--txt-2);
  --c-border:       var(--border);
  --c-border-soft:  var(--border);
  --c-pill-bg:      var(--muted);
  --c-pill-border:  var(--border);
  --c-pill-active-bg:     var(--primary);
  --c-pill-active-border: var(--primary);
  --c-pill-active-text:   var(--primary-fg);
  --c-head-text:    var(--primary);
  --c-accent:       var(--primary);
  --c-accent-dark:  var(--primary-deep);
  --c-accent-deep:  var(--primary-deep);
  --c-success:      var(--success);
  --c-warning:      var(--warning);
  --c-danger:       var(--danger);
  --c-shadow:       rgba(15,23,42,.08);
}

/* =====================================================================
   Lot 3 — Re-thème Back Office sur la charte STOCK @chr/design (LAW-08-002,
   décision fix). SCOPÉ au root BO (.bo-stock-theme) → surcharge les variables
   front en valeurs Stock pour le SOUS-ARBRE BO uniquement. La caisse POS (hors
   ce sous-arbre) garde sa charte actuelle (hors périmètre). En light = charte
   claire Stock ; en night mode, le BO bascule sur la palette Stock SOMBRE via
   `body[data-theme="dark"] .bo-stock-theme` (retour fix : night mode du BO).
   Tokens = @chr/design (crème + texte bleu nuit #0A1028 + doré #ffbd52).
   ===================================================================== */
.bo-stock-theme {
  --background:    #FAF8F2;   /* Stock --background (crème) */
  --foreground:    #0A1028;   /* Stock --foreground (bleu nuit, texte) */
  --surface:       #FFFFFF;
  --surface-h:     #FFFFFF;
  --card:          #FFFFFF;   /* Stock --card */
  --txt-2:         #5A5A6E;
  --txt-3:         #8A8A9E;   /* Stock --muted-foreground */
  --primary:       #0A1028;   /* Stock primary = bleu nuit (accent BO = navy) */
  --primary-fg:    #FAF8F2;   /* Stock --primary-foreground */
  --primary-deep:  #121A36;   /* Stock --surface-soft */
  --secondary:     #F2E8D5;   /* Stock --secondary (cream) */
  --muted:         #F2E8D5;
  --border:        #E5E0D5;   /* Stock --border */
  --input-bg:      #FFFFFF;
  --topbar-bg:     #FFFFFF;
  --statusbar-bg:  #FAF8F2;
  --success:       #1F9D55;   /* Stock semantic */
  --warning:       #E0A800;
  --danger:        #C53030;
  --gold:          #ffbd52;   /* Stock module accent (doré) — highlights BO */
  /* Radii Stock sm4 / md8 / lg12 / xl16 */
  --radius-sm:     .25rem;    /* 4px */
  --radius-md:     .5rem;     /* 8px */
  --radius:        .75rem;    /* 12px */
  --radius-lg:     1rem;      /* 16px */
}

/* Night mode BO (retour fix « night mode non fonctionnel sur le corps du BO »).
   `.bo-stock-theme` (0,1,0), appliqué DIRECTEMENT sur la racine BO, gagnait sur
   la valeur héritée de body[data-theme="dark"] → le BO restait crème. Cette règle
   (0,2,0) est plus spécifique → bascule le sous-arbre BO sur la palette Stock
   SOMBRE (navy #0A1028 + crème + accent doré). Les vues BO utilisant les vars
   (--background/--card/--foreground/--border/--primary…) suivent automatiquement. */
body[data-theme="dark"] .bo-stock-theme {
  --background:    #0A1028;   /* Stock bleu nuit = fond dark */
  --foreground:    #F3F0E8;   /* crème (texte) */
  --surface:       #141C3A;
  --surface-h:     #1C2750;
  --card:          #141C3A;   /* navy un cran plus clair que le fond */
  --txt-2:         #C2C6D6;
  --txt-3:         #8E93AB;
  --primary:       #ffbd52;   /* accent doré (visible sur navy ; en clair = navy) */
  --primary-fg:    #0A1028;   /* texte navy sur surfaces dorées */
  --primary-deep:  #1C2750;
  --secondary:     #1C2750;
  --muted:         #1C2750;
  --border:        #2A3563;
  --input-bg:      #141C3A;
  --topbar-bg:     #141C3A;
  --statusbar-bg:  #0A1028;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
  --shadow-md: 0 4px 8px rgba(0,0,0,.55);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.65);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.7);
  --c-shadow:  rgba(0,0,0,.5);
}

body[data-theme="dark"] {
  --background:    #0A0E1A;
  --foreground:    #F1F5F9;
  --surface:       #131825;
  --surface-h:     #1C2333;
  --card:          #131825;
  --txt-2:         #94A3B8;
  --txt-3:         #64748B;
  --primary-deep:  #1D4ED8;
  --secondary:     #1C2333;
  --success:       #34D399;
  --warning:       #FBBF24;
  --danger:        #F87171;
  --muted:         #1C2333;
  --border:        #1E293B;
  --input-bg:      #131825;
  --topbar-bg:     #131825;
  --statusbar-bg:  #0F1320;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.5);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.6);
  --c-shadow:       rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--foreground);
  background: var(--background);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: background 200ms, color 200ms;
}

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: var(--background); color: var(--txt-2);
  z-index: 9999; transition: opacity 300ms;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash .logo { font-size: 32px; letter-spacing: 6px; font-weight: 700; color: var(--foreground); }
.splash .logo span { color: var(--primary); }
.splash .sub { font-size: 12px; text-transform: uppercase; letter-spacing: 3px; color: var(--primary); }
.splash .msg { font-size: 12px; color: var(--txt-3); margin-top: 20px; }
.splash .spin {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Topbar ---------- */
.topbar {
  height: 56px; background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  font-size: 13px; position: relative; z-index: 10;
  box-shadow: var(--shadow-sm);
}
.topbar .logo { font-weight: 700; font-size: 16px; letter-spacing: 1.5px; color: var(--foreground); }
.topbar .logo span { color: var(--primary); }

/* Brandmark « CHR POS » — charte Stock : carré navy + « CHR » doré (Barlow Condensed,
   fallback condensé système si la font n'est pas chargée — pas de dépendance réseau au boot).
   Sélecteurs en (0,3,0) pour battre `.splash .logo span` / `.topbar .logo span` (couleur primary). */
.splash .logo .brandmark,
.topbar .logo .brandmark {
  display: inline-flex; align-items: center; justify-content: center;
  background: #0A1028; color: #ffbd52;
  border-radius: 0.16em; padding: 0.04em 0.22em; margin-right: 0.3em;
  font-family: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 800; letter-spacing: 0.02em;
}
.topbar .sub { color: var(--txt-3); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-top: 1px; }
.topbar .pill {
  background: var(--muted); border: 1px solid transparent;
  padding: 5px 12px; border-radius: 999px; color: var(--txt-2);
  font-size: 12px; font-weight: 500;
}
.topbar .pill.active {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary); border-color: transparent;
}
.topbar .spacer { flex: 1; }
.topbar .clock {
  font-variant-numeric: tabular-nums; color: var(--foreground);
  font-weight: 500; min-width: 72px; text-align: right;
}

/* ---------- Main ---------- */
main {
  position: absolute;
  top: 56px; left: 0; right: 0; bottom: 32px;
  padding: 20px;
  /* Cadre applicatif fixe (entre topbar 56px et statusbar 32px) MAIS scrollable :
     une page dont le contenu dépasse la hauteur du cadre DOIT scroller, jamais
     être coupée (bug historique « la page ne scrolle pas » — overflow:hidden
     clippait TOUTES les pages trop hautes). overflow-y:auto reste dormant pour
     les pages qui gèrent leur propre scroll interne (contenu à hauteur:100%).
     overflow-x:hidden : jamais de scroll horizontal de la page entière. */
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- Statusbar ---------- */
.statusbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 32px; background: var(--statusbar-bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
  font-size: 12px; color: var(--txt-3); z-index: 9;
}
.statusbar .ok   { color: var(--success); }
.statusbar .warn { color: var(--warning); }
.statusbar .err  { color: var(--danger); }
.statusbar .spacer { flex: 1; }

/* ---------- Boutons ---------- */
.btn {
  background: var(--secondary); color: var(--foreground);
  border: 0; border-radius: var(--radius-md);
  padding: 10px 16px; font: inherit;
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: color-mix(in srgb, var(--secondary) 80%, var(--foreground));
}
.btn:active:not([disabled]) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  background: var(--primary); color: var(--primary-fg);
}
.btn.primary:hover:not([disabled]) {
  background: color-mix(in srgb, var(--primary) 88%, black);
}
.btn.danger {
  background: var(--danger); color: #fff;
}
.btn.danger:hover:not([disabled]) {
  background: color-mix(in srgb, var(--danger) 88%, black);
}
.btn.light {
  background: var(--surface-h); color: var(--foreground);
  border: 1px solid var(--border);
}
.btn.light:hover:not([disabled]) {
  background: var(--muted);
}
.btn.dark {
  background: var(--secondary); color: var(--foreground);
}
.btn.ghost {
  background: transparent; color: var(--foreground); box-shadow: none;
  border: 1px solid var(--border);
}
.btn.ghost:hover:not([disabled]) {
  background: var(--muted); transform: none; box-shadow: none;
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Pill generic ---------- */
.pill {
  background: var(--muted); border: 1px solid transparent;
  padding: 4px 10px; border-radius: 999px; color: var(--txt-2);
  font-size: 11px; font-weight: 500;
}

/* ---------- Formulaires ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; color: var(--txt-2);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
  font-weight: 500;
}
.field input[type=text], .field input[type=number], .field input[type=time],
.field input[type=email], .field input[type=date], .field input[type=tel],
.field input[type=search], .field input[type=url],
.field input[type=password], .field input:not([type]),
.field select, .field textarea {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--foreground); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.card .head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--txt-2); font-weight: 600;
  background: transparent;
}
.card .body { padding: 18px; }

/* ---------- Login ---------- */
/* #137-#140 : fond vidéo CHR Solution avec auto-rotation et tag dark/light.
   Le wrap est position:fixed full-viewport pour couvrir derrière topbar/status.
   L'overlay (gradient dark→transparent) garantit la lisibilité du contenu.    */
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.login-bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
}
.login-bg-overlay {
  position: absolute; inset: 0;
  /* Light theme : voile clair léger, on veut VOIR la vidéo. */
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--background) 55%, transparent),
    color-mix(in srgb, var(--background) 30%, transparent)
  );
}
body[data-theme="dark"] .login-bg-overlay {
  /* Dark theme : voile sombre LÉGER (était 0.75 = vidéo invisible).
     30-50% laisse la vidéo bien visible tout en gardant le contenu lisible. */
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.45),
    rgba(0, 0, 0, 0.25)
  );
}
.login {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: center;
  justify-items: center;
  position: relative; z-index: 1; /* au-dessus du fond vidéo */
}
.login .operators {
  display: grid;
  grid-template-columns: repeat(3, 180px);
  grid-auto-rows: 160px;
  gap: 18px;
  max-width: 620px;
}
.op-card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; cursor: pointer; color: var(--foreground);
  box-shadow: var(--shadow-md);
  transition: all .2s ease;
}
.op-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.op-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
.op-card .avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--primary-fg);
}
.op-card .name { font-weight: 600; font-size: 14px; }
.op-card .role { font-size: 11px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .5px; }

.pinpad {
  background: var(--card);
  border: 0; border-radius: var(--radius-lg);
  padding: 20px; width: 320px;
  box-shadow: var(--shadow-lg);
}
.pinpad h3 {
  margin: 0 0 14px; text-align: center;
  color: var(--txt-2); font-weight: 500; font-size: 14px;
}
.pindisplay {
  background: var(--muted); border: 0;
  border-radius: var(--radius-md);
  height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; letter-spacing: 10px; margin-bottom: 14px;
  color: var(--primary); font-variant-numeric: tabular-nums; font-weight: 700;
}
.pin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.pin-grid .btn { padding: 16px 0; font-size: 22px; aspect-ratio: 1; box-shadow: none; }
.pin-grid .btn:not(.primary):not(.danger) { background: var(--muted); }

/* ---------- Home (page connectée) ---------- */
.home {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: 100%;
}
.home .left  { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.home .right { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.home .user-card { text-align: center; padding: 22px; }
.home .user-card .avatar-lg {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary);
  font-size: 32px; font-weight: 700; color: var(--primary-fg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.home .user-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.home .user-card .role {
  color: var(--txt-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.home .actions { display: grid; gap: 10px; }
.home .actions .btn {
  padding: 14px; text-align: left;
  display: flex; align-items: center; gap: 12px;
  justify-content: flex-start;
  font-weight: 500;
}
.home .actions .btn .ico { font-size: 18px; }

.home .tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.home .tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px; box-shadow: none;
}
.card .body .home .tile,
.card .body .tile {
  /* nested tiles inside a card → flat, no shadow */
  background: transparent;
  border-color: transparent;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}
.home .tile .label {
  font-size: 11px; color: var(--txt-2);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
}
.home .tile .val {
  font-size: 26px; font-weight: 700; margin-top: 6px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
  color: var(--primary);
}
.home .tile .val.blue  { color: var(--primary); }
.home .tile .val.green { color: var(--success); }

.home .rights-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 200px; overflow-y: auto;
}
.home .rights-list .chip {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border: 0; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 500;
}
.home .rights-list .chip.disabled {
  background: var(--muted); color: var(--txt-3);
}

/* ---------- Toast « liquid glass » (spec fix/pos-general 2026-07-12) ----------
   Capsule flottante centrée en bas, verre translucide teinté par TYPE (icône +
   liseré + lavis léger), pas une barre pleine largeur. Le type se lit à l'icône
   et au liseré, pas à un fond opaque. Texte via var(--foreground) → lisible en
   thème clair ET sombre. `saturate` ravive les couleurs du fond = cœur du look. */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 460px; display: inline-flex; align-items: center; gap: 11px;
  padding: 12px 16px; border-radius: 16px;
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  background: var(--toast-wash, rgba(148,163,184,.12));
  border: 1px solid var(--toast-rim, rgba(148,163,184,.45));
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  color: var(--foreground);
  font-weight: 500; font-size: 13.5px; line-height: 1.35;
  z-index: 999; animation: toastIn 200ms ease-out;
}
.toast__icon { display: inline-flex; flex: 0 0 auto; color: var(--toast-accent, #3B82F6); }
.toast__icon svg { width: 20px; height: 20px; display: block; }
.toast__msg { min-width: 0; }
.toast--success { --toast-rim: rgba(16,185,129,.55); --toast-accent: #10B981; --toast-wash: rgba(16,185,129,.11); }
.toast--warning { --toast-rim: rgba(245,158,11,.55); --toast-accent: #F59E0B; --toast-wash: rgba(245,158,11,.11); }
.toast--error   { --toast-rim: rgba(239,68,68,.55);  --toast-accent: #EF4444; --toast-wash: rgba(239,68,68,.11); }
.toast--info    { --toast-rim: rgba(59,130,246,.55); --toast-accent: #3B82F6; --toast-wash: rgba(59,130,246,.11); }
/* Repli sans backdrop-filter (vieux navigateurs) : verre un peu plus opaque. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .toast { background: color-mix(in srgb, var(--card) 88%, transparent); }
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Readonly banner (mode visualisation pos-mobile migration) ---------- */
#readonly-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
  color: #fff;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  z-index: 998;
  border-top: 2px solid #e65100;
}
#readonly-banner .ro-icon { font-size: 20px; line-height: 1; }
#readonly-banner .ro-text { flex: 1; line-height: 1.4; }
#readonly-banner .ro-text a { color: #fff; text-decoration: underline; font-weight: 700; }
#readonly-banner button {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
#readonly-banner button:hover { background: rgba(255,255,255,0.28); }

/* Mode visu : laisse passer la navigation, mais masque visuellement les
   boutons d'opération caisse (commandes, paiement, clôture). Les écritures
   sont déjà bloquées au niveau appendEvent ; ce CSS sert juste à éviter de
   faire cliquer l'utilisateur sur des boutons qui afficheront un toast. */
body.pos-readonly { padding-bottom: 48px; }
body.pos-readonly .btn-pay,
body.pos-readonly .btn-send,
body.pos-readonly .btn-close-z,
body.pos-readonly .order-actions .btn-primary,
body.pos-readonly .payment-actions .btn-primary {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.4);
}
body.pos-readonly .order-actions::after,
body.pos-readonly .payment-actions::after {
  content: 'Mode visualisation — opération désactivée';
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #f57c00;
  font-style: italic;
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--foreground) 18%, transparent);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--foreground) 30%, transparent);
}

/* ---------- Stub / placeholder ---------- */
.stub {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  height: 100%; color: var(--txt-3);
}
.stub .ico { font-size: 56px; }
.stub h2 { color: var(--foreground); margin: 0; font-weight: 600; }
.stub p { max-width: 540px; text-align: center; line-height: 1.6; color: var(--txt-2); }

/* ---------- Tables data (BO produits, audit, etc.) ---------- */
table.data, .data {
  width: 100%; border-collapse: collapse;
  background: var(--card); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
table.data thead, .data thead { background: var(--surface-h); }
table.data th, .data th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; color: var(--txt-2);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
table.data td, .data td {
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 14px; color: var(--foreground);
}
table.data tr:hover td, .data tr:hover td {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
/* #117 : espacement renforcé sur les tableaux de reporting (colonnes étaient
   collées dans des cards étroites). On donne du padding latéral + on impose
   nowrap sur les cellules numériques pour éviter les retours à la ligne. */
table.data th + th, .data th + th,
table.data td + td, .data td + td {
  padding-left: 24px;
}
table.data th[style*="text-align:right"], .data th[style*="text-align:right"],
table.data td[style*="text-align:right"], .data td[style*="text-align:right"],
table.data th[style*="text-align:center"], .data th[style*="text-align:center"],
table.data td[style*="text-align:center"], .data td[style*="text-align:center"] {
  white-space: nowrap;
}

/* ---------- empty-state ---------- */
.empty-state {
  text-align: center; padding: 32px;
  color: var(--txt-3); font-size: 13px;
}

/* ---------- confidentialité des chiffres (2026-05-24) ---------- */
/* Les éléments .fig-secret sont floutés quand body.figures-masked est actif.
   Le clic n'est pas bloqué — on floute visuellement seulement. */
body.figures-masked .fig-secret {
  filter: blur(9px);
  user-select: none;
  transition: filter .18s ease;
  cursor: default;
}
.fig-secret { transition: filter .18s ease; }

/* ---------- overlay verrouillage inactivité (2026-05-24) ---------- */
#idle-overlay {
  position: fixed; inset: 0; z-index: 9800;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center;
  background: rgba(8, 12, 18, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff;
}
#idle-overlay .idle-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 30px 34px; max-width: 380px;
}
#idle-overlay h2 { margin: 0 0 8px; font-size: 20px; color: var(--foreground); }
#idle-overlay p  { margin: 0 0 18px; font-size: 13px; color: var(--txt-2); }

/* Bandeau d'avertissement avant verrouillage/déconnexion inactivité (#207) */
#idle-warning {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9700;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  background: #e6a23c; color: #1a1205;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#idle-warning strong { font-variant-numeric: tabular-nums; }

/* ---------- gabarit de largeur BO (spec Design validée PO, 2026-07-18) ---------- */
/* Gouttière = celle des écrans full existants (padding 20px de `main`), donc
   padding horizontal 0 ici : les 9 écrans s'alignent EXACTEMENT sur les full
   (décision PO, option 1). max-width borne les très grands écrans. */
.bo-container {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
}
.bo-content--narrow-form { max-width: 640px; margin: 0 auto; }
.bo-content--narrow-split { display: flex; gap: 48px; align-items: flex-start; }
.bo-content--narrow-split > .main  { flex: 0 0 480px; min-width: 0; }
.bo-content--narrow-split > .annex { flex: 1 1 320px; min-width: 280px; }
@media (max-width: 1024px) {
  .bo-content--narrow-split { flex-direction: column; gap: 24px; }
  .bo-content--narrow-split > .main { flex-basis: auto; }
}
.bo-content--narrow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 1024px) {
  .bo-content--narrow-grid { grid-template-columns: 1fr; }
}
