/* AltiusForms — feuille unique, générée par frontend/scripts/build-css.mjs.
   Ne pas modifier : éditer static/css/src/*.css puis `npm run build:css`. */

/* ==== 10-base.css ==== */
/* =========================================================================
   THEME.CSS — Surcharge Bootstrap 5.3 + composants custom.
   NE PAS ÉDITER par projet. Tout est piloté par theme-tokens.css.
   À charger APRÈS bootstrap.min.css et APRÈS theme-tokens.css.
   ========================================================================= */

/* ═════════════════════════════════════════════════════════════════════════
   1. MAPPING DES TOKENS VERS LES VARIABLES BOOTSTRAP
   ═════════════════════════════════════════════════════════════════════════ */
:root,
[data-bs-theme="light"] {
  /* Primary */
  --bs-primary:        var(--brand-600);
  --bs-primary-rgb:    34, 139, 90; /* fallback, overridden by oklch below */
  --bs-primary-bg-subtle:     var(--brand-50);
  --bs-primary-border-subtle: var(--brand-200);
  --bs-primary-text-emphasis: var(--brand-700);

  /* Surfaces & body */
  --bs-body-bg:        var(--gray-50);
  --bs-body-color:     var(--gray-800);
  --bs-secondary-bg:   var(--gray-100);
  --bs-tertiary-bg:    var(--gray-100);
  --bs-emphasis-color: var(--gray-950);
  --bs-secondary-color: var(--gray-600);
  --bs-tertiary-color:  var(--gray-500);

  /* Borders */
  --bs-border-color:        var(--gray-200);
  --bs-border-color-translucent: var(--gray-200);

  /* Status */
  --bs-success: var(--success-600);
  --bs-warning: var(--warning-600);
  --bs-danger:  var(--danger-600);
  --bs-info:    var(--info-600);
  --bs-success-bg-subtle: var(--success-100);
  --bs-warning-bg-subtle: var(--warning-100);
  --bs-danger-bg-subtle:  var(--danger-100);
  --bs-info-bg-subtle:    var(--info-100);

  /* Radius */
  --bs-border-radius:    var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-xl: var(--radius-xl);
  --bs-border-radius-pill: var(--radius-pill);

  /* Type */
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size:   var(--fs-base);
  --bs-body-line-height: var(--lh-base);
  --bs-body-font-weight: 400;

  /* Links */
  --bs-link-color:       var(--accent-fg);
  --bs-link-hover-color: var(--brand-800);

  /* Surfaces app */
  --app-surface:        var(--gray-0);
  --app-surface-muted:  var(--gray-50);
  --app-surface-sunken: var(--gray-100);
  --app-border:         var(--gray-200);
  --app-border-strong:  var(--gray-300);
}

[data-bs-theme="dark"] {
  --bs-body-bg:        var(--gray-50);
  --bs-body-color:     var(--gray-800);
  --bs-secondary-bg:   var(--gray-100);
  --bs-tertiary-bg:    var(--gray-100);
  --bs-emphasis-color: var(--gray-950);
  --bs-secondary-color: var(--gray-600);
  --bs-tertiary-color:  var(--gray-500);
  --bs-border-color:    var(--gray-200);
  --bs-border-color-translucent: var(--gray-200);

  --bs-primary-bg-subtle:     color-mix(in oklch, var(--brand-500) 12%, var(--gray-100));
  --bs-primary-border-subtle: color-mix(in oklch, var(--brand-500) 30%, var(--gray-200));
  --bs-primary-text-emphasis: var(--brand-300);

  --app-surface:        var(--gray-50);
  --app-surface-muted:  var(--gray-0);
  --app-surface-sunken: var(--gray-100);
  --app-border:         var(--gray-200);
  --app-border-strong:  var(--gray-300);
}

/* ═════════════════════════════════════════════════════════════════════════
   2. RESET / BASE
   ═════════════════════════════════════════════════════════════════════════ */
html { -webkit-text-size-adjust: 100%; }

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11"; /* Inter polish */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: color-mix(in oklch, var(--brand-500) 30%, transparent);
  color: var(--gray-950);
}

/* Focus ring uniforme partout */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.page-link:focus,
.dropdown-item:focus-visible,
.nav-link:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus) !important;
  border-color: var(--brand-500) !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   3. TYPOGRAPHIE
   ═════════════════════════════════════════════════════════════════════════ */
h1, .h1 { font-size: var(--fs-3xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -.02em; color: var(--gray-950); }
h2, .h2 { font-size: var(--fs-2xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -.015em; color: var(--gray-950); }
h3, .h3 { font-size: var(--fs-xl);  font-weight: 600; line-height: var(--lh-snug);  letter-spacing: -.01em;  color: var(--gray-950); }
h4, .h4 { font-size: var(--fs-lg);  font-weight: 600; line-height: var(--lh-snug);  color: var(--gray-950); }
h5, .h5 { font-size: var(--fs-md);  font-weight: 600; line-height: var(--lh-snug);  color: var(--gray-950); }
h6, .h6 { font-size: var(--fs-base); font-weight: 600; line-height: var(--lh-snug); color: var(--gray-950); }

.display-1 { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.display-2 { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.05; }

.text-muted { color: var(--gray-600) !important; }
.text-subtle { color: var(--gray-500); }
.text-strong { color: var(--gray-950); font-weight: 600; }
.text-mono { font-family: var(--font-mono); font-size: .92em; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-500);
}

code, kbd, pre, samp { font-family: var(--font-mono); font-size: .92em; }
code {
  padding: 1px 5px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-900);
}
/* Fix : à l'intérieur d'un bloc <pre> à fond sombre, le <code> n'a pas son propre fond clair */
pre code, .sg-code code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}
kbd {
  display: inline-flex; align-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 11px; font-weight: 500;
  background: var(--gray-0);
  border: 1px solid var(--gray-300);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  box-shadow: var(--shadow-xs);
}

/* ═════════════════════════════════════════════════════════════════════════
   4. BOUTONS
   ═════════════════════════════════════════════════════════════════════════ */
.btn {
  --bs-btn-padding-x: 12px;
  --bs-btn-padding-y: 6px;
  --bs-btn-font-size: var(--fs-base);
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: var(--radius-md);
  --bs-btn-line-height: 1.4;
  min-height: var(--control-h-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: translateY(0.5px); }

.btn-sm { --bs-btn-padding-x: 10px; --bs-btn-padding-y: 4px; --bs-btn-font-size: var(--fs-sm); min-height: var(--control-h-sm); }
.btn-xs { --bs-btn-padding-x: 8px;  --bs-btn-padding-y: 2px; --bs-btn-font-size: var(--fs-xs); min-height: var(--control-h-xs); border-radius: var(--radius-sm); }
.btn-lg { --bs-btn-padding-x: 16px; --bs-btn-padding-y: 8px; --bs-btn-font-size: var(--fs-md); min-height: var(--control-h-lg); }

/* Primary — solide, opinionné */
.btn-primary {
  --bs-btn-bg: var(--brand-600);
  --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-800);
  --bs-btn-active-border-color: var(--brand-800);
  --bs-btn-disabled-bg: var(--brand-300);
  --bs-btn-disabled-border-color: var(--brand-300);
  color: #fff; box-shadow: var(--shadow-xs);
}

/* Secondary — outline neutre, le bouton "par défaut" software */
.btn-secondary {
  --bs-btn-bg: var(--app-surface);
  --bs-btn-color: var(--gray-800);
  --bs-btn-border-color: var(--gray-300);
  --bs-btn-hover-bg: var(--gray-50);
  --bs-btn-hover-color: var(--gray-950);
  --bs-btn-hover-border-color: var(--gray-400);
  --bs-btn-active-bg: var(--gray-100);
  --bs-btn-active-color: var(--gray-950);
  --bs-btn-active-border-color: var(--gray-400);
  box-shadow: var(--shadow-xs);
}

/* Outline primary */
.btn-outline-primary {
  --bs-btn-color: var(--accent-fg);
  --bs-btn-border-color: var(--brand-300);
  --bs-btn-bg: transparent;
  --bs-btn-hover-bg: var(--brand-50);
  --bs-btn-hover-color: var(--brand-800);
  --bs-btn-hover-border-color: var(--brand-400);
  --bs-btn-active-bg: var(--brand-100);
}

/* Ghost — transparent jusqu'au hover */
.btn-ghost {
  --bs-btn-bg: transparent;
  --bs-btn-color: var(--gray-700);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--gray-100);
  --bs-btn-hover-color: var(--gray-950);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--gray-200);
}

/* Danger / Success / Warning */
.btn-danger {
  --bs-btn-bg: var(--danger-600); --bs-btn-border-color: var(--danger-600);
  --bs-btn-hover-bg: oklch(45% .19 var(--status-danger-hue));
  --bs-btn-hover-border-color: oklch(45% .19 var(--status-danger-hue));
  color: #fff;
}
.btn-success {
  --bs-btn-bg: var(--success-600); --bs-btn-border-color: var(--success-600);
  --bs-btn-hover-bg: oklch(43% .13 var(--status-success-hue));
  --bs-btn-hover-border-color: oklch(43% .13 var(--status-success-hue));
  color: #fff;
}

/* Icon button (carré, juste une icône) */
.btn-icon {
  width: var(--control-h-md); padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-icon.btn-lg { width: var(--control-h-lg); }

/* ═════════════════════════════════════════════════════════════════════════
   5. FORMULAIRES
   ═════════════════════════════════════════════════════════════════════════ */
.form-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.form-label .required { color: var(--danger-600); margin-left: 2px; }

.form-control,
.form-select {
  font-size: var(--fs-base);
  padding: 6px 10px;
  min-height: var(--control-h-md);
  background: var(--app-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-950);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.form-control::placeholder { color: var(--gray-500); }
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) { border-color: var(--gray-400); }
.form-control:disabled,
.form-select:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }

.form-control-sm, .form-select-sm { min-height: var(--control-h-sm); font-size: var(--fs-sm); padding: 4px 8px; }
.form-control-lg, .form-select-lg { min-height: var(--control-h-lg); font-size: var(--fs-md); padding: 8px 12px; }

textarea.form-control { min-height: 80px; resize: vertical; }

.form-text, .form-help { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 4px; }

/* Floating labels */
.form-floating > .form-control,
.form-floating > .form-select { min-height: 52px; padding-top: 18px; padding-bottom: 6px; }
.form-floating > label { padding: 8px 10px; font-size: var(--fs-sm); color: var(--gray-500); }

/* Checkbox / radio / switch */
.form-check-input {
  width: 16px; height: 16px;
  border: 1.5px solid var(--gray-400);
  background: var(--app-surface);
  margin-top: 3px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}
.form-check-input[type="checkbox"] { border-radius: var(--radius-sm); }
.form-check-label { font-size: var(--fs-base); color: var(--gray-800); cursor: pointer; padding-left: 2px; }
.form-switch .form-check-input { width: 32px; height: 18px; }

/* Validation */
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--danger-500); }
.form-control.is-invalid:focus,
.form-select.is-invalid:focus { box-shadow: 0 0 0 3px oklch(60% .2 var(--status-danger-hue) / .2) !important; }
.invalid-feedback, .form-errors { font-size: var(--fs-xs); color: var(--danger-600); margin-top: 4px; }
.form-control.is-valid { border-color: var(--success-500); }

/* Django form errorlist (sans aucune surcharge dans le template) */
.errorlist {
  list-style: none; padding: 0; margin: 4px 0 0;
  font-size: var(--fs-xs); color: var(--danger-600);
}
.errorlist li::before { content: "⚠ "; }
.helptext { display: block; font-size: var(--fs-xs); color: var(--gray-600); margin-top: 4px; }

/* Input group */
.input-group-text {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-600);
  font-size: var(--fs-sm);
  padding: 0 10px;
}

/* ═════════════════════════════════════════════════════════════════════════
   6. CARDS
   ═════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: 12px 16px;
  font-weight: 600;
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.card-body { padding: 16px; }
.card-footer {
  background: var(--app-surface-muted);
  border-top: 1px solid var(--app-border);
  padding: 10px 16px;
}
.card-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: 4px; }
.card-subtitle { font-size: var(--fs-sm); color: var(--gray-600); margin-bottom: 12px; }

/* Card interactive (hover lift) */
.card-interactive { cursor: pointer; transition: all var(--t-base); }
.card-interactive:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ═════════════════════════════════════════════════════════════════════════
   7. KPI / STAT CARDS
   ═════════════════════════════════════════════════════════════════════════ */
.stat-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-xs);
}
.stat-card__label {
  font-size: var(--fs-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-600);
  display: flex; align-items: center; gap: 6px;
}
.stat-card__value {
  font-size: var(--fs-3xl); font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1; color: var(--gray-950);
  font-feature-settings: "tnum";
}
.stat-card__delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--fs-xs); font-weight: 500;
  padding: 2px 6px; border-radius: var(--radius-pill);
}
.stat-card__delta--up { color: var(--success-600); background: var(--success-100); }
.stat-card__delta--down { color: var(--danger-600); background: var(--danger-100); }
.stat-card__delta--flat { color: var(--gray-700); background: var(--gray-100); }

/* ═════════════════════════════════════════════════════════════════════════
   8. BADGES
   ═════════════════════════════════════════════════════════════════════════ */
.badge {
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 4px;
  line-height: 1.5;
}
.badge.text-bg-primary { background: var(--brand-100) !important; color: var(--brand-800) !important; }
.badge.text-bg-success { background: var(--success-100); color: var(--success-600); }
.badge.text-bg-warning { background: var(--warning-100); color: oklch(45% .15 var(--status-warning-hue)); }
.badge.text-bg-danger { background: var(--danger-100); color: var(--danger-600); }
.badge.text-bg-info { background: var(--info-100); color: var(--info-600); }
.badge.text-bg-secondary { background: var(--gray-100); color: var(--gray-700); }

.badge-solid.text-bg-primary { background: var(--brand-600) !important; color: #fff !important; }
.badge-solid.text-bg-success { background: var(--success-600); color: #fff; }
.badge-solid.text-bg-danger { background: var(--danger-600); color: #fff; }

.badge-dot { padding-left: 5px; }
.badge-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block; margin-right: 4px;
}

/* ═════════════════════════════════════════════════════════════════════════
   9. ALERTS (+ Django messages mapping)
   ═════════════════════════════════════════════════════════════════════════ */
.alert {
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: var(--fs-base);
  border-width: 1px;
  border-style: solid;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-primary { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.alert-success { background: var(--success-100); border-color: oklch(85% .12 var(--status-success-hue)); color: oklch(35% .11 var(--status-success-hue)); }
.alert-warning { background: var(--warning-100); border-color: oklch(85% .15 var(--status-warning-hue)); color: oklch(38% .15 var(--status-warning-hue)); }
.alert-danger { background: var(--danger-100); border-color: oklch(85% .08 var(--status-danger-hue)); color: oklch(40% .17 var(--status-danger-hue)); }
.alert-info { background: var(--info-100); border-color: oklch(85% .07 var(--status-info-hue)); color: oklch(40% .13 var(--status-info-hue)); }

/* Django messages : .alert.alert-debug / .info / .success / .warning / .error */
.alert.alert-debug { background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-800); }
.alert.alert-error { background: var(--danger-100); border-color: oklch(85% .08 var(--status-danger-hue)); color: oklch(40% .17 var(--status-danger-hue)); }

/* ═════════════════════════════════════════════════════════════════════════
   10. TABLES
   ═════════════════════════════════════════════════════════════════════════ */
.table {
  --bs-table-bg: transparent;
  font-size: var(--fs-base);
  margin: 0;
  color: var(--gray-800);
  border-collapse: separate;
  border-spacing: 0;
}
.table > thead {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-600);
  background: var(--app-surface-muted);
}
.table > thead > tr > th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--app-border);
  border-top: 1px solid var(--app-border);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table > tbody > tr > td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}
.table > tbody > tr:last-child > td { border-bottom: none; }
.table > tbody > tr:hover { background: var(--app-surface-muted); }

.table-sortable th[data-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
}
.table-sortable th[data-sort]:hover { color: var(--gray-900); }
.table-sortable th[data-sort]::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 10px; height: 10px; transform: translateY(-50%);
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4 6l4-4 4 4M4 10l4 4 4-4" stroke="currentColor" fill="none" stroke-width="1.5"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4 6l4-4 4 4M4 10l4 4 4-4" stroke="currentColor" fill="none" stroke-width="1.5"/></svg>') center / contain no-repeat;
  opacity: .4;
}
.table-sortable th[data-sort].asc::after  { opacity: 1; transform: translateY(-50%) rotate(180deg); }
.table-sortable th[data-sort].desc::after { opacity: 1; }

.table-compact > tbody > tr > td,
.table-compact > thead > tr > th { padding: 5px 10px; }

.table-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-card .table > thead > tr > th:first-child,
.table-card .table > tbody > tr > td:first-child { padding-left: 16px; }
.table-card .table > thead > tr > th:last-child,
.table-card .table > tbody > tr > td:last-child  { padding-right: 16px; }
.table-card .table > thead > tr > th { border-top: none; }

/* ═════════════════════════════════════════════════════════════════════════
   11. NAVBAR / TOPBAR / SIDEBAR
   ═════════════════════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
  background: var(--app-surface-muted);
}
.app-shell.app-shell--collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.app-topbar {
  grid-area: topbar;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  position: sticky; top: 0; z-index: 100;
}

.app-sidebar {
  grid-area: sidebar;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  display: flex; flex-direction: column;
  padding: 8px 0;
  /* Sticky : reste visible quand on scroll. Scroll interne si la nav déborde. */
  position: sticky;
  top: 0;
  /* z-index > topbar (100) et main : le contexte d'empilement de la sidebar (et
     donc le flyout fixed en mode réduit) passe AU-DESSUS du contenu de la page. */
  z-index: 200;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* scrollbar discrète sur la sidebar */
  scrollbar-width: thin;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border: none; }
.app-sidebar::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* Pied de la sidebar (toujours en bas, ne scrolle pas avec la nav) */
.app-sidebar__footer {
  margin-top: auto;
  padding: 8px 12px;
  border-top: 1px solid var(--app-border);
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);
  color: var(--gray-700);
}
.app-shell--collapsed .app-sidebar__footer span,
.app-shell--collapsed .app-sidebar__footer .app-sidebar__footer-text { display: none; }
.app-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 16px;
  font-weight: 600; font-size: var(--fs-md);
  color: var(--gray-950);
}
.app-sidebar__brand-mark {
  width: 28px; height: 28px;
  background: var(--brand-600);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: var(--fs-md);
  flex-shrink: 0;
}
.app-sidebar__section { padding: 8px 8px 4px; }
.app-sidebar__section-title {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  padding: 8px 8px 4px;
}
.app-sidebar__nav { display: flex; flex-direction: column; gap: 1px; padding: 0 8px; }
.app-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius-md);
  font-size: var(--fs-base); color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.app-nav-link i { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; color: var(--gray-500); }
.app-nav-link:hover { background: var(--gray-100); color: var(--gray-950); }
.app-nav-link:hover i { color: var(--gray-700); }
.app-nav-link.active {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 600;
}
.app-nav-link.active i { color: var(--accent-fg); }
[data-bs-theme="dark"] .app-nav-link.active {
  background: color-mix(in oklch, var(--brand-500) 15%, transparent);
  color: var(--brand-300);
}
.app-nav-link__badge {
  margin-left: auto; font-size: 10px; padding: 0 5px;
  background: var(--gray-200); color: var(--gray-700);
  border-radius: var(--radius-pill); min-width: 18px; text-align: center;
}
.app-nav-link.active .app-nav-link__badge { background: var(--brand-200); color: var(--brand-800); }

.app-shell--collapsed .app-sidebar__brand span,
.app-shell--collapsed .app-sidebar__section-title,
.app-shell--collapsed .app-nav-link span,
.app-shell--collapsed .app-nav-link__badge { display: none; }
.app-shell--collapsed .app-nav-link { justify-content: center; padding: 8px; }

/* ── Sidebar : sous-menus + flyout (mode réduit) ──────────────────────── */
.app-nav-link--parent {
  width: 100%; border: 0; background: transparent;
  font-family: inherit; text-align: left; cursor: pointer;
}
/* Le label prend l'espace ; badge + caret restent à droite. */
.app-nav-link > span:not(.app-nav-link__badge):not(.app-nav-flyout) {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.app-nav-link__caret {
  margin-left: 4px; font-size: 12px !important; width: auto !important;
  color: var(--gray-400); transition: transform var(--t-fast);
}
.app-nav-link--parent[aria-expanded="true"] .app-nav-link__caret { transform: rotate(90deg); }

/* Sous-liste (mode déployé) : rail vertical + items alignés sous le label parent */
.app-nav-sub { list-style: none; margin: 2px 0; padding: 0 0 0 18px; position: relative; }
.app-nav-sub::before {
  content: ""; position: absolute; left: 19px; top: 2px; bottom: 2px;
  width: 1px; background: var(--app-border);
}
.app-nav-sublink {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 16px; border-radius: var(--radius-md);
  font-size: var(--fs-sm); color: var(--gray-600);
  text-decoration: none; font-weight: 500;
  position: relative; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.app-nav-sublink:hover { background: var(--gray-100); color: var(--gray-950); }
.app-nav-sublink.active { background: var(--brand-50); color: var(--accent-fg); font-weight: 600; }
[data-bs-theme="dark"] .app-nav-sublink.active { background: color-mix(in oklch, var(--brand-500) 14%, transparent); color: var(--brand-300); }
/* pastille de marque sur le rail pour l'item actif */
.app-nav-sublink.active::before {
  content: ""; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500);
}
.app-nav-sublink .app-nav-link__badge { margin-left: auto; }

/* En mode réduit : plus de caret ni de sous-liste inline — le flyout prend le relais. */
.app-shell--collapsed .app-nav-link__caret,
.app-shell--collapsed .app-nav-sub { display: none !important; }
/* Mode réduit : chaque item = une pastille 40px centrée dans le rail. Taille
   EXPLICITE (indépendante du flex/scrollbar) → cible de survol fiable + icône
   centrée. margin:auto centre horizontalement dans la colonne. */
.app-shell--collapsed .app-nav-group { display: block; width: 40px; margin: 0 auto; }
.app-shell--collapsed .app-sidebar__nav > .app-nav-link,
.app-shell--collapsed .app-nav-group > .app-nav-link--parent {
  width: 40px; height: 38px; padding: 0; margin: 1px auto;
  justify-content: center; border-radius: var(--radius-md);
}

/* Flyout (mode réduit) — popover thémé. Caché en mode déployé. */
.app-nav-flyout { display: none; }
/* position:fixed → échappe l'overflow de la sidebar ; top/left écrits par theme.js.
   Spécificité > la règle qui masque les <span> en mode réduit. */
.app-shell--collapsed .app-nav-link .app-nav-flyout,
.app-shell--collapsed .app-nav-group .app-nav-flyout {
  display: block;
  position: fixed; left: 0; top: 0; z-index: 1080;
  min-width: 190px; max-width: 280px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden; transform: translateX(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}
.app-shell--collapsed .app-nav-flyout.is-visible {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
}
/* pont invisible : ne pas perdre le survol dans le vide entre l'icône et le flyout */
.app-shell--collapsed .app-nav-flyout::before {
  content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px;
}
/* petite flèche vers le rail (façon tooltip) */
.app-shell--collapsed .app-nav-flyout::after {
  content: ""; position: absolute; left: -5px; top: 13px;
  width: 9px; height: 9px; background: var(--app-surface);
  border-left: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border);
  transform: rotate(45deg);
}
/* feuille (item sans enfants) : label seul, façon tooltip */
.app-nav-flyout--label {
  font-size: var(--fs-sm); font-weight: 600; color: var(--gray-950);
  white-space: nowrap; padding: 6px 10px;
}
/* groupe : en-tête + items stylés comme les liens de nav */
.app-nav-flyout__title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-500); padding: 4px 10px 8px;
  border-bottom: 1px solid var(--app-border); margin-bottom: 4px;
}
.app-nav-flyout__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.app-nav-flyout__list a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-md);
  font-size: var(--fs-sm); color: var(--gray-700); text-decoration: none; white-space: nowrap;
  font-weight: 500; transition: background var(--t-fast), color var(--t-fast);
}
.app-nav-flyout__list a:hover { background: var(--gray-100); color: var(--gray-950); }
.app-nav-flyout__list a.active { background: var(--brand-50); color: var(--accent-fg); font-weight: 600; }
[data-bs-theme="dark"] .app-nav-flyout__list a.active { background: color-mix(in oklch, var(--brand-500) 14%, transparent); color: var(--brand-300); }
.app-nav-flyout__list .app-nav-link__badge { margin-left: auto; }

.app-main {
  grid-area: main;
  padding: 20px 24px 40px;
  overflow-x: hidden;
  max-width: 100%;
}

/* Mobile : sidebar en offcanvas */
@media (max-width: 991.98px) {
  .app-shell { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform var(--t-base);
    z-index: 1050; box-shadow: var(--shadow-xl);
  }
  .app-shell.app-shell--mobile-open .app-sidebar { transform: translateX(0); }
  .app-main { padding: 16px; }
}

/* Backdrop mobile */
.app-shell__backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .4);
  z-index: 1040; opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.app-shell.app-shell--mobile-open .app-shell__backdrop { opacity: 1; pointer-events: auto; }

/* ═════════════════════════════════════════════════════════════════════════
   12. PAGE HEADER
   ═════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-end; justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--app-border);
}
.page-header__title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.015em; margin: 0; color: var(--gray-950); }
.page-header__subtitle { font-size: var(--fs-sm); color: var(--gray-600); margin-top: 2px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-header__breadcrumb { margin-bottom: 4px; }

/* ═════════════════════════════════════════════════════════════════════════
   13. BREADCRUMBS
   ═════════════════════════════════════════════════════════════════════════ */
.breadcrumb {
  font-size: var(--fs-sm);
  margin: 0;
  --bs-breadcrumb-divider: '/';
  --bs-breadcrumb-divider-color: var(--gray-400);
}
.breadcrumb-item a {
  color: var(--gray-600);
  text-decoration: none;
}
.breadcrumb-item a:hover { color: var(--accent-fg); }
.breadcrumb-item.active { color: var(--gray-900); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--gray-400); padding: 0 6px; }

/* ═════════════════════════════════════════════════════════════════════════
   14. PAGINATION (Django-friendly)
   ═════════════════════════════════════════════════════════════════════════ */
.pagination {
  --bs-pagination-padding-y: 4px;
  --bs-pagination-padding-x: 8px;
  --bs-pagination-font-size: var(--fs-sm);
  --bs-pagination-border-radius: var(--radius-md);
  --bs-pagination-color: var(--gray-700);
  --bs-pagination-bg: var(--app-surface);
  --bs-pagination-border-color: var(--gray-300);
  --bs-pagination-hover-color: var(--gray-950);
  --bs-pagination-hover-bg: var(--gray-100);
  --bs-pagination-hover-border-color: var(--gray-300);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: var(--brand-600);
  --bs-pagination-active-border-color: var(--brand-600);
  --bs-pagination-disabled-color: var(--gray-400);
  --bs-pagination-disabled-bg: var(--app-surface);
  --bs-pagination-disabled-border-color: var(--gray-200);
  gap: 4px;
}
.pagination .page-link {
  min-width: var(--control-h-sm); height: var(--control-h-sm);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  font-weight: 500;
}

/* ═════════════════════════════════════════════════════════════════════════
   15. NAV TABS / PILLS
   ═════════════════════════════════════════════════════════════════════════ */
.nav-tabs {
  border-bottom: 1px solid var(--app-border);
  gap: 4px;
  --bs-nav-tabs-border-color: transparent;
  --bs-nav-tabs-border-radius: 0;
}
.nav-tabs .nav-link {
  border: none;
  padding: 8px 12px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--gray-900); border-bottom-color: var(--gray-300); }
.nav-tabs .nav-link.active {
  color: var(--accent-fg);
  border-bottom-color: var(--brand-600);
  background: transparent;
}

.nav-pills .nav-link {
  padding: 4px 10px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-md);
}
.nav-pills .nav-link.active {
  background: var(--gray-900);
  color: var(--gray-0);
}

/* ═════════════════════════════════════════════════════════════════════════
   16. DROPDOWN
   ═════════════════════════════════════════════════════════════════════════ */
.dropdown-menu {
  --bs-dropdown-min-width: 180px;
  --bs-dropdown-padding-y: 4px;
  --bs-dropdown-padding-x: 4px;
  --bs-dropdown-font-size: var(--fs-base);
  --bs-dropdown-bg: var(--app-surface);
  --bs-dropdown-border-color: var(--app-border);
  --bs-dropdown-border-radius: var(--radius-lg);
  --bs-dropdown-link-color: var(--gray-800);
  --bs-dropdown-link-hover-bg: var(--gray-100);
  --bs-dropdown-link-hover-color: var(--gray-950);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-base);
}
.dropdown-item i { color: var(--gray-500); width: 16px; }
.dropdown-divider { border-color: var(--app-border); margin: 4px 0; }
.dropdown-header {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500); padding: 6px 10px 2px;
}

/* ═════════════════════════════════════════════════════════════════════════
   17. MODAL / OFFCANVAS
   ═════════════════════════════════════════════════════════════════════════ */
.modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  background: var(--app-surface);
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--app-border);
  padding: 14px 20px;
}
.modal-title { font-size: var(--fs-lg); font-weight: 600; }
.modal-body { padding: 20px; font-size: var(--fs-base); }
.modal-footer {
  border-top: 1px solid var(--app-border);
  padding: 12px 20px;
  background: var(--app-surface-muted);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  gap: 8px;
}

.offcanvas {
  background: var(--app-surface);
  border-color: var(--app-border) !important;
}
.offcanvas-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--app-border);
}
.offcanvas-title { font-size: var(--fs-lg); font-weight: 600; }
.offcanvas-body { padding: 20px; }

/* ═════════════════════════════════════════════════════════════════════════
   18. TOASTS
   ═════════════════════════════════════════════════════════════════════════ */
.toast-container { padding: 16px; gap: 8px; display: flex; flex-direction: column; }
.toast {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-base);
  width: 340px;
  max-width: 100%;
  --bs-toast-bg: var(--app-surface);
  --bs-toast-color: var(--gray-900);
}
.toast-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: 8px 12px;
  font-weight: 600;
}
.toast-body { padding: 10px 12px; color: var(--gray-700); }
.toast--success { border-left: 3px solid var(--success-500); }
.toast--danger  { border-left: 3px solid var(--danger-500); }
.toast--warning { border-left: 3px solid var(--warning-500); }
.toast--info    { border-left: 3px solid var(--info-500); }

/* ═════════════════════════════════════════════════════════════════════════
   19. PROGRESS / SPINNER / PLACEHOLDER (skeleton)
   ═════════════════════════════════════════════════════════════════════════ */
.progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar { background: var(--brand-600); }
.progress.progress-thin { height: 3px; }
.progress.progress-thick { height: 10px; }

.spinner-border, .spinner-grow { --bs-spinner-border-width: 2px; }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.skeleton-text { height: 12px; width: 100%; }
.skeleton-text.skeleton-text--short { width: 40%; }
.skeleton-text.skeleton-text--medium { width: 70%; }
.skeleton-block { display: block; height: 80px; width: 100%; border-radius: var(--radius-md); }
.skeleton-circle { border-radius: 50%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═════════════════════════════════════════════════════════════════════════
   20. AVATAR
   ═════════════════════════════════════════════════════════════════════════ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--app-border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 20px; height: 20px; font-size: 10px; }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: var(--fs-md); }
.avatar-xl { width: 56px; height: 56px; font-size: var(--fs-lg); }

.avatar-square { border-radius: var(--radius-md); }

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--app-surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack__more {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--gray-700);
  font-size: var(--fs-xs); font-weight: 600;
  border-radius: 50%;
  width: 32px; height: 32px;
  border: 2px solid var(--app-surface);
  margin-left: -6px;
}

/* Colored avatars (for initials) */
.avatar--primary { background: var(--brand-100); color: var(--brand-800); }
.avatar--success { background: var(--success-100); color: var(--success-600); }
.avatar--warning { background: var(--warning-100); color: oklch(45% .15 var(--status-warning-hue)); }
.avatar--danger  { background: var(--danger-100); color: var(--danger-600); }
.avatar--info    { background: var(--info-100); color: var(--info-600); }

/* ═════════════════════════════════════════════════════════════════════════
   21. STEPPER / WIZARD
   ═════════════════════════════════════════════════════════════════════════ */
.stepper {
  display: flex; align-items: flex-start;
  gap: 0;
  width: 100%;
}
.stepper__step {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
  gap: 6px;
  padding: 0 8px;
}
.stepper__step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 16px);
  right: calc(50% + 16px);
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.stepper__step:first-child::before { display: none; }
.stepper__step--done::before,
.stepper__step--active::before { background: var(--brand-500); }
.stepper__bullet {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--app-surface);
  border: 2px solid var(--gray-300);
  color: var(--gray-600);
  font-size: var(--fs-xs); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.stepper__step--active .stepper__bullet {
  border-color: var(--brand-600);
  color: var(--brand-700);
  background: var(--brand-50);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-500) 20%, transparent);
}
.stepper__step--done .stepper__bullet {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.stepper__label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.3;
}
.stepper__step--active .stepper__label { color: var(--gray-950); font-weight: 600; }
.stepper__step--done .stepper__label { color: var(--gray-800); }

/* ═════════════════════════════════════════════════════════════════════════
   22. EMPTY STATE
   ═════════════════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  color: var(--gray-500);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.empty-state__title { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-950); margin: 4px 0 0; }
.empty-state__desc { font-size: var(--fs-sm); color: var(--gray-600); max-width: 360px; }
.empty-state__actions { display: flex; gap: 8px; margin-top: 8px; }

/* ═════════════════════════════════════════════════════════════════════════
   23. COMMAND PALETTE (⌘K)
   ═════════════════════════════════════════════════════════════════════════ */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1070;
  display: none;
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(2px);
}
[data-bs-theme="dark"] .cmdk-backdrop { background: rgba(0, 0, 0, .65); }
.cmdk-backdrop.is-open { display: flex; }
.cmdk {
  width: 640px; max-width: calc(100% - 32px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.cmdk__input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-border);
}
.cmdk__input-wrap i { color: var(--gray-500); font-size: 16px; }
.cmdk__input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: var(--fs-lg);
  color: var(--gray-950);
}
.cmdk__input::placeholder { color: var(--gray-500); }
.cmdk__list { overflow-y: auto; padding: 6px; }
.cmdk__group-title {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  padding: 8px 10px 4px;
}
.cmdk__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--gray-800);
  cursor: pointer;
}
.cmdk__item i { color: var(--gray-500); width: 18px; font-size: 15px; }
.cmdk__item:hover, .cmdk__item.is-selected {
  background: var(--gray-100);
  color: var(--gray-950);
}
.cmdk__item.is-selected i { color: var(--brand-600); }
.cmdk__item-shortcut { margin-left: auto; display: flex; gap: 3px; }
.cmdk__footer {
  border-top: 1px solid var(--app-border);
  padding: 8px 14px;
  background: var(--app-surface-muted);
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-xs); color: var(--gray-600);
}
.cmdk__footer kbd { font-size: 10px; height: 16px; min-width: 16px; }

/* ═════════════════════════════════════════════════════════════════════════
   24. SEARCH INPUT (avec icône)
   ═════════════════════════════════════════════════════════════════════════ */
.search-input {
  position: relative;
  display: inline-flex; align-items: center;
  width: 100%;
}
.search-input > i {
  position: absolute; left: 10px;
  color: var(--gray-500); font-size: 14px;
  pointer-events: none;
}
.search-input > .form-control { padding-left: 32px; }
.search-input > kbd { position: absolute; right: 10px; }
.search-input.search-input--with-kbd > .form-control { padding-right: 40px; }

/* ═════════════════════════════════════════════════════════════════════════
   25. LIST GROUP
   ═════════════════════════════════════════════════════════════════════════ */
.list-group { --bs-list-group-bg: var(--app-surface); --bs-list-group-border-color: var(--app-border); }
.list-group-item {
  padding: 10px 14px;
  font-size: var(--fs-base);
  color: var(--gray-800);
  border-color: var(--app-border);
}
.list-group-item.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

/* ═════════════════════════════════════════════════════════════════════════
   26. ACCORDION
   ═════════════════════════════════════════════════════════════════════════ */
.accordion {
  --bs-accordion-bg: var(--app-surface);
  --bs-accordion-border-color: var(--app-border);
  --bs-accordion-border-radius: var(--radius-md);
  --bs-accordion-active-bg: var(--brand-50);
  --bs-accordion-active-color: var(--brand-800);
  --bs-accordion-btn-focus-box-shadow: var(--shadow-focus);
}
.accordion-button {
  font-size: var(--fs-base);
  font-weight: 500;
  padding: 12px 14px;
}
.accordion-button:not(.collapsed) { box-shadow: none; }
.accordion-body { padding: 12px 14px; font-size: var(--fs-base); color: var(--gray-700); }

/* ═════════════════════════════════════════════════════════════════════════
   27. SECTIONS / DIVIDERS / HELPERS
   ═════════════════════════════════════════════════════════════════════════ */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.section-divider::before, .section-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--app-border);
}
.section-divider__label {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
}

.surface { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg); }
.surface-muted { background: var(--app-surface-muted); }
.bordered { border: 1px solid var(--app-border); }
.bordered-top { border-top: 1px solid var(--app-border); }
.bordered-bottom { border-bottom: 1px solid var(--app-border); }

/* Status dot inline */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-400);
  vertical-align: middle;
}
.status-dot--online { background: var(--success-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success-500) 25%, transparent); }
.status-dot--busy { background: var(--danger-500); }
.status-dot--away { background: var(--warning-500); }
.status-dot--offline { background: var(--gray-400); }

/* ═════════════════════════════════════════════════════════════════════════
   28. UTILITAIRES SUPPLÉMENTAIRES
   ═════════════════════════════════════════════════════════════════════════ */
.bg-app { background: var(--app-surface) !important; }
.bg-app-muted { background: var(--app-surface-muted) !important; }
.text-brand { color: var(--brand-600) !important; }
.border-app { border-color: var(--app-border) !important; }

.fs-xs { font-size: var(--fs-xs) !important; }
.fs-sm { font-size: var(--fs-sm) !important; }
.fs-base { font-size: var(--fs-base) !important; }
.fs-md { font-size: var(--fs-md) !important; }
.fs-lg { font-size: var(--fs-lg) !important; }
.fs-xl { font-size: var(--fs-xl) !important; }

.tabular-nums { font-variant-numeric: tabular-nums; }

/* ═════════════════════════════════════════════════════════════════════════
   29. FOOTERS (4 variantes)
   ═════════════════════════════════════════════════════════════════════════ */

/* — 29a. App footer : en bas d'un dashboard, discret, status + version — */
.app-footer {
  display: flex; align-items: center;
  gap: 16px;
  padding: 10px 16px;
  margin: 24px -24px -40px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  font-size: var(--fs-xs);
  color: var(--gray-600);
}
.app-footer__divider { width: 1px; height: 12px; background: var(--app-border); }
.app-footer a { color: var(--gray-700); text-decoration: none; }
.app-footer a:hover { color: var(--accent-fg); }
.app-footer__status { display: inline-flex; align-items: center; gap: 6px; }
.app-footer__version { font-family: var(--font-mono); color: var(--gray-500); }
.app-footer__links { display: inline-flex; gap: 14px; margin-left: auto; }
@media (max-width: 767.98px) {
  .app-footer { flex-wrap: wrap; padding: 12px; margin: 16px -16px -16px; }
  .app-footer__links { margin-left: 0; width: 100%; padding-top: 8px; border-top: 1px solid var(--app-border); }
}

/* — 29b. Site footer : pour landing/marketing, multi-colonnes — */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 56px 0 0;
  font-size: var(--fs-sm);
  margin-top: 80px;
}
[data-bs-theme="dark"] .site-footer { background: var(--gray-100); }
.site-footer__container {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}
.site-footer__brand h4 { color: #fff; font-size: var(--fs-lg); margin: 12px 0 8px; }
[data-bs-theme="dark"] .site-footer__brand h4 { color: var(--gray-950); }
.site-footer__brand p { color: var(--gray-400); margin: 0 0 16px; max-width: 280px; }
.site-footer__brand-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 700; color: #fff;
}
[data-bs-theme="dark"] .site-footer__brand-logo { color: var(--gray-950); }
.site-footer__brand-mark {
  width: 32px; height: 32px;
  background: var(--brand-600);
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.site-footer__social { display: flex; gap: 8px; margin-top: 16px; }
.site-footer__social a {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .06);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-300);
  transition: all var(--t-fast);
  text-decoration: none;
}
.site-footer__social a:hover { background: var(--brand-600); color: #fff; }
[data-bs-theme="dark"] .site-footer__social a { background: var(--gray-200); color: var(--gray-700); }
[data-bs-theme="dark"] .site-footer__social a:hover { background: var(--brand-600); color: #fff; }

.site-footer__col h6 {
  color: #fff;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
}
[data-bs-theme="dark"] .site-footer__col h6 { color: var(--gray-950); }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer__col a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--t-fast);
}
.site-footer__col a:hover { color: #fff; }
[data-bs-theme="dark"] .site-footer__col a { color: var(--gray-700); }
[data-bs-theme="dark"] .site-footer__col a:hover { color: var(--gray-950); }
.site-footer__col .badge { margin-left: 4px; }

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: var(--fs-xs);
  color: var(--gray-500);
  max-width: var(--content-max-w);
  margin: 0 auto;
}
[data-bs-theme="dark"] .site-footer__bottom { border-top-color: var(--gray-200); color: var(--gray-600); }
.site-footer__bottom a { color: var(--gray-400); text-decoration: none; margin-left: 14px; }
.site-footer__bottom a:hover { color: #fff; }
[data-bs-theme="dark"] .site-footer__bottom a { color: var(--gray-700); }

@media (max-width: 991.98px) {
  .site-footer__container { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .site-footer__container { grid-template-columns: 1fr; }
}

/* — 29c. Simple footer : centré, juste une ligne — */
.simple-footer {
  border-top: 1px solid var(--app-border);
  padding: 20px 24px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--gray-600);
  background: var(--app-surface);
}
.simple-footer a { color: var(--gray-700); text-decoration: none; }
.simple-footer a:hover { color: var(--accent-fg); }
.simple-footer__sep { margin: 0 8px; color: var(--gray-400); }

/* — 29d. CTA footer : grand bandeau pleine largeur, conversion — */
.cta-footer {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  padding: 64px 24px;
  text-align: center;
  border-radius: var(--radius-xl);
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}
.cta-footer::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.06) 0%, transparent 50%);
  pointer-events: none;
}
.cta-footer__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  background: rgba(255, 255, 255, .12);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  position: relative;
}
.cta-footer__title {
  font-size: var(--fs-4xl); font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 12px; line-height: 1.1;
  color: #fff;
  position: relative;
}
.cta-footer__desc {
  font-size: var(--fs-lg); color: rgba(255, 255, 255, .8);
  margin: 0 auto 24px; max-width: 540px;
  position: relative;
}
.cta-footer__actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  position: relative;
}
.cta-footer .btn-primary {
  background: #fff; color: var(--brand-800); border-color: #fff;
}
.cta-footer .btn-primary:hover { background: var(--gray-50); color: var(--brand-900); border-color: var(--gray-50); }
.cta-footer .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.cta-footer .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ═════════════════════════════════════════════════════════════════════════
   30. CARDS — variantes additionnelles
   ═════════════════════════════════════════════════════════════════════════ */

/* Cover card : image en haut, contenu en bas */
.card-cover { display: flex; flex-direction: column; overflow: hidden; }
.card-cover__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand-200), var(--brand-500));
  position: relative;
  overflow: hidden;
}
.card-cover__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover__badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 6px;
}

/* Profile card : avatar + meta + actions */
.card-profile {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 20px;
  text-align: center;
}
.card-profile__avatar { margin-bottom: 12px; }
.card-profile__name { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 2px; color: var(--gray-950); }
.card-profile__title { font-size: var(--fs-sm); color: var(--gray-600); margin: 0 0 16px; }
.card-profile__meta {
  display: flex; gap: 24px; padding: 12px 0;
  border-top: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
  width: 100%; justify-content: center; margin-bottom: 16px;
}
.card-profile__meta-item { text-align: center; }
.card-profile__meta-value { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-950); display: block; }
.card-profile__meta-label { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }

/* Pricing card */
.pricing-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
  transition: all var(--t-base);
}
.pricing-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.pricing-card--featured {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-500), var(--shadow-md);
}
.pricing-card__ribbon {
  position: absolute; top: -10px; right: 16px;
  background: var(--brand-600); color: #fff;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: .04em;
}
.pricing-card__name { font-size: var(--fs-md); font-weight: 600; color: var(--gray-950); margin: 0; }
.pricing-card__desc { font-size: var(--fs-sm); color: var(--gray-600); margin: 0; }
.pricing-card__price {
  display: flex; align-items: baseline; gap: 4px;
  font-feature-settings: "tnum";
}
.pricing-card__amount { font-size: var(--fs-4xl); font-weight: 700; color: var(--gray-950); letter-spacing: -.02em; line-height: 1; }
.pricing-card__period { font-size: var(--fs-sm); color: var(--gray-600); }
.pricing-card__features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pricing-card__features li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); color: var(--gray-800); }
.pricing-card__features i { color: var(--success-500); font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.pricing-card__features li.is-disabled { color: var(--gray-500); text-decoration: line-through; }
.pricing-card__features li.is-disabled i { color: var(--gray-400); }

/* Stat card with sparkline */
.stat-card__chart {
  height: 32px;
  width: 100%;
  margin-top: 4px;
}

/* Feature card (icon + text, pour landing) */
.feature-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
}
.feature-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.feature-card__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-950); margin: 0 0 4px; }
.feature-card__desc { font-size: var(--fs-sm); color: var(--gray-600); margin: 0; line-height: 1.55; }

/* ═════════════════════════════════════════════════════════════════════════
   31. HERO / BANNER (landing pages)
   ═════════════════════════════════════════════════════════════════════════ */
.hero {
  padding: 64px 24px;
  text-align: center;
  background: var(--app-surface);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-800);
  margin-bottom: 16px;
}
.hero__title {
  font-size: var(--fs-5xl);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--gray-950);
  margin: 0 auto 16px;
  max-width: 720px;
  text-wrap: balance;
}
.hero__desc {
  font-size: var(--fs-lg);
  color: var(--gray-600);
  margin: 0 auto 24px;
  max-width: 560px;
  line-height: 1.55;
}
.hero__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero__trust {
  margin-top: 32px;
  font-size: var(--fs-xs);
  color: var(--gray-500);
  display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap;
}

/* ═════════════════════════════════════════════════════════════════════════
   32. FILE UPLOAD (dropzone)
   ═════════════════════════════════════════════════════════════════════════ */
.file-drop {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  background: var(--app-surface-muted);
  transition: all var(--t-fast);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.file-drop:hover, .file-drop.is-dragover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-800);
}
.file-drop__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 18px;
  margin-bottom: 4px;
}
.file-drop:hover .file-drop__icon { color: var(--accent-fg); border-color: var(--brand-300); }
.file-drop__title { font-weight: 600; color: var(--gray-950); font-size: var(--fs-base); }
.file-drop__hint { font-size: var(--fs-sm); color: var(--gray-600); }
.file-drop__hint strong { color: var(--accent-fg); }
.file-drop input[type=file] { display: none; }

/* Item de fichier uploadé */
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  font-size: var(--fs-sm);
}
.file-item__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  color: var(--gray-700);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-item__name { font-weight: 500; color: var(--gray-950); }
.file-item__meta { font-size: var(--fs-xs); color: var(--gray-600); }
.file-item__progress { flex-grow: 1; }

/* ═════════════════════════════════════════════════════════════════════════
   33. TIMELINE
   ═════════════════════════════════════════════════════════════════════════ */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 1px; background: var(--app-border);
}
.timeline__item { position: relative; padding-left: 36px; padding-bottom: 20px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__bullet {
  position: absolute; left: 4px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--app-surface);
  border: 2px solid var(--gray-300);
  z-index: 1;
}
.timeline__item--active .timeline__bullet { border-color: var(--brand-600); background: var(--brand-100); box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-500) 20%, transparent); }
.timeline__item--done .timeline__bullet { background: var(--brand-600); border-color: var(--brand-600); }
.timeline__item--danger .timeline__bullet { background: var(--danger-500); border-color: var(--danger-500); }
.timeline__time { font-size: var(--fs-xs); color: var(--gray-500); font-family: var(--font-mono); display: block; margin-bottom: 2px; }
.timeline__title { font-size: var(--fs-base); font-weight: 600; color: var(--gray-950); margin: 0 0 2px; }
.timeline__desc { font-size: var(--fs-sm); color: var(--gray-600); margin: 0; }

/* ═════════════════════════════════════════════════════════════════════════
   34. TAGS / CHIPS INPUT
   ═════════════════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-sm);
  padding: 2px 4px 2px 8px;
  background: var(--gray-100);
  color: var(--gray-800);
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.chip--primary { background: var(--brand-50); color: var(--brand-800); }
.chip--success { background: var(--success-100); color: var(--success-600); }
.chip__remove {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.chip__remove:hover { background: var(--gray-200); color: var(--gray-950); }
.chip--primary .chip__remove:hover { background: var(--brand-200); color: var(--brand-900); }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  border: 1px solid var(--gray-300);
  background: var(--app-surface);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  min-height: var(--control-h-md);
  box-shadow: var(--shadow-xs);
}
.chip-input:focus-within { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.chip-input > input {
  flex: 1; min-width: 80px;
  border: none; outline: none; background: transparent;
  font-size: var(--fs-base); padding: 2px 4px;
  color: var(--gray-950);
}
.chip-input > input::placeholder { color: var(--gray-500); }

/* ═════════════════════════════════════════════════════════════════════════
   35. AUTH SCREENS (login / signup)
   ═════════════════════════════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--app-surface-muted);
}
.auth-shell--split { grid-template-columns: 1fr 1fr; }
.auth-shell--split .auth-side {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
  position: relative; overflow: hidden;
}
.auth-shell--split .auth-side::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 80%, rgba(255,255,255,.1), transparent 60%);
}
@media (max-width: 767.98px) { .auth-shell--split { grid-template-columns: 1fr; } .auth-shell--split .auth-side { display: none; } }

.auth-card {
  width: 100%; max-width: 400px;
  margin: auto;
  padding: 40px 32px;
  background: var(--app-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--app-border);
}
.auth-card__brand {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
  font-weight: 600; font-size: var(--fs-md);
}
.auth-card__brand-mark {
  width: 32px; height: 32px;
  background: var(--brand-600); color: #fff;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.auth-card__title { font-size: var(--fs-2xl); font-weight: 600; margin: 0 0 4px; color: var(--gray-950); }
.auth-card__subtitle { font-size: var(--fs-sm); color: var(--gray-600); margin: 0 0 24px; }
.auth-card__form { display: flex; flex-direction: column; gap: 12px; }
.auth-card__footer-text { font-size: var(--fs-sm); color: var(--gray-600); text-align: center; margin-top: 16px; }
.auth-card__divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--gray-500);
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em;
}
.auth-card__divider::before, .auth-card__divider::after {
  content: ""; flex: 1; height: 1px; background: var(--app-border);
}
.auth-card__social { display: flex; flex-direction: column; gap: 8px; }

/* ═════════════════════════════════════════════════════════════════════════
   36. NEWSLETTER INLINE
   ═════════════════════════════════════════════════════════════════════════ */
/* Wrapper vertical : titre + desc empilés, puis le form (input-group gère la
   ligne input+bouton). L'ancien `display:flex` mettait tout côte à côte → cassé. */
.newsletter { max-width: 480px; }
.newsletter__title {
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em;
  color: var(--gray-950); margin: 0 0 4px;
}
.newsletter__desc { font-size: var(--fs-sm); color: var(--gray-600); margin: 0 0 12px; }
.newsletter__form { max-width: 440px; }

/* ═════════════════════════════════════════════════════════════════════════
   37. FILTER BAR (au-dessus d'un tableau / liste)
   ═════════════════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
}
.filter-bar__divider { width: 1px; height: 20px; background: var(--app-border); }
.filter-bar__chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 10px;
  font-size: var(--fs-sm);
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-md);
  font-weight: 500;
}
.filter-bar__chip-remove { font-size: 13px; cursor: pointer; }

/* ═════════════════════════════════════════════════════════════════════════
   38. CALENDAR / DATE PICKER (visual, à brancher avec une lib JS)
   ═════════════════════════════════════════════════════════════════════════ */
.calendar {
  width: 280px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
}
.calendar__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.calendar__title { font-weight: 600; color: var(--gray-950); font-size: var(--fs-base); }
.calendar__nav { display: flex; gap: 2px; }
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar__dow {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500);
  text-align: center;
  padding: 4px 0;
}
.calendar__day {
  aspect-ratio: 1;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--gray-800);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  border: none;
  background: transparent;
  transition: all var(--t-fast);
}
.calendar__day:hover { background: var(--gray-100); }
.calendar__day.is-muted { color: var(--gray-400); }
.calendar__day.is-today {
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--brand-400);
  color: var(--accent-fg);
}
.calendar__day.is-selected {
  background: var(--brand-600);
  color: #fff;
}
.calendar__day.is-in-range { background: var(--brand-50); color: var(--brand-800); border-radius: 0; }
.calendar__day.is-range-start { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); background: var(--brand-600); color: #fff; }
.calendar__day.is-range-end { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); background: var(--brand-600); color: #fff; }
.calendar__day:disabled { color: var(--gray-300); cursor: not-allowed; }
.calendar__day.has-event { position: relative; }
.calendar__day.has-event::after {
  content: ""; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand-500);
}
.calendar__day.is-selected.has-event::after { background: #fff; }
.calendar__footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px; margin-top: 8px;
  border-top: 1px solid var(--app-border);
}

/* Date input avec icône (preset pour ouvrir un picker custom) */
.date-input { position: relative; }
.date-input > .form-control { padding-right: 32px; }
.date-input > i {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); pointer-events: none;
  color: var(--gray-500);
}

/* ═════════════════════════════════════════════════════════════════════════
   39. AUTOCOMPLETE / COMBOBOX
   ═════════════════════════════════════════════════════════════════════════ */
.combobox { position: relative; }
.combobox__input { padding-right: 32px; }
.combobox__caret {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--gray-500); pointer-events: none;
}
.combobox__panel {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  z-index: 50;
}
.combobox__item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--gray-800);
  cursor: pointer;
}
.combobox__item:hover, .combobox__item.is-active {
  background: var(--gray-100);
  color: var(--gray-950);
}
.combobox__item.is-selected {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 500;
}
.combobox__item.is-selected i.bi-check { margin-left: auto; color: var(--brand-600); }
.combobox__item-avatar { flex-shrink: 0; }
.combobox__item-label { flex-grow: 1; min-width: 0; }
.combobox__item-meta { font-size: var(--fs-xs); color: var(--gray-500); }
.combobox__group-label {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500);
  padding: 6px 8px 2px;
}
.combobox__empty {
  padding: 12px;
  text-align: center;
  color: var(--gray-500);
  font-size: var(--fs-sm);
}

/* highlight matched text */
.combobox__match { background: color-mix(in oklch, var(--brand-300) 40%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }

/* ═════════════════════════════════════════════════════════════════════════
   40. TREE VIEW (arborescence pliable)
   ═════════════════════════════════════════════════════════════════════════ */
.tree {
  font-size: var(--fs-sm);
  user-select: none;
}
.tree ul {
  list-style: none;
  padding-left: 18px;
  margin: 0;
  border-left: 1px dashed var(--gray-200);
  margin-left: 9px;
}
.tree > ul { padding-left: 0; border-left: none; margin-left: 0; }
.tree__node {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-800);
  position: relative;
}
.tree__node:hover { background: var(--gray-100); }
.tree__node.is-selected {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 500;
}
.tree__chevron {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.tree__chevron.is-empty { visibility: hidden; }
.tree__item.is-open > .tree__node .tree__chevron { transform: rotate(90deg); }
.tree__item:not(.is-open) > ul { display: none; }
.tree__icon { color: var(--gray-500); flex-shrink: 0; font-size: 14px; }
.tree__node.is-selected .tree__icon { color: var(--accent-fg); }
.tree__label { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree__meta { font-size: var(--fs-xs); color: var(--gray-500); font-variant-numeric: tabular-nums; }
.tree__badge { font-size: 10px; padding: 0 5px; background: var(--gray-100); color: var(--gray-700); border-radius: var(--radius-pill); }

/* ═════════════════════════════════════════════════════════════════════════
   41. ANNOUNCEMENT BANNER (top of app, dismissable)
   ═════════════════════════════════════════════════════════════════════════ */
.announce-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: var(--brand-700);
  color: #fff;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--brand-800);
}
.announce-bar--info { background: var(--info-600); border-bottom-color: oklch(45% .13 var(--status-info-hue)); }
.announce-bar--warning { background: oklch(50% .15 var(--status-warning-hue)); color: #fff; border-bottom-color: oklch(40% .15 var(--status-warning-hue)); }
.announce-bar--danger { background: var(--danger-600); border-bottom-color: oklch(45% .19 var(--status-danger-hue)); }
.announce-bar__icon { font-size: 16px; flex-shrink: 0; }
.announce-bar__content { flex-grow: 1; }
.announce-bar__content strong { font-weight: 600; }
.announce-bar__content a { color: #fff; text-decoration: underline; font-weight: 500; }
.announce-bar__cta {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-xs); font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast);
}
.announce-bar__cta:hover { background: rgba(255,255,255,.24); color: #fff; }
.announce-bar__close {
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: .8;
  transition: opacity var(--t-fast);
}
.announce-bar__close:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* ═════════════════════════════════════════════════════════════════════════
   42. COOKIE CONSENT (banner flottant bas)
   ═════════════════════════════════════════════════════════════════════════ */
.cookie-consent {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 480px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 16px 20px;
  z-index: 1080;
  display: flex; flex-direction: column; gap: 12px;
}
.cookie-consent__title { font-weight: 600; color: var(--gray-950); margin: 0; font-size: var(--fs-base); }
.cookie-consent__body { font-size: var(--fs-sm); color: var(--gray-700); margin: 0; line-height: 1.55; }
.cookie-consent__body a { color: var(--accent-fg); }
.cookie-consent__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═════════════════════════════════════════════════════════════════════════
   43. NOTIFICATION CENTER (panel / inbox)
   ═════════════════════════════════════════════════════════════════════════ */
.notif-panel {
  width: 360px; max-width: 100%;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-panel__head {
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--app-border);
}
.notif-panel__title { font-weight: 600; font-size: var(--fs-md); color: var(--gray-950); margin: 0; }
.notif-panel__tabs {
  display: flex; gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--app-border);
}
.notif-panel__tabs a {
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
}
.notif-panel__tabs a.is-active { color: var(--accent-fg); border-bottom-color: var(--brand-600); }
.notif-panel__list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
  position: relative;
}
.notif-item:hover { background: var(--app-surface-muted); }
.notif-item:last-child { border-bottom: none; }
.notif-item--unread::before {
  content: "";
  position: absolute; left: 6px; top: 16px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-600);
}
.notif-item__icon {
  flex-shrink: 0;
}
.notif-item__body { flex-grow: 1; min-width: 0; }
.notif-item__title { font-size: var(--fs-sm); color: var(--gray-950); margin: 0; line-height: 1.4; }
.notif-item--unread .notif-item__title { font-weight: 600; }
.notif-item__desc { font-size: var(--fs-xs); color: var(--gray-600); margin: 2px 0 0; }
.notif-item__time { font-size: var(--fs-xs); color: var(--gray-500); margin-top: 2px; }
.notif-panel__foot {
  padding: 8px 16px;
  text-align: center;
  border-top: 1px solid var(--app-border);
}
.notif-panel__foot a { font-size: var(--fs-sm); color: var(--accent-fg); text-decoration: none; font-weight: 500; }

/* ═════════════════════════════════════════════════════════════════════════
   44. COMPARISON TABLE (features par plan)
   ═════════════════════════════════════════════════════════════════════════ */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--app-border);
  text-align: center;
  font-size: var(--fs-sm);
}
.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--gray-800);
  background: var(--app-surface-muted);
}
.compare-table thead th {
  background: var(--app-surface-muted);
  font-weight: 600;
  color: var(--gray-950);
  font-size: var(--fs-base);
  padding-top: 16px; padding-bottom: 16px;
}
.compare-table thead th .compare-table__price {
  display: block;
  font-size: var(--fs-xs);
  color: var(--gray-600);
  font-weight: 400;
  margin-top: 2px;
}
.compare-table thead th.is-featured {
  background: var(--brand-50);
  color: var(--brand-800);
  position: relative;
}
.compare-table thead th.is-featured::before {
  content: "POPULAIRE";
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--brand-600); color: #fff;
  font-size: 9px; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: .08em;
}
.compare-table td.is-featured-col { background: color-mix(in oklch, var(--brand-500) 8%, transparent); }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table .check { color: var(--success-500); font-size: 16px; }
.compare-table .cross { color: var(--gray-400); font-size: 14px; }
.compare-table__group {
  background: var(--gray-100) !important;
  font-weight: 600 !important;
  font-size: var(--fs-xs) !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-700) !important;
}
[data-bs-theme="dark"] .compare-table__group { background: var(--gray-200) !important; }

/* ═════════════════════════════════════════════════════════════════════════
   45. TESTIMONIALS
   ═════════════════════════════════════════════════════════════════════════ */
.testimonial {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
  font-size: var(--fs-base);
}
.testimonial__quote-mark {
  position: absolute; top: 16px; right: 20px;
  font-size: 48px; line-height: 1;
  color: var(--brand-100);
  font-family: Georgia, serif;
}
.testimonial__rating {
  display: flex; gap: 2px;
  color: var(--warning-500);
  font-size: 14px;
}
.testimonial__rating .empty { color: var(--gray-300); }
.testimonial__quote { color: var(--gray-900); font-size: var(--fs-base); line-height: 1.6; margin: 0; flex-grow: 1; }
.testimonial__author {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}
.testimonial__author-name { font-weight: 600; color: var(--gray-950); font-size: var(--fs-sm); }
.testimonial__author-meta { font-size: var(--fs-xs); color: var(--gray-600); }
.testimonial--featured { background: linear-gradient(135deg, var(--brand-50), var(--app-surface)); border-color: var(--brand-200); }
[data-bs-theme="dark"] .testimonial--featured { background: color-mix(in oklch, var(--brand-500) 8%, var(--app-surface)); }

/* ═════════════════════════════════════════════════════════════════════════
   46. FAQ
   ═════════════════════════════════════════════════════════════════════════ */
.faq { display: flex; flex-direction: column; gap: 1px; }
.faq__item {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
}
.faq__question {
  padding: 14px 16px;
  font-weight: 500;
  font-size: var(--fs-base);
  color: var(--gray-950);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}
.faq__question:hover { color: var(--accent-fg); }
.faq__question i { transition: transform var(--t-fast); color: var(--gray-500); }
.faq__item.is-open .faq__question i { transform: rotate(180deg); color: var(--accent-fg); }
.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base);
}
.faq__item.is-open .faq__answer { max-height: 320px; }
.faq__answer-inner {
  padding: 0 16px 16px;
  font-size: var(--fs-sm);
  color: var(--gray-700);
  line-height: 1.6;
}

/* ═════════════════════════════════════════════════════════════════════════
   47. SPARKLINE (mini-graph dans une stat-card)
   ═════════════════════════════════════════════════════════════════════════ */
.sparkline {
  width: 100%; height: 40px;
  display: block;
}
.sparkline__line {
  fill: none;
  stroke: var(--brand-500);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sparkline__area {
  fill: url(#sparklineGradient);
  opacity: .35;
}
.sparkline__dot {
  fill: var(--brand-600);
  stroke: var(--app-surface);
  stroke-width: 2;
}
.sparkline--success .sparkline__line { stroke: var(--success-500); }
.sparkline--success .sparkline__dot { fill: var(--success-600); }
.sparkline--danger .sparkline__line { stroke: var(--danger-500); }
.sparkline--danger .sparkline__dot { fill: var(--danger-600); }

/* Bar sparkline (alternative) */
.spark-bars {
  display: flex; align-items: flex-end; gap: 2px;
  height: 32px;
}
.spark-bars__bar {
  flex: 1;
  background: var(--brand-300);
  border-radius: 1px;
  min-height: 2px;
}
.spark-bars__bar--last { background: var(--brand-600); }

/* ═════════════════════════════════════════════════════════════════════════
   48. DIFF VIEWER
   ═════════════════════════════════════════════════════════════════════════ */
.diff {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.diff__head {
  padding: 8px 12px;
  background: var(--app-surface-muted);
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
}
.diff__filename { font-weight: 600; color: var(--gray-950); }
.diff__stats { display: flex; gap: 8px; font-family: var(--font-mono); font-size: var(--fs-xs); }
.diff__stats .add { color: var(--success-600); }
.diff__stats .del { color: var(--danger-600); }
.diff__body { padding: 0; }
.diff__row {
  display: grid;
  grid-template-columns: 40px 40px 1fr;
  border-bottom: 1px solid transparent;
}
.diff__lineno {
  text-align: right;
  padding: 1px 8px;
  color: var(--gray-400);
  background: var(--app-surface-muted);
  user-select: none;
  border-right: 1px solid var(--app-border);
}
.diff__code {
  padding: 1px 12px;
  white-space: pre;
  color: var(--gray-800);
  overflow-x: auto;
}
.diff__row--add { background: color-mix(in oklch, var(--success-500) 8%, transparent); }
.diff__row--add .diff__lineno { background: color-mix(in oklch, var(--success-500) 14%, var(--app-surface-muted)); color: var(--success-600); }
.diff__row--add .diff__code::before { content: "+ "; color: var(--success-600); font-weight: 600; }
.diff__row--del { background: color-mix(in oklch, var(--danger-500) 8%, transparent); }
.diff__row--del .diff__lineno { background: color-mix(in oklch, var(--danger-500) 14%, var(--app-surface-muted)); color: var(--danger-600); }
.diff__row--del .diff__code::before { content: "- "; color: var(--danger-600); font-weight: 600; }
.diff__row--hunk {
  background: color-mix(in oklch, var(--info-500) 8%, transparent);
  color: var(--info-600);
}
.diff__row--hunk .diff__code { color: var(--info-600); font-weight: 500; }
.diff__row--hunk .diff__code::before { content: ""; }

/* ═════════════════════════════════════════════════════════════════════════
   49. ERROR PAGES (404 / 500 / maintenance)
   ═════════════════════════════════════════════════════════════════════════ */
.error-page {
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 16px;
}
.error-page__code {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.error-page__code--mono {
  background: linear-gradient(135deg, var(--gray-700), var(--gray-900));
  -webkit-background-clip: text; background-clip: text;
}
.error-page__code--danger {
  background: linear-gradient(135deg, var(--danger-500), oklch(40% .17 var(--status-danger-hue)));
  -webkit-background-clip: text; background-clip: text;
}
.error-page__title {
  font-size: var(--fs-2xl); font-weight: 600;
  color: var(--gray-950);
  margin: 0;
}
.error-page__desc {
  font-size: var(--fs-md);
  color: var(--gray-600);
  max-width: 480px;
  margin: 0;
  line-height: 1.55;
}
.error-page__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.error-page__details {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--gray-500);
  padding: 8px 12px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
}

/* ═════════════════════════════════════════════════════════════════════════
   50. CONTEXTUAL TOOLBAR (bulk actions sur une sélection)
   ═════════════════════════════════════════════════════════════════════════ */
.bulkbar {
  position: sticky;
  top: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  background: var(--gray-900);
  color: var(--gray-50);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  z-index: 50;
  animation: bulkbar-in var(--t-base);
}
@keyframes bulkbar-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-bs-theme="dark"] .bulkbar { background: var(--gray-200); color: var(--gray-950); }
.bulkbar__count {
  background: rgba(255, 255, 255, .12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
[data-bs-theme="dark"] .bulkbar__count { background: var(--gray-50); color: var(--gray-950); }
.bulkbar__divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .15); }
[data-bs-theme="dark"] .bulkbar__divider { background: var(--gray-300); }
.bulkbar__btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #fff;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}
[data-bs-theme="dark"] .bulkbar__btn { color: var(--gray-950); }
.bulkbar__btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
[data-bs-theme="dark"] .bulkbar__btn:hover { background: var(--gray-50); color: var(--gray-950); }
.bulkbar__btn--danger:hover { background: var(--danger-600); color: #fff; }
.bulkbar__close {
  margin-left: auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .7);
  background: transparent; border: none;
  cursor: pointer;
}
[data-bs-theme="dark"] .bulkbar__close { color: var(--gray-700); }
.bulkbar__close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
[data-bs-theme="dark"] .bulkbar__close:hover { background: var(--gray-50); color: var(--gray-950); }

/* ═════════════════════════════════════════════════════════════════════════
   51. CAROUSEL (override Bootstrap natif + nos styles)
   ═════════════════════════════════════════════════════════════════════════ */
.carousel { border-radius: var(--radius-lg); overflow: hidden; }
.carousel-control-prev, .carousel-control-next {
  width: 44px; opacity: 1;
  background: transparent;
}
.carousel-control-prev-icon, .carousel-control-next-icon {
  width: 36px; height: 36px;
  background-color: var(--app-surface);
  border-radius: 50%;
  background-size: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--app-border);
  opacity: .95;
}
.carousel-control-prev-icon:hover, .carousel-control-next-icon:hover { background-color: var(--gray-50); }
.carousel-indicators { gap: 6px; margin-bottom: 16px; }
.carousel-indicators [data-bs-target] {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  border: none;
  margin: 0;
  opacity: 1;
  transition: all var(--t-fast);
}
.carousel-indicators [data-bs-target].active {
  width: 24px;
  border-radius: 999px;
  background: #fff;
}
.carousel-caption {
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  left: 0; right: 0; bottom: 0;
  padding: 60px 20px 20px;
  text-align: left;
}

/* ═════════════════════════════════════════════════════════════════════════
   52. DRAWER / BOTTOM SHEET (mobile-style)
   ═════════════════════════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 1075;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--app-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, .2);
  z-index: 1076;
  transform: translateY(100%);
  transition: transform var(--t-base);
  max-height: 85vh;
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateY(0); }
.drawer__handle {
  width: 32px; height: 4px;
  background: var(--gray-300);
  border-radius: 999px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
.drawer__head {
  padding: 12px 20px;
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__title { font-weight: 600; color: var(--gray-950); margin: 0; font-size: var(--fs-md); }
.drawer__body { padding: 16px 20px; overflow-y: auto; flex-grow: 1; }
.drawer__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--app-border);
  display: flex; gap: 8px;
}
.drawer__footer .btn { flex: 1; }

/* Drawer side (desktop, depuis la droite) */
.drawer--right {
  left: auto; bottom: 0; top: 0; right: 0;
  width: 420px; max-width: 100%;
  max-height: 100vh;
  border-radius: 0;
  transform: translateX(100%);
}
.drawer--right.is-open { transform: translateX(0); }

/* ═════════════════════════════════════════════════════════════════════════
   53. ONBOARDING TOUR (popover guidé avec pointeur)
   ═════════════════════════════════════════════════════════════════════════ */
.tour-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 1085;
}
.tour-popover {
  position: absolute;
  width: 320px;
  background: var(--app-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 16px;
  z-index: 1086;
  border: 1px solid var(--app-border);
}
.tour-popover__step {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand-600);
  margin-bottom: 6px;
}
.tour-popover__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-950); margin: 0 0 4px; }
.tour-popover__desc { font-size: var(--fs-sm); color: var(--gray-700); margin: 0 0 16px; line-height: 1.55; }
.tour-popover__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}
.tour-popover__progress {
  display: flex; gap: 4px;
}
.tour-popover__progress-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
}
.tour-popover__progress-dot.is-active { background: var(--brand-600); width: 20px; border-radius: 999px; }
.tour-popover__actions { display: flex; gap: 6px; }
/* Pointeur (flèche) — 4 positions */
.tour-popover::before {
  content: ""; position: absolute;
  width: 12px; height: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  transform: rotate(45deg);
}
.tour-popover--top::before { bottom: -7px; left: 24px; border-top: none; border-left: none; }
.tour-popover--bottom::before { top: -7px; left: 24px; border-bottom: none; border-right: none; }
.tour-popover--left::before { right: -7px; top: 24px; border-bottom: none; border-left: none; }
.tour-popover--right::before { left: -7px; top: 24px; border-top: none; border-right: none; }

/* Spotlight (anneau autour de l'élément cible) */
.tour-spotlight {
  position: absolute;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-500) 50%, transparent),
              0 0 0 9999px rgba(15, 23, 42, .55);
  pointer-events: none;
  z-index: 1084;
}

/* ═════════════════════════════════════════════════════════════════════════
   54. LOGO ROW (clients / partenaires)
   ═════════════════════════════════════════════════════════════════════════ */
.logo-row {
  display: flex; flex-wrap: wrap; gap: 40px;
  align-items: center; justify-content: center;
  padding: 24px 0;
}
.logo-row__caption {
  width: 100%; text-align: center;
  font-size: var(--fs-sm);
  color: var(--gray-600);
  margin-bottom: 12px;
}
.logo-row__item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-lg); font-weight: 700;
  color: var(--gray-500);
  filter: grayscale(1);
  opacity: .8;
  transition: all var(--t-base);
  letter-spacing: -.01em;
}
.logo-row__item:hover { filter: grayscale(0); opacity: 1; color: var(--gray-900); }
.logo-row__item i { font-size: 24px; }

/* ═════════════════════════════════════════════════════════════════════════
   55. STATS SECTION (gros chiffres marketing)
   ═════════════════════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px 0;
}
.stats-row__item {
  text-align: center;
  padding: 16px;
  border-right: 1px solid var(--app-border);
}
.stats-row__item:last-child { border-right: none; }
.stats-row__value {
  font-size: var(--fs-5xl); font-weight: 700;
  letter-spacing: -.03em;
  color: var(--gray-950);
  font-feature-settings: "tnum";
  line-height: 1;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.stats-row__label {
  font-size: var(--fs-sm);
  color: var(--gray-600);
  margin-top: 8px;
}
@media (max-width: 767.98px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row__item:nth-child(2) { border-right: none; }
  .stats-row__item:nth-child(-n+2) { border-bottom: 1px solid var(--app-border); padding-bottom: 24px; }
}

/* ═════════════════════════════════════════════════════════════════════════
   56. BENTO GRID (cellules asymétriques, style Apple/Linear)
   ═════════════════════════════════════════════════════════════════════════ */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(140px, auto);
  gap: 12px;
}
.bento__cell {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.bento__cell--accent {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  border-color: transparent;
}
.bento__cell--accent .bento__title, .bento__cell--accent .bento__value { color: #fff; }
.bento__cell--accent .bento__desc { color: rgba(255, 255, 255, .8); }
.bento__cell--accent::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.15), transparent 60%);
  pointer-events: none;
}
.bento__cell--muted { background: var(--app-surface-muted); }
.bento__cell--w-2 { grid-column: span 2; }
.bento__cell--w-3 { grid-column: span 3; }
.bento__cell--w-4 { grid-column: span 4; }
.bento__cell--h-2 { grid-row: span 2; }
.bento__eyebrow {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  opacity: .7;
}
.bento__title { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-950); margin: 0; line-height: 1.2; }
.bento__desc { font-size: var(--fs-sm); color: var(--gray-700); margin: 0; line-height: 1.5; flex-grow: 1; }
.bento__value { font-size: var(--fs-4xl); font-weight: 700; color: var(--gray-950); line-height: 1; letter-spacing: -.02em; font-feature-settings: "tnum"; }
.bento__icon { font-size: 28px; color: var(--brand-600); }
.bento__cell--accent .bento__icon { color: #fff; opacity: .9; }
@media (max-width: 991.98px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento__cell--w-2, .bento__cell--w-3, .bento__cell--w-4 { grid-column: span 2; }
}

/* ═════════════════════════════════════════════════════════════════════════
   57. NUMBERED STEPS (process en 3-4 étapes)
   ═════════════════════════════════════════════════════════════════════════ */
.num-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  counter-reset: numstep;
}
.num-step {
  position: relative;
  padding: 20px 16px 16px;
  counter-increment: numstep;
}
.num-step::before {
  content: "0" counter(numstep);
  display: block;
  font-size: var(--fs-4xl); font-weight: 700;
  color: var(--brand-500);
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 12px;
  font-feature-settings: "tnum";
}
.num-step__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-950); margin: 0 0 6px; }
.num-step__desc { font-size: var(--fs-sm); color: var(--gray-600); margin: 0; line-height: 1.55; }

/* Variant avec ligne de connexion */
.num-steps--connected .num-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 28px; right: -16px;
  width: 32px; height: 1px;
  background: var(--app-border);
}

/* ═════════════════════════════════════════════════════════════════════════
   58. HEATMAP CALENDAR (style GitHub contributions)
   ═════════════════════════════════════════════════════════════════════════ */
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  padding: 8px;
}
.heatmap__cell {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: var(--gray-100);
  cursor: pointer;
  transition: transform var(--t-fast);
}
.heatmap__cell:hover { transform: scale(1.2); outline: 1px solid var(--gray-400); }
.heatmap__cell[data-level="1"] { background: color-mix(in oklch, var(--brand-500) 25%, var(--gray-100)); }
.heatmap__cell[data-level="2"] { background: color-mix(in oklch, var(--brand-500) 50%, var(--gray-100)); }
.heatmap__cell[data-level="3"] { background: color-mix(in oklch, var(--brand-500) 75%, var(--gray-100)); }
.heatmap__cell[data-level="4"] { background: var(--brand-600); }
.heatmap-wrap { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg); padding: 16px; overflow-x: auto; }
.heatmap-legend {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: var(--gray-600);
  justify-content: flex-end; margin-top: 8px;
}
.heatmap-legend__cell {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--gray-100);
}

/* ═════════════════════════════════════════════════════════════════════════
   59. DONUT / GAUGE (SVG)
   ═════════════════════════════════════════════════════════════════════════ */
.donut {
  position: relative;
  width: 140px; height: 140px;
}
.donut__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut__track {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 10;
}
.donut__fill {
  fill: none;
  stroke: var(--brand-600);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--t-slow);
}
.donut__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.donut__value { font-size: var(--fs-2xl); font-weight: 700; color: var(--gray-950); line-height: 1; font-feature-settings: "tnum"; }
.donut__label { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* Gauge (demi-cercle) */
.gauge {
  position: relative;
  width: 160px; height: 88px;
}
.gauge__svg { width: 100%; height: 100%; }
.gauge__track { fill: none; stroke: var(--gray-200); stroke-width: 12; stroke-linecap: round; }
.gauge__fill { fill: none; stroke: var(--brand-600); stroke-width: 12; stroke-linecap: round; }
.gauge--success .gauge__fill { stroke: var(--success-500); }
.gauge--warning .gauge__fill { stroke: var(--warning-500); }
.gauge--danger .gauge__fill { stroke: var(--danger-500); }
.gauge__center {
  position: absolute; left: 0; right: 0; bottom: 0;
  text-align: center;
}
.gauge__value { font-size: var(--fs-xl); font-weight: 700; color: var(--gray-950); font-feature-settings: "tnum"; line-height: 1; }
.gauge__label { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }

/* ═════════════════════════════════════════════════════════════════════════
   60. MULTI-STEP FORM LAYOUT
   ═════════════════════════════════════════════════════════════════════════ */
.multistep {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.multistep__head {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
}
.multistep__body {
  padding: 32px;
  min-height: 280px;
}
.multistep__footer {
  padding: 16px 32px;
  border-top: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--app-surface-muted);
}
.multistep__progress-text { font-size: var(--fs-sm); color: var(--gray-600); font-variant-numeric: tabular-nums; }
.multistep__step-title { font-size: var(--fs-xl); font-weight: 600; margin: 8px 0 4px; color: var(--gray-950); }
.multistep__step-desc { font-size: var(--fs-sm); color: var(--gray-600); }

/* ═════════════════════════════════════════════════════════════════════════
   61. RICH TEXT EDITOR (toolbar visuelle)
   ═════════════════════════════════════════════════════════════════════════ */
.rte {
  background: var(--app-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.rte:focus-within { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.rte__toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  flex-wrap: wrap;
}
.rte__group { display: flex; gap: 1px; }
.rte__divider { width: 1px; height: 20px; background: var(--app-border); margin: 0 4px; }
.rte__btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--t-fast);
}
.rte__btn:hover { background: var(--gray-200); color: var(--gray-950); }
.rte__btn.is-active { background: var(--brand-100); color: var(--brand-800); }
.rte__select {
  height: 28px;
  padding: 0 6px;
  border: none;
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--gray-800);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rte__select:hover { background: var(--gray-200); }
.rte__content {
  padding: 12px 14px;
  min-height: 140px;
  font-size: var(--fs-base);
  color: var(--gray-950);
  line-height: 1.6;
  outline: none;
}
.rte__content p { margin: 0 0 8px; }
.rte__content p:last-child { margin-bottom: 0; }
.rte__statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  font-size: var(--fs-xs);
  color: var(--gray-600);
}

/* ═════════════════════════════════════════════════════════════════════════
   62. SPINNERS (enrichis)
   ═════════════════════════════════════════════════════════════════════════ */
.spinner-border {
  --bs-spinner-width: 1em;
  --bs-spinner-height: 1em;
  --bs-spinner-border-width: 2px;
  border-color: currentColor;
  border-right-color: transparent;
  color: var(--brand-600);
}
.spinner-border-xs { --bs-spinner-width: 10px; --bs-spinner-height: 10px; --bs-spinner-border-width: 1.5px; }
.spinner-border-sm { --bs-spinner-width: 14px; --bs-spinner-height: 14px; }
.spinner-border-lg { --bs-spinner-width: 32px; --bs-spinner-height: 32px; --bs-spinner-border-width: 3px; }

.spinner-grow { color: var(--brand-600); }

/* Loading dots animés */
.spinner-dots {
  display: inline-flex; gap: 4px;
  align-items: center;
}
.spinner-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: spinner-dot 1.2s ease-in-out infinite;
}
.spinner-dots span:nth-child(2) { animation-delay: .2s; }
.spinner-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes spinner-dot {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Pulse dot (status) */
.spinner-pulse {
  position: relative;
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success-500);
}
.spinner-pulse::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--success-500);
  animation: spinner-pulse 1.6s ease-out infinite;
  opacity: .6;
}
@keyframes spinner-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(3); opacity: 0; }
}

/* Bouton en état loading : .btn.is-loading */
.btn.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  top: 50%; left: 50%;
  margin-top: -7px; margin-left: -7px;
  border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after,
.btn-outline-primary.is-loading::after {
  border-color: color-mix(in oklch, var(--brand-500) 30%, transparent);
  border-top-color: var(--brand-600);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Overlay de chargement plein-écran ou local */
.loading-overlay {
  position: absolute; inset: 0;
  background: color-mix(in oklch, var(--app-surface) 75%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  z-index: 10;
  backdrop-filter: blur(2px);
}
.loading-overlay--fixed { position: fixed; z-index: 9999; }
.loading-overlay__text { font-size: var(--fs-sm); color: var(--gray-700); }

/* Progress bar indéterminée (top of page, style YouTube) */
.progress-indeterminate {
  position: relative;
  height: 2px;
  width: 100%;
  background: var(--gray-100);
  overflow: hidden;
}
.progress-indeterminate::before {
  content: "";
  position: absolute; left: -30%; top: 0;
  width: 30%; height: 100%;
  background: var(--brand-500);
  animation: progress-indeterm 1.4s ease-in-out infinite;
}
@keyframes progress-indeterm {
  0% { left: -30%; }
  60% { left: 100%; }
  100% { left: 100%; }
}

/* ═════════════════════════════════════════════════════════════════════════
   63. FAB (Floating Action Button)
   ═════════════════════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1040;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--t-fast);
}
.fab:hover { background: var(--brand-700); transform: translateY(-1px); box-shadow: var(--shadow-xl); }
.fab:active { transform: translateY(0.5px); }
.fab--sm { width: 36px; height: 36px; font-size: 16px; }
.fab--lg { width: 56px; height: 56px; font-size: 24px; }
.fab--extended {
  width: auto; border-radius: var(--radius-pill);
  padding: 0 18px; gap: 8px;
  font-size: var(--fs-base); font-weight: 500;
}
.fab--bottom-left { right: auto; left: 24px; }
.fab--top-right { bottom: auto; top: 80px; }
.fab--success { background: var(--success-600); }
.fab--success:hover { background: oklch(43% .13 var(--status-success-hue)); }
.fab--danger { background: var(--danger-600); }
.fab--danger:hover { background: oklch(45% .19 var(--status-danger-hue)); }
.fab--secondary {
  background: var(--app-surface);
  color: var(--gray-900);
  border: 1px solid var(--app-border);
}
.fab--secondary:hover { background: var(--gray-50); }

/* Badge sur FAB (notif count) */
.fab__badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger-500); color: #fff;
  font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--app-surface);
}

/* Speed-dial : groupe de FAB avec mini-actions au survol */
.fab-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1040;
  display: flex; flex-direction: column-reverse; align-items: flex-end;
  gap: 12px;
}
.fab-stack__actions {
  display: flex; flex-direction: column-reverse;
  gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.fab-stack.is-open .fab-stack__actions { opacity: 1; pointer-events: auto; }
.fab-stack__action {
  display: inline-flex; align-items: center; gap: 10px;
  flex-direction: row-reverse;
}
.fab-stack__action .fab { box-shadow: var(--shadow-md); }
.fab-stack__action-label {
  background: var(--gray-900);
  color: var(--gray-50);
  font-size: var(--fs-xs);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  font-weight: 500;
}
[data-bs-theme="dark"] .fab-stack__action-label { background: var(--gray-200); color: var(--gray-950); }
.fab-stack__trigger i { transition: transform var(--t-base); }
.fab-stack.is-open .fab-stack__trigger i { transform: rotate(45deg); }

/* ═════════════════════════════════════════════════════════════════════════
   64. SCROLLSPY (styles pour la nav qui suit le scroll)
   ═════════════════════════════════════════════════════════════════════════ */
.scrollspy-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  align-self: start;
}
.scrollspy-nav__title {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  padding: 4px 12px;
  margin-bottom: 4px;
}
.scrollspy-nav .nav-link {
  font-size: var(--fs-sm);
  color: var(--gray-600);
  padding: 4px 12px;
  border-left: 2px solid var(--app-border);
  border-radius: 0;
  margin-left: 0;
  transition: all var(--t-fast);
}
.scrollspy-nav .nav-link:hover { color: var(--gray-900); border-left-color: var(--gray-400); }
.scrollspy-nav .nav-link.active {
  color: var(--accent-fg);
  font-weight: 600;
  border-left-color: var(--brand-600);
  background: transparent;
}
.scrollspy-nav .nav-link.nested { padding-left: 24px; font-size: var(--fs-xs); }

/* ═════════════════════════════════════════════════════════════════════════
   65. SELECT2-STYLE (single + multi, avec recherche, dropdown stylé)
   ═════════════════════════════════════════════════════════════════════════ */
.select2 {
  position: relative;
  width: 100%;
}

/* Control (le faux input) */
.select2__control {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
  padding: 4px 32px 4px 8px;
  min-height: var(--control-h-md);
  background: var(--app-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.select2.is-open .select2__control { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.select2.is-disabled .select2__control { background: var(--gray-100); cursor: not-allowed; color: var(--gray-500); }

.select2__placeholder {
  color: var(--gray-500);
  font-size: var(--fs-base);
  padding: 2px 4px;
}
.select2__value {
  font-size: var(--fs-base);
  color: var(--gray-950);
  padding: 2px 4px;
}
.select2__value-meta {
  display: inline-flex; align-items: center; gap: 6px;
}

/* Chips dans le control (mode multi) */
.select2__chips {
  display: contents;
}
.select2__chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 8px;
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
}
.select2__chip-remove {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--accent-fg);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.select2__chip-remove:hover { background: var(--brand-200); color: var(--brand-900); }

/* Caret (chevron à droite) */
.select2__caret {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 14px;
  pointer-events: none;
  transition: transform var(--t-fast);
}
.select2.is-open .select2__caret { transform: translateY(-50%) rotate(180deg); }

/* Clear button (croix) */
.select2__clear {
  position: absolute; right: 28px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 12px;
}
.select2__clear:hover { background: var(--gray-100); color: var(--gray-900); }

/* Dropdown */
.select2__dropdown {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
  display: none;
}
.select2.is-open .select2__dropdown { display: block; }

.select2__search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.select2__search-wrap > i {
  position: absolute; left: 18px;
  color: var(--gray-500);
}
.select2__search-input {
  flex: 1;
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 28px;
  font-size: var(--fs-sm);
  background: var(--app-surface);
  color: var(--gray-950);
  outline: none;
}
.select2__search-input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }

.select2__options {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.select2__group-label {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500);
  padding: 6px 10px 2px;
}
.select2__option {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--gray-800);
  cursor: pointer;
  user-select: none;
}
.select2__option:hover, .select2__option.is-active {
  background: var(--gray-100);
  color: var(--gray-950);
}
.select2__option.is-selected {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 500;
}
.select2__option.is-selected i.bi-check { margin-left: auto; color: var(--brand-600); }
.select2__option.is-disabled { color: var(--gray-400); cursor: not-allowed; }
.select2__option-meta { font-size: var(--fs-xs); color: var(--gray-500); margin-left: auto; }
.select2__option-avatar { flex-shrink: 0; }
.select2__option-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.select2__empty {
  padding: 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: var(--fs-sm);
}

.select2__footer {
  padding: 6px 10px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--gray-600);
}
.select2__footer a, .select2__footer button {
  color: var(--accent-fg);
  background: transparent;
  border: none;
  padding: 0;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.select2__footer a:hover, .select2__footer button:hover { text-decoration: underline; }

/* Tailles */
.select2--sm .select2__control { min-height: var(--control-h-sm); font-size: var(--fs-sm); }
.select2--lg .select2__control { min-height: var(--control-h-lg); font-size: var(--fs-md); }

/* ═════════════════════════════════════════════════════════════════════════
   66. INTERNATIONAL PHONE INPUT
   ═════════════════════════════════════════════════════════════════════════ */
.phone-input {
  display: flex; align-items: stretch;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.phone-input:focus-within { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }

.phone-input__country {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px;
  background: var(--app-surface-muted);
  border: none;
  border-right: 1px solid var(--app-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  cursor: pointer;
  color: var(--gray-900);
  font-size: var(--fs-base);
  white-space: nowrap;
  transition: background var(--t-fast);
}
.phone-input__country:hover { background: var(--gray-100); }
.phone-input.is-open .phone-input__country { background: var(--gray-100); }

.phone-input__flag {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}
.phone-input__code {
  font-variant-numeric: tabular-nums;
  color: var(--gray-700);
  font-weight: 500;
}
.phone-input__caret {
  font-size: 10px;
  color: var(--gray-500);
  transition: transform var(--t-fast);
}
.phone-input.is-open .phone-input__caret { transform: rotate(180deg); }

.phone-input__field {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 12px;
  background: transparent;
  font-size: var(--fs-base);
  color: var(--gray-950);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.phone-input__field::placeholder { color: var(--gray-500); }

/* Dropdown du sélecteur de pays */
.phone-input__dropdown {
  position: absolute;
  top: calc(100% + 4px); left: 0;
  width: 320px; max-width: 100%;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
  display: none;
}
.phone-input.is-open .phone-input__dropdown { display: block; }

.phone-input__search {
  padding: 8px;
  border-bottom: 1px solid var(--app-border);
  position: relative;
}
.phone-input__search > i {
  position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}
.phone-input__search input {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 28px;
  font-size: var(--fs-sm);
  background: var(--app-surface);
  color: var(--gray-950);
  outline: none;
}
.phone-input__search input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }

.phone-input__list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.phone-input__group-label {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500);
  padding: 6px 10px 2px;
}
.phone-input__country-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--gray-800);
  cursor: pointer;
}
.phone-input__country-item:hover, .phone-input__country-item.is-active {
  background: var(--gray-100);
  color: var(--gray-950);
}
.phone-input__country-item.is-selected { background: var(--brand-50); color: var(--brand-800); font-weight: 500; }
.phone-input__country-item .phone-input__flag { font-size: 16px; }
.phone-input__country-item .phone-input__code {
  margin-left: auto;
  color: var(--gray-500);
  font-size: var(--fs-xs);
}
.phone-input__country-item.is-selected .phone-input__code { color: var(--accent-fg); }
.phone-input__country-name {
  flex-grow: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Tailles */
.phone-input--sm { min-height: var(--control-h-sm); }
.phone-input--sm .phone-input__country, .phone-input--sm .phone-input__field { font-size: var(--fs-sm); padding-top: 4px; padding-bottom: 4px; }

/* ═════════════════════════════════════════════════════════════════════════
   67. GPS PICKER (carte + sélecteur de point/polygone, 3 couches)
   ═════════════════════════════════════════════════════════════════════════ */

/* — Input compact (lat/lng + bouton "ouvrir sur carte") — */
.gps-input {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.gps-input:focus-within { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.gps-input__field {
  flex: 1;
  border: none; outline: none;
  padding: 6px 12px;
  background: transparent;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  color: var(--gray-950);
  min-width: 0;
}
.gps-input__field--lat { border-right: 1px solid var(--app-border); }
.gps-input__field::placeholder { color: var(--gray-500); }
.gps-input__btn {
  background: var(--app-surface-muted);
  border: none;
  border-left: 1px solid var(--app-border);
  padding: 0 12px;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm);
  transition: background var(--t-fast);
}
.gps-input__btn:hover { background: var(--gray-100); color: var(--gray-950); }

/* — Picker complet (carte + chrome) — */
.gps-picker {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Toolbar du haut */
.gps-picker__toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  flex-wrap: wrap;
}
.gps-picker__toolbar .vr {
  width: 1px; height: 20px;
  background: var(--app-border);
  margin: 0 2px;
}

/* Switcher de tuiles (3 couches) */
.gps-layers {
  display: inline-flex;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--app-surface);
}
.gps-layers__btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: var(--fs-sm);
  color: var(--gray-700);
  cursor: pointer;
  border-right: 1px solid var(--app-border);
  transition: all var(--t-fast);
}
.gps-layers__btn:last-child { border-right: none; }
.gps-layers__btn:hover { background: var(--gray-100); color: var(--gray-950); }
.gps-layers__btn.is-active {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 600;
}
.gps-layers__btn i { font-size: 14px; }

/* Outils de dessin */
.gps-tools {
  display: inline-flex;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--app-surface);
}
.gps-tools__btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  border-right: 1px solid var(--app-border);
  transition: all var(--t-fast);
}
.gps-tools__btn:last-child { border-right: none; }
.gps-tools__btn:hover { background: var(--gray-100); color: var(--gray-950); }
.gps-tools__btn.is-active {
  background: var(--brand-600);
  color: #fff;
}

/* La zone carte */
.gps-picker__map {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  cursor: crosshair;
}

/* ─── Backgrounds mock pour les 3 couches (à remplacer par Leaflet/Mapbox) ─── */

/* Standard (rues, light) */
.gps-picker__map[data-layer="standard"] {
  background-color: oklch(96% 0.015 90);
  background-image:
    /* Eau (rivière diagonale) */
    linear-gradient(115deg, transparent 38%, oklch(82% 0.05 230) 40%, oklch(82% 0.05 230) 45%, transparent 47%),
    /* Parcs (blobs verts) */
    radial-gradient(ellipse 18% 22% at 22% 28%, oklch(86% 0.08 145), transparent 60%),
    radial-gradient(ellipse 12% 14% at 76% 64%, oklch(86% 0.08 145), transparent 60%),
    /* Quartiers (gris) */
    radial-gradient(ellipse 24% 16% at 55% 35%, oklch(90% 0.005 90), transparent 70%),
    radial-gradient(ellipse 20% 14% at 30% 78%, oklch(90% 0.005 90), transparent 70%),
    /* Grille routes */
    repeating-linear-gradient(0deg, transparent 0, transparent 50px, oklch(78% 0.01 90) 50px, oklch(78% 0.01 90) 51px),
    repeating-linear-gradient(90deg, transparent 0, transparent 50px, oklch(78% 0.01 90) 50px, oklch(78% 0.01 90) 51px);
}

/* Satellite (sombre, vert/marron) */
.gps-picker__map[data-layer="satellite"] {
  background-color: oklch(28% 0.04 135);
  background-image:
    radial-gradient(ellipse 30% 35% at 28% 30%, oklch(38% 0.06 130), transparent 60%),
    radial-gradient(ellipse 24% 30% at 72% 68%, oklch(32% 0.05 70), transparent 65%),
    radial-gradient(ellipse 16% 20% at 50% 50%, oklch(45% 0.08 140), transparent 70%),
    /* Eau */
    linear-gradient(115deg, transparent 38%, oklch(35% 0.08 230) 40%, oklch(35% 0.08 230) 45%, transparent 47%),
    /* Texture grain */
    radial-gradient(circle at 15% 80%, oklch(22% 0.03 130), transparent 30%);
}
.gps-picker__map[data-layer="satellite"] .gps-picker__attr,
.gps-picker__map[data-layer="satellite"] .gps-picker__scale { color: rgba(255,255,255,.85); }

/* Topo (beige + contours) */
.gps-picker__map[data-layer="topo"] {
  background-color: oklch(94% 0.03 80);
  background-image:
    /* Contours topographiques */
    repeating-radial-gradient(circle at 35% 45%, transparent 0, transparent 26px, oklch(75% 0.08 50) 26px, oklch(75% 0.08 50) 27px),
    repeating-radial-gradient(circle at 70% 65%, transparent 0, transparent 22px, oklch(75% 0.08 50) 22px, oklch(75% 0.08 50) 23px),
    /* Eau */
    linear-gradient(115deg, transparent 38%, oklch(78% 0.06 220) 40%, oklch(78% 0.06 220) 45%, transparent 47%);
}

/* Markers de point */
.gps-marker {
  position: absolute;
  width: 24px; height: 32px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.gps-marker::before {
  content: "";
  position: absolute; left: 50%; bottom: 0;
  width: 24px; height: 24px;
  transform: translateX(-50%);
  background: var(--brand-600);
  border: 2px solid #fff;
  border-radius: 50%;
}
.gps-marker::after {
  content: "";
  position: absolute; left: 50%; bottom: -2px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--brand-600);
}
.gps-marker--danger::before { background: var(--danger-500); }
.gps-marker--danger::after { border-top-color: var(--danger-500); }
.gps-marker--success::before { background: var(--success-500); }
.gps-marker--success::after { border-top-color: var(--success-500); }
.gps-marker__label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--gray-50);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: 600;
}

/* Polygone tracé (SVG overlay) */
.gps-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.gps-polygon {
  fill: color-mix(in oklch, var(--brand-500) 25%, transparent);
  stroke: var(--brand-600);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}
.gps-polyline {
  fill: none;
  stroke: var(--brand-600);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gps-circle {
  fill: color-mix(in oklch, var(--brand-500) 15%, transparent);
  stroke: var(--brand-600);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}
.gps-vertex {
  fill: #fff;
  stroke: var(--brand-600);
  stroke-width: 2;
}

/* Contrôles flottants sur la carte */
.gps-picker__zoom {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.gps-picker__zoom-btn {
  width: 32px; height: 32px;
  background: var(--app-surface);
  border: none;
  border-bottom: 1px solid var(--app-border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-800);
  cursor: pointer;
  font-size: 14px;
  transition: background var(--t-fast);
}
.gps-picker__zoom-btn:last-child { border-bottom: none; }
.gps-picker__zoom-btn:hover { background: var(--gray-100); }

/* Recherche overlay */
.gps-picker__search {
  position: absolute; top: 12px; left: 12px;
  width: 280px; max-width: calc(100% - 80px);
  display: flex; align-items: center; gap: 6px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 4px 8px 4px 30px;
  box-shadow: var(--shadow-md);
  position: absolute;
}
.gps-picker__search > i {
  position: absolute; left: 10px;
  color: var(--gray-500);
}
.gps-picker__search input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--gray-950);
  padding: 4px 0;
}

/* Localiser (bouton en bas-droite) */
.gps-picker__locate {
  position: absolute; bottom: 36px; right: 12px;
  width: 36px; height: 36px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-fg);
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--t-fast);
}
.gps-picker__locate:hover { background: var(--brand-50); color: var(--brand-800); }

/* Échelle (bas-gauche) */
.gps-picker__scale {
  position: absolute; bottom: 12px; left: 12px;
  font-size: 10px;
  color: var(--gray-800);
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(255, 255, 255, .85);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 6px;
}
.gps-picker__scale::after {
  content: "";
  width: 40px; height: 8px;
  border-left: 2px solid var(--gray-900);
  border-right: 2px solid var(--gray-900);
  border-bottom: 2px solid var(--gray-900);
}

/* Attribution */
.gps-picker__attr {
  position: absolute; bottom: 4px; right: 56px;
  font-size: 9px;
  color: var(--gray-700);
  background: rgba(255, 255, 255, .7);
  padding: 1px 5px;
  border-radius: 2px;
}

/* Footer (coordonnées + actions) */
.gps-picker__footer {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  font-size: var(--fs-sm);
  flex-wrap: wrap;
}
.gps-picker__coord-group {
  display: inline-flex; align-items: center; gap: 6px;
}
.gps-picker__coord-label {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-600);
}
.gps-picker__coord-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--gray-950);
  font-weight: 500;
}

/* Liste des points placés (cas point multi ou vertices d'un polygone) */
.gps-points-list {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--fs-sm);
}
.gps-points-list__item {
  display: grid;
  grid-template-columns: 24px 1fr auto 32px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--app-border);
}
.gps-points-list__item:last-child { border-bottom: none; }
.gps-points-list__item:hover { background: var(--app-surface-muted); }
.gps-points-list__index {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.gps-points-list__coord {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--gray-800);
}
.gps-points-list__name { font-weight: 500; color: var(--gray-950); }
.gps-points-list__meta { font-size: var(--fs-xs); color: var(--gray-600); font-family: var(--font-mono); }

/* ═════════════════════════════════════════════════════════════════════════
   68. NUMBER STEPPER (input quantité avec +/-)
   ═════════════════════════════════════════════════════════════════════════ */
.qty-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.qty-stepper:focus-within { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.qty-stepper__btn {
  width: 30px;
  background: var(--app-surface-muted);
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.qty-stepper__btn:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-950); }
.qty-stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper__btn--minus { border-right: 1px solid var(--app-border); }
.qty-stepper__btn--plus { border-left: 1px solid var(--app-border); }
.qty-stepper__input {
  width: 48px;
  text-align: center;
  border: none; outline: none;
  background: transparent;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--gray-950);
  -moz-appearance: textfield;
}
.qty-stepper__input::-webkit-outer-spin-button,
.qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.qty-stepper--sm .qty-stepper__btn { width: 24px; font-size: 12px; }
.qty-stepper--sm .qty-stepper__input { width: 36px; font-size: var(--fs-sm); }
.qty-stepper--lg .qty-stepper__btn { width: 36px; font-size: 16px; }
.qty-stepper--lg .qty-stepper__input { width: 56px; font-size: var(--fs-md); }

/* ═════════════════════════════════════════════════════════════════════════
   69. E-COMMERCE / SHOPPING
   ═════════════════════════════════════════════════════════════════════════ */

/* ─── Product card (grid) ─── */
.product-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all var(--t-base);
  position: relative;
}
.product-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--app-surface-muted);
  overflow: hidden;
}
.product-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.product-card__wishlist {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(4px);
  transition: all var(--t-fast);
}
.product-card__wishlist:hover, .product-card__wishlist.is-active { color: var(--danger-500); }
.product-card__wishlist.is-active i.bi { font-weight: bold; }

.product-card__quick-add {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--t-base);
}
.product-card:hover .product-card__quick-add { opacity: 1; transform: translateY(0); }
.product-card__quick-add .btn {
  width: 100%;
  background: var(--gray-950);
  color: var(--gray-50);
  border-color: var(--gray-950);
}
.product-card__quick-add .btn:hover { background: var(--brand-600); border-color: var(--brand-600); }

.product-card__body { padding: 12px 14px; flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card__category {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
}
.product-card__title {
  font-size: var(--fs-base); font-weight: 600;
  color: var(--gray-950);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.product-card__rating {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs);
  color: var(--gray-600);
}
.product-card__rating .stars { color: var(--warning-500); }

/* Prix */
.price {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.price__current {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--gray-950);
}
.price__current--discount { color: var(--danger-600); }
.price__old {
  font-size: var(--fs-sm);
  color: var(--gray-500);
  text-decoration: line-through;
}
.price__discount {
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--danger-100);
  color: var(--danger-600);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}
.price--lg .price__current { font-size: var(--fs-2xl); }
.price--lg .price__old { font-size: var(--fs-md); }
.price__per { font-size: var(--fs-xs); color: var(--gray-500); }

/* Star rating */
.star-rating {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: var(--fs-sm);
  color: var(--warning-500);
}
.star-rating .empty { color: var(--gray-400); }
.star-rating__count { color: var(--gray-600); font-size: var(--fs-xs); margin-left: 4px; }

/* Badges produit */
.product-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.product-badge--new { background: var(--brand-600); color: #fff; }
.product-badge--sale { background: var(--danger-600); color: #fff; }
.product-badge--exclusive { background: var(--gray-900); color: var(--gray-50); }
.product-badge--limited { background: var(--warning-500); color: oklch(25% .15 var(--status-warning-hue)); }
.product-badge--bestseller { background: var(--success-600); color: #fff; }

/* Swatches : couleur */
.swatches { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--app-surface);
  outline: 1px solid var(--gray-300);
  cursor: pointer;
  position: relative;
  transition: all var(--t-fast);
}
.swatch:hover { outline-color: var(--gray-500); }
.swatch.is-active {
  outline: 2px solid var(--brand-600);
  outline-offset: 1px;
}
.swatch--more {
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gray-300);
  outline: none;
}

/* Swatches : taille (pills) */
.size-swatches { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.size-swatch {
  min-width: 36px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--gray-300);
  background: var(--app-surface);
  color: var(--gray-800);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.size-swatch:hover:not(:disabled) { border-color: var(--gray-500); }
.size-swatch.is-active {
  background: var(--gray-950);
  border-color: var(--gray-950);
  color: var(--gray-50);
}
.size-swatch:disabled, .size-swatch.is-out {
  color: var(--gray-400);
  text-decoration: line-through;
  cursor: not-allowed;
  background: var(--gray-50);
}

/* ─── Cart : ligne (item) ─── */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--app-border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item__media {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--app-surface-muted);
  flex-shrink: 0;
}
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__body { min-width: 0; }
.cart-item__title { font-size: var(--fs-base); font-weight: 600; color: var(--gray-950); margin: 0; }
.cart-item__variant { font-size: var(--fs-xs); color: var(--gray-600); margin: 2px 0 0; }
.cart-item__price { font-weight: 600; color: var(--gray-950); white-space: nowrap; }
.cart-item__remove {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-item__remove:hover { background: var(--danger-100); color: var(--danger-600); }
@media (max-width: 575.98px) {
  .cart-item { grid-template-columns: 56px 1fr; }
  .cart-item__price, .cart-item__remove { grid-column: 2; justify-self: start; }
}

/* ─── Cart summary ─── */
.cart-summary {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.cart-summary__row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm);
  padding: 6px 0;
  color: var(--gray-700);
}
.cart-summary__row--total {
  border-top: 1px solid var(--app-border);
  padding-top: 12px; margin-top: 8px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--gray-950);
}
.cart-summary__row strong { color: var(--gray-950); }
.cart-summary__row--discount { color: var(--success-600); }

/* ─── Product gallery (main + thumbnails) ─── */
.product-gallery {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
}
.product-gallery__main {
  aspect-ratio: 1 / 1;
  background: var(--app-surface-muted);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--app-border);
}
.product-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery__thumbs { display: flex; flex-direction: column; gap: 8px; }
.product-gallery__thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.product-gallery__thumb:hover { border-color: var(--gray-400); }
.product-gallery__thumb.is-active { border-color: var(--brand-600); border-width: 2px; }
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Delivery options (radio cards) ─── */
.delivery-options {
  display: flex; flex-direction: column; gap: 8px;
}
.delivery-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  cursor: pointer;
  transition: all var(--t-fast);
}
.delivery-option:hover { border-color: var(--gray-400); }
.delivery-option.is-active {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 1px var(--brand-500);
}
[data-bs-theme="dark"] .delivery-option.is-active { background: color-mix(in oklch, var(--brand-500) 12%, transparent); }
.delivery-option input[type="radio"] { margin: 0; }
.delivery-option__title { font-weight: 600; color: var(--gray-950); font-size: var(--fs-base); }
.delivery-option__meta { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 2px; }
.delivery-option__icon { font-size: 20px; color: var(--gray-600); }
.delivery-option.is-active .delivery-option__icon { color: var(--accent-fg); }
.delivery-option__price { font-weight: 600; color: var(--gray-950); white-space: nowrap; }
.delivery-option__price--free { color: var(--success-600); }

/* ═════════════════════════════════════════════════════════════════════════
   70. DELIVERY MAP (zones tarifaires, points relais)
   ═════════════════════════════════════════════════════════════════════════ */
.delivery-map { position: relative; }
.delivery-zone {
  fill-opacity: .25;
  stroke-width: 2;
  stroke-dasharray: 4 3;
  transition: fill-opacity var(--t-fast);
  cursor: pointer;
}
.delivery-zone:hover { fill-opacity: .4; }
.delivery-zone--free { fill: var(--success-500); stroke: var(--success-600); }
.delivery-zone--standard { fill: var(--brand-500); stroke: var(--brand-600); }
.delivery-zone--express { fill: var(--warning-500); stroke: var(--warning-600); }
.delivery-zone--unavailable { fill: var(--gray-500); stroke: var(--gray-600); stroke-dasharray: 2 2; }

/* Légende */
.delivery-legend {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  position: absolute; top: 12px; right: 12px;
  font-size: var(--fs-xs);
  box-shadow: var(--shadow-md);
}
.delivery-legend__title {
  font-weight: 600; color: var(--gray-950);
  margin-bottom: 2px;
}
.delivery-legend__item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gray-700);
}
.delivery-legend__swatch {
  width: 12px; height: 12px;
  border-radius: 2px;
  border: 1.5px solid;
}
.delivery-legend__swatch--free { background: color-mix(in oklch, var(--success-500) 25%, transparent); border-color: var(--success-600); }
.delivery-legend__swatch--standard { background: color-mix(in oklch, var(--brand-500) 25%, transparent); border-color: var(--brand-600); }
.delivery-legend__swatch--express { background: color-mix(in oklch, var(--warning-500) 25%, transparent); border-color: var(--warning-600); }

/* Point relais sur carte */
.relay-point {
  position: absolute;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--app-surface);
  border: 2px solid var(--brand-600);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.relay-point.is-active { background: var(--brand-600); color: #fff; transform: translate(-50%, -50%) scale(1.15); }
.relay-point:hover { transform: translate(-50%, -50%) scale(1.1); }

/* ═════════════════════════════════════════════════════════════════════════
   71. PUBLIC NAVBAR (marketing top nav horizontal)
   ═════════════════════════════════════════════════════════════════════════ */
.public-nav {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  position: sticky; top: 0; z-index: 100;
}
.public-nav__container {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center;
  gap: 16px;
  height: 64px;
}
.public-nav__brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 700;
  color: var(--gray-950);
  text-decoration: none;
  margin-right: 8px;
  white-space: nowrap;
}
.public-nav__brand-mark {
  width: 28px; height: 28px;
  background: var(--brand-600);
  color: #fff;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.public-nav__menu {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
  margin: 0; padding: 0;
}
.public-nav__menu > li { position: relative; }
.public-nav__link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--t-fast);
  white-space: nowrap;
}
.public-nav__link:hover { color: var(--gray-950); background: var(--gray-100); }
.public-nav__link.is-active { color: var(--accent-fg); font-weight: 600; }
.public-nav__link i.bi-chevron-down { font-size: 10px; opacity: .7; transition: transform var(--t-fast); }
.public-nav__menu > li:hover > .public-nav__link i.bi-chevron-down { transform: rotate(180deg); }

.public-nav__cta {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}

/* Mega menu */
.mega-menu {
  position: absolute;
  top: 100%; left: 0;
  width: 720px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 16px;
  display: none;
  z-index: 80;
}
.public-nav__menu > li:hover > .mega-menu,
.public-nav__menu > li.is-open > .mega-menu { display: grid; }
.mega-menu {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.mega-menu__col h6 {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  margin: 0 0 6px;
}
.mega-menu__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--gray-800);
  transition: background var(--t-fast);
}
.mega-menu__item:hover { background: var(--gray-100); color: var(--gray-950); }
.mega-menu__item-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.mega-menu__item-title { font-weight: 600; font-size: var(--fs-sm); }
.mega-menu__item-desc { font-size: var(--fs-xs); color: var(--gray-600); }
.mega-menu__featured {
  grid-column: 3;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.mega-menu__featured h4 { color: #fff; font-size: var(--fs-md); margin: 0 0 4px; }
.mega-menu__featured p { color: rgba(255,255,255,.85); font-size: var(--fs-xs); margin: 0 0 12px; }

/* Cart icon avec badge */
.cart-icon {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  border: none;
  font-size: 18px;
  transition: all var(--t-fast);
}
.cart-icon:hover { background: var(--gray-100); color: var(--gray-950); }
.cart-icon__badge {
  position: absolute; top: 0; right: 0;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--danger-500); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--app-surface);
}

/* Mobile hamburger */
.public-nav__hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--gray-800);
  align-items: center; justify-content: center;
  font-size: 20px;
}
@media (max-width: 991.98px) {
  .public-nav__menu, .public-nav__cta > *:not(.cart-icon):not(.public-nav__hamburger) { display: none; }
  .public-nav__hamburger { display: inline-flex; }
  .mega-menu { display: none !important; }
}

/* ═════════════════════════════════════════════════════════════════════════
   72. IMAGE LIGHTBOX + ZOOM
   ═════════════════════════════════════════════════════════════════════════ */
.lightbox-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 15, .92);
  z-index: 1090;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
  padding: 32px;
  gap: 16px;
  backdrop-filter: blur(8px);
}
.lightbox-backdrop.is-open { display: flex; }
.lightbox__close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.lightbox__close:hover { background: rgba(255, 255, 255, .18); }
.lightbox__nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.lightbox__nav:hover { background: rgba(255, 255, 255, .18); }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }
.lightbox__stage {
  flex: 1; max-width: 90vw; max-height: 75vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.lightbox__image {
  width: min(80vw, 900px); height: min(70vh, 620px);
  max-width: 100%; max-height: 100%;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  border-radius: var(--radius-md);
  cursor: zoom-in;
  transition: transform var(--t-base);
  user-select: none;
}
.lightbox__image.is-zoomed { cursor: zoom-out; transform: scale(2); }
.lightbox__caption {
  color: rgba(255, 255, 255, .85);
  font-size: var(--fs-sm);
  text-align: center;
  max-width: 600px;
}
.lightbox__counter {
  color: rgba(255, 255, 255, .6);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.lightbox__thumbs {
  display: flex; gap: 6px;
  justify-content: center; flex-wrap: wrap;
  max-width: 90vw;
}
.lightbox__thumb {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: .5;
  border: 2px solid transparent;
  transition: all var(--t-fast);
  background: var(--gray-800);
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .8; }
.lightbox__thumb.is-active { opacity: 1; border-color: #fff; }
.lightbox__zoom-controls {
  position: absolute; bottom: 12px; right: 12px;
  display: flex; gap: 4px;
  background: rgba(0, 0, 0, .6);
  border-radius: var(--radius-md);
  padding: 4px;
}
.lightbox__zoom-controls button {
  width: 32px; height: 32px;
  background: transparent; border: none; color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox__zoom-controls button:hover { background: rgba(255, 255, 255, .15); }

/* Trigger : image zoomable au survol (sur les images produit) */
.zoomable {
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.zoomable img { transition: transform var(--t-slow); display: block; }
.zoomable:hover img { transform: scale(1.5); }
.zoomable__hint {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, .6);
  color: #fff; font-size: var(--fs-xs);
  padding: 3px 8px; border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.zoomable:hover .zoomable__hint { opacity: 1; }

/* ═════════════════════════════════════════════════════════════════════════
   73. VIDEO PLAYER (custom HTML5)
   ═════════════════════════════════════════════════════════════════════════ */
.video-player {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-player__poster {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.video-player video {
  width: 100%; height: 100%;
  display: block;
}
.video-player__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(0,0,0,.1) 0%, rgba(0,0,0,.4) 70%, rgba(0,0,0,.8) 100%);
  transition: opacity var(--t-base);
  z-index: 2;
}
.video-player.is-playing .video-player__overlay { opacity: 0; pointer-events: none; }
.video-player__play {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  border: none;
  color: var(--gray-950);
  font-size: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: all var(--t-fast);
  padding-left: 4px;
}
.video-player__play:hover { background: #fff; transform: scale(1.05); }
.video-player__title {
  position: absolute; top: 16px; left: 16px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  z-index: 3;
}
.video-player__duration {
  position: absolute; bottom: 16px; right: 16px;
  background: rgba(0, 0, 0, .7);
  color: #fff; font-size: var(--fs-xs);
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  z-index: 3;
}
/* Controls bar */
.video-player__controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 30px 16px 12px;
  display: flex; flex-direction: column; gap: 6px;
  color: #fff;
  z-index: 3;
  opacity: 1;
  transition: opacity var(--t-base);
}
.video-player.is-playing:not(:hover) .video-player__controls { opacity: 0; }
.video-player__progress {
  height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.video-player__progress-fill {
  height: 100%;
  background: var(--brand-500);
  border-radius: 999px;
  position: relative;
}
.video-player__progress-fill::after {
  content: "";
  position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--brand-500);
}
.video-player__bottom {
  display: flex; align-items: center; gap: 8px;
}
.video-player__btn {
  background: transparent; border: none;
  color: #fff;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.video-player__btn:hover { background: rgba(255, 255, 255, .15); }
.video-player__time {
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  opacity: .9;
}
.video-player__volume {
  width: 60px; height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 999px;
  position: relative;
}
.video-player__volume-fill {
  height: 100%;
  background: #fff;
  border-radius: 999px;
}
.video-player__spacer { flex: 1; }
.video-player__speed-pill {
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

/* ═════════════════════════════════════════════════════════════════════════
   74. CATEGORY CARDS + SUB-CATEGORY NAV
   ═════════════════════════════════════════════════════════════════════════ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  display: flex; flex-direction: column;
  transition: all var(--t-base);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-card__media {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.category-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.category-card:hover .category-card__media img { transform: scale(1.06); }
.category-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.7));
}
.category-card__body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  color: #fff;
}
.category-card__title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin: 0;
  letter-spacing: -.01em;
}
.category-card__count {
  font-size: var(--fs-xs);
  opacity: .85;
  display: block;
  margin-top: 2px;
}
/* Variant : carte simple (light bg, sans image dominante) */
.category-card--simple {
  background: var(--app-surface);
  aspect-ratio: auto;
  padding: 16px;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.category-card--simple .category-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.category-card--simple .category-card__title { color: var(--gray-950); }
.category-card--simple .category-card__count { color: var(--gray-600); }
.category-card--simple .category-card__overlay,
.category-card--simple .category-card__media { display: none; }

/* Sub-category nav (chips horizontaux scrollables) */
.subcat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.subcat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--gray-800);
  font-size: var(--fs-sm); font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.subcat-chip:hover { border-color: var(--gray-400); color: var(--gray-950); }
.subcat-chip.is-active {
  background: var(--gray-950);
  border-color: var(--gray-950);
  color: var(--gray-50);
}
.subcat-chip__count {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 10px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.subcat-chip.is-active .subcat-chip__count {
  background: color-mix(in srgb, var(--gray-50) 15%, transparent);
  color: var(--gray-50);
}

/* ═════════════════════════════════════════════════════════════════════════
   75. CHARTS AVANCÉS (bar / line / area en SVG inline)
   ═════════════════════════════════════════════════════════════════════════ */
.chart {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.chart__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.chart__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-950); margin: 0; }
.chart__subtitle { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 2px; }
.chart__total { font-size: var(--fs-2xl); font-weight: 700; color: var(--gray-950); font-variant-numeric: tabular-nums; line-height: 1; margin-top: 4px; letter-spacing: -.01em; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__grid line { stroke: var(--app-border); stroke-width: 1; stroke-dasharray: 2 3; }
.chart__axis text { font-size: 10px; fill: var(--gray-500); font-family: var(--font-sans); }
.chart__bar { fill: var(--brand-500); transition: fill var(--t-fast); }
.chart__bar:hover { fill: var(--brand-700); }
.chart__bar--muted { fill: var(--gray-200); }
.chart__bar--success { fill: var(--success-500); }
.chart__bar--danger { fill: var(--danger-500); }
.chart__line {
  fill: none;
  stroke: var(--brand-500);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart__line--dashed { stroke-dasharray: 4 3; opacity: .6; }
.chart__area { fill: url(#chartGradient); opacity: .4; }
.chart__point { fill: var(--brand-600); stroke: var(--app-surface); stroke-width: 2; }
.chart__legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--gray-700);
  margin-top: 12px;
}
.chart__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart__legend-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}

/* ═════════════════════════════════════════════════════════════════════════
   76. ORDER TRACKING (timeline horizontale e-commerce)
   ═════════════════════════════════════════════════════════════════════════ */
.order-tracking {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.order-tracking__header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.order-tracking__number {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--gray-700);
}
.order-tracking__status-badge {
  background: var(--brand-50);
  color: var(--brand-800);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.order-tracking__eta {
  font-size: var(--fs-sm);
  color: var(--gray-700);
  margin-left: auto;
}
.order-tracking__eta strong { color: var(--gray-950); }

.order-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  padding: 16px 0;
}
.order-step {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: 8px;
  padding: 0 8px;
}
.order-step::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -50%; right: 50%;
  height: 3px;
  background: var(--gray-200);
  z-index: 0;
}
.order-step:first-child::before { display: none; }
.order-step--done::before, .order-step--active::before { background: var(--brand-500); }
.order-step__bullet {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--app-surface);
  border: 2px solid var(--gray-300);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--gray-500);
  position: relative;
  z-index: 1;
}
.order-step--done .order-step__bullet {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.order-step--active .order-step__bullet {
  border-color: var(--brand-600);
  color: var(--brand-700);
  background: var(--brand-50);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-500) 20%, transparent);
  animation: order-pulse 2s ease-in-out infinite;
}
@keyframes order-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand-500) 20%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in oklch, var(--brand-500) 5%, transparent); }
}
.order-step--failed .order-step__bullet {
  background: var(--danger-100);
  border-color: var(--danger-500);
  color: var(--danger-600);
}
.order-step__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gray-700);
}
.order-step--done .order-step__label, .order-step--active .order-step__label { color: var(--gray-950); }
.order-step__time {
  font-size: var(--fs-xs);
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.order-tracking__detail {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}
.order-tracking__detail-item .label {
  font-size: var(--fs-xs); color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.order-tracking__detail-item .value { font-size: var(--fs-sm); color: var(--gray-950); font-weight: 500; }

@media (max-width: 575.98px) {
  .order-steps { grid-template-columns: 1fr; gap: 12px; }
  .order-step { flex-direction: row; align-items: flex-start; text-align: left; }
  .order-step::before { display: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   77. STOCK INDICATOR
   ═════════════════════════════════════════════════════════════════════════ */
.stock-indicator {
  font-size: var(--fs-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.stock-indicator__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.stock-indicator--high .stock-indicator__label { color: var(--success-600); }
.stock-indicator--medium .stock-indicator__label { color: var(--warning-600); }
.stock-indicator--low .stock-indicator__label { color: var(--danger-600); }
.stock-indicator--out .stock-indicator__label { color: var(--gray-600); }
.stock-indicator__label::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.stock-indicator__bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.stock-indicator__bar-fill {
  height: 100%;
  background: var(--success-500);
  border-radius: 999px;
  transition: width var(--t-slow);
}
.stock-indicator--medium .stock-indicator__bar-fill { background: var(--warning-500); }
.stock-indicator--low .stock-indicator__bar-fill { background: var(--danger-500); }

.stock-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs);
  color: var(--gray-700);
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.stock-pulse::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success-500);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--success-500) 30%, transparent);
}

/* ═════════════════════════════════════════════════════════════════════════
   78. REVIEWS (avis détaillés clients)
   ═════════════════════════════════════════════════════════════════════════ */
.reviews-summary {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  align-items: center;
}
.reviews-summary__overall { text-align: center; }
.reviews-summary__score {
  font-size: var(--fs-5xl);
  font-weight: 700;
  color: var(--gray-950);
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reviews-summary__max { font-size: var(--fs-xl); color: var(--gray-500); font-weight: 500; }
.reviews-summary__stars { margin: 8px 0 4px; font-size: 18px; color: var(--warning-500); }
.reviews-summary__count { font-size: var(--fs-sm); color: var(--gray-600); }
.reviews-summary__bars {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 6px 10px;
  align-items: center;
  font-size: var(--fs-sm);
}
.reviews-summary__bar-label {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--gray-700);
}
.reviews-summary__bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.reviews-summary__bar-fill {
  height: 100%;
  background: var(--warning-500);
  border-radius: 999px;
}
.reviews-summary__bar-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gray-600);
  font-size: var(--fs-xs);
}
@media (max-width: 575.98px) {
  .reviews-summary { grid-template-columns: 1fr; }
}

.review {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.review__head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.review__author { flex-grow: 1; }
.review__author-name {
  font-weight: 600;
  color: var(--gray-950);
  font-size: var(--fs-base);
  display: inline-flex; align-items: center; gap: 6px;
}
.review__author-meta {
  font-size: var(--fs-xs);
  color: var(--gray-600);
  margin-top: 2px;
}
.review__verified {
  font-size: 10px;
  background: var(--success-100);
  color: var(--success-600);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
}
.review__stars {
  font-size: var(--fs-sm);
  color: var(--warning-500);
}
.review__stars .empty { color: var(--gray-400); }
.review__title {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--gray-950);
  margin: 4px 0 6px;
}
.review__body {
  font-size: var(--fs-sm);
  color: var(--gray-800);
  line-height: 1.6;
  margin: 0;
}
.review__photos {
  display: flex; gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.review__photo {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  cursor: pointer;
}
.review__photo img { width: 100%; height: 100%; object-fit: cover; }
.review__footer {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
  font-size: var(--fs-sm);
}
.review__helpful {
  background: transparent; border: 1px solid var(--app-border);
  color: var(--gray-700);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.review__helpful:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-950); }
.review__helpful.is-active {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-800);
}

/* Réponse du vendeur */
.review__reply {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--app-surface-muted);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-500);
}
.review__reply-author {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--gray-950);
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 4px;
}
.review__reply-body {
  font-size: var(--fs-sm);
  color: var(--gray-700);
  margin: 0;
  line-height: 1.55;
}

/* ═════════════════════════════════════════════════════════════════════════
   79. CHAT / MESSAGING UI
   ═════════════════════════════════════════════════════════════════════════ */
.chat {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 480px;
  overflow: hidden;
}
.chat__header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}
.chat__header-name { font-weight: 600; color: var(--gray-950); font-size: var(--fs-base); }
.chat__header-status { font-size: var(--fs-xs); color: var(--gray-600); display: inline-flex; align-items: center; gap: 4px; }
.chat__body {
  padding: 16px;
  overflow-y: auto;
  background: var(--app-surface-muted);
  display: flex; flex-direction: column; gap: 4px;
}
.chat__day-sep {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--gray-500);
  margin: 12px 0 8px;
  display: flex; align-items: center; gap: 10px;
}
.chat__day-sep::before, .chat__day-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--app-border);
}
.chat__msg {
  display: flex; gap: 8px;
  max-width: 75%;
  align-self: flex-start;
}
.chat__msg--out { align-self: flex-end; flex-direction: row-reverse; }
.chat__bubble {
  padding: 8px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  font-size: var(--fs-sm);
  color: var(--gray-950);
  line-height: 1.5;
  position: relative;
}
.chat__msg--out .chat__bubble {
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
  border-radius: 14px 14px 4px 14px;
}
.chat__msg--continuation .chat__bubble { border-radius: 14px; }
.chat__msg--out.chat__msg--continuation .chat__bubble { border-radius: 14px; }
.chat__bubble-time {
  font-size: 10px;
  opacity: .7;
  margin-top: 2px;
  display: inline-flex; align-items: center; gap: 3px;
}
.chat__bubble-time .bi-check2-all { font-size: 12px; }
.chat__avatar { flex-shrink: 0; align-self: flex-end; }
.chat__msg--continuation .chat__avatar { visibility: hidden; }
.chat__typing {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 14px 14px 14px 4px;
}
.chat__typing span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gray-500);
  animation: chat-typing 1.4s ease-in-out infinite;
}
.chat__typing span:nth-child(2) { animation-delay: .2s; }
.chat__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-typing {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.chat__composer {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 10px 12px;
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
}
.chat__composer-input {
  flex: 1;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: var(--fs-sm);
  resize: none;
  outline: none;
  color: var(--gray-950);
  background: var(--app-surface);
  min-height: 32px;
  max-height: 100px;
}
.chat__composer-input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.chat__attachment {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs);
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
}

/* Conversation list (sidebar inbox) */
.chat-list {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-list__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.chat-list__item:last-child { border-bottom: none; }
.chat-list__item:hover { background: var(--app-surface-muted); }
.chat-list__item.is-active { background: var(--brand-50); }
[data-bs-theme="dark"] .chat-list__item.is-active { background: color-mix(in oklch, var(--brand-500) 14%, transparent); }
.chat-list__name {
  font-weight: 600; font-size: var(--fs-sm);
  color: var(--gray-950);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-list__preview {
  font-size: var(--fs-xs);
  color: var(--gray-600);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-list__meta { text-align: right; }
.chat-list__time { font-size: 10px; color: var(--gray-500); }
.chat-list__unread {
  background: var(--brand-600); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 2px;
}

/* ═════════════════════════════════════════════════════════════════════════
   80. COMMENTS THREAD (nested, type Reddit / Disqus)
   ═════════════════════════════════════════════════════════════════════════ */
.comments { display: flex; flex-direction: column; gap: 16px; }
.comment {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
}
.comment__avatar { flex-shrink: 0; }
.comment__body {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.comment__head {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs);
  color: var(--gray-600);
  margin-bottom: 4px;
}
.comment__author {
  font-weight: 600;
  color: var(--gray-950);
  font-size: var(--fs-sm);
}
.comment__role {
  background: var(--brand-100); color: var(--brand-800);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.comment__text {
  font-size: var(--fs-sm);
  color: var(--gray-800);
  margin: 0;
  line-height: 1.55;
}
.comment__actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
  font-size: var(--fs-xs);
}
.comment__action {
  background: transparent; border: none;
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}
.comment__action:hover { color: var(--gray-950); background: var(--gray-100); }
.comment__action.is-active { color: var(--accent-fg); }
.comment__action.is-active.upvote i.bi-arrow-up-circle::before { content: "\f135"; } /* fill */
.comment__votes {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gray-800);
}
.comment__replies {
  margin-top: 12px;
  padding-left: 20px;
  border-left: 2px solid var(--app-border);
  display: flex; flex-direction: column; gap: 12px;
}
.comment--collapsed .comment__text, .comment--collapsed .comment__actions, .comment--collapsed .comment__replies {
  display: none;
}
.comment__collapse {
  font-size: var(--fs-xs);
  color: var(--gray-600);
  background: none; border: none;
  cursor: pointer;
  padding: 0 4px;
}

/* ═════════════════════════════════════════════════════════════════════════
   81. PRICING TOGGLE (Mensuel / Annuel)
   ═════════════════════════════════════════════════════════════════════════ */
.pricing-toggle {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-pill);
  padding: 4px;
  position: relative;
}
.pricing-toggle__option {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--gray-700);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--t-fast);
  position: relative;
}
.pricing-toggle__option.is-active {
  background: var(--gray-950);
  color: var(--gray-50);
}
.pricing-toggle__save {
  background: var(--success-100);
  color: var(--success-600);
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
}
.pricing-toggle__option.is-active .pricing-toggle__save {
  background: var(--success-500);
  color: #fff;
}

/* ═════════════════════════════════════════════════════════════════════════
   82. TRUST BADGES ROW
   ═════════════════════════════════════════════════════════════════════════ */
.trust-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 16px;
  background: var(--app-surface-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--app-border);
}
.trust-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);
  color: var(--gray-800);
}
.trust-item__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-fg);
  font-size: 16px;
  flex-shrink: 0;
}
.trust-item__icon--success { color: var(--success-600); }
.trust-item__title { font-weight: 600; color: var(--gray-950); font-size: var(--fs-sm); }
.trust-item__desc { font-size: var(--fs-xs); color: var(--gray-600); }

/* Logos paiement */
.payment-logos { display: inline-flex; align-items: center; gap: 8px; }
.payment-logo {
  width: 38px; height: 24px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.02em;
}

/* ═════════════════════════════════════════════════════════════════════════
   83. MOBILE BOTTOM NAV
   ═════════════════════════════════════════════════════════════════════════ */
.mobile-nav {
  display: flex;
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
  padding: 6px 4px env(safe-area-inset-bottom, 6px);
}
.mobile-nav--fixed {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .08);
}
.mobile-nav__item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px;
  gap: 2px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-md);
  position: relative;
  transition: color var(--t-fast);
}
.mobile-nav__item i { font-size: 20px; }
.mobile-nav__item.is-active { color: var(--accent-fg); }
.mobile-nav__item.is-active i.bi { font-weight: bold; }
.mobile-nav__item:hover { color: var(--gray-950); }
.mobile-nav__item-badge {
  position: absolute; top: 2px; right: calc(50% - 18px);
  background: var(--danger-500); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px; padding: 0 4px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--app-surface);
}
.mobile-nav__item--cta i {
  background: var(--brand-600);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 2px;
  box-shadow: var(--shadow-md);
}
.mobile-nav__item--cta { color: var(--accent-fg); }

/* ═════════════════════════════════════════════════════════════════════════
   84. STICKY MOBILE CTA BAR
   ═════════════════════════════════════════════════════════════════════════ */
.sticky-cta {
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
  padding: 10px 12px env(safe-area-inset-bottom, 10px);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
}
.sticky-cta--fixed {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
}
.sticky-cta__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-950);
  display: flex; flex-direction: column;
  line-height: 1.2;
}
.sticky-cta__price-label { font-size: 10px; color: var(--gray-600); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.sticky-cta__price-value { font-size: var(--fs-md); }
.sticky-cta__price-old { font-size: var(--fs-xs); color: var(--gray-500); text-decoration: line-through; font-weight: 500; }
.sticky-cta__btn { flex: 1; }

/* ═════════════════════════════════════════════════════════════════════════
   85. ADDRESS AUTOCOMPLETE
   ═════════════════════════════════════════════════════════════════════════ */
.addr-input { position: relative; }
.addr-input__field { padding-left: 36px; }
.addr-input > .icon-left {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}
.addr-input__suggestions {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.addr-suggestion {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.addr-suggestion:hover, .addr-suggestion.is-active {
  background: var(--gray-100);
}
.addr-suggestion__icon {
  color: var(--gray-500);
  font-size: 16px;
}
.addr-suggestion__main { color: var(--gray-950); font-weight: 500; }
.addr-suggestion__main mark {
  background: color-mix(in oklch, var(--brand-300) 40%, transparent);
  color: inherit; padding: 0 1px; border-radius: 2px;
}
.addr-suggestion__sub { font-size: var(--fs-xs); color: var(--gray-600); }
.addr-suggestion__type {
  font-size: 10px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.addr-suggestion.is-current { background: var(--brand-50); }
[data-bs-theme="dark"] .addr-suggestion.is-current { background: color-mix(in oklch, var(--brand-500) 12%, transparent); }

/* ═════════════════════════════════════════════════════════════════════════
   86. SEARCH OVERLAY (plein écran)
   ═════════════════════════════════════════════════════════════════════════ */
.search-overlay {
  position: fixed; inset: 0;
  background: var(--app-surface);
  z-index: 1100;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.search-overlay.is-open { display: flex; }
.search-overlay__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--app-border);
}
.search-overlay__head-icon { font-size: 20px; color: var(--gray-500); }
.search-overlay__input {
  flex: 1;
  border: none; outline: none;
  font-size: var(--fs-xl);
  background: transparent;
  color: var(--gray-950);
  padding: 4px 0;
}
.search-overlay__close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.search-overlay__body {
  flex: 1;
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.search-overlay__section { margin-bottom: 24px; }
.search-overlay__section-title {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.search-result {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.search-result:hover, .search-result.is-active { background: var(--gray-100); }
.search-result__media {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--app-surface-muted);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-fg);
  font-size: 20px;
  overflow: hidden;
}
.search-result__media img { width: 100%; height: 100%; object-fit: cover; }
.search-result__title { font-weight: 600; color: var(--gray-950); font-size: var(--fs-base); }
.search-result__title mark { background: color-mix(in oklch, var(--brand-300) 40%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }
.search-result__desc { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 2px; }
.search-result__price { font-weight: 600; color: var(--gray-950); font-variant-numeric: tabular-nums; }
.search-result__type {
  font-size: 10px;
  background: var(--gray-100); color: var(--gray-700);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}

.search-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-sm);
  padding: 4px 10px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-pill);
  color: var(--gray-800);
  cursor: pointer;
  margin-right: 6px; margin-bottom: 6px;
}
.search-tag:hover { background: var(--gray-100); color: var(--gray-950); }
.search-tag i { font-size: 12px; color: var(--gray-500); }

/* ═════════════════════════════════════════════════════════════════════════
   87. BEFORE / AFTER IMAGE SLIDER
   ═════════════════════════════════════════════════════════════════════════ */
.before-after {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background: var(--app-surface-muted);
}
.before-after__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
}
.before-after__after {
  clip-path: inset(0 0 0 50%);
}
.before-after__divider {
  position: absolute; top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  transform: translateX(-1px);
  pointer-events: none;
}
.before-after__handle {
  position: absolute; top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-900);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.before-after__handle::before, .before-after__handle::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  border-top: 2px solid var(--gray-900);
  border-left: 2px solid var(--gray-900);
}
.before-after__handle::before { transform: rotate(-45deg); margin-right: 14px; }
.before-after__handle::after { transform: rotate(135deg); margin-left: 14px; }
.before-after__label {
  position: absolute;
  top: 12px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: .04em;
  pointer-events: none;
}
.before-after__label--before { left: 12px; }
.before-after__label--after { right: 12px; }
.before-after__input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

/* ═════════════════════════════════════════════════════════════════════════
   88. DRAG-TO-REORDER LIST (kanban / tri)
   ═════════════════════════════════════════════════════════════════════════ */
.reorder-list {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.reorder-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
  cursor: grab;
  transition: background var(--t-fast);
}
.reorder-item:last-child { border-bottom: none; }
.reorder-item:hover { background: var(--app-surface-muted); }
.reorder-item.is-dragging {
  opacity: .5;
  cursor: grabbing;
  background: var(--brand-50);
}
.reorder-item.is-drop-target {
  border-top: 2px solid var(--brand-500);
  margin-top: -1px;
}
.reorder-handle {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: 16px;
  border-radius: var(--radius-sm);
  cursor: grab;
}
.reorder-handle:hover { color: var(--gray-700); background: var(--gray-100); }
.reorder-item__body { min-width: 0; }
.reorder-item__title { font-size: var(--fs-sm); font-weight: 500; color: var(--gray-950); margin: 0; }
.reorder-item__meta { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 2px; }
.reorder-item__actions { display: inline-flex; gap: 4px; }

/* ═════════════════════════════════════════════════════════════════════════
   89. INBOX UI (email-style 2 colonnes)
   ═════════════════════════════════════════════════════════════════════════ */
.inbox {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 480px;
}
@media (max-width: 767.98px) { .inbox { grid-template-columns: 1fr; } .inbox__detail { display: none; } }
.inbox__sidebar {
  border-right: 1px solid var(--app-border);
  display: flex; flex-direction: column;
}
.inbox__search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
}
.inbox__list { overflow-y: auto; flex: 1; }
.inbox-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast);
}
.inbox-item:hover { background: var(--app-surface-muted); }
.inbox-item.is-active { background: var(--brand-50); }
[data-bs-theme="dark"] .inbox-item.is-active { background: color-mix(in oklch, var(--brand-500) 12%, transparent); }
.inbox-item.is-unread::before {
  content: "";
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px;
  background: var(--brand-600);
  border-radius: 50%;
}
.inbox-item__from {
  font-weight: 600;
  color: var(--gray-950);
  font-size: var(--fs-sm);
  display: flex; justify-content: space-between; gap: 8px;
}
.inbox-item.is-unread .inbox-item__from { font-weight: 700; }
.inbox-item__time { font-size: 10px; color: var(--gray-500); font-weight: 500; }
.inbox-item__subject {
  font-size: var(--fs-sm);
  color: var(--gray-800);
  margin: 2px 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox-item.is-unread .inbox-item__subject { font-weight: 600; color: var(--gray-950); }
.inbox-item__preview {
  font-size: var(--fs-xs);
  color: var(--gray-600);
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inbox-item__tags { display: inline-flex; gap: 4px; margin-top: 4px; }
.inbox-item__star {
  position: absolute; right: 8px; bottom: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  background: transparent;
  border: none;
  cursor: pointer;
}
.inbox-item__star:hover, .inbox-item__star.is-active { color: var(--warning-500); }

.inbox__detail { display: flex; flex-direction: column; }
.inbox__detail-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--app-border);
}
.inbox__detail-subject { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-950); margin: 0 0 6px; }
.inbox__detail-tags { display: inline-flex; gap: 4px; }
.inbox__detail-from {
  padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--app-border);
}
.inbox__detail-from-info { flex-grow: 1; }
.inbox__detail-from-name { font-weight: 600; color: var(--gray-950); font-size: var(--fs-sm); }
.inbox__detail-from-meta { font-size: var(--fs-xs); color: var(--gray-600); }
.inbox__detail-body {
  padding: 20px;
  font-size: var(--fs-sm);
  color: var(--gray-800);
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
}
.inbox__detail-body p { margin: 0 0 12px; }
.inbox__detail-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--app-border);
  display: flex; gap: 8px;
  background: var(--app-surface-muted);
}

/* ═════════════════════════════════════════════════════════════════════════
   90. RECENTLY VIEWED STRIP (carousel horizontal compact)
   ═════════════════════════════════════════════════════════════════════════ */
.recent-strip {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.recent-strip__item {
  width: 140px;
  flex-shrink: 0;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
.recent-strip__media {
  aspect-ratio: 1 / 1;
  background: var(--app-surface-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--app-border);
  overflow: hidden;
  margin-bottom: 6px;
}
.recent-strip__media img { width: 100%; height: 100%; object-fit: cover; }
.recent-strip__title {
  font-size: var(--fs-xs);
  color: var(--gray-950);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.recent-strip__price {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gray-950);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.recent-strip__price-old {
  font-size: var(--fs-xs);
  color: var(--gray-500);
  text-decoration: line-through;
  font-weight: 500;
  margin-left: 4px;
}

/* ═════════════════════════════════════════════════════════════════════════
   91. PROMO COUNTDOWN TIMER
   ═════════════════════════════════════════════════════════════════════════ */
.countdown {
  display: inline-flex; align-items: stretch;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.countdown__unit {
  background: var(--gray-950);
  color: var(--gray-50);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 44px;
  display: flex; flex-direction: column;
}
.countdown__value {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}
.countdown__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .65;
  margin-top: 2px;
  font-weight: 500;
}
.countdown__sep {
  display: flex; align-items: center;
  font-size: var(--fs-lg);
  color: var(--gray-500);
  font-weight: 700;
  padding: 0 2px;
}
.countdown--inline {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 0;
}
.countdown--inline .countdown__unit {
  background: transparent;
  color: var(--gray-950);
  border-right: 1px solid var(--app-border);
}
.countdown--inline .countdown__unit:last-child { border-right: none; }
.countdown--inline .countdown__label { color: var(--gray-600); opacity: 1; }
.countdown--danger .countdown__unit { background: var(--danger-600); }
.countdown--brand .countdown__unit { background: var(--brand-700); }
.countdown--sm .countdown__unit { padding: 4px 6px; min-width: 32px; }
.countdown--sm .countdown__value { font-size: var(--fs-md); }

/* Banner avec countdown intégré */
.promo-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand-50), var(--app-surface));
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}
[data-bs-theme="dark"] .promo-banner {
  background: linear-gradient(135deg, color-mix(in oklch, var(--brand-500) 12%, var(--app-surface)), var(--app-surface));
}
.promo-banner__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-600);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.promo-banner__content { flex: 1; min-width: 200px; }
.promo-banner__title { font-size: var(--fs-md); font-weight: 700; color: var(--gray-950); margin: 0; }
.promo-banner__desc { font-size: var(--fs-sm); color: var(--gray-700); margin: 2px 0 0; }

/* ═════════════════════════════════════════════════════════════════════════
   92. AUDIO PLAYER
   ═════════════════════════════════════════════════════════════════════════ */
.audio-player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.audio-player__cover {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.audio-player__cover img { width: 100%; height: 100%; object-fit: cover; }
.audio-player__body { flex: 1; min-width: 0; }
.audio-player__title {
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--gray-950);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audio-player__meta { font-size: var(--fs-xs); color: var(--gray-600); }
.audio-player__progress {
  height: 4px;
  background: var(--gray-200);
  border-radius: 999px;
  position: relative;
  margin-top: 6px;
  cursor: pointer;
}
.audio-player__progress-fill {
  height: 100%;
  background: var(--brand-600);
  border-radius: 999px;
  position: relative;
}
.audio-player__progress-fill::after {
  content: "";
  position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  background: var(--brand-600);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.audio-player__time {
  font-size: 10px;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
  display: flex; justify-content: space-between;
  margin-top: 2px;
}
.audio-player__controls {
  display: inline-flex; align-items: center; gap: 4px;
}
.audio-player__btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--gray-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.audio-player__btn:hover { background: var(--gray-100); color: var(--gray-950); }
.audio-player__btn--play {
  background: var(--brand-600);
  color: #fff;
  width: 40px; height: 40px;
  font-size: 16px;
}
.audio-player__btn--play:hover { background: var(--brand-700); color: #fff; }

/* Variant : audio player avec waveform */
.audio-player--wave .audio-player__wave {
  flex: 1;
  display: flex; align-items: end; gap: 1px;
  height: 32px;
  cursor: pointer;
}
.audio-player__wave-bar {
  flex: 1;
  background: var(--gray-300);
  border-radius: 1px;
  min-height: 4px;
  transition: background var(--t-fast);
}
.audio-player__wave-bar.is-played { background: var(--brand-600); }
.audio-player__wave-bar.is-cursor { background: var(--brand-700); }

/* Variant : audio player compact */
.audio-player--compact { padding: 6px 10px; gap: 8px; }
.audio-player--compact .audio-player__cover { width: 32px; height: 32px; font-size: 14px; }
.audio-player--compact .audio-player__btn--play { width: 32px; height: 32px; font-size: 14px; }

/* ═════════════════════════════════════════════════════════════════════════
   93. PDF VIEWER
   ═════════════════════════════════════════════════════════════════════════ */
.pdf-viewer {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.pdf-viewer__toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  flex-wrap: wrap;
}
.pdf-viewer__filename {
  font-weight: 600; color: var(--gray-950);
  font-size: var(--fs-sm);
  display: inline-flex; align-items: center; gap: 6px;
}
.pdf-viewer__page-input {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--app-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: var(--fs-sm);
}
.pdf-viewer__page-input input {
  width: 32px;
  text-align: center;
  border: none;
  outline: none;
  background: transparent;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gray-950);
}
.pdf-viewer__page-total {
  font-variant-numeric: tabular-nums;
  color: var(--gray-600);
}
.pdf-viewer__zoom { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); min-width: 44px; text-align: center; }

.pdf-viewer__body {
  display: grid;
  grid-template-columns: 120px 1fr;
  min-height: 400px;
  max-height: 600px;
}
.pdf-viewer__thumbs {
  background: var(--gray-100);
  border-right: 1px solid var(--app-border);
  padding: 8px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
[data-bs-theme="dark"] .pdf-viewer__thumbs { background: var(--gray-50); }
.pdf-viewer__thumb {
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  aspect-ratio: 0.71;
  position: relative;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 8px;
  color: var(--gray-400);
  padding: 6px 4px;
  overflow: hidden;
}
.pdf-viewer__thumb:hover { border-color: var(--gray-500); }
.pdf-viewer__thumb.is-active { border-color: var(--brand-500); box-shadow: 0 0 0 2px color-mix(in oklch, var(--brand-500) 30%, transparent); }
.pdf-viewer__thumb-number {
  position: absolute; bottom: 2px; right: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--gray-700);
  background: rgba(255,255,255,.9);
  padding: 0 4px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.pdf-viewer__thumb-content {
  display: flex; flex-direction: column; gap: 1px;
}
.pdf-viewer__thumb-content div { background: var(--gray-200); height: 2px; border-radius: 1px; }

.pdf-viewer__stage {
  background: var(--gray-200);
  overflow: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px;
  gap: 12px;
}
[data-bs-theme="dark"] .pdf-viewer__stage { background: var(--gray-100); }
.pdf-page {
  background: #fff;
  width: 100%; max-width: 380px;
  aspect-ratio: 0.71;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  padding: 28px 24px;
  font-size: 8px;
  color: var(--gray-950);
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.pdf-page__title { font-size: 12px; font-weight: 700; margin: 0 0 4px; }
.pdf-page__h2 { font-size: 9px; font-weight: 700; margin: 8px 0 3px; }
.pdf-page p { margin: 0 0 4px; font-size: 7px; color: var(--gray-800); }
.pdf-page__num {
  position: absolute; bottom: 12px; right: 16px;
  font-size: 7px;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
  .pdf-viewer__body { grid-template-columns: 1fr; }
  .pdf-viewer__thumbs { display: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   94. IMAGE VIEWER (avec pan/zoom/rotation)
   ═════════════════════════════════════════════════════════════════════════ */
.image-viewer {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.image-viewer__toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  flex-wrap: wrap;
}
.image-viewer__title { font-size: var(--fs-sm); font-weight: 500; color: var(--gray-800); margin-right: 8px; }
.image-viewer__zoom { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--gray-700); min-width: 44px; text-align: center; }
.image-viewer__stage {
  background: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  min-height: 320px;
  position: relative;
  cursor: grab;
}
.image-viewer__stage.is-grabbing { cursor: grabbing; }
.image-viewer__img {
  max-width: 100%; max-height: 100%;
  transition: transform var(--t-base);
  user-select: none;
  pointer-events: none;
}
.image-viewer__placeholder {
  width: 70%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, oklch(70% .12 30), oklch(50% .14 50));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  transition: transform var(--t-base);
}
.image-viewer__exif {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  display: flex; flex-direction: column; gap: 2px;
}

/* ═════════════════════════════════════════════════════════════════════════
   95. EXCEL / SPREADSHEET VIEWER (lecture seule)
   ═════════════════════════════════════════════════════════════════════════ */
.xls-viewer {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}
.xls-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--app-border);
  background: oklch(40% .08 130);
  color: #fff;
  font-size: var(--fs-sm);
}
.xls-toolbar__filename {
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.xls-toolbar__btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.xls-toolbar__btn:hover { background: rgba(255,255,255,.22); }

.xls-formula-bar {
  display: grid;
  grid-template-columns: 48px 1fr;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.xls-formula-bar__cell-ref {
  padding: 4px 8px;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface);
  font-weight: 600;
  color: var(--gray-950);
}
.xls-formula-bar__formula {
  padding: 4px 8px;
  color: var(--gray-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.xls-grid-wrap {
  overflow: auto;
  background: var(--app-surface);
  max-height: 380px;
}
.xls-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}
.xls-grid th, .xls-grid td {
  border: 1px solid oklch(85% 0.012 235);
  padding: 4px 8px;
  text-align: left;
  vertical-align: middle;
  height: 22px;
  white-space: nowrap;
  background: var(--app-surface);
  color: var(--gray-950);
}
[data-bs-theme="dark"] .xls-grid th, [data-bs-theme="dark"] .xls-grid td { border-color: var(--gray-300); }
.xls-grid thead th {
  background: var(--gray-100);
  text-align: center;
  font-weight: 600;
  color: var(--gray-700);
  position: sticky; top: 0;
  z-index: 2;
  min-width: 80px;
}
.xls-grid tbody th {
  background: var(--gray-100);
  text-align: center;
  font-weight: 600;
  color: var(--gray-700);
  width: 36px;
  position: sticky; left: 0;
  z-index: 1;
}
.xls-grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.xls-grid .selected {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
  background: var(--brand-50);
  font-weight: 600;
}
.xls-grid .bold { font-weight: 700; }
.xls-grid .pos { color: var(--success-600); }
.xls-grid .neg { color: var(--danger-600); }

.xls-sheet-tabs {
  display: flex; align-items: center;
  background: var(--app-surface-muted);
  border-top: 1px solid var(--app-border);
  overflow-x: auto;
}
.xls-sheet-tab {
  padding: 5px 14px;
  font-size: var(--fs-xs);
  border-right: 1px solid var(--app-border);
  color: var(--gray-700);
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.xls-sheet-tab.is-active {
  background: var(--app-surface);
  color: var(--gray-950);
  font-weight: 600;
  border-bottom-color: oklch(40% .08 130);
}

/* ═════════════════════════════════════════════════════════════════════════
   96. WORD / DOCUMENT VIEWER (lecture seule)
   ═════════════════════════════════════════════════════════════════════════ */
.doc-viewer {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.doc-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--app-border);
  background: oklch(38% .15 245);
  color: #fff;
  font-size: var(--fs-sm);
}
.doc-toolbar__filename {
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.doc-toolbar__btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  cursor: pointer;
}
.doc-toolbar__btn:hover { background: rgba(255,255,255,.22); }

.doc-stage {
  background: var(--gray-200);
  padding: 20px;
  overflow-y: auto;
  max-height: 580px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
[data-bs-theme="dark"] .doc-stage { background: var(--gray-100); }
.doc-page {
  background: #fff;
  width: 100%; max-width: 600px;
  aspect-ratio: 0.71;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  padding: 56px 64px;
  color: #1a1a1a;
  font-family: "Calibri", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  position: relative;
}
.doc-page h1 { font-size: 18px; font-weight: 600; margin: 0 0 10px; color: #2b579a; }
.doc-page h2 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: #2b579a; }
.doc-page p { margin: 0 0 8px; }
.doc-page ul, .doc-page ol { margin: 0 0 8px 18px; padding: 0; }
.doc-page ul li, .doc-page ol li { margin-bottom: 2px; }
.doc-page__pagenum {
  position: absolute; bottom: 18px; right: 32px;
  font-size: 9px;
  color: #999;
}

/* ═════════════════════════════════════════════════════════════════════════
   97. SIGNATURE PAD
   ═════════════════════════════════════════════════════════════════════════ */
.signature-pad {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.signature-pad__head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--app-surface-muted);
}
.signature-pad__label {
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--gray-950);
}
.signature-pad__hint {
  font-size: var(--fs-xs); color: var(--gray-600);
}
.signature-pad__canvas-wrap {
  position: relative;
  background: oklch(99% 0.005 90);
  height: 180px;
  cursor: crosshair;
  /* lignes de guidage */
  background-image: linear-gradient(to bottom, transparent calc(100% - 1px), oklch(80% 0.02 90) 100%);
  background-position: 0 calc(100% - 32px);
  background-size: 100% 32px;
}
.signature-pad__placeholder {
  position: absolute;
  bottom: 38px; left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-xs);
  color: var(--gray-500);
  font-style: italic;
  pointer-events: none;
  letter-spacing: .04em;
}
.signature-pad.is-signed .signature-pad__placeholder { display: none; }
.signature-pad canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.signature-pad__x {
  position: absolute; left: 16px; bottom: 32px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-700);
  pointer-events: none;
}
.signature-pad__actions {
  padding: 8px 14px;
  border-top: 1px solid var(--app-border);
  display: flex; align-items: center; gap: 8px;
  background: var(--app-surface-muted);
}
.signature-pad__actions .ms-auto { margin-left: auto; }
.signature-pad__meta {
  font-size: var(--fs-xs); color: var(--gray-600);
  display: inline-flex; align-items: center; gap: 4px;
}

/* Affichage compact (en lecture seule) */
.signature-display {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
}
.signature-display__img {
  width: 120px; height: 48px;
  background: var(--app-surface-muted);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-700);
  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 22px;
  font-style: italic;
  border-bottom: 1px solid var(--gray-400);
}
.signature-display__meta {
  font-size: var(--fs-xs); color: var(--gray-600);
}
.signature-display__name { font-weight: 600; color: var(--gray-950); font-size: var(--fs-sm); }

/* Scrollbars discrètes desktop */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 999px; border: 2px solid var(--app-surface-muted); }
  ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
}

/* ── Rich-text (Quill snow) — accord BS5/--brand. Scopé .rte pour battre le CDN. */
.rte .ql-toolbar.ql-snow,
.rte .ql-container.ql-snow { border-color: var(--app-border); }
.rte .ql-toolbar.ql-snow {
  border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md);
  background: var(--app-surface-muted);
}
.rte .ql-container.ql-snow {
  border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md);
  font-family: inherit; font-size: var(--fs-base);
}
.rte .ql-editor { min-height: var(--rte-h, 180px); color: var(--app-text, var(--gray-900)); }
.rte .ql-editor.ql-blank::before { color: var(--gray-500); font-style: normal; }
/* Icônes/labels de la toolbar */
.rte .ql-snow .ql-stroke { stroke: var(--gray-600); }
.rte .ql-snow .ql-fill { fill: var(--gray-600); }
.rte .ql-snow .ql-picker { color: var(--gray-700); }
.rte .ql-snow .ql-toolbar button:hover .ql-stroke,
.rte .ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--brand-600); }
.rte .ql-snow .ql-toolbar button:hover .ql-fill,
.rte .ql-snow .ql-toolbar button.ql-active .ql-fill { fill: var(--brand-600); }
.rte .ql-snow .ql-toolbar button.ql-active,
.rte .ql-snow .ql-picker-label.ql-active,
.rte .ql-snow .ql-picker-item.ql-selected { color: var(--brand-600); }
.rte .ql-snow a { color: var(--accent-fg); }
/* Focus visible cohérent avec le thème */
.rte:focus-within .ql-container.ql-snow,
.rte:focus-within .ql-toolbar.ql-snow { border-color: var(--brand-400); }
/* Mode sombre : Quill snow est clair par défaut → on adapte fonds/traits. */
[data-bs-theme="dark"] .rte .ql-snow .ql-stroke { stroke: var(--gray-500); }
[data-bs-theme="dark"] .rte .ql-snow .ql-fill { fill: var(--gray-500); }
[data-bs-theme="dark"] .rte .ql-picker-options {
  background: var(--app-surface); border-color: var(--app-border);
}
[data-bs-theme="dark"] .rte .ql-editor.ql-blank::before { color: var(--gray-400); }

/* ── Datepicker (flatpickr) — accord --brand + mode sombre.
   Préfixé .flatpickr-calendar pour battre en spécificité le CSS CDN (chargé après). */
.flatpickr-calendar .flatpickr-day.selected, .flatpickr-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar .flatpickr-day.startRange, .flatpickr-calendar .flatpickr-day.endRange {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
}
.flatpickr-calendar .flatpickr-day.inRange { background: var(--brand-50); border-color: var(--brand-50); box-shadow: -5px 0 0 var(--brand-50), 5px 0 0 var(--brand-50); }
.flatpickr-calendar .flatpickr-day.today { border-color: var(--brand-400); }
.flatpickr-calendar .flatpickr-day:hover { background: var(--gray-100); }
[data-bs-theme="dark"] .flatpickr-calendar {
  background: var(--app-surface); color: var(--gray-900);
  box-shadow: var(--shadow-lg); border: 1px solid var(--app-border);
}
[data-bs-theme="dark"] .flatpickr-months .flatpickr-month,
[data-bs-theme="dark"] .flatpickr-current-month input.cur-year,
[data-bs-theme="dark"] .flatpickr-monthDropdown-months,
[data-bs-theme="dark"] span.flatpickr-weekday { color: var(--gray-900); fill: var(--gray-900); }
[data-bs-theme="dark"] .flatpickr-day { color: var(--gray-800); }
[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled { color: var(--gray-500); }
[data-bs-theme="dark"] .flatpickr-day:hover { background: var(--gray-100); }
[data-bs-theme="dark"] .flatpickr-prev-month svg, [data-bs-theme="dark"] .flatpickr-next-month svg { fill: var(--gray-700); }
[data-bs-theme="dark"] .flatpickr-calendar .flatpickr-day.inRange { background: color-mix(in srgb, var(--brand-500) 18%, transparent); border-color: transparent; box-shadow: none; }

/* ── Téléphone international (intl-tel-input) — mode sombre ───────────── */
[data-bs-theme="dark"] .iti__dropdown-content {
  background: var(--app-surface); border: 1px solid var(--app-border);
}
[data-bs-theme="dark"] .iti__country.iti__highlight { background: var(--gray-100); }
[data-bs-theme="dark"] .iti__country { color: var(--gray-900); }
.iti { width: 100%; }
.iti__search-input { background: var(--app-surface); color: var(--gray-900); }

/* ── Scrollspy nav ────────────────────────────────────────────────────── */
.scrollspy-nav .nav-link { color: var(--gray-700); padding: 4px 10px; border-radius: var(--radius-md); }
.scrollspy-nav .nav-link:hover { color: var(--gray-950); }
.scrollspy-nav.nav-pills .nav-link.active { background: var(--brand-600); color: #fff; }
.scrollspy-nav .nav-link.active { color: var(--accent-fg); font-weight: 600; }
[data-bs-theme="dark"] .scrollspy-nav .nav-link.active { color: var(--brand-300); }
[data-bs-theme="dark"] .scrollspy-nav.nav-pills .nav-link.active { color: #fff; }
.scrollspy-nav__sub { font-size: var(--fs-sm); }

/* ── Trust badges : sous-éléments (item + icône + titre + desc) ───────── */
.trust-row__item { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 200px; min-width: 0; }
.trust-row__icon { font-size: 22px; color: var(--accent-fg); flex-shrink: 0; line-height: 1.2; }
.trust-row__title { font-size: var(--fs-sm); font-weight: 600; color: var(--gray-950); }
.trust-row__desc { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 1px; }

/* ── Pricing toggle : variante interrupteur (labels + switch) ─────────── */
.pricing-toggle__label { font-size: var(--fs-sm); font-weight: 500; color: var(--gray-700); }
.pricing-toggle__switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.pricing-toggle__switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pricing-toggle__slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--gray-300); border-radius: var(--radius-pill);
  transition: background var(--t-fast);
}
.pricing-toggle__slider::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast);
}
.pricing-toggle__switch input:checked + .pricing-toggle__slider { background: var(--brand-600); }
.pricing-toggle__switch input:checked + .pricing-toggle__slider::before { transform: translateX(18px); }
.pricing-toggle__switch input:focus-visible + .pricing-toggle__slider { box-shadow: var(--shadow-focus); }

/* ── Auth : composants (icônes, sessions, meter, resend) ─────────────── */
.auth-locked__icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-3xl);
  background: var(--brand-50); color: var(--accent-fg);
}
.auth-locked--danger .auth-locked__icon { background: var(--danger-100); color: var(--danger-600); }
.auth-locked__timer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: var(--fs-sm); color: var(--gray-700);
  margin: 12px 0 18px;
}
.auth-locked__actions { display: flex; flex-direction: column; gap: 8px; }

.auth-magic__icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--brand-50); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-3xl);
}
.auth-magic__hint {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); padding: 10px 12px;
  font-size: var(--fs-sm); color: var(--gray-700); margin-top: 16px;
}
.auth-magic__hint i { color: var(--accent-fg); margin-top: 1px; }
.auth-magic__resend { text-align: center; font-size: var(--fs-sm); color: var(--gray-600); margin-top: 14px; }

.auth-otp__resend { text-align: center; font-size: var(--fs-sm); color: var(--gray-600); margin-top: 12px; }

.auth-pwd-meter__bar {
  height: 100%; width: 0;
  background: var(--danger-500); border-radius: var(--radius-pill);
  transition: width var(--t-base), background var(--t-base);
}
.auth-pwd-meter__label { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 4px; min-height: 1.1em; }

.auth-sessions { list-style: none; margin: 0; padding: 0; }
.auth-sessions__item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--app-border);
}
.auth-sessions__item:last-child { border-bottom: none; }
.auth-sessions__item.is-current { background: color-mix(in oklch, var(--success-500) 10%, transparent); }
.auth-sessions__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-700); font-size: var(--fs-lg);
}
.auth-sessions__item.is-current .auth-sessions__icon { background: color-mix(in oklch, var(--success-500) 16%, transparent); color: var(--success-600); border-color: transparent; }
.auth-sessions__body { min-width: 0; }
.auth-sessions__title { font-weight: 600; font-size: var(--fs-sm); color: var(--gray-950); display: flex; align-items: center; gap: 8px; }
.auth-sessions__meta { font-size: var(--fs-xs); color: var(--gray-600); margin-top: 2px; }
.auth-sessions__time { font-size: var(--fs-xs); color: var(--gray-500); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.auth-sessions__action { white-space: nowrap; }
.auth-sessions__footer { border-top: 1px solid var(--app-border); padding: 12px 16px; text-align: right; }
.auth-sessions__empty { font-size: var(--fs-sm); color: var(--gray-500); text-align: center; padding: 24px 16px; }

.auth-verify__steps {
  list-style: none; margin: 16px 0 8px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.auth-verify__steps li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--gray-800); }
.auth-verify__steps i { font-size: var(--fs-lg); color: var(--accent-fg); }

/* ── Address autocomplete (coquille : bouton position + dropdown) ─────── */
.addr-autocomplete { position: relative; }
.addr-autocomplete__locate {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent;
  color: var(--gray-500); border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.addr-autocomplete__locate:hover { background: var(--gray-100); color: var(--accent-fg); }
.addr-autocomplete__suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px;
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto; padding: 4px;
}

/* ==== 20-legacy.css ==== */
/* ============================================================================
   AltiusForms — Stylesheet consolidé
   Base : Bootswatch Sandstone 5.3.3
   Couleurs marque : var(--brand-600) (teal logo) + #e76f51 (coral, accent UI)
   Source unique. Toute couleur, composant, layout et dark mode passe ici.
   ============================================================================ */

/* ------------------------------ TOKENS ---------------------------------- */
:root {
    --pp-primary: var(--brand-600);
    --pp-primary-dark: #066b64;
    --pp-primary-darker: #055955;
    --pp-primary-light: #4dd0c3;
    --pp-primary-lighter: #7ee0d5;
    --pp-primary-soft: rgba(8, 129, 120, 0.08);
    --pp-primary-soft-2: rgba(8, 129, 120, 0.15);
    --pp-secondary: #e76f51;
    --pp-secondary-dark: #c85a3d;

    --pp-sand-bg: #f8f5f0;
    --pp-sand-border: #e5e1d8;
    --pp-dark-bg: #1a1d21;
    --pp-dark-bg-2: #22262d;
    --pp-dark-bg-3: #262a30;
    --pp-dark-border: #2e3238;
    --pp-dark-border-2: #3a3d42;
    --pp-dark-text: #e1e4e9;
    --pp-dark-text-muted: #8a9098;

    --bs-primary: var(--pp-primary);
    --bs-primary-rgb: 8, 129, 120;
    /* Bootstrap's `secondary` stays neutral (Anw gray). Coral lives in
       --pp-secondary / --color-accent for explicit accents only. */
    --bs-link-color: var(--pp-primary);
    --bs-link-color-rgb: 8, 129, 120;
    --bs-link-hover-color: var(--pp-primary-dark);
}

/* ------------------------ LAYOUT GUARDRAILS ------------------------------ */
/* Règle d'or : jamais de scroll horizontal sur la page.
   Chaque conteneur doit pouvoir absorber des enfants plus larges que lui.
   Cela suppose 3 choses :
   1) autoriser le shrink des flex items (`min-width: 0`)
   2) borner la largeur maximale (`max-width: 100%`)
   3) confiner l'overflow horizontal à l'enfant qui le produit (`.table-responsive`, `.accordion-body`) */
html { scroll-behavior: smooth; }
html, body { max-width: 100vw; }
body > * { max-width: 100vw; }
main, .container, .container-fluid, .offcanvas-body, .modal-body { max-width: 100%; }

/* Empêcher les flex children de forcer le wrapper à dépasser : indispensable pour
   que `main.flex-grow-1`, les `.tab-content`, `.card-body`, `.accordion-body`
   restent dans leur conteneur même avec du contenu naturellement large à l'intérieur. */
main, .tab-content, .tab-pane, .card, .card-body, .accordion, .accordion-item,
.accordion-body, .offcanvas-body, .modal-body, .flex-grow-1,
.studio-section, #studio-triage, #studio-side-panel,
.report-builder, .editor-panel, .preview-panel {
    min-width: 0;
    max-width: 100%;
}

/* Contenus intrinsèquement larges (tables, scroll horizontaux D3) : confinés
   localement par leur .accordion-body / .table-responsive, jamais par la page. */
.accordion-body { overflow-x: auto; }
.table-responsive { max-width: 100%; overflow-x: auto; }
.table { margin-bottom: 0; }
.tab-pane { overflow-x: auto; }

/* Dropdowns inside .table-responsive : let the menu escape clipping when open
   without sacrificing horizontal scrolling in the idle state.
   Uses :has() which is supported in all evergreen browsers from ~2023. */
.table-responsive:has(.dropdown-menu.show) { overflow: visible; }

img, video, canvas, svg { max-width: 100%; height: auto; }

/* ------------------------ SIDEBAR MINI MODE ----------------------------- */
/* Active when <html> carries .pp-sidebar-mini. The brand itself (logo.png)
   is the toggle: clicking it shrinks the sidebar and swaps to picto.svg.
   Desktop only — on <lg the sidebar is an offcanvas via .navbar-toggler. */

.pp-sidebar-brand-toggle { cursor: pointer; transition: transform .15s ease; }
.pp-sidebar-brand-toggle:hover { transform: scale(1.05); }
.pp-sidebar-brand-toggle:focus-visible { outline: 2px solid var(--pp-primary); outline-offset: 3px; border-radius: 4px; }
.pp-brand-mini { display: none; }
html.pp-sidebar-mini .pp-brand-full { display: none; }
html.pp-sidebar-mini .pp-brand-mini { display: inline-block; }

@media (min-width: 992px) {
    /* Smooth resize on the aside AND on the page-wrapper that follows it. */
    .navbar-vertical.navbar-expand-lg,
    .navbar-expand-lg.navbar-vertical ~ .page-wrapper { transition: width .2s ease, margin-left .2s ease; }

    /* The legacy sidebar hardcoded 15rem on both .navbar-vertical.navbar-expand-lg (width)
       and .page-wrapper (margin-left). Override both directly when mini. */
    html.pp-sidebar-mini .navbar-vertical.navbar-expand-lg { width: 4.5rem; }
    html.pp-sidebar-mini .navbar-expand-lg.navbar-vertical ~ .page-wrapper,
    html.pp-sidebar-mini .navbar-expand-lg.navbar-vertical ~ .navbar { margin-left: 4.5rem; }

    /* Brand: hide wordmark, keep logo centered. */
    html.pp-sidebar-mini .navbar-vertical .navbar-brand {
        justify-content: center;
        padding-left: .25rem;
        padding-right: .25rem;
    }
    html.pp-sidebar-mini .navbar-vertical .navbar-brand img { height: 28px; }

    /* Hide titles, captions, indicator chevrons on dropdowns. */
    html.pp-sidebar-mini .navbar-vertical .nav-link-title,
    html.pp-sidebar-mini .navbar-vertical .dropdown-toggle::after,
    html.pp-sidebar-mini .navbar-vertical .nav-item .badge { display: none; }

    /* Center the icon in each row. */
    html.pp-sidebar-mini .navbar-vertical .nav-link {
        justify-content: center;
        padding: .5rem .25rem;
    }
    html.pp-sidebar-mini .navbar-vertical .nav-link-icon {
        margin-right: 0 !important;
        font-size: 1.25rem;
        display: inline-block !important;  /* override d-md-none d-lg-inline-block */
    }

    /* Hide subheaders/dividers in the trimmed view. */
    html.pp-sidebar-mini .navbar-vertical .nav-item > .nav-link.h6,
    html.pp-sidebar-mini .navbar-vertical h6.dropdown-header,
    html.pp-sidebar-mini .navbar-vertical .navbar-nav > .nav-item > h6 { display: none; }

    /* Dropdowns become right-side flyouts — override Popper inline styles. */
    html.pp-sidebar-mini .navbar-vertical .dropdown-menu.show {
        position: absolute !important;
        inset: 0 auto auto 100% !important;
        transform: none !important;
        margin-left: .5rem !important;
        min-width: 14rem;
    }
    /* Inside the flyout we want the normal labelled layout back. */
    html.pp-sidebar-mini .navbar-vertical .dropdown-menu .dropdown-item { white-space: normal; }

    /* Picto a bit larger when alone in the narrow header. */
    html.pp-sidebar-mini .pp-brand-mini { height: 36px !important; }
}
/* Graphes D3 / Observable dans le Studio : bornés à leur parent sur les deux axes */
.chart-container, .chart-wrapper, .d3-chart, [data-chart], .observable-container {
    max-width: 100%;
    overflow: auto;
}
.chart-container > svg, .chart-wrapper > svg, [data-chart] > svg { max-width: 100%; }

/* ------------------------------ BUTTONS ---------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--pp-primary);
    --bs-btn-border-color: var(--pp-primary);
    --bs-btn-hover-bg: var(--pp-primary-dark);
    --bs-btn-hover-border-color: var(--pp-primary-dark);
    --bs-btn-active-bg: var(--pp-primary-darker);
    --bs-btn-active-border-color: var(--pp-primary-darker);
    --bs-btn-disabled-bg: var(--pp-primary);
    --bs-btn-disabled-border-color: var(--pp-primary);
}
.btn-secondary {
    --bs-btn-bg: var(--pp-secondary);
    --bs-btn-border-color: var(--pp-secondary);
    --bs-btn-hover-bg: var(--pp-secondary-dark);
    --bs-btn-hover-border-color: var(--pp-secondary-dark);
    --bs-btn-active-bg: #d63a3a;
    --bs-btn-active-border-color: #d63a3a;
    --bs-btn-disabled-bg: var(--pp-secondary);
    --bs-btn-disabled-border-color: var(--pp-secondary);
}
.btn-outline-primary {
    --bs-btn-color: var(--pp-primary);
    --bs-btn-border-color: var(--pp-primary);
    --bs-btn-hover-bg: var(--pp-primary);
    --bs-btn-hover-border-color: var(--pp-primary);
    --bs-btn-active-bg: var(--pp-primary-dark);
}
.btn-outline-secondary {
    --bs-btn-color: var(--pp-secondary);
    --bs-btn-border-color: var(--pp-secondary);
    --bs-btn-hover-bg: var(--pp-secondary);
    --bs-btn-hover-border-color: var(--pp-secondary);
}

/* Bouton avec icône — pattern unique partout dans l'app */
.btn > i.bi,
.dropdown-item > i.bi,
.nav-link > i.bi {
    vertical-align: -0.125em;
    line-height: 1;
}

/* Bootstrap Icons baseline alignment everywhere — drop-in so icons in
   headings, labels and badges sit on the text baseline without per-element
   inline `vertical-align` styles (BI's own recommended value). */
i.bi { vertical-align: -0.125em; }

/* Row-action dropdowns inside a table: let them escape the table's scroll
   clipping via an explicit opt-in class, instead of forcing overflow on
   every .table-responsive (which would break horizontal scroll). */
.pp-table-actions,
.pp-table-actions .table td { overflow: visible; }
.pp-table-actions .dropdown-menu { z-index: 1050; }

/* Small initials/photo avatar — replaces ad-hoc inline width/height/font-size. */
.pp-avatar-xs {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    object-fit: cover;
}
.btn-icon-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

/* ------------------------------ FORMS ------------------------------------ */
.form-control:focus, .form-select:focus {
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 .25rem rgba(8, 129, 120, .25);
}
.form-check-input:checked { background-color: var(--pp-primary); border-color: var(--pp-primary); }

/* ------------------------------ UTILS ------------------------------------ */
.bg-primary { background-color: var(--pp-primary) !important; }
.text-primary { color: var(--pp-primary) !important; }
.border-primary { border-color: var(--pp-primary) !important; }
.link-primary { color: var(--pp-primary) !important; }
.page-link { color: var(--pp-primary); }
.page-item.active .page-link { background-color: var(--pp-primary); border-color: var(--pp-primary); }
.nav-pills .nav-link.active { background-color: var(--pp-primary); color: #fff; }

/* KPI card — composant réutilisable unifié */
.pp-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: .5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    min-width: 0;
}
.pp-stat-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: var(--pp-primary-soft);
    color: var(--pp-primary);
    font-size: 1.25rem;
}
.pp-stat-body { min-width: 0; flex: 1; }
.pp-stat-label { font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .15rem; }
.pp-stat-value { font-size: 1.5rem; font-weight: 600; color: var(--bs-emphasis-color); line-height: 1.1; }

/* Conteneurs de section avec ombre douce Sandstone */
.pp-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: 1.25rem;
}

/* Titre de section + actions à droite */
.pp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.pp-section-header .pp-section-title { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--bs-emphasis-color); }
.pp-section-header .pp-section-subtitle { margin: .15rem 0 0; font-size: .875rem; color: var(--bs-secondary-color); }
.pp-section-header .pp-section-actions {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* État vide (liste sans contenu, filtre sans résultat) */
.pp-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
}
.pp-empty-state-icon {
    font-size: 3rem;
    opacity: .4;
    margin-bottom: .75rem;
    color: var(--pp-primary);
}
.pp-empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--bs-emphasis-color); margin-bottom: .25rem; }
.pp-empty-state-message { margin-bottom: 1rem; }

/* ------------------------- COMPOSANTS LEGACY PORTÉS --------------------- */
/* KPI card (variante utilisée par iot_devices/search) : survol translate + shadow */
.stat-card { transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .1); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon i { font-size: 24px; }
.stat-icon.bg-primary-soft { background: var(--pp-primary-soft); color: var(--pp-primary); }

/* Status dot (IoT / health indicators) */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.online {
    background-color: var(--success-500);
    box-shadow: 0 0 8px rgba(52, 195, 143, .6);
    animation: pp-pulse 2s infinite;
}
.status-dot.offline { background-color: var(--danger-500); }
.status-dot.warning { background-color: var(--warning-500); }

/* Severity tiles (alerts IoT) */
.severity-info { background-color: rgba(80, 165, 241, .15); border-left: 4px solid var(--info-500); }
.severity-warning { background-color: rgba(241, 180, 76, .15); border-left: 4px solid var(--warning-500); }
.severity-error { background-color: rgba(244, 106, 106, .15); border-left: 4px solid var(--danger-500); }
.severity-critical { background-color: rgba(220, 53, 69, .15); border-left: 4px solid #dc3545; }

/* Device cards (IoT) */
.device-card {
    transition: all .2s;
    border: 1px solid var(--bs-border-color);
}
.device-card:hover { border-color: var(--pp-primary); transform: translateY(-2px); }
.device-card .device-icon { font-size: 32px; opacity: .8; }

.chart-container { position: relative; height: 300px; }

/* Modal overlay utilitaire (IoT / formsbuilder) — alternative à .modal Bootstrap */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal-overlay .card { max-height: 90vh; overflow: hidden; }

/* Form field group (formsbuilder — groupage visuel de champs) */
.form-field-group {
    background: var(--bs-tertiary-bg);
    border-radius: .5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-border-color);
}
.form-field-group .group-header { border-bottom: 1px solid var(--bs-border-color); }

/* -------------------------- NOTIFICATIONS ------------------------------- */
.notification-item {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: 1rem;
    transition: transform .2s, box-shadow .2s;
}
.notification-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
.notification-unread {
    border-left: 4px solid var(--pp-primary);
    background: var(--pp-primary-soft);
}
.notification-read { opacity: .8; }

.notification-item.notification-success { border-left: 4px solid var(--success-500); }
.notification-item.notification-warning { border-left: 4px solid var(--warning-500); }
.notification-item.notification-error { border-left: 4px solid var(--pp-secondary); }
.notification-item.notification-info { border-left: 4px solid var(--pp-primary); }

.notification-icon {
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notification-icon.success { background: rgba(52, 195, 143, .15); color: #1f7a56; }
.notification-icon.warning { background: rgba(241, 180, 76, .15); color: #8a6916; }
.notification-icon.error { background: rgba(231, 111, 81, .15); color: var(--pp-secondary-dark); }
.notification-icon.info { background: var(--pp-primary-soft-2); color: var(--pp-primary-dark); }

.notification-dropdown {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}
.notification-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
}
.notification-empty-icon {
    width: 4rem; height: 4rem;
    margin: 0 auto 1rem;
    opacity: .5;
}
.notification-badge {
    background: var(--pp-primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: .125rem .5rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notification-action {
    padding: .5rem 1rem;
    border-radius: .375rem;
    font-size: .875rem;
    font-weight: 500;
    transition: background .2s;
    border: 1px solid transparent;
}
.notification-action.primary { background: var(--pp-primary); color: #fff; }
.notification-action.primary:hover { background: var(--pp-primary-dark); color: #fff; }
.notification-action.secondary {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
.notification-action.secondary:hover { background: var(--bs-secondary-bg); color: var(--bs-emphasis-color); }

/* Animations partagées */
@keyframes pp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes pp-slide-in-right { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pp-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.notification-enter { animation: pp-slide-in-right .3s ease-out; }
.notification-fade-in { animation: pp-fade-in .3s ease-out; }

/* ----------------- COMPAT CLASSES (legacy Evara theme) ------------------ */
/* Shim les classes utilitaires du thème Evara pour que les pages non encore
   portées (users/list, mailing/admin, notification_list, formsbuilder/submissions,
   analysis/dashboard…) rendent proprement avec les tokens Sandstone + dark mode.
   Celles-ci remplacent petit à petit les bricolages .bg-primary-light etc. */

/* KPI card wrapper (était `<article class="icontext">` dans Evara) */
.icontext {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.icontext .text { min-width: 0; flex: 1; }
.icontext .text h6 { margin-bottom: 0; }


/* Soft-tinted backgrounds : 2 spellings héritées (Evara utilisait les deux) */
.bg-primary-light, .bg-light-primary { background-color: var(--pp-primary-soft) !important; }
.bg-success-light, .bg-light-success { background-color: rgba(52, 195, 143, .12) !important; }
.bg-warning-light, .bg-light-warning { background-color: rgba(241, 180, 76, .15) !important; }
.bg-danger-light,  .bg-light-danger  { background-color: rgba(231, 111, 81, .12) !important; }
.bg-info-light,    .bg-light-info    { background-color: rgba(80, 165, 241, .14) !important; }

[data-bs-theme="dark"] .bg-primary-light,
[data-bs-theme="dark"] .bg-light-primary { background-color: rgba(77, 208, 195, .14) !important; }
[data-bs-theme="dark"] .bg-success-light,
[data-bs-theme="dark"] .bg-light-success { background-color: rgba(52, 195, 143, .18) !important; }
[data-bs-theme="dark"] .bg-warning-light,
[data-bs-theme="dark"] .bg-light-warning { background-color: rgba(241, 180, 76, .18) !important; }
[data-bs-theme="dark"] .bg-danger-light,
[data-bs-theme="dark"] .bg-light-danger  { background-color: rgba(231, 111, 81, .18) !important; }
[data-bs-theme="dark"] .bg-info-light,
[data-bs-theme="dark"] .bg-light-info    { background-color: rgba(80, 165, 241, .18) !important; }

/* Font-size / font-weight legacy helpers (Evara utilisait .f-s-12..64 et .f-w-500/600/700) */
.f-s-10 { font-size: 10px; }
.f-s-11 { font-size: 11px; }
.f-s-12 { font-size: 12px; }
.f-s-13 { font-size: 13px; }
.f-s-14 { font-size: 14px; }
.f-s-15 { font-size: 15px; }
.f-s-16 { font-size: 16px; }
.f-s-18 { font-size: 18px; }
.f-s-20 { font-size: 20px; }
.f-s-24 { font-size: 24px; }
.f-s-28 { font-size: 28px; }
.f-s-32 { font-size: 32px; }
.f-s-48 { font-size: 48px; }
.f-s-64 { font-size: 64px; }
.f-w-400 { font-weight: 400; }
.f-w-500 { font-weight: 500; }
.f-w-600 { font-weight: 600; }
.f-w-700 { font-weight: 700; }

/* Phosphor icons compat — le projet n'embarque pas Phosphor.
   Les pages qui utilisent encore `<i class="ph ph-…">` / `<i class="ph-duotone ph-…">`
   seront rendues silencieusement invisibles. Ce fallback affiche au moins un
   carré neutre à la place pour que le layout ne s'effondre pas. Les pages
   concernées (graph/*) sont en cours de migration vers `bi bi-*`. */
i.ph, i[class*="ph-duotone"], i[class*=" ph-"] {
    display: inline-block;
    min-width: 1em;
    min-height: 1em;
}

/* Legacy Evara breadcrumb (`<ul class="app-line-breadcrumbs">`) — style
   comme un `<ol class="breadcrumb">` Bootstrap. Les pages pas encore migrées
   vers `{% block breadcrumb %}` conservent leur markup mais rendent comme BS. */
ul.app-line-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    padding: .5rem 0;
    margin-bottom: 1rem;
    font-size: var(--bs-breadcrumb-font-size, inherit);
    list-style: none;
}
ul.app-line-breadcrumbs > li { display: flex; align-items: center; }
ul.app-line-breadcrumbs > li + li::before {
    content: var(--bs-breadcrumb-divider, "/");
    padding: 0 .5rem;
    color: var(--bs-secondary-color);
}
ul.app-line-breadcrumbs > li > a {
    color: var(--bs-link-color);
    text-decoration: none;
}
ul.app-line-breadcrumbs > li > a:hover { color: var(--bs-link-hover-color); text-decoration: underline; }
ul.app-line-breadcrumbs > li.active,
ul.app-line-breadcrumbs > li.active > span { color: var(--bs-secondary-color); }

/* -------------------------------- SIDEBAR -------------------------------- */
@media (min-width: 992px) {
    #pp-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        flex-shrink: 0;
        width: 260px;
    }
}
#pp-sidebar {
    background-color: var(--pp-sand-bg) !important;
    color: #212529;
    border-right: 1px solid var(--pp-sand-border);
}
#pp-sidebar .nav-link { color: #2a2d31; }
#pp-sidebar .nav-link:hover { background-color: var(--pp-primary-soft); color: var(--pp-primary-dark); }
#pp-sidebar .nav-link.active,
#pp-sidebar .nav-link.pp-parent-active { background-color: var(--pp-primary) !important; color: #fff !important; }
#pp-sidebar .text-body-secondary,
#pp-sidebar .text-uppercase { color: #6c757d !important; }
#pp-sidebar .border-top,
#pp-sidebar .border-bottom { border-color: var(--pp-sand-border) !important; }

/* Sidebar dropdowns : inline (le container a overflow:auto, Popper serait clippé) */
#pp-sidebar .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    margin: .15rem 0 .4rem 0;
    padding: .25rem .5rem;
    border: 0;
    box-shadow: none;
    transform: none !important;
    inset: auto !important;
    background-color: var(--pp-primary-soft);
}
#pp-sidebar .dropdown-menu .dropdown-item {
    padding: .35rem .75rem;
    border-radius: .3rem;
    font-size: .92rem;
    color: #2a2d31;
}
#pp-sidebar .dropdown-menu .dropdown-item:hover { background-color: var(--pp-primary-soft-2); color: var(--pp-primary-dark); }
#pp-sidebar .dropdown-menu .dropdown-item.active {
    background-color: var(--pp-primary) !important;
    color: #fff !important;
    font-weight: 500;
}
#pp-sidebar .dropdown-menu .dropdown-header {
    padding: .4rem .75rem .2rem;
    font-size: .7rem;
    letter-spacing: .05em;
    color: #6c757d;
}

/* Sidebar rétractée (icon-only) */
body.pp-sidebar-collapsed #pp-sidebar { width: 64px !important; }
body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-label,
body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-brand-text,
body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-user-text,
body.pp-sidebar-collapsed #pp-sidebar .dropdown-menu,
body.pp-sidebar-collapsed #pp-sidebar .dropdown-toggle::after,
body.pp-sidebar-collapsed #pp-sidebar .ms-auto { display: none !important; }
body.pp-sidebar-collapsed #pp-sidebar .nav-link { justify-content: center; padding: .6rem .4rem; }
body.pp-sidebar-collapsed #pp-sidebar .nav-link i { margin: 0 !important; font-size: 1.15rem; }
body.pp-sidebar-collapsed #pp-sidebar .nav-link > span.badge { display: none; }
body.pp-sidebar-collapsed #pp-collapse-toggle i.bi-chevron-double-left { transform: rotate(180deg); }

@media (max-width: 991.98px) {
    body.pp-sidebar-collapsed #pp-sidebar { width: 260px !important; }
    body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-label,
    body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-brand-text,
    body.pp-sidebar-collapsed #pp-sidebar .pp-sidebar-user-text,
    body.pp-sidebar-collapsed #pp-sidebar .dropdown-menu { display: initial !important; }
}

/* -------------------------------- NAVBAR -------------------------------- */
.navbar.bg-body-tertiary {
    background-color: var(--pp-sand-bg) !important;
    border-bottom: 1px solid var(--pp-sand-border);
}
.navbar.bg-body-tertiary .nav-link { color: #2a2d31; }
.navbar.bg-body-tertiary .nav-link:hover { color: var(--pp-primary-dark); }

/* -------------------------------- DARK MODE ----------------------------- */
[data-bs-theme="dark"] {
    --bs-body-bg: #1e1f22;
    --bs-body-bg-rgb: 30, 31, 34;
    --bs-body-color: #dcdfe4;
    --bs-body-color-rgb: 220, 223, 228;
    --bs-secondary-bg: var(--pp-dark-bg-2);
    --bs-tertiary-bg: var(--pp-dark-bg-3);
    --bs-border-color: var(--pp-dark-border-2);
    --bs-border-color-translucent: rgba(255, 255, 255, .1);
    --bs-emphasis-color: #fff;
    --bs-heading-color: #fff;
    --bs-secondary-color: rgba(220, 223, 228, 0.72);
    --bs-tertiary-color: rgba(220, 223, 228, 0.5);
    --bs-link-color: var(--pp-primary-light);
    --bs-link-color-rgb: 77, 208, 195;
    --bs-link-hover-color: var(--pp-primary-lighter);
}

[data-bs-theme="dark"] body { background-color: var(--bs-body-bg); color: var(--bs-body-color); }

/* Fond clairs hardcodés → dark */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light { background-color: var(--bs-secondary-bg) !important; color: var(--bs-body-color); }
[data-bs-theme="dark"] .bg-body-tertiary { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme="dark"] .bg-body-secondary { background-color: var(--bs-secondary-bg) !important; }

/* Conteneurs */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .popover,
[data-bs-theme="dark"] .toast,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .pp-card,
[data-bs-theme="dark"] .pp-stat {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .accordion-button {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--pp-primary-soft-2);
    color: var(--pp-primary-light);
}

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--pp-dark-bg-2) !important;
    border-color: var(--pp-dark-border) !important;
    color: var(--pp-dark-text);
}
[data-bs-theme="dark"] .dropdown-item { color: var(--pp-dark-text) !important; }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus { background-color: var(--pp-dark-border) !important; color: #fff !important; }
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item:active { background-color: var(--pp-primary) !important; color: #fff !important; }
[data-bs-theme="dark"] .dropdown-header { color: var(--pp-dark-text-muted) !important; }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--pp-dark-border) !important; }
.dropdown-item.active,
.dropdown-item:active { background-color: var(--pp-primary); color: #fff; }

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .form-control::placeholder { color: rgba(220, 223, 228, 0.5); }
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled { background-color: #1a1c20; color: rgba(220, 223, 228, 0.5); }
[data-bs-theme="dark"] .form-check-input { background-color: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .form-check-label { color: var(--bs-body-color); }

/* Tableaux */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
    color: var(--bs-body-color);
}
.table-responsive {
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
}

/* Nav tabs / Breadcrumb / Pagination */
[data-bs-theme="dark"] .nav-tabs { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--bs-body-color); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .breadcrumb { background-color: transparent; }
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .pagination {
    --bs-pagination-bg: var(--bs-secondary-bg);
    --bs-pagination-color: var(--bs-body-color);
    --bs-pagination-border-color: var(--bs-border-color);
    --bs-pagination-hover-bg: var(--bs-tertiary-bg);
    --bs-pagination-hover-color: #fff;
    --bs-pagination-disabled-bg: var(--bs-secondary-bg);
    --bs-pagination-disabled-color: rgba(220, 223, 228, 0.4);
}

/* Alerts (tons assourdis) */
[data-bs-theme="dark"] .alert-info { color: #b6e3f0; background-color: rgba(29, 161, 242, 0.12); border-color: rgba(29, 161, 242, 0.3); }
[data-bs-theme="dark"] .alert-warning { color: #ffe0a3; background-color: rgba(255, 180, 0, 0.12); border-color: rgba(255, 180, 0, 0.3); }
[data-bs-theme="dark"] .alert-danger { color: #f4bdab; background-color: rgba(231, 111, 81, 0.12); border-color: rgba(231, 111, 81, 0.3); }
[data-bs-theme="dark"] .alert-success { color: #a8e6a3; background-color: rgba(52, 195, 143, 0.12); border-color: rgba(52, 195, 143, 0.3); }

/* Text muted + borders */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-body-secondary { color: var(--bs-secondary-color) !important; }
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end { border-color: var(--bs-border-color) !important; }

/* Close / images */
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] img { filter: brightness(.95); }
[data-bs-theme="dark"] img.pp-no-dark-filter,
[data-bs-theme="dark"] .leaflet-container img { filter: none; }

/* Sidebar dark */
[data-bs-theme="dark"] #pp-sidebar {
    background-color: var(--pp-dark-bg) !important;
    color: var(--pp-dark-text);
    border-right: 1px solid var(--pp-dark-border);
}
[data-bs-theme="dark"] #pp-sidebar .nav-link { color: var(--pp-dark-text); }
[data-bs-theme="dark"] #pp-sidebar .nav-link:hover { background-color: rgba(77, 208, 195, 0.12); color: var(--pp-primary-light); }
[data-bs-theme="dark"] #pp-sidebar .nav-link.active,
[data-bs-theme="dark"] #pp-sidebar .nav-link.pp-parent-active { background-color: var(--pp-primary) !important; color: #fff !important; }
[data-bs-theme="dark"] #pp-sidebar .dropdown-menu { background-color: rgba(255, 255, 255, 0.04) !important; }
[data-bs-theme="dark"] #pp-sidebar .dropdown-menu .dropdown-item { color: var(--pp-dark-text); }
[data-bs-theme="dark"] #pp-sidebar .dropdown-menu .dropdown-item:hover { background-color: rgba(77, 208, 195, 0.12); color: var(--pp-primary-light); }
[data-bs-theme="dark"] #pp-sidebar .text-body-secondary,
[data-bs-theme="dark"] #pp-sidebar .text-uppercase { color: var(--pp-dark-text-muted) !important; }
[data-bs-theme="dark"] #pp-sidebar .border-top,
[data-bs-theme="dark"] #pp-sidebar .border-bottom { border-color: var(--pp-dark-border) !important; }

/* Navbar dark */
[data-bs-theme="dark"] .navbar.bg-body-tertiary {
    background-color: var(--pp-dark-bg) !important;
    border-bottom-color: var(--pp-dark-border);
}
[data-bs-theme="dark"] .navbar.bg-body-tertiary .nav-link { color: var(--pp-dark-text); }
[data-bs-theme="dark"] .navbar.bg-body-tertiary .nav-link:hover { color: var(--pp-primary-light); }
[data-bs-theme="dark"] .navbar .form-control { background-color: var(--pp-dark-bg-3); border-color: var(--pp-dark-border); color: var(--pp-dark-text); }

/* `btn btn-light` : en dark mode, sort un bouton quasi-blanc avec texte noir.
   On remap vers une variante secondary-bg qui reste lisible et cohérente. */
[data-bs-theme="dark"] .btn-light {
    --bs-btn-bg: var(--bs-tertiary-bg);
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-color: var(--bs-emphasis-color);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-color: var(--bs-emphasis-color);
    --bs-btn-active-border-color: var(--bs-border-color);
}

/* Dark mode — composants legacy portés & notifications */
[data-bs-theme="dark"] .device-card { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .device-card:hover { border-color: var(--pp-primary-light); }
[data-bs-theme="dark"] .form-field-group { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .notification-item { background: var(--bs-secondary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .notification-unread { background: rgba(77, 208, 195, .1); border-left-color: var(--pp-primary-light); }
[data-bs-theme="dark"] .notification-dropdown { background: var(--bs-secondary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .notification-icon.success { background: rgba(52, 195, 143, .18); color: #6fd5a8; }
[data-bs-theme="dark"] .notification-icon.warning { background: rgba(241, 180, 76, .18); color: #f5ca7a; }
[data-bs-theme="dark"] .notification-icon.error { background: rgba(231, 111, 81, .18); color: #ffb89e; }
[data-bs-theme="dark"] .notification-icon.info { background: rgba(77, 208, 195, .18); color: var(--pp-primary-light); }
[data-bs-theme="dark"] .notification-badge { background: var(--pp-primary); }
[data-bs-theme="dark"] .notification-action.primary { background: var(--pp-primary); color: #fff; }
[data-bs-theme="dark"] .notification-action.primary:hover { background: var(--pp-primary-dark); }
[data-bs-theme="dark"] .notification-action.secondary {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .pp-empty-state-icon { color: var(--pp-primary-light); }

/* ---------------------- REPORT BUILDER LAYOUT --------------------------- */
/* Responsive : wrap sur petits écrans, plus de débordement */
.report-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 600px;
}
.editor-panel,
.preview-panel {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}
@media (min-width: 1200px) {
    .editor-panel { flex: 0 0 440px; max-width: 440px; }
    .preview-panel { flex: 1 1 0; }
}
.editor-panel .card,
.preview-panel .card { display: flex; flex-direction: column; min-width: 0; }
.builder-toolbar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .75rem;
    background: var(--bs-tertiary-bg);
    border-radius: .375rem;
    margin-bottom: 1rem;
}
[data-bs-theme="dark"] .builder-toolbar { background: var(--pp-dark-bg-2); }
.section-list, .preview-panel .report-preview {
    overflow-y: auto;
    max-height: calc(100vh - 320px);
}

/* ─────────────────────────────────────────────────────────────────────────
   Card-grid helper — equal-height columns + vertical stacking
   ─────────────────────────────────────────────────────────────────────────
   Lives HERE (app override, loaded after theme.css) on purpose: it is NOT part
   of the Anw base theme, and regenerating theme.css has reverted this fix
   before — cf. reference_ui_gotchas. Keeping it in paperpoint.css makes it
   survive any theme regeneration via the cascade.

   The trap it avoids: putting a card-bearing column in `display:flex` without
   `flex-direction:column` turns the column into a flex ROW, so several cards
   stacked in one column line up side by side, cramped (the "entassé" bug on
   /users/<pk>/ and /users/teams/<pk>/). Fix: stack vertically, and only let a
   SOLE card stretch (which is what keeps one-card-per-column KPI rows
   equal-height); multiple cards keep natural height + their own mb-* spacing.
   Do NOT reintroduce `display:flex` without `column`, nor `flex:1` without
   `:only-child`. */
.row:has(> [class*="col-"] > .card),
.row:has(> [class*="col-"] > [class*="card-"]),
.row:has(> .col > .card) {
  --bs-gutter-y: 1rem;
  row-gap: 1rem;
}
.row:has(> [class*="col-"] > .card) > [class*="col-"],
.row:has(> [class*="col-"] > [class*="card-"]) > [class*="col-"],
.row:has(> .col > .card) > .col {
  display: flex;
  flex-direction: column;
}
.row:has(> [class*="col-"] > .card) > [class*="col-"] > .card:only-child,
.row:has(> [class*="col-"] > [class*="card-"]) > [class*="col-"] > [class*="card-"]:only-child,
.row:has(> .col > .card) > .col > .card:only-child {
  flex: 1 1 auto;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Overrides AltiusForms réinjectés après régénération du theme.css Anw.
   Le theme.css de base est écrasé depuis Anw à chaque synchro ; ces règles
   vivent ici (chargé après) pour survivre. Voir MEMORY : gotcha form-select.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Le theme.css Anw pose `background: var(--app-surface)` (raccourci) sur
   .form-select, ce qui remet background-image à `none` et EFFACE la flèche que
   Bootstrap dessine → le select paraît inerte. On restaure toute la pile
   background en référençant la variable chevron de Bootstrap (--bs-form-select-
   bg-img), qui bascule automatiquement en mode sombre. */
.form-select {
  background-color: var(--app-surface);
  background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px 12px;
}

/* Variante shell pour les pages anonymes : même chrome (topbar + main) sans
   sidebar. */
.app-shell.app-shell--anon {
  grid-template-columns: 1fr;
  grid-template-areas: "topbar" "main";
}

/* min-width:0 — laisse un enfant flex rétrécir et tronquer au lieu de déborder. */
.min-w-0 { min-width: 0 !important; }

/* .card-header d'Anw est `display:flex; justify-content:space-between`. Une
   grille Bootstrap `.row` placée dedans devient un flex-item unique qui rétrécit
   à son contenu minimal → le titre passe sur plusieurs lignes et les selects de
   filtre s'écrasent en un chevron illisible. On force la row à remplir toute la
   largeur de l'entête pour que ses colonnes reprennent des largeurs normales.
   Beaucoup de tables utilisent ce pattern (entête card = titre + filtre). */
.card-header > .row {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

/* ==== 30-media.css ==== */
/* ============================================================================
   AltiusForms — Media capture widgets (.pp-media)
   Chargé sur les formulaires de remplissage (public/authenticated/collab/form)
   ET l'app. Autonome, 100% tokens Anw → suit le thème clair/sombre. Extrait de
   paperpoint.css car les pages de remplissage standalone ne chargent PAS
   paperpoint.css. Voir MEMORY reference_media_widgets.
   ============================================================================ */

/* ═══════════════════════════════════════════════════════════════════════════
   MEDIA CAPTURE WIDGETS (.pp-media) — dictaphone, photo, vidéo (mono/multi).
   Système partagé par tous les widgets de capture (templates
   formsbuilder/widgets/*_input.html). 100 % tokens Anw → suit le thème en clair
   ET sombre, aucune couleur hardcodée, aucune classe Tabler (btn-xs) ni
   espacement invalide (m-10/me-5). Remplace les <style>/style="" inline.
   ═══════════════════════════════════════════════════════════════════════════ */
.pp-media { --pp-media-max: 560px; display: flex; flex-direction: column; gap: .75rem; }
/* Le fichier réel est piloté par le widget (capture) → jamais l'input natif. */
.pp-media > input[type="file"] { display: none !important; }

/* Boutons utilitaires NEUTRES dans les widgets média. `.btn-outline-secondary`
   et `.btn-secondary` de l'app sont coral (--pp-secondary) → hors thème pour des
   contrôles techniques. On les repeint en gris neutre (tokens Anw), light/dark. */
.pp-media .btn-outline-secondary {
  --bs-btn-color: var(--gray-700);
  --bs-btn-border-color: var(--gray-400);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-bg: var(--gray-100);
  --bs-btn-hover-border-color: var(--gray-500);
  --bs-btn-active-bg: var(--gray-200);
  --bs-btn-active-border-color: var(--gray-500);
  --bs-btn-active-color: var(--bs-body-color);
}
.pp-media .btn-secondary {
  --bs-btn-bg: var(--gray-200);
  --bs-btn-border-color: var(--gray-300);
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-hover-bg: var(--gray-300);
  --bs-btn-hover-border-color: var(--gray-400);
  --bs-btn-hover-color: var(--bs-body-color);
}
/* Cibles tactiles confortables sur mobile (>= 40px). */
.pp-media .btn { min-height: 40px; }
.pp-media__controls { row-gap: .5rem; }

/* Scène : preview caméra live ou média capturé, sur fond sombre neutre.
   Ratio 16:9 = celui de la caméra (1280×720) → pas de bandes noires en live. */
.pp-media__stage {
  position: relative;
  width: 100%;
  max-width: var(--pp-media-max);
  aspect-ratio: 16 / 9;
  background: #0b0d12;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pp-media__stage > video,
.pp-media__stage > img,
.pp-media__stage > canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
/* Live camera : `cover` remplit la scène (pas de bandes noires). Média capturé
   (photo/vidéo relue) : `contain` pour montrer l'image entière sans rogner. */
.pp-media__stage > video:not(.recorded-video):not([controls]) { object-fit: cover; }
.pp-media__stage > video.recorded-video,
.pp-media__stage > video[controls],
.pp-media__stage > img { object-fit: contain; }
.pp-media__stage--contain > img { object-fit: contain; }

/* Placeholder (caméra éteinte). */
.pp-media__placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem;
  color: rgba(255, 255, 255, .6);
  cursor: pointer; text-align: center; padding: 1rem;
}
.pp-media__placeholder i { font-size: 2.5rem; opacity: .6; }
.pp-media__placeholder p { margin: 0; font-size: var(--fs-sm); }

/* Gate idle : la caméra/micro n'est PAS acquise tant que l'utilisateur n'a pas
   activé CE champ (évite que plusieurs widgets se battent pour l'appareil au
   chargement). Superpose la scène avec une icône + un bouton d'activation. */
.pp-media__gate {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .75rem;
  padding: 1rem; text-align: center;
  color: rgba(255, 255, 255, .7);
  background: radial-gradient(circle at center, #14171f 0%, #0b0d12 100%);
}
.pp-media__gate i { font-size: 2.5rem; opacity: .7; }
.pp-media__gate p { margin: 0; font-size: var(--fs-sm); }

/* Pastille statut, coin haut-droit de la scène. Couleur pilotée par
   data-status → un seul markup, pas de innerHTML qui réinjecte des styles. */
.pp-media__status {
  position: absolute; top: .5rem; right: .5rem;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .6rem;
  font-size: var(--fs-xs); font-weight: 600;
  color: #fff; background: rgba(0, 0, 0, .55);
  border-radius: 999px; backdrop-filter: blur(4px);
}
.pp-media__status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-400); flex-shrink: 0;
}
.pp-media__status[data-status="ready"]::before     { background: var(--success-500); }
.pp-media__status[data-status="recording"]::before { background: var(--danger-500); animation: pp-media-pulse 1s infinite; }
.pp-media__status[data-status="processing"]::before{ background: var(--warning-500); }
.pp-media__status[data-status="captured"]::before,
.pp-media__status[data-status="completed"]::before { background: var(--brand-500); }
.pp-media__status[data-status="error"]::before     { background: var(--danger-500); }

/* Boutons flottants sur la scène (grille, flash, switch). */
.pp-media__stage-btn {
  position: absolute;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .3rem .5rem;
  color: #fff; background: rgba(0, 0, 0, .5);
  border: 0; border-radius: var(--radius-md);
  font-size: var(--fs-xs); cursor: pointer;
  transition: background var(--t-fast);
}
.pp-media__stage-btn:hover { background: rgba(0, 0, 0, .7); }
.pp-media__stage-btn.is-active { color: var(--warning-500); }

/* Grille de composition (règle des tiers). */
.pp-media__grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  opacity: .35; pointer-events: none;
}
.pp-media__grid > span { border: 1px solid rgba(255, 255, 255, .7); }

/* Rangée de contrôles principale. */
.pp-media__controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.pp-media__controls--center { justify-content: center; }

/* Déclencheur circulaire (photo). */
.pp-media__shutter {
  width: 60px; height: 60px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border-radius: 50%;
  background: var(--app-surface);
  border: 3px solid var(--brand-600);
  cursor: pointer; box-shadow: var(--shadow-md);
  transition: transform var(--t-fast);
}
.pp-media__shutter::after {
  content: ""; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-600); transition: background var(--t-fast);
}
.pp-media__shutter:active { transform: scale(.92); }
.pp-media__shutter:disabled { opacity: .5; cursor: not-allowed; }

/* Compteur / méta (durée, dimensions, format). */
.pp-media__meta {
  display: flex; flex-wrap: wrap; gap: .75rem;
  font-size: var(--fs-sm); color: var(--gray-600);
}
.pp-media__meta i { margin-right: .25rem; }

/* Bloc preview (audio player, vidéo relue, photo prise). */
.pp-media__preview { display: flex; flex-direction: column; gap: .5rem; }
.pp-media__preview audio { width: 100%; }
.pp-media__ok { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); color: var(--success-500); }

/* Galerie multi-items. */
.pp-media__gallery {
  display: flex; flex-wrap: wrap; gap: .5rem;
  max-height: 260px; overflow-y: auto;
  padding: .25rem;
}
.pp-media__thumb {
  position: relative; width: 92px; height: 92px;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--app-border); cursor: pointer;
}
.pp-media__thumb img,
.pp-media__thumb video { width: 100%; height: 100%; object-fit: cover; }
.pp-media__thumb-num {
  position: absolute; bottom: 3px; left: 3px;
  padding: 0 .35rem; border-radius: 4px;
  font-size: 11px; color: #fff; background: rgba(0, 0, 0, .7);
}
/* Cible tactile confortable (28px visible + zone de 44px via ::before). */
.pp-media__thumb-remove {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: var(--danger-500); line-height: 1;
  font-size: 1rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.pp-media__thumb-remove::before {
  content: ""; position: absolute; inset: -8px;
}

/* Lightbox preview (plein écran dans le widget). */
.pp-media__lightbox {
  position: fixed; inset: 0; z-index: 1080;
  display: none; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgba(0, 0, 0, .85);
}
.pp-media__lightbox.is-open { display: flex; }
.pp-media__lightbox-box {
  position: relative; max-width: 820px; width: 100%;
  max-height: 90vh; overflow: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); padding: .6rem;
}
.pp-media__lightbox-box img,
.pp-media__lightbox-box video { width: 100%; border-radius: var(--radius-md); display: block; }
.pp-media__lightbox-actions { position: absolute; top: .8rem; right: .8rem; display: flex; gap: .4rem; }
.pp-media__lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
}
.pp-media__lightbox-nav--prev { left: .8rem; }
.pp-media__lightbox-nav--next { right: .8rem; }

/* Bouton flash actif. */
.pp-media .flash-toggle.is-flash-on,
.pp-media .burst-toggle.is-active {
  color: var(--warning-500);
  border-color: var(--warning-500);
}

/* Bande d'onde (dictaphone) : strip sombre, pas de scène 4:3. */
.pp-media__wave {
  width: 100%; max-width: var(--pp-media-max);
  height: 72px;
  background: #0b0d12;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  display: block;
}

/* ─── Champ au repos (« Net ») ─────────────────────────────────────────────
   Tant que la caméra n'est pas allumée, pas de grand bloc noir : une zone
   claire, en pointillés, à la taille du contenu. La scène sombre ne revient
   que pendant la prise de vue et la relecture. */
.pp-media[data-state="idle"] .pp-media__stage {
  aspect-ratio: auto;
  height: 168px;
  background: var(--app-surface-muted);
  border: 1px dashed var(--gray-300);
}
.pp-media[data-state="idle"] .pp-media__gate { background: transparent; color: var(--gray-600); }
.pp-media[data-state="idle"] .pp-media__gate > i { color: var(--gray-500); opacity: 1; font-size: 2rem; }
.pp-media__gate .btn i { font-size: 1rem; opacity: 1; color: inherit; }
/* Dictaphone : la bande d'onde n'apparaît que pendant l'enregistrement. */
.audio-recording-widget:not(.is-recording) .pp-media__wave { display: none; }

@keyframes pp-media-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }


/* ─── Mobile : contrôles confortables, pas de débordement ──────────────── */
@media (max-width: 576px) {
  .pp-media { --pp-media-max: 100%; }
  /* Les boutons de contrôle passent pleine largeur (min 2 par ligne) et
     gardent une hauteur tactile. Le déclencheur photo reste centré au-dessus. */
  .pp-media__controls { flex-wrap: wrap; }
  .pp-media__controls .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
  .pp-media__controls--center { flex-direction: column; align-items: stretch; }
  .pp-media__controls--center .pp-media__shutter { align-self: center; }
  .pp-media__shutter { width: 68px; height: 68px; }
  .pp-media__shutter::after { width: 28px; height: 28px; }
  .pp-media__lightbox { padding: .5rem; }
  .pp-media__gallery { gap: .4rem; }
}

/* ==== 40-net.css ==== */
/* =========================================================================
   NET.CSS — direction « Net » (sobre et professionnelle) + composants
   de liste. Chargé après theme.css ; ne lit que des variables, donc un
   thème client (/theme/<id>.css) le recolore sans y toucher.
   ========================================================================= */

/* ── Base ─────────────────────────────────────────────────────────────── */
body { font-family: var(--font-sans); font-size: var(--fs-base); }
.pp-mono, .app-sidebar__section-title {
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

/* Le bouton principal prend la couleur exacte du thème (pas une nuance). */
.btn-primary {
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-color: var(--color-on-primary);
  --bs-btn-hover-color: var(--color-on-primary);
  --bs-btn-active-color: var(--color-on-primary);
  box-shadow: none;
  font-weight: 500;
}

/* ── Menu latéral : la page active en gris, la couleur reste pour l'action ── */
.app-nav-link { font-size: var(--fs-md); padding: 8px 10px; }
.app-nav-link.active { background: var(--gray-100); color: var(--gray-950); font-weight: 500; }
.app-nav-link.active i { color: var(--gray-800); }
.app-sidebar__section-title { font-size: 11px; color: var(--gray-500); }
.app-nav-sublink.active { background: transparent; color: var(--gray-950); font-weight: 600; }
.app-nav-sublink.active::before { background: var(--color-primary); }

/* ── En-tête de page ──────────────────────────────────────────────────── */
.page-header { border-bottom: 0; margin-bottom: 20px; padding-bottom: 0; align-items: center; }
.page-header__subtitle { font-size: var(--fs-md); color: var(--gray-600); }

/* ── Cartes : filet, pas d'ombre ──────────────────────────────────────── */
.card { box-shadow: none; }

/* ── Recherche ────────────────────────────────────────────────────────── */
.pp-search {
  display: flex; align-items: center; gap: 8px;
  height: var(--control-h-md); padding: 0 12px; width: 260px; max-width: 100%;
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); color: var(--gray-500);
}
.pp-search:focus-within { border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.pp-search__input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--color-text); font: inherit; }

/* ── Chiffres clés ────────────────────────────────────────────────────── */
.pp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pp-kpi {
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg);
}
.pp-kpi__label { font-size: var(--fs-sm); color: var(--gray-600); }
.pp-kpi__value { font-size: 26px; font-weight: 600; color: var(--gray-950); font-variant-numeric: tabular-nums; }

/* ── Tableau ──────────────────────────────────────────────────────────── */
.pp-table-wrap {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); overflow-x: auto;
}
.pp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.pp-table thead th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-500);
  padding: 12px 20px; border-bottom: 1px solid var(--app-border); white-space: nowrap; text-align: left;
}
.pp-table td { padding: 14px 20px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table tbody tr:hover { background: var(--gray-50); }
.pp-table__title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--gray-950); }
.pp-table__title a { color: inherit; text-decoration: none; }
.pp-table__title a:hover { color: var(--color-primary); text-decoration: underline; }
.pp-table__meta { font-size: var(--fs-sm); color: var(--gray-500); margin-top: 2px; }
.pp-num { font-variant-numeric: tabular-nums; }
.pp-table .dropdown-item i { width: 18px; color: var(--gray-500); }
.pp-table .dropdown-item.text-danger i { color: inherit; }

/* ── Étiquette et « en direct » ───────────────────────────────────────── */
.pp-tag {
  font-size: 11px; font-weight: 500; color: var(--gray-700);
  background: var(--gray-100); border-radius: var(--radius-sm); padding: 2px 6px;
}
.pp-live { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-fg); text-decoration: none; font-weight: 500; }
.pp-live:hover { text-decoration: underline; }
.pp-live__dot {
  width: 8px; height: 8px; border-radius: 4px; background: var(--success-500);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--success-500) 20%, transparent);
}

@media (max-width: 767.98px) {
  .page-header__actions { width: 100%; }
  .pp-search { width: auto; flex: 1; }
  .pp-table thead th:nth-child(2), .pp-table td:nth-child(2) { display: none; }
}

/* ── Champs de formulaire ─────────────────────────────────────────────── */
/* Sélecteur de fichier : le bouton natif prend le style des boutons. */
input[type="file"].form-control { padding: 0; overflow: hidden; }
input[type="file"].form-control::file-selector-button {
  height: 100%; margin: 0 12px 0 0; padding: 0 14px;
  border: 0; border-right: 1px solid var(--app-border);
  background: var(--app-surface-muted); color: var(--color-text);
  font: inherit; font-weight: 500; cursor: pointer;
}
input[type="file"].form-control:hover::file-selector-button { background: var(--gray-200); }
/* Téléphone (intl-tel-input) : même largeur et hauteur que les autres champs. */
.iti { display: block; width: 100%; }
.iti input.form-control, .iti input[type="tel"] {
  width: 100%; height: var(--control-h-md);
  border: var(--bs-border-width, 1px) solid var(--app-border); border-radius: var(--radius-md);
  font: inherit; color: var(--color-text); background: var(--app-surface);
}
.iti input[type="tel"]:focus { border-color: var(--color-primary); box-shadow: var(--shadow-focus); outline: 0; }

/* ── Boutons secondaires : gris sobre (paperpoint.css les mettait en corail) ── */
.btn-secondary, .btn-outline-secondary {
  --bs-btn-color: var(--gray-800);
  --bs-btn-bg: var(--app-surface);
  --bs-btn-border-color: var(--gray-300);
  --bs-btn-hover-color: var(--gray-950);
  --bs-btn-hover-bg: var(--gray-100);
  --bs-btn-hover-border-color: var(--gray-400);
  --bs-btn-active-color: var(--gray-950);
  --bs-btn-active-bg: var(--gray-200);
  --bs-btn-active-border-color: var(--gray-400);
  --bs-btn-disabled-color: var(--gray-500);
  --bs-btn-disabled-bg: var(--app-surface);
  --bs-btn-disabled-border-color: var(--gray-200);
}

/* ── Pastilles : teintes pâles et texte lisible (Bootstrap force les
      couleurs pleines de text-bg-* avec !important). ───────────────────── */
.badge { font-weight: 500; letter-spacing: 0; }
.badge.text-bg-secondary, .badge.bg-secondary, .badge.bg-light, .badge.bg-dark {
  background: var(--gray-100) !important; color: var(--gray-700) !important;
}
.badge.text-bg-success, .badge.bg-success { background: var(--success-100) !important; color: var(--success-600) !important; }
.badge.text-bg-warning, .badge.bg-warning { background: var(--warning-100) !important; color: oklch(45% .15 var(--status-warning-hue)) !important; }
.badge.text-bg-danger, .badge.bg-danger { background: var(--danger-100) !important; color: var(--danger-600) !important; }
.badge.text-bg-info, .badge.bg-info { background: var(--info-100) !important; color: var(--info-600) !important; }
.badge.bg-primary { background: var(--brand-100) !important; color: var(--brand-800) !important; }

/* ── Tableau de bord : pas de bandeau en dégradé ──────────────────────── */
.welcome-banner {
  background: var(--app-surface) !important; color: var(--color-text) !important;
  border: 1px solid var(--app-border); border-radius: var(--radius-lg) !important;
}
.welcome-banner h2, .welcome-banner p { color: inherit !important; }

/* ── Générateur : en-tête de groupe neutre ────────────────────────────── */
.group-container > .card { border-left-width: 1px !important; border-color: var(--app-border) !important; }
.group-container > .card > .card-header { background: var(--gray-50) !important; }
.group-container > .card > .card-header .text-success { color: var(--gray-600) !important; }

/* ── Choix en cartes (radio) ──────────────────────────────────────────── */
.pp-choices { display: grid; gap: 8px; }
.pp-choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--app-border); border-radius: var(--radius-md); background: var(--app-surface);
}
.pp-choice:hover { border-color: var(--gray-300); background: var(--gray-50); }
.pp-choice:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.pp-choice .form-check-input { margin-top: 3px; flex-shrink: 0; }
.pp-choice__body { display: flex; flex-direction: column; gap: 2px; }
.pp-choice__title { font-weight: 500; color: var(--gray-950); }
.pp-choice__desc { font-size: var(--fs-sm); color: var(--gray-600); }

/* ── Confirmation d'envoi : en-tête sobre, coche verte pâle ───────────── */
.pp-success-head { background: var(--app-surface) !important; color: var(--color-text-strong); border-bottom: 1px solid var(--app-border); }
.pp-success-head h1, .pp-success-head h2, .pp-success-head h4, .pp-success-head h5 { color: inherit; }
.pp-success-icon {
  width: 60px; height: 60px; border-radius: 50%; font-size: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--success-100); color: var(--success-600);
}

/* ── Boutons « info » (cyan Bootstrap) : même gris sobre que les secondaires ── */
.btn-outline-info, .btn-info {
  --bs-btn-color: var(--gray-800);
  --bs-btn-bg: var(--app-surface);
  --bs-btn-border-color: var(--gray-300);
  --bs-btn-hover-color: var(--gray-950);
  --bs-btn-hover-bg: var(--gray-100);
  --bs-btn-hover-border-color: var(--gray-400);
  --bs-btn-active-color: var(--gray-950);
  --bs-btn-active-bg: var(--gray-200);
  --bs-btn-active-border-color: var(--gray-400);
}
/* Bouton vert « success » : la couleur d'action du thème. */
.btn-success {
  --bs-btn-bg: var(--color-primary); --bs-btn-border-color: var(--color-primary);
  --bs-btn-color: var(--color-on-primary); --bs-btn-hover-color: var(--color-on-primary);
  --bs-btn-hover-bg: var(--color-primary-hover); --bs-btn-hover-border-color: var(--color-primary-hover);
  --bs-btn-active-bg: var(--color-primary-hover); --bs-btn-active-border-color: var(--color-primary-hover);
}

/* ── Une ligne « aucun élément » ne réagit pas au survol ─────────────── */
.table > tbody > tr:has(.empty-state):hover,
.table > tbody > tr:has(.empty-state):hover > td { background: transparent; --bs-table-bg-state: transparent; }

/* ── Petits sélecteurs : la flèche ne recouvre plus le texte ─────────── */
.form-select-sm { padding-right: 2rem; background-position: right .5rem center; }

/* ── Logo AltiusForms : version claire ou sombre selon le thème ─────── */
.pp-logo-dark { display: none !important; }
[data-bs-theme="dark"] .pp-logo-light { display: none !important; }
[data-bs-theme="dark"] .pp-logo-dark { display: inline-block !important; }

/* ── Pages de saisie (création, paramètres) : une colonne lisible ───── */
.pp-create, .pp-settings { max-width: 760px; }
.pp-section {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
}
.pp-section__title { font-size: var(--fs-lg, 16px); font-weight: 600; color: var(--gray-950); margin: 0 0 4px; }
.pp-section__lead { font-size: var(--fs-sm); color: var(--gray-600); margin: 0 0 16px; }
.pp-section__title + .pp-choices, .pp-section__title + .pp-field { margin-top: 12px; }
.pp-field + .pp-field { margin-top: 20px; }
.pp-field .form-label { font-weight: 500; color: var(--gray-900); }
.pp-optional { font-weight: 400; color: var(--gray-500); font-size: var(--fs-sm); }
.pp-section > .form-text { margin-top: 12px; }
.pp-choice__extra { display: block; margin-top: 10px; max-width: 280px; }
.pp-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 0 24px; }
.pp-actions--sticky {
  position: sticky; bottom: 0; z-index: 5; justify-content: space-between;
  background: var(--app-bg, var(--app-surface-muted)); border-top: 1px solid var(--app-border);
  padding: 12px 0; margin-top: 8px;
}

/* ==== 50-report-builder.css ==== */
/* ============================================================================
   Report Builder — styles spécifiques (hors layout général).
   Layout responsif (.report-builder, .editor-panel, .preview-panel, .builder-toolbar,
   .section-list overflow/max-height) : défini dans static/css/paperpoint.css.
   Ce fichier ne contient QUE les détails propres au builder (items, preview, modal,
   empty state interne).
   Tous les tokens passent par --pp-* ou --bs-*.
   ============================================================================ */

/* ---------- Section list (skin — le layout est dans paperpoint.css) ---------- */
.section-list {
    padding: 10px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    min-height: 200px;
}

.section-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    cursor: grab;
    transition: border-color .2s, box-shadow .2s;
}
.section-item:hover {
    border-color: var(--pp-primary);
    box-shadow: 0 2px 8px rgba(8, 129, 120, .15);
}
.section-item.dragging { opacity: .5; transform: scale(1.02); }

.section-item .drag-handle { cursor: grab; color: var(--bs-secondary-color); padding: 4px; }
.section-item .section-content { flex: 1; }
.section-item .section-type {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: 4px;
}
.section-item .section-actions { display: flex; gap: 4px; }
.section-item .section-actions .btn { padding: 2px 6px; font-size: 12px; }

/* Section type icons */
.section-icon {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 18px;
}
.section-icon.title { background: #e7f1ff; color: #0d6efd; }
.section-icon.text { background: #e8f5e9; color: #28a745; }
.section-icon.stats { background: #fff3e0; color: #fd7e14; }
.section-icon.figure { background: #f3e5f5; color: #6f42c1; }
.section-icon.cross { background: #e0f7fa; color: #17a2b8; }

/* ---------- Preview pane ---------- */
.preview-container {
    flex: 1;
    overflow-y: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.preview-content { padding: 40px; min-height: 100%; }

.preview-content .report-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--bs-emphasis-color);
    margin-bottom: 20px;
    text-align: center;
}
.preview-content .report-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 25px 0 15px;
}
.preview-content .report-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--bs-body-color);
    margin: 15px 0;
}

.preview-content .report-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}
.preview-content .stat-item {
    text-align: center;
    padding: 15px 25px;
    background: var(--bs-tertiary-bg);
    border-radius: 8px;
}
.preview-content .stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--pp-primary);
}
.preview-content .stat-label {
    font-size: 12px;
    color: var(--bs-secondary-color);
}

.preview-content .report-figure,
.preview-content .report-cross-analysis {
    margin: 25px 0;
    padding: 30px;
    background: var(--bs-tertiary-bg);
    border: 2px dashed var(--bs-border-color);
    border-radius: 8px;
    text-align: center;
}
.preview-content .figure-placeholder { color: var(--bs-secondary-color); }
.preview-content .figure-placeholder i {
    font-size: 48px;
    opacity: .5;
    margin-bottom: 10px;
}

.preview-content .report-divider {
    border: none;
    border-top: 2px solid var(--bs-border-color);
    margin: 30px 0;
}
.preview-content .page-break {
    border: 2px dashed var(--pp-secondary);
    margin: 20px 0;
    padding: 10px;
    text-align: center;
    color: var(--pp-secondary);
    font-size: 12px;
}

/* ---------- Modal styles ---------- */
.section-config-modal .modal-body { padding: 20px; }
.config-group { margin-bottom: 15px; }
.config-group label { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: block; }

/* ---------- Empty state interne au builder ---------- */
.empty-sections {
    text-align: center;
    padding: 40px;
    color: var(--bs-secondary-color);
}
.empty-sections i { font-size: 48px; opacity: .3; margin-bottom: 15px; }

/* ---------- Footer actions ---------- */
.builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bs-tertiary-bg);
    border-radius: 8px;
    margin-top: 15px;
}

/* ============================================================================
   DARK MODE — overrides ciblés (se branche sur [data-bs-theme="dark"] global)
   ============================================================================ */
[data-bs-theme="dark"] .section-list,
[data-bs-theme="dark"] .section-item {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .section-item:hover {
    border-color: var(--pp-primary-light);
    box-shadow: 0 2px 8px rgba(8, 129, 120, .25);
}
[data-bs-theme="dark"] .section-item .drag-handle,
[data-bs-theme="dark"] .section-item .section-type,
[data-bs-theme="dark"] .empty-sections,
[data-bs-theme="dark"] .preview-content .stat-label,
[data-bs-theme="dark"] .preview-content .figure-placeholder { color: var(--bs-secondary-color); }

/* Section type icons — variantes dark mode */
[data-bs-theme="dark"] .section-icon.title { background: rgba(13, 110, 253, .2); color: #79b8ff; }
[data-bs-theme="dark"] .section-icon.text { background: rgba(40, 167, 69, .2); color: #85e89d; }
[data-bs-theme="dark"] .section-icon.stats { background: rgba(253, 126, 20, .2); color: #ffab70; }
[data-bs-theme="dark"] .section-icon.figure { background: rgba(111, 66, 193, .2); color: #b392f0; }
[data-bs-theme="dark"] .section-icon.cross { background: rgba(23, 162, 184, .2); color: #79dfc1; }

[data-bs-theme="dark"] .preview-container,
[data-bs-theme="dark"] .preview-panel .card {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
[data-bs-theme="dark"] .preview-content .report-title { color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .preview-content .report-subtitle { color: var(--bs-body-color); }
[data-bs-theme="dark"] .preview-content .report-text { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .preview-content .stat-item,
[data-bs-theme="dark"] .preview-content .report-figure,
[data-bs-theme="dark"] .preview-content .report-cross-analysis {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .preview-content .stat-value { color: var(--pp-primary-light); }
[data-bs-theme="dark"] .preview-content .report-divider { border-top-color: var(--bs-border-color); }
[data-bs-theme="dark"] .preview-content .page-break { border-color: var(--pp-secondary); color: #ff9999; }

[data-bs-theme="dark"] .builder-footer { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); }

[data-bs-theme="dark"] .section-config-modal .modal-content,
[data-bs-theme="dark"] #section-modal .modal-content {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] #section-modal .modal-header,
[data-bs-theme="dark"] #section-modal .modal-footer {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] #section-modal .modal-header .modal-title { color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .config-group label { color: var(--bs-body-color); }

/* Canvas helpers (rarely-used legacy selectors) */
[data-bs-theme="dark"] .section-placeholder {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: rgba(220, 223, 228, .5);
}
[data-bs-theme="dark"] .section-toolbar {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .report-preview { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
[data-bs-theme="dark"] .preview-section { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .preview-title { color: var(--bs-emphasis-color); }
[data-bs-theme="dark"] .chart-wrapper { background: var(--bs-secondary-bg); }
[data-bs-theme="dark"] .preview-kpi { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .preview-kpi-value { color: var(--pp-primary-light); }
[data-bs-theme="dark"] .preview-kpi-label { color: var(--bs-secondary-color); }

[data-bs-theme="dark"] .report-builder .card-header.bg-primary { background-color: var(--pp-primary) !important; }
[data-bs-theme="dark"] .report-builder .card-header.bg-secondary { background-color: var(--bs-tertiary-bg) !important; }

/* ==== 60-partials.css ==== */
/* =========================================================================
   FRAGMENTS DU CONSTRUCTEUR ET DES SOUMISSIONS
   (templates/formsbuilder/partials/*, templates/pages/*).
   ========================================================================= */

/* Pages statiques (confidentialité, conditions, aide). */
.pg-static-card { max-width: 820px; }

/* Sessions collaboratives : code d'accès et codes de créneau. */
.collab-access-code {
  font-family: var(--font-mono); font-size: 1.125rem; font-weight: 700;
  letter-spacing: .1875rem; color: var(--brand-600);
}
.slot-code-chip {
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
  border-radius: .375rem; padding: .25rem .625rem;
}
.slot-code-chip__code { font-size: .8125rem; font-weight: 700; letter-spacing: .125rem; color: var(--brand-600); }
.slot-code-chip__copy { padding: 0 .25rem; }
.slot-code-chip__copy .bi { font-size: .75rem; }
.collab-slot-panel { border-style: dashed !important; }
.collab-select-sm { width: 100px; }
.collab-select-md { width: 160px; }
.collab-input-label { width: 200px; }

/* Choix de la langue sur les pages publiques (partials/public_language_selector.html). */
.public-lang-selector { position: relative; display: inline-block; }
.public-lang-selector .lang-current {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--gray-100);
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--gray-800);
    transition: background var(--t-fast);
    user-select: none;
}
.public-lang-selector .lang-current:hover { background: var(--gray-200); }
.public-lang-selector .lang-arrow { transition: transform var(--t-fast); font-size: 12px; }
.public-lang-selector.open .lang-arrow { transform: rotate(180deg); }
.public-lang-selector .lang-dropdown {
    display: none;
    position: absolute;
    top: 100%; right: 0;
    margin-top: 4px;
    background: var(--app-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--app-border);
    min-width: 160px;
    overflow: hidden;
    z-index: 1100;
}
.public-lang-selector.open .lang-dropdown { display: block; }
.public-lang-selector .lang-form { margin: 0; }
.public-lang-selector .lang-option {
    display: block; width: 100%;
    padding: 10px 16px;
    border: none; background: none;
    text-align: left;
    font-size: var(--fs-sm);
    cursor: pointer;
    color: var(--gray-800);
    transition: background var(--t-fast);
}
.public-lang-selector .lang-option:hover { background: var(--gray-100); }
.public-lang-selector .lang-option.active {
    color: var(--brand-700);
    font-weight: 600;
    background: var(--brand-50);
}

/* Formulaire intégré dans un autre site (?embed=1, partials/embed_mode.html) :
   ni en-tête ni pied, fond transparent. */
html.is-embed, html.is-embed body { background: transparent !important; min-height: 0 !important; }
html.is-embed .public-header, html.is-embed .public-footer, html.is-embed .success-footer { display: none !important; }
html.is-embed .public-form-container { padding-top: 0 !important; padding-bottom: 0 !important; }

/* Aperçu du formulaire dans le constructeur (partials/preview_form.html). */
.preview-form-container {
  background: var(--app-surface-muted); border: 2px dashed var(--app-border);
  border-radius: var(--radius-lg); padding: 1.25rem; position: relative;
}
.preview-form-container::before {
  content: attr(data-label); position: absolute; top: -0.6rem; left: 1rem;
  background: var(--app-surface); padding: 0.1rem 0.6rem; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--gray-600);
}
.preview-form-container .form-group-container .card,
.preview-form-container .form-group-container .section-group,
.preview-form-container .form-group-container fieldset { border-left: 3px solid var(--color-primary); }
.preview-form-container .form-group-container .section-group { padding-left: 1rem; }

/* Petites icônes d'aide dans le constructeur. */
.icon-xs { font-size: 12px; }

/* Constructeur : poignée de glisser-déposer. */
.drag-handle { cursor: grab; }

/* ── Liste des formulaires sur téléphone : nom et réponses seulement ── */
@media (max-width: 575.98px) {
  .pp-table--forms th:nth-child(4), .pp-table--forms td:nth-child(4) { display: none; }
  .pp-table--forms th, .pp-table--forms td { padding: 12px; }
  .pp-table--forms th:last-child, .pp-table--forms td:last-child { padding-left: 0; }
}

/* ==== 61-shell.css ==== */
/* =========================================================================
   COQUE — barre latérale, barre du haut, connexion (base.html,
   base_login.html, base_formsbuilder.html, components/*).
   ========================================================================= */

/* Barre latérale : marque et pied (utilisateur + déconnexion). */
.app-sidebar__brand-mark-img { width: 28px; height: 28px; }
.app-sidebar__footer-logout { flex-shrink: 0; }
.app-shell--collapsed .app-sidebar__footer { padding: 8px 4px; justify-content: center; }
.app-shell--collapsed .app-sidebar__footer-logout,
.app-shell--collapsed .app-sidebar__footer-text,
.app-shell--collapsed .app-sidebar__brand-text { display: none; }
.shell-user-avatar {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  object-fit: cover; font-size: .7rem; font-weight: 600;
  background: var(--brand-50); color: var(--brand-800);
}
.shell-user-name { font-size: var(--fs-sm); }
.shell-user-role { font-size: var(--fs-xs); color: var(--gray-600); }

/* Coque anonyme : la barre du haut suit le flux. */
body > .d-flex > .app-topbar { position: sticky; top: 0; z-index: 100; }
.shell-logo { height: 36px; }

/* Pages de connexion (base_login.html). */
.auth-page { background: var(--app-surface-muted); }
.auth-column { max-width: 420px; }
.auth-logo { height: 72px; }
.auth-title { letter-spacing: -.015em; }
.auth-tagline, .auth-footer { font-size: var(--fs-sm); color: var(--gray-600); }
.auth-footer a { color: var(--gray-600); }

/* Notifications flottantes (FormUtils.showNotification). */
.shell-toasts { z-index: 9999; }
.shell-toasts .alert { min-width: 300px; }

/* Leaflet (cartes) : icônes du dossier vendors, carte stable dans une
   carte Bootstrap, tuiles jamais redimensionnées par les règles d'images. */
.leaflet-default-icon-path { background-image: url("../vendors/leaflet/images/marker-icon.png"); }
.leaflet-control-layers-toggle { background-image: url("../vendors/leaflet/images/layers.png"); }
.leaflet-retina .leaflet-control-layers-toggle { background-image: url("../vendors/leaflet/images/layers-2x.png"); }
.card:has(.leaflet-container),
.card:has(.gps-map-container) { transform: none !important; transition: none !important; }
.card:has(.leaflet-container):hover,
.card:has(.gps-map-container):hover { transform: none !important; }
.leaflet-container { z-index: 1 !important; background: var(--gray-200) !important; }
.gps-map-container { position: relative; z-index: 1; }
.leaflet-tile-pane,
.leaflet-tile-container,
.leaflet-tile { visibility: visible !important; opacity: 1 !important; }
.leaflet-pane,
.leaflet-map-pane { visibility: visible !important; }
.leaflet-container img,
.leaflet-marker-icon,
.leaflet-marker-shadow { max-width: none !important; max-height: none !important; }
.leaflet-tile-container img,
.leaflet-tile { max-width: none !important; max-height: none !important; width: 256px !important; height: 256px !important; }

/* Barre du haut (components/topbar.html). */
.topbar-search { max-width: 380px; }
.topbar-badge { font-size: .6rem; }
.topbar-lang { font-size: var(--fs-xs); }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; background: var(--brand-50); color: var(--brand-800);
}

/* Champ traduisible (components/translatable_input.html) : onglets de langue,
   point vert quand une langue est remplie. */
.translatable-tabs { font-size: .8rem; }
.translatable-dot {
  display: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success-500); vertical-align: middle;
}
.translatable-dot.is-filled { display: inline-block; }

/* ── Mode sombre : titre d'une carte de choix cochée lisible ───────────
   (brand-800 sur fond sombre était illisible ; à reporter dans 90-system). */

/* ==== 62-widgets.css ==== */
/* =========================================================================
   CHAMPS DE FORMULAIRE (templates/formsbuilder/widgets, pages géo).
   Affichés dans les formulaires publics, collaboratifs, authentifiés et le
   constructeur : uniquement des variables du thème, clair et sombre.
   Les éléments masqués par les scripts portent l'attribut `hidden` ; leur
   affichage visible vient des règles ci-dessous (flex, grid…), jamais d'un
   style posé dans le HTML.
   ========================================================================= */

/* ── Capture photo / vidéo / audio : positions des pastilles ─────────── */
.pp-media__status--left { left: .5rem; right: auto; }
.pp-media__status--bottom-left { left: .8rem; right: auto; top: auto; bottom: .8rem; }
.pp-media__stage-btn--top-left { top: .5rem; left: .5rem; }
.pp-media__stage.is-flash { filter: brightness(2); }

/* ── Oui / non ───────────────────────────────────────────────────────── */
.boolean-toggle__row { display: flex; align-items: center; gap: 12px; min-height: var(--control-h-md); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin: 0; }
.toggle-switch .toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background-color: var(--gray-300); border-radius: 24px;
  transition: background-color var(--t-fast, .15s) ease;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--app-surface); border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
  transition: transform var(--t-fast, .15s) ease;
}
.toggle-input:checked + .toggle-slider { background-color: var(--color-primary); }
.toggle-input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-input:focus-visible + .toggle-slider { box-shadow: var(--shadow-focus); }
.toggle-label-text { color: var(--gray-700); }
.boolean-toggle__info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-primary); cursor: pointer;
}
.boolean-toggle__info-btn:hover { background: var(--gray-100); }
.boolean-toggle__info {
  margin-top: 12px; padding: 16px; border-radius: var(--radius-md);
  background: var(--app-surface-muted); border: 1px solid var(--app-border);
}
.boolean-toggle__doc {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; padding: 12px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-md);
}

/* ── Liste de données (sélection dépendante) ─────────────────────────── */
.data-select-widget__loading { display: flex; align-items: center; gap: 6px; color: var(--color-primary); }
.data-select-widget__loading[hidden] { display: none; }

/* ── GPS ─────────────────────────────────────────────────────────────── */
.gps-widget { position: relative; }
.gps-widget .gps-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.gps-widget .gps-coords { display: flex; gap: 10px; margin-bottom: 10px; }
.gps-widget .gps-coords .input-group { flex: 1; }
/* .gps-map-box devient .leaflet-container quand la carte est créée. */
.gps-widget .gps-map-box {
  width: 100%; height: 300px; position: relative; z-index: 1; isolation: isolate;
  border: 1px solid var(--app-border); border-radius: var(--radius-md);
  background: var(--gray-200);
}
.gps-widget .gps-map-box .leaflet-control-zoom { z-index: 1000; }
.gps-widget .gps-info { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: var(--fs-sm); color: var(--gray-600); }
.gps-map-parent-card, .gps-map-parent-card:hover { transform: none !important; transition: none !important; overflow: visible !important; }

/* ── Polygone sur carte ──────────────────────────────────────────────── */
.geo-polygon-widget__map { height: 360px; border: 1px solid var(--app-border); border-radius: var(--radius-md); }

/* ── Fichiers (un ou plusieurs) ──────────────────────────────────────── */
.file-widget__hint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.file-widget__current {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
  padding: 10px 12px; border: 1px solid var(--app-border); border-radius: var(--radius-md); background: var(--app-surface);
}
.file-widget__list {
  margin-top: 8px; padding: 12px; border: 1px dashed var(--gray-300); border-radius: var(--radius-md);
  background: var(--app-surface-muted);
}
.file-widget__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; margin-bottom: 4px; font-size: var(--fs-sm);
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-md);
}
.file-widget__item:last-child { margin-bottom: 0; }
.file-widget__name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; color: var(--color-text); }
.file-widget__name i { color: var(--color-primary); }
.file-widget__size { color: var(--gray-600); white-space: nowrap; }
.file-widget__camera { position: relative; overflow: hidden; background: #0b0d12; border-radius: var(--radius-lg); }
.file-widget__camera video { display: block; width: 100%; max-height: 300px; }
.file-widget__camera-actions { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }

/* ── Signature ───────────────────────────────────────────────────────── */
.signature-pad-container { margin-bottom: 8px; padding: 8px; border: 1px solid var(--app-border); border-radius: var(--radius-md); background: var(--app-surface); }
/* Le trait reste lisible en mode sombre : le papier est blanc. */
.signature-pad { display: block; width: 100%; height: 140px; background: #fff; border-radius: var(--radius-sm); touch-action: none; }
.signature-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.signature-preview__img { max-width: 100%; border: 1px solid var(--app-border); border-radius: var(--radius-md); background: #fff; }

/* ── Adresse suisse ──────────────────────────────────────────────────── */
.swiss-address-dropdown {
  position: absolute; left: 0; right: 0; z-index: 1050; max-height: 250px; overflow-y: auto;
  box-shadow: var(--shadow-lg); border-radius: var(--radius-md);
}
.swiss-address-detail__box { padding: 10px 12px; border: 1px solid var(--app-border); border-radius: var(--radius-md); background: var(--app-surface-muted); }

/* ── Grille (matrice) ────────────────────────────────────────────────── */
.matrix-grid__actions { width: 48px; }

/* ── Carte géographique d'un formulaire ──────────────────────────────── */
/* width:100 % indispensable : sans elle, le conteneur Leaflet se réduit à
   ~2 px dans la colonne Bootstrap et la carte est invisible. */
#form-geo-map { width: 100%; height: 70vh; min-height: 480px; border: 1px solid var(--app-border); border-radius: var(--radius-md); }
.fgm-popup { font-size: 13px; line-height: 1.4; }
.fgm-popup .fgm-label { color: var(--gray-600); font-size: 11px; }
.fgm-popup a { display: inline-block; margin-top: 4px; }

/* ── Aperçu des fichiers choisis (champ fichier simple) ─────────────── */
.file-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-preview.is-hidden { display: none; }
.file-preview__file {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: var(--fs-sm);
  color: var(--gray-700); background: var(--app-surface-muted); border: 1px solid var(--app-border); border-radius: var(--radius-md);
}

/* ── Choix de fichier : bouton et état dans la langue de la page ────── */
.file-pick__native {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 !important;
}
.file-pick {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: var(--control-h-md); padding: 6px 8px 6px 6px;
  border: 1px dashed var(--gray-300); border-radius: var(--radius-md); background: var(--app-surface);
}
.file-pick__status { font-size: var(--fs-sm); color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.file-pick.has-files { border-style: solid; }
.file-pick.has-files .file-pick__status { color: var(--gray-800); }
.file-pick__native:focus-visible + .file-pick { box-shadow: var(--shadow-focus); border-color: var(--color-primary); }

/* GPS obligatoire non renseigné : la carte se borde de rouge. */
.gps-widget-container.is-invalid .gps-map { border-color: var(--danger-500) !important; }

/* Phone number: the country search inside the dial-code list */
.iti__dropdown-content { border: 1px solid var(--app-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.12)); background: var(--app-surface); color: var(--color-text); }
.iti__search-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--app-border); padding: 8px 12px; font: inherit;
  background: var(--app-surface); color: var(--color-text); outline: 0;
}
.iti__search-input:focus { box-shadow: inset 0 -2px 0 var(--color-primary); }
.iti__country.iti__highlight { background: color-mix(in oklch, var(--color-primary) 10%, var(--app-surface)); }
.iti__dial-code { color: var(--gray-500); }

/* ==== 63-pages.css ==== */
/* =========================================================================
   PAGES — formsbuilder/pages : pages de remplissage autonomes (public,
   code, session collaborative, connecté) et pages de l'espace de travail.
   Chaque page pose sa classe .pg-* (sur <body> pour les pages autonomes,
   sur l'élément racine du contenu sinon) : rien ne déborde sur une autre.
   ========================================================================= */

/* ── formsbuilder/pages/public_form.html (.pg-public-form) ── */
body.pg-public-form { background: var(--pp-page-bg, var(--app-surface-muted)); min-height: 100vh; }
.pg-public-form .public-form-container { max-width: var(--pp-form-max-w, 800px); margin: 0 auto; padding: 10px 5px; }
.pg-public-form .form-card {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            overflow: hidden;
        }
.pg-public-form .form-header {
            /* « Net » : en-tête sobre par défaut ; un thème peut le colorer. */
            background: var(--pp-form-header-bg, var(--app-surface));
            color: var(--pp-form-header-fg, var(--color-text-strong));
            border-bottom: 1px solid var(--app-border);
            padding: 16px 14px;
        }
.pg-public-form .form-header h1 { font-size: var(--fs-xl); margin: 0 0 6px 0; letter-spacing: -.015em; color: inherit; }
.pg-public-form .form-header p { margin: 0; opacity: 0.92; font-size: var(--fs-sm); }
.pg-public-form .form-header__lock {
            margin-top: 12px;
            font-size: var(--fs-xs);
            opacity: 0.88;
            display: inline-flex; align-items: center; gap: 6px;
        }
.pg-public-form .form-body { padding: 14px; }
/* Error state for the shared _field.html component (Anw convention). */
.pg-public-form .has-error .form-control,
.pg-public-form .has-error .form-select { border-color: var(--danger-500); }
.pg-public-form .form-section {
            background: var(--app-surface-muted);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-md);
            padding: 12px;
            margin-bottom: 16px;
        }
.pg-public-form .form-section .section-header { border-bottom: 1px solid var(--app-border); margin-bottom: 10px; padding-bottom: 8px; }
.pg-public-form .form-section .section-header h2 {
            margin: 0; font-size: var(--fs-md); font-weight: 600;
            color: var(--gray-950);
        }
.pg-public-form .form-section .section-header p {
            margin: 4px 0 0 0; font-size: var(--fs-xs);
            color: var(--gray-600);
        }
.pg-public-form .public-header {
            background: var(--app-surface);
            border-bottom: 1px solid var(--app-border);
            padding: 12px 0;
        }
.pg-public-form .public-header__inner {
            display: flex; justify-content: space-between; align-items: center;
            max-width: var(--pp-form-max-w, 800px); margin: 0 auto; padding: 0 15px;
        }
.pg-public-form .public-secure-badge {
            display: inline-flex; align-items: center; gap: 4px;
            font-size: var(--fs-xs); color: var(--gray-600);
        }
.pg-public-form .public-footer {
            text-align: center;
            padding: 16px;
            color: var(--gray-600);
            font-size: var(--fs-xs);
        }
.pg-public-form .public-footer img { height: 20px; margin-right: 8px; vertical-align: middle; }
/* Form body buttons stay compact even when widgets inject them. */
.pg-public-form .form-body .btn { white-space: nowrap; }
.pg-public-form .form-body .gps-controls { flex-wrap: wrap; gap: 8px; }
.pg-public-form .form-body .gps-coords { flex-direction: column; }
/* Submit button — distinct from inline widget btns. */
.pg-public-form .submit-btn {
            background: var(--color-primary);
            border: none;
            color: #fff;
            padding: 12px 30px;
            font-size: var(--fs-md);
            font-weight: 600;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: background var(--t-fast);
            width: 100%;
        }
.pg-public-form .submit-btn:hover { background: var(--color-primary-hover); }
@media (min-width: 768px) {
.pg-public-form .public-form-container { padding: 30px 15px; }
.pg-public-form .public-header__inner { max-width: 1140px; padding: 0 30px; }
.pg-public-form .form-header { padding: 28px 30px; }
.pg-public-form .form-header h1 { font-size: var(--fs-2xl); }
.pg-public-form .form-body { padding: 28px; }
.pg-public-form .form-section { padding: 18px; }
.pg-public-form .submit-btn { width: auto; padding: 12px 40px; }
.pg-public-form .form-body .gps-coords { flex-direction: row; }
}
@media (min-width: 1200px) {
.pg-public-form .public-form-container { max-width: 1140px; }
}
/* Matrix layout (kept from the previous theme to preserve behavior). */
.pg-public-form .matrix-grid-wrapper { min-width: 0; overflow-x: auto; }
.pg-public-form .form-body .matrix-grid { margin-bottom: 0; }
.pg-public-form .form-body .matrix-grid th,
.pg-public-form .form-body .matrix-grid td { vertical-align: middle; }
.pg-public-form .matrix-grid .form-check {
            display: inline-block;
            align-items: initial;
            padding-left: 1.5em;
            margin-bottom: 0.25rem;
            margin-right: 0.5rem;
        }
.pg-public-form .matrix-grid .form-check.form-check-inline { display: inline-block; }
.pg-public-form .matrix-grid .form-check-input {
            width: 1em; height: 1em;
            margin-left: -1.5em;
            margin-right: 0;
            float: left;
        }
.pg-public-form .matrix-grid .form-check-label { margin-left: 0; }
.pg-public-form .matrix-grid td > input[type="checkbox"].form-check-input {
            display: block;
            margin: 0 auto;
            float: none;
            width: 1.1em;
            height: 1.1em;
        }

/* ── formsbuilder/pages/public_form_success.html (.pg-public-success) ── */
body.pg-public-success {
            background: var(--pp-page-bg, var(--app-surface-muted));
            min-height: 100vh;
            display: flex; align-items: center; justify-content: center;
        }
.pg-public-success .success-container { max-width: 500px; width: 100%; margin: 0 auto; padding: 20px; }
.pg-public-success .success-card {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            text-align: center;
        }
.pg-public-success .success-header {
            background: var(--pp-form-header-bg, var(--app-surface));
            color: var(--pp-form-header-fg, var(--color-text-strong));
            border-bottom: 1px solid var(--app-border);
            padding: 36px 28px;
        }
.pg-public-success .success-icon {
            width: 60px; height: 60px;
            background: var(--success-100); color: var(--success-600); font-size: 28px;
            border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            margin-bottom: 16px;
        }
.pg-public-success .success-header h1 {
            font-size: var(--fs-2xl);
            margin: 0 0 8px 0;
            letter-spacing: -.015em;
        }
.pg-public-success .success-header p { margin: 0; opacity: 0.92; font-size: var(--fs-sm); }
.pg-public-success .success-body { padding: 28px; }
.pg-public-success .success-footer {
            text-align: center;
            padding: 16px;
            color: var(--gray-600);
            font-size: var(--fs-xs);
        }
.pg-public-success .success-footer img { height: 20px; margin-right: 8px; vertical-align: middle; }

/* ── formsbuilder/pages/authenticated_form.html (.pg-auth-form) ── */
body.pg-auth-form { background: var(--app-bg); color: var(--app-text); font-family: var(--font-sans); }
.pg-auth-form .auth-topbar {
            position: sticky; top: 0; z-index: 100;
            background: var(--app-surface);
            border-bottom: 1px solid var(--gray-200);
            padding: .75rem 1rem;
        }
.pg-auth-form .form-field-group {
            background: var(--gray-50);
            border: 1px solid var(--gray-100);
            border-radius: var(--radius-md, .5rem);
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
[data-bs-theme="dark"] .pg-auth-form .form-field-group {
            background: var(--gray-900);
            border-color: var(--gray-800);
        }
.pg-auth-form .form-field-group .group-header { border-bottom: 1px solid var(--gray-200); }
[data-bs-theme="dark"] .pg-auth-form .form-field-group .group-header { border-bottom-color: var(--gray-800); }
.pg-auth-form .checkbox-group,
.pg-auth-form .radio-group { margin-left: 1rem; }
.pg-auth-form .form-check { display: flex; align-items: center; padding-left: 0; margin-bottom: .5rem; }
.pg-auth-form .form-check-input { width: 18px; height: 18px; margin-right: .625rem; cursor: pointer; flex-shrink: 0; }
.pg-auth-form .form-check-label { cursor: pointer; margin-bottom: 0; }
.pg-auth-form .avatar-initial {
            width: 28px; height: 28px;
            background: var(--brand-50); color: var(--brand-800);
            border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: .75rem;
        }

/* ── formsbuilder/pages/code_access.html (.pg-code-access) ── */
body.pg-code-access {
            background: var(--app-bg); color: var(--app-text);
            font-family: var(--font-sans);
            min-height: 100vh; margin: 0;
            display: flex; flex-direction: column;
        }
.pg-code-access .code-topbar {
            background: var(--app-surface);
            border-bottom: 1px solid var(--app-border);
            padding: .75rem 1rem;
        }
.pg-code-access .code-topbar .brand {
            display: flex; align-items: center; gap: .5rem; font-weight: 600;
        }
.pg-code-access .code-topbar .brand img { height: 1.75rem; }
.pg-code-access .theme-toggle {
            background: transparent;
            border: 1px solid var(--app-border);
            border-radius: 999px;
            width: 2rem; height: 2rem;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--app-text); padding: 0;
        }
.pg-code-access .theme-toggle:hover { background: var(--app-surface-muted); }
.pg-code-access .code-access-container {
            flex: 1; display: flex; align-items: center; justify-content: center;
            padding: 2rem 1rem;
        }
.pg-code-access .code-card {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg, .75rem);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            width: 100%; max-width: 32rem;
        }
.pg-code-access .code-header {
            background: var(--pp-form-header-bg, var(--app-surface));
            color: var(--pp-form-header-fg, var(--color-text-strong));
            border-bottom: 1px solid var(--app-border); padding: 1.875rem; text-align: center;
        }
.pg-code-access .code-header .icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px;
  border-radius: 50%; font-size: 24px; opacity: 1;
  background: color-mix(in oklch, var(--color-primary) 12%, var(--app-surface)); color: var(--color-primary);
}
.pg-code-access .code-body { padding: 1.875rem; }
.pg-code-access .code-input {
            text-align: center; letter-spacing: .25rem;
            font-size: 1.125rem; font-weight: 500;
            font-family: var(--font-mono);
        }
.pg-code-access .form-title {
            font-size: .8125rem; color: var(--gray-600);
            margin-top: 1.25rem; text-align: center;
            padding-top: 1.25rem; border-top: 1px solid var(--app-border);
        }
[data-bs-theme="dark"] .pg-code-access .form-title { color: var(--gray-400); }
.pg-code-access .public-footer {
            text-align: center; padding: 1.25rem;
            color: var(--gray-600); font-size: .75rem;
        }
[data-bs-theme="dark"] .pg-code-access .public-footer { color: var(--gray-400); }
.pg-code-access .public-footer img { height: 1.5rem; margin-right: .5rem; vertical-align: middle; }

/* ── formsbuilder/pages/collaborative_join.html (.pg-collab-join) ── */
body.pg-collab-join {
            background: var(--app-bg); color: var(--app-text);
            font-family: var(--font-sans);
            min-height: 100vh; margin: 0;
            display: flex; flex-direction: column;
        }
.pg-collab-join .join-topbar {
            background: var(--app-surface);
            border-bottom: 1px solid var(--app-border);
            padding: .75rem 1rem;
        }
.pg-collab-join .join-topbar .brand {
            display: flex; align-items: center; gap: .5rem;
            font-weight: 600;
        }
.pg-collab-join .join-topbar .brand img { height: 1.75rem; }
.pg-collab-join .theme-toggle {
            background: transparent;
            border: 1px solid var(--app-border);
            border-radius: 999px;
            width: 2rem; height: 2rem;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--app-text);
            padding: 0;
        }
.pg-collab-join .theme-toggle:hover { background: var(--app-surface-muted); }
.pg-collab-join .join-container {
            flex: 1;
            display: flex; align-items: center; justify-content: center;
            padding: 2rem 1rem;
        }
.pg-collab-join .join-card {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg, .75rem);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            width: 100%; max-width: 32rem;
        }
.pg-collab-join .join-header {
            background: var(--pp-form-header-bg, var(--app-surface));
            color: var(--pp-form-header-fg, var(--color-text-strong));
            border-bottom: 1px solid var(--app-border);
            padding: 2rem 1.875rem;
            text-align: center;
        }
.pg-collab-join .join-header.is-closed {
            background: var(--danger-50, var(--danger-100)); color: var(--danger-600);
        }
.pg-collab-join .join-header .icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px;
  border-radius: 50%; font-size: 24px; opacity: 1;
  background: color-mix(in oklch, var(--color-primary) 12%, var(--app-surface)); color: var(--color-primary);
}
.pg-collab-join .join-header h1 { font-size: 1.375rem; margin: 0 0 .375rem; font-weight: 600; }
.pg-collab-join .join-header p { margin: 0; opacity: .9; font-size: .875rem; }
.pg-collab-join .join-body { padding: 1.875rem; }
.pg-collab-join .code-input {
            text-align: center; letter-spacing: .375rem; text-transform: uppercase;
            font-size: 1.375rem; font-weight: 600;
            font-family: var(--font-mono);
        }
/* ── Slot picker (click-to-fill) ── */
.pg-collab-join .slot-picker {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
            gap: .5rem;
            margin-bottom: 1rem;
        }
.pg-collab-join .slot-card {
            background: var(--app-surface-muted);
            border: 1.5px solid var(--app-border);
            border-radius: var(--radius-md, .5rem);
            padding: .75rem .875rem;
            cursor: pointer;
            transition: transform .15s ease, border-color .15s ease, background .15s ease;
            display: flex; flex-direction: column; gap: .25rem;
            position: relative;
        }
.pg-collab-join .slot-card:hover:not(.is-taken) {
            transform: translateY(-1px);
            border-color: var(--brand-500);
            background: var(--brand-50, var(--app-surface));
        }
[data-bs-theme="dark"] .pg-collab-join .slot-card:hover:not(.is-taken) {
            background: var(--gray-800);
        }
.pg-collab-join .slot-card.is-selected {
            border-color: var(--brand-600);
            background: var(--brand-50);
            box-shadow: 0 0 0 3px oklch(from var(--brand-500) l c h / 0.18);
        }
[data-bs-theme="dark"] .pg-collab-join .slot-card.is-selected {
            background: var(--gray-800);
        }
.pg-collab-join .slot-card.is-taken {
            opacity: .55;
            cursor: not-allowed;
            border-style: dashed;
        }
.pg-collab-join .slot-card .slot-head {
            display: flex; align-items: center; justify-content: space-between;
            font-weight: 600; font-size: .875rem;
        }
.pg-collab-join .slot-card .slot-status {
            font-size: .75rem; color: var(--gray-600);
        }
[data-bs-theme="dark"] .pg-collab-join .slot-card .slot-status { color: var(--gray-400); }
.pg-collab-join .slot-card .slot-status.is-free { color: var(--success-600); }
.pg-collab-join .slot-card .slot-dot {
            width: .625rem; height: .625rem; border-radius: 50%;
            background: var(--gray-400);
            display: inline-block;
        }
.pg-collab-join .slot-card.is-free .slot-dot { background: var(--success-500); }
.pg-collab-join .slot-card.is-taken .slot-dot { background: var(--gray-300); }
.pg-collab-join .slot-card .slot-locked-icon {
            position: absolute; top: .5rem; right: .5rem;
            font-size: .875rem; color: var(--gray-500);
        }
.pg-collab-join .slot-help {
            font-size: .75rem; color: var(--gray-600);
            margin-top: -.25rem; margin-bottom: 1rem;
        }
[data-bs-theme="dark"] .pg-collab-join .slot-help { color: var(--gray-400); }
.pg-collab-join .session-info {
            background: var(--app-surface-muted);
            border-radius: var(--radius-md, .5rem);
            padding: .875rem 1rem;
            margin-bottom: 1.25rem;
            font-size: .875rem;
            border-left: 3px solid var(--brand-500);
        }
.pg-collab-join .public-footer {
            text-align: center; padding: 1.25rem;
            color: var(--gray-600); font-size: .75rem;
        }
[data-bs-theme="dark"] .pg-collab-join .public-footer { color: var(--gray-400); }
.pg-collab-join .public-footer img { height: 1.25rem; margin-right: .5rem; vertical-align: middle; }

/* ── formsbuilder/pages/collaborative_form.html (.pg-collab-form) ── */
body.pg-collab-form {
            background: var(--app-bg); color: var(--app-text);
            font-family: var(--font-sans);
            min-height: 100vh; margin: 0;
        }
.pg-collab-form .public-form-container { max-width: 50rem; margin: 0 auto; padding: 1.875rem 1rem; padding-top: 5rem; }
.pg-collab-form .form-card {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg, .75rem);
            box-shadow: var(--shadow-md);
            overflow: hidden;
        }
.pg-collab-form .form-header {
            background: var(--pp-form-header-bg, var(--app-surface));
            color: var(--pp-form-header-fg, var(--color-text-strong));
            border-bottom: 1px solid var(--app-border);
            padding: 1.5rem 1.875rem;
        }
.pg-collab-form .form-body { padding: 1.875rem; }
.pg-collab-form .field-group { margin-bottom: 1.25rem; position: relative; }
.pg-collab-form .field-label {
            font-size: .8125rem; font-weight: 500; color: var(--app-text);
            margin-bottom: .5rem; display: block;
        }
.pg-collab-form .required-star { color: var(--danger-500); margin-left: .25rem; }
.pg-collab-form .field-help { font-size: .75rem; color: var(--gray-600); margin-top: .3125rem; }
[data-bs-theme="dark"] .pg-collab-form .field-help { color: var(--gray-400); }
.pg-collab-form .form-section {
            background: var(--app-surface-muted);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-md, .5rem);
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
.pg-collab-form .form-section .section-header {
            margin-bottom: .9375rem; padding-bottom: .625rem;
            border-bottom: 1px solid var(--app-border);
        }
.pg-collab-form .checkbox-group,
.pg-collab-form .radio-group { margin-left: 1rem; }
.pg-collab-form .form-check { display: flex; align-items: center; padding-left: 0; margin-bottom: .5rem; }
.pg-collab-form .form-check-input { width: 1.125rem; height: 1.125rem; margin-right: .625rem; cursor: pointer; flex-shrink: 0; }
.pg-collab-form .form-check-label { cursor: pointer; margin-bottom: 0; }
.pg-collab-form .public-footer { text-align: center; padding: 1.25rem; color: var(--gray-600); font-size: .75rem; }
[data-bs-theme="dark"] .pg-collab-form .public-footer { color: var(--gray-400); }
.pg-collab-form .public-footer img { height: 1.5rem; margin-right: .5rem; vertical-align: middle; }
/* ── Collaborative toolbar ── */
.pg-collab-form .collab-toolbar {
            position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
            background: var(--app-surface);
            border-bottom: 1px solid var(--app-border);
            padding: .5rem .9375rem;
            display: flex; align-items: center; justify-content: space-between;
            gap: .5rem;
            box-shadow: 0 2px 8px rgba(0,0,0,.05);
        }
.pg-collab-form .collab-toolbar .participants {
            display: flex; gap: .375rem; align-items: center; flex-wrap: wrap;
        }
.pg-collab-form .participant-badge {
            width: 2rem; height: 2rem; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-weight: 600; font-size: .8125rem;
            position: relative; cursor: default;
            border: 2px solid var(--app-surface);
            box-shadow: 0 0 0 1px var(--app-border);
        }
.pg-collab-form .participant-badge.disconnected { opacity: .4; }
.pg-collab-form .participant-badge .tooltip-name {
            display: none; position: absolute; bottom: -1.5rem; left: 50%;
            transform: translateX(-50%);
            background: var(--gray-900); color: #fff; padding: .125rem .5rem;
            border-radius: .25rem; font-size: .6875rem; white-space: nowrap;
            font-weight: 400; z-index: 10;
        }
.pg-collab-form .participant-badge:hover .tooltip-name { display: block; }
.pg-collab-form .collab-meta {
            display: flex; align-items: center; gap: .75rem;
            font-size: .75rem; color: var(--gray-600);
        }
[data-bs-theme="dark"] .pg-collab-form .collab-meta { color: var(--gray-400); }
.pg-collab-form .collab-code {
            background: var(--app-surface-muted);
            border: 1px solid var(--app-border);
            padding: .25rem .625rem; border-radius: .25rem;
            font-family: var(--font-mono);
            font-size: .875rem; font-weight: 600;
            cursor: pointer; letter-spacing: .125rem;
            color: var(--app-text);
        }
.pg-collab-form .collab-code:hover { background: var(--app-surface-sunken); }
.pg-collab-form .ws-indicator {
            width: .5rem; height: .5rem; border-radius: 50%; display: inline-block;
        }
.pg-collab-form .ws-indicator.connected { background: var(--success-500); }
.pg-collab-form .ws-indicator.disconnected { background: var(--danger-500); animation: pg-collab-form-pulse 1.2s ease-in-out infinite; }
.pg-collab-form .ws-indicator.syncing { background: var(--warning-500, #f1b44c); }
.pg-collab-form .collab-pending { font-size: .75rem; color: var(--text-muted, #6c757d); margin-left: .5rem; }
@keyframes pg-collab-form-pulse { 50% { opacity: .35; } }
.pg-collab-form .theme-toggle,
.pg-collab-form .filter-toggle {
            background: transparent;
            border: 1px solid var(--app-border);
            border-radius: 999px;
            min-width: 2rem; height: 2rem;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--app-text);
            padding: 0 .625rem; font-size: .75rem; gap: .25rem;
        }
.pg-collab-form .theme-toggle:hover,
.pg-collab-form .filter-toggle:hover { background: var(--app-surface-muted); }
.pg-collab-form .filter-toggle[aria-pressed="true"] {
            background: var(--brand-100);
            border-color: var(--brand-500);
            color: var(--brand-800);
        }
[data-bs-theme="dark"] .pg-collab-form .filter-toggle[aria-pressed="true"] {
            background: var(--brand-800);
            color: var(--brand-100);
        }
/* ── Reconnect banner ── */
.pg-collab-form .collab-reconnect-banner {
            display: none;
            background: var(--warning-100);
            color: oklch(28% 0.10 var(--status-warning-hue));
            border: 1px solid var(--warning-500);
            border-radius: var(--radius-md, .5rem);
            padding: .625rem 1rem;
            margin: 0 0 1rem 0;
            font-size: .8125rem;
            align-items: center; gap: .625rem;
        }
[data-bs-theme="dark"] .pg-collab-form .collab-reconnect-banner {
            background: oklch(22% 0.05 var(--status-warning-hue));
            color: var(--warning-100);
        }
.pg-collab-form .collab-reconnect-banner.is-visible { display: flex; }
.pg-collab-form .collab-reconnect-banner .btn-retry {
            margin-left: auto;
            background: transparent;
            border: 1px solid currentColor;
            color: inherit;
            padding: .125rem .5rem; border-radius: .25rem;
            font-size: .75rem; cursor: pointer;
        }
.pg-collab-form .collab-reconnect-banner .btn-retry:hover { background: rgba(0,0,0,.06); }
/* ── Mobile toolbar ── */
@media (max-width: 575.98px) {
.pg-collab-form .collab-toolbar { padding: .375rem .625rem; flex-wrap: wrap; }
.pg-collab-form .collab-toolbar .participants { display: none; }
.pg-collab-form .collab-toolbar .participants.mobile-visible {
                display: flex; position: absolute; top: 2.75rem; left: 0; right: 0;
                background: var(--app-surface); padding: .625rem .9375rem;
                border-bottom: 1px solid var(--app-border);
            }
.pg-collab-form .mobile-participants-toggle {
                display: flex !important; align-items: center; gap: .25rem;
                background: var(--app-surface-muted);
                border: 1px solid var(--app-border); border-radius: .25rem;
                padding: .125rem .5rem; font-size: .75rem; color: var(--app-text);
                cursor: pointer;
            }
.pg-collab-form .public-form-container { padding-top: 3.75rem; }
.pg-collab-form .form-header h1 { font-size: 1.125rem !important; }
.pg-collab-form .filter-toggle .filter-label { display: none; }
}
@media (min-width: 576px) {
.pg-collab-form .mobile-participants-toggle { display: none !important; }
}
/* ── Overall progress ── */
.pg-collab-form .overall-progress-wrap { margin-bottom: .9375rem; }
.pg-collab-form .overall-progress-bar {
            height: .375rem; background: var(--app-surface-sunken);
            border-radius: .1875rem; overflow: hidden;
        }
.pg-collab-form .overall-progress-fill {
            height: 100%;
            background: var(--color-primary);
            border-radius: .1875rem; transition: width .4s ease;
            width: 0%;
        }
.pg-collab-form .overall-progress-label {
            font-size: .6875rem; color: var(--gray-600);
            text-align: right; margin-top: .25rem;
        }
[data-bs-theme="dark"] .pg-collab-form .overall-progress-label { color: var(--gray-400); }
/* ── Field locking & assignment ── */
.pg-collab-form .field-group.field-locked {
            border-left: 3px solid transparent;
            padding-left: .5rem;
            border-radius: .25rem;
        }
.pg-collab-form .field-lock-badge {
            position: absolute; top: 0; right: 0;
            font-size: .625rem; padding: .125rem .5rem;
            border-radius: 0 0 0 .375rem;
            color: #fff; font-weight: 500;
        }
.pg-collab-form .field-readonly-collab {
            opacity: .55;
            pointer-events: none;
            position: relative;
        }
.pg-collab-form .field-readonly-collab::after {
            content: '';
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 5;
        }
.pg-collab-form .field-slot-badge {
            display: inline-block; font-size: .625rem; padding: .125rem .5rem;
            border-radius: .625rem; color: #fff; font-weight: 500;
            margin-left: .5rem; vertical-align: middle;
        }
/* ── "My fields only" filter ── */
body.pg-collab-form.collab-show-mine .form-field-wrapper.field-readonly-collab { display: none; }
body.pg-collab-form.collab-show-mine .form-section:not(:has(.form-field-wrapper:not(.field-readonly-collab))) { display: none; }
/* ── Finalize / completion ── */
.pg-collab-form .finalize-bar {
            text-align: center; padding: 1.5625rem;
            border-top: 1px solid var(--app-border); margin-top: 1.875rem;
        }
.pg-collab-form .finalize-btn {
            background-color: var(--color-primary); border: none; color: var(--color-on-primary);
            padding: .75rem 2.5rem; font-size: .875rem; font-weight: 500;
            border-radius: var(--radius-md, .5rem); cursor: pointer; transition: all .2s;
        }
.pg-collab-form .finalize-btn:hover { background-color: var(--color-primary-hover); }
.pg-collab-form .finalize-btn:disabled {
            background-color: var(--gray-400); cursor: not-allowed; opacity: .6;
        }
.pg-collab-form .completion-bar {
            display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
            margin-bottom: .75rem;
        }
.pg-collab-form .completion-slot {
            font-size: .6875rem; padding: .25rem .625rem; border-radius: .75rem;
            background: var(--app-surface-sunken); color: var(--app-text);
        }
.pg-collab-form .completion-slot.complete {
            background: var(--success-100); color: var(--success-600);
        }
.pg-collab-form .completed-overlay {
            display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: oklch(from var(--app-bg) l c h / 0.95);
            z-index: 2000;
            justify-content: center; align-items: center; flex-direction: column;
        }
.pg-collab-form .completed-overlay.active { display: flex; }
.pg-collab-form .completed-overlay .icon {
            font-size: 4rem; color: var(--success-500); margin-bottom: 1.25rem;
        }
/* ── Field save status ── */
.pg-collab-form .field-save-error {
            border-left: 3px solid var(--danger-500); padding-left: .5rem;
        }
.pg-collab-form .field-save-status {
            font-size: .6875rem; margin-left: .5rem; opacity: 0;
            transition: opacity .3s ease; vertical-align: middle;
        }
.pg-collab-form .field-save-status.visible { opacity: 1; }
.pg-collab-form .field-save-status.saving { color: var(--brand-500); }
.pg-collab-form .field-save-status.saved { color: var(--success-500); }
.pg-collab-form .field-save-status.error { color: var(--danger-500); }
/* ── Conflict ── */
.pg-collab-form .field-conflict-banner {
            display: none; font-size: .75rem;
            color: oklch(28% 0.10 var(--status-warning-hue));
            background: var(--warning-100);
            border: 1px solid var(--warning-500);
            border-radius: .25rem; padding: .375rem .625rem; margin-top: .375rem;
        }
[data-bs-theme="dark"] .pg-collab-form .field-conflict-banner {
            background: oklch(22% 0.05 var(--status-warning-hue));
            color: var(--warning-100);
        }
.pg-collab-form .field-conflict-banner.active { display: block; }
.pg-collab-form .field-conflict-banner button {
            background: none; border: none; color: var(--brand-500);
            cursor: pointer; font-size: .75rem; text-decoration: underline;
            padding: 0; margin-left: .5rem;
        }
/* ── Toasts ── */
.pg-collab-form .collab-toasts {
            position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 1500;
            display: flex; flex-direction: column; gap: .5rem;
            pointer-events: none;
        }
.pg-collab-form .collab-toast {
            background: var(--gray-900); color: var(--gray-0);
            padding: .625rem 1rem; border-radius: var(--radius-md, .5rem);
            font-size: .8125rem; pointer-events: auto;
            box-shadow: 0 .25rem .75rem rgba(0,0,0,.15);
            animation: pg-collab-form-toastIn .3s ease, pg-collab-form-toastOut .3s ease 2.7s;
        }
[data-bs-theme="dark"] .pg-collab-form .collab-toast {
            background: var(--gray-100); color: var(--gray-900);
        }
@keyframes pg-collab-form-toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pg-collab-form-toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ── formsbuilder/pages/collaborative_completed.html (.pg-collab-done) ── */
body.pg-collab-done {
            background: var(--app-bg);
            color: var(--app-text);
            font-family: var(--font-sans);
            min-height: 100vh;
            display: flex; align-items: center; justify-content: center;
            margin: 0; padding: 1rem;
        }
.pg-collab-done .completed-shell {
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: var(--radius-lg, .75rem);
            box-shadow: var(--shadow-md);
            padding: 2.5rem 2rem;
            text-align: center;
            max-width: 32rem; width: 100%;
        }
.pg-collab-done .completed-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            color: var(--success-500);
        }
.pg-collab-done .completed-icon.expired { color: var(--warning-500); }
.pg-collab-done .participants-row {
            display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
            margin: 1rem 0 1.5rem;
        }
.pg-collab-done .participant-chip {
            display: inline-flex; align-items: center; gap: .375rem;
            background: var(--app-surface-muted);
            border: 1px solid var(--app-border);
            border-radius: 999px;
            padding: .25rem .625rem;
            font-size: .75rem;
        }
.pg-collab-done .participant-chip .dot {
            width: .5rem; height: .5rem; border-radius: 50%;
        }
.pg-collab-done .action-row {
            display: flex; flex-direction: column; gap: .5rem; margin-top: 1.25rem;
        }
.pg-collab-done .theme-toggle {
            position: fixed; top: 1rem; right: 1rem;
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            border-radius: 999px;
            width: 2.25rem; height: 2.25rem;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--app-text);
        }
.pg-collab-done .theme-toggle:hover { background: var(--app-surface-muted); }

/* ── formsbuilder/pages/submission_detail.html (.pg-submission-detail) ── */
body:has(.pg-submission-detail) .field-card {
    transition: border-color 0.2s ease;
}
body:has(.pg-submission-detail) .field-card:hover {
    border-color: var(--gray-300);
}
body:has(.pg-submission-detail) .field-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}
body:has(.pg-submission-detail) .field-value {
    color: var(--color-text);
}
body:has(.pg-submission-detail) .field-type-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body:has(.pg-submission-detail) .submission-meta {
    background: var(--app-surface);
}
body:has(.pg-submission-detail) .submission-meta .meta-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
body:has(.pg-submission-detail) .submission-meta .meta-item:last-child {
    border-bottom: none;
}
body:has(.pg-submission-detail) .gps-map-container {
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}
body:has(.pg-submission-detail) .signature-preview {
    max-width: 300px;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    background: #fff;
}
body:has(.pg-submission-detail) .media-preview {
    max-width: 100%;
    border-radius: 8px;
}
body:has(.pg-submission-detail) .file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
body:has(.pg-submission-detail) .file-thumb {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
body:has(.pg-submission-detail) .file-thumb:hover {
    transform: scale(1.05);
}

/* ── formsbuilder/pages/user_dashboard.html (.pg-my-space) ── */
/* Dashboard Layout */
body:has(.pg-my-space) .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 992px) {
body:has(.pg-my-space) .dashboard-grid {
        grid-template-columns: 340px 1fr;
    }
}
/* Welcome Banner */
body:has(.pg-my-space) .welcome-banner {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--success-500) 100%);
    border-radius: 12px;
    padding: 24px;
    color: #fff;
    margin-bottom: 24px;
}
body:has(.pg-my-space) .welcome-banner h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}
body:has(.pg-my-space) .welcome-banner p {
    opacity: 0.9;
    margin-bottom: 0;
}
/* Stats Cards */
body:has(.pg-my-space) .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
body:has(.pg-my-space) .stat-box {
    background: var(--app-surface);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--app-border);
    transition: all 0.2s ease;
}
body:has(.pg-my-space) .stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
body:has(.pg-my-space) .stat-box .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}
body:has(.pg-my-space) .stat-box .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}
body:has(.pg-my-space) .stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Quick Actions */
body:has(.pg-my-space) .quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
body:has(.pg-my-space) .quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
body:has(.pg-my-space) .quick-action-btn:hover {
    border-color: var(--success-500);
    background: rgba(52, 195, 143, 0.05);
    transform: translateX(4px);
}
body:has(.pg-my-space) .quick-action-btn .action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
body:has(.pg-my-space) .quick-action-btn .action-text h6 {
    margin-bottom: 2px;
    font-weight: 600;
}
body:has(.pg-my-space) .quick-action-btn .action-text p {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--gray-600);
}
/* Submission Card */
body:has(.pg-my-space) .submission-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
body:has(.pg-my-space) .submission-card:hover {
    border-color: var(--success-500);
    box-shadow: 0 2px 8px rgba(52, 195, 143, 0.15);
}
body:has(.pg-my-space) .submission-card:last-child {
    margin-bottom: 0;
}
body:has(.pg-my-space) .submission-card .submission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
body:has(.pg-my-space) .submission-card .form-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}
body:has(.pg-my-space) .submission-card .submission-date {
    font-size: 0.85rem;
    color: var(--gray-600);
}
body:has(.pg-my-space) .submission-card .submission-actions {
    display: flex;
    gap: 8px;
}
/* Empty State */
body:has(.pg-my-space) .empty-state {
    text-align: center;
    padding: 48px 24px;
}
body:has(.pg-my-space) .empty-state .empty-state__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--app-surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
body:has(.pg-my-space) .empty-state .empty-state__icon i {
    font-size: 40px;
    color: var(--gray-500);
}
body:has(.pg-my-space) .empty-state h5 {
    font-weight: 600;
    margin-bottom: 8px;
}
body:has(.pg-my-space) .empty-state p {
    color: var(--gray-600);
    margin-bottom: 20px;
}
/* Popular Form Card */
body:has(.pg-my-space) .popular-form-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--app-surface-muted);
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
body:has(.pg-my-space) .popular-form-card:last-child {
    margin-bottom: 0;
}
body:has(.pg-my-space) .popular-form-card:hover {
    background: rgba(52, 195, 143, 0.1);
    transform: translateX(4px);
}
body:has(.pg-my-space) .popular-form-card .form-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--app-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
body:has(.pg-my-space) .popular-form-card .form-info {
    flex: 1;
    min-width: 0;
}
body:has(.pg-my-space) .popular-form-card .form-info h6 {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body:has(.pg-my-space) .popular-form-card .form-info p {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0;
}
/* Section Title */
body:has(.pg-my-space) .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}
body:has(.pg-my-space) .section-title i {
    color: var(--success-500);
}
/* Modal improvements */

/* ── formsbuilder/pages/form_submission_success.html (.pg-submit-success) ── */
@keyframes pg-submit-success-success-scale {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
body:has(.pg-submit-success) .success-animation i { animation: pg-submit-success-success-scale 0.6s ease-out; }

/* ── formsbuilder/pages/builder.html (.pg-builder) ── */
body:has(.pg-builder) .move-btn { transition: transform 0.15s ease-in-out; }
body:has(.pg-builder) .move-btn:hover { transform: scale(1.08); }
body:has(.pg-builder) .move-btn:active { transform: scale(0.95); }
body:has(.pg-builder) .moving { background-color: var(--app-surface-muted) !important; }
/* Group nesting */
body:has(.pg-builder) .group-container .card { margin-bottom: 0; }
body:has(.pg-builder) .group-fields-list .card {
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--bs-success);
}
body:has(.pg-builder) .group-fields-list .card:last-child { margin-bottom: 0; }
/* Dropdowns escape card overflow — scoped to builder lists only */
body:has(.pg-builder) #fields-list .dropdown-menu,
body:has(.pg-builder) #groups-list .dropdown-menu,
body:has(.pg-builder) .group-fields-list .dropdown-menu {
    z-index: 1050;
}
/* Disable sticky preview on mobile to preserve screen real-estate */
@media (max-width: 991.98px) {
body:has(.pg-builder) .sticky-top { position: static !important; }
}
/* Drag cues */
body:has(.pg-builder) .dragging {
    opacity: 0.5;
    outline: 2px dashed var(--bs-success) !important;
}
body:has(.pg-builder) .drag-over {
    outline: 2px dashed var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.06) !important;
}
/* Collapse chevron rotation */
body:has(.pg-builder) [data-bs-toggle="collapse"] .ti { transition: transform 0.2s; }
body:has(.pg-builder) [data-bs-toggle="collapse"].collapsed .ti { transform: rotate(-90deg); }
.pg-auth-form .auth-avatar { width: 28px; height: 28px; }
.pg-auth-form .auth-main { max-width: 800px; margin: 0 auto; padding: 1.875rem 1rem; }
.pg-auth-form .auth-card-head { background: var(--gray-50); }
body:has(.pg-builder) .builder-preview { top: 1rem; }
.pg-code-access .code-title { font-size: var(--fs-2xl); font-weight: 600; margin: 0 0 .5rem; }
.pg-code-access .code-lead { margin: 0; color: var(--gray-600); font-size: var(--fs-base); }
.pg-collab-form .collab-title { font-size: var(--fs-2xl); font-weight: 600; margin: 0 0 .5rem; }
.pg-collab-form .collab-lead { margin: 0; color: var(--gray-600); font-size: var(--fs-base); }
.pg-collab-form .collab-group-title { font-size: var(--fs-base); font-weight: 600; }
@media (max-width: 575.98px) { .pg-collab-form .collab-title { font-size: var(--fs-xl); } }

/* ── formsbuilder/pages/collaborative_manage.html (.pg-collab-manage) ── */
.pg-collab-manage .cm-select-narrow { width: 80px; }
.pg-collab-manage .cm-steps { padding-left: 18px; line-height: 1.8; }
.pg-collab-manage .cm-slot-panel { border-style: dashed; }
.pg-collab-manage .cm-slot-label { width: 200px; }

/* ── formsbuilder/pages/form_sharing.html (.pg-sharing) ── */
.pg-sharing .sh-session-code { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 700; letter-spacing: 2px; color: var(--color-primary); }
.pg-sharing .sh-slot-code { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 1px; color: var(--color-primary); }
.pg-sharing .sh-slot-copy { padding: 1px 4px; }
body:has(.pg-sharing) .sh-copy-buffer { position: fixed; left: -9999px; top: -9999px; }
body:has(.pg-sharing) .sh-copy-toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  background: var(--gray-950); color: var(--app-surface); padding: 12px 20px;
  border-radius: var(--radius-md); font-size: var(--fs-base); box-shadow: var(--shadow-lg);
  transition: opacity .3s;
}
body:has(.pg-sharing) .sh-copy-toast.is-leaving { opacity: 0; }
.pg-public-form .public-form-container.pf-messages { padding-top: 20px; padding-bottom: 0; }
.pg-public-form .pf-submit-bar { border-top: 1px solid var(--app-border); }
.pg-public-success .ps-message { color: var(--gray-700); }
body:has(.pg-submission-detail) .sd-image { max-width: min(400px, 100%); }
body:has(.pg-submission-detail) .sd-longtext { white-space: pre-wrap; }
body:has(.pg-submission-detail) .sd-eyebrow { font-size: 11px; }
body:has(.pg-my-space) .ud-tint-brand { background: color-mix(in oklch, var(--color-primary) 14%, transparent); }
body:has(.pg-my-space) .ud-tint-success { background: color-mix(in oklch, var(--success-500) 12%, transparent); }
body:has(.pg-my-space) .ud-tint-info { background: color-mix(in oklch, var(--info-500) 14%, transparent); }
body:has(.pg-my-space) .ud-help-icon { width: 44px; height: 44px; }
body:has(.pg-my-space) .ud-status-dot { width: 40px; height: 40px; background: var(--success-500); }
body:has(.pg-my-space) .ud-data-row { background: var(--app-surface-muted); }

/* ── Nouveau formulaire : de zéro, ou depuis un exemple ─────────────── */
.pp-create { max-width: 880px; }
.pp-create__row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.pp-create__name { flex: 1; }
.pp-create__more { margin-top: 12px; }
.pp-create__more summary { color: var(--gray-600); cursor: pointer; font-size: var(--fs-sm); }
.pp-create__more[open] summary { margin-bottom: 12px; }
.pp-create__examples { margin-top: 24px; }
.pp-starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.pp-starters form { display: contents; }
.pp-starter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; height: 100%;
  border: 1px solid var(--app-border); border-radius: var(--radius-lg); background: var(--app-surface); padding: 16px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pp-starter:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pp-starter:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }
.pp-starter__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; font-size: 20px;
  background: color-mix(in oklch, var(--color-primary) 10%, var(--app-surface)); color: var(--color-primary);
}
.pp-starter__title { font-weight: 600; color: var(--gray-950); }
.pp-starter__summary { font-size: var(--fs-sm); color: var(--gray-600); flex: 1; }
.pp-starter__meta { font-family: var(--font-mono); font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 575.98px) { .pp-create__row { flex-direction: column; align-items: stretch; } }

/* ── Paramètres : groupes et niveaux ────────────────────────────────── */
.pp-group-rows { display: grid; gap: 8px; }
.pp-group-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.pp-group-row.is-new .pp-group-row__team select { border-style: dashed; }
.pp-group-row__remove {
  display: grid; place-items: center; width: 36px; height: var(--control-h-md); border-radius: var(--radius-md);
  color: var(--gray-500); cursor: pointer;
}
.pp-group-row__remove:hover { background: var(--danger-100); color: var(--danger-600); }
.pp-group-row__remove input { position: absolute; opacity: 0; pointer-events: none; }
.pp-group-row:has(.pp-group-row__remove input:checked) { opacity: .45; }
.pp-group-row:has(.pp-group-row__remove input:checked) .pp-group-row__remove { color: var(--danger-600); }

/* ── Réponses : filtre par formulaire dans l'en-tête ────────────────── */
.pp-answers-filter { min-width: 240px; max-width: 100%; }

/* Champ de code : l'espacement des lettres ne touche pas le texte d'exemple. */
.pg-code-access .code-input::placeholder, .pg-collab-join .code-input::placeholder { letter-spacing: normal; font-family: var(--font-sans); font-weight: 400; font-size: var(--fs-base); }
/* Session fermée : le cercle prend la couleur d'alerte. */
.pg-collab-join .join-header.is-closed .icon { background: var(--danger-100); color: var(--danger-600); }

/* Détail d'une réponse : la carte des réponses prend la hauteur de son contenu. */
body:has(.pg-submission-detail) .col-lg-8 > .card { height: auto; }

/* Formulaire collaboratif sur téléphone : mêmes marges que le formulaire public. */
@media (max-width: 575.98px) {
  .pg-collab-form .public-form-container { padding-left: 8px; padding-right: 8px; }
  .pg-collab-form .form-header { padding: 16px 14px; }
  .pg-collab-form .form-body { padding: 14px; }
  .pg-collab-form .form-section { padding: 12px; }
}

/* Jauge de stockage (Mon espace, personnel) et page « Espace de stockage plein » */
.storage-gauge__figures { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.storage-gauge__percent { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.storage-gauge__track { height: 8px; border-radius: 999px; background: var(--color-surface-muted); overflow: hidden; }
.storage-gauge__bar { display: block; height: 100%; width: var(--pct, 0%); background: var(--color-primary); border-radius: inherit; }
.storage-gauge--warning .storage-gauge__bar { background: var(--color-warning); }
.storage-gauge--full .storage-gauge__bar { background: var(--color-danger); }
.storage-gauge__note { margin: 8px 0 0; font-size: 0.8rem; }
.storage-gauge--warning .storage-gauge__note { color: var(--color-warning); }
.storage-gauge--full .storage-gauge__note { color: var(--color-danger); }
.storage-gauge--full { border-color: var(--color-danger); }
.storage-gauge__link { display: inline-flex; gap: 4px; align-items: center; margin-top: 10px; font-size: 0.85rem; }
.storage-full { text-align: center; padding: 8px 0; }
.storage-full__icon { display: block; font-size: 2rem; color: var(--color-danger); margin-bottom: 8px; }

/* ==== 64-studio.css ==== */
/* =========================================================================
   STUDIO, ANALYSES ET RECHERCHE — classes du domaine (préfixe .st-).
   Les pages de ce domaine n'ont aucun style dans leur HTML.
   ========================================================================= */

/* ── Cartes repliables (onglets Données et Export) ───────────────────── */
.card-header.collapsible {
  display: flex; align-items: center; cursor: pointer;
  text-decoration: none; color: inherit; user-select: none;
}
.card-header.collapsible:hover { background-color: var(--app-surface-muted); }
.card-header.collapsible .collapsible-chevron { transition: transform .2s ease; }
.card-header.collapsible.collapsed .collapsible-chevron { transform: rotate(-90deg); }
.list-group-item-action.collapsible { text-decoration: none; color: inherit; }
.list-group-item-action.collapsible:hover { background-color: var(--app-surface-muted); }
.list-group-item-action.collapsible .collapsible-chevron { transition: transform .2s ease; display: inline-block; }
.list-group-item-action.collapsible.collapsed .collapsible-chevron { transform: rotate(-90deg); }

/* ── Export : cartes de format ───────────────────────────────────────── */
.export-format-card { transition: transform .12s ease, border-color .12s ease; }
.export-format-card:hover { transform: translateY(-2px); border-color: var(--gray-300); }

/* ── Éléments cliquables sans lien (lignes htmx, cartes de section) ──── */
.st-clickable { cursor: pointer; }
.st-sortable { cursor: pointer; user-select: none; }
.st-sortable:hover { color: var(--gray-900); }

/* ── Listes et tableaux de soumissions ───────────────────────────────── */
.st-list-scroll { max-height: 420px; overflow-y: auto; }
.st-table-scroll { max-height: 520px; overflow-y: auto; }
.st-sticky-head { z-index: 5; background: var(--app-surface); }
.st-sticky-head th { background: var(--app-surface); }
.st-row-active > td, .list-group-item.st-row-active { background: color-mix(in oklch, var(--color-primary) 6%, var(--app-surface)) !important; }

/* Lien vers les données géographiques : un filet de couleur à gauche. */
.st-accent-card { border-left: 3px solid var(--color-primary); }
.st-accent-card:hover { border-color: var(--color-primary); background: var(--gray-50); }

/* Squelette de chargement d'un graphique. */
.st-skeleton-chart { height: 120px; }

/* Sélecteurs compacts dans les barres d'outils. */
.st-select-md { max-width: 320px; }
.st-select-wide { min-width: 220px; }
.st-select-op { width: 90px; }

/* ── Analyses ────────────────────────────────────────────────────────── */
.st-analysis-map { width: 100%; height: 340px; border-radius: var(--radius-md); overflow: hidden; }
.st-map-popup { font-size: var(--fs-sm); line-height: 1.5; }

/* ── Petites mesures communes au domaine ─────────────────────────────── */
.st-xs { font-size: var(--fs-xs); }
.st-w-28 { width: 28px; } .st-h-28 { height: 28px; } .st-lh-28 { line-height: 28px; }
.st-w-40 { width: 40px; } .st-w-200 { width: 200px; }
.st-h-6 { height: 6px; } .st-h-8 { height: 8px; } .st-h-10 { height: 10px; }
.st-h-350 { height: 350px; } .st-h-450 { height: 450px; }
.st-minh-250 { min-height: 250px; } .st-minh-400 { min-height: 400px; }
.st-maxw-200 { max-width: 200px; } .st-maxw-300 { max-width: 300px; }
.st-z-1 { z-index: 1; } .st-z-5 { z-index: 5; }
.st-pad-badge { padding: 8px 12px; }

/* Numéro d'étape (1, 2, 3) dans un en-tête de carte. */
.st-step {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%; font-size: var(--fs-sm); font-weight: 600;
  background: var(--gray-100); color: var(--gray-800);
}

/* Pastille de couleur d'une série ; la couleur arrive par --swatch. */
.st-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; background: var(--swatch, var(--gray-400)); flex-shrink: 0; }
/* Échelle de couleur d'une carte de chaleur. */
.st-legend-scale { height: 10px; border-radius: 5px; background: linear-gradient(to right, var(--success-500), var(--warning-500), var(--danger-500)); }
/* Mot d'un nuage : taille et opacité par variables. */
.st-word { font-size: var(--size, 14px); opacity: var(--alpha, 1); }
/* Marqueur rond sur une carte Leaflet. */
.st-marker {
  width: var(--size, 16px); height: var(--size, 16px); border-radius: 50%;
  background: var(--swatch, var(--color-primary)); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
}
.st-marker--soft { opacity: .8; }
.st-popup-scroll { max-width: 300px; max-height: 200px; overflow: auto; }

/* ── Ancienne page d'analyse d'un formulaire (.pg-analysis) ───────────── */
.pg-analysis .card, .pg-analysis .card-body { overflow: visible; }
.pg-analysis .dropdown-menu { z-index: 1050; }
.pg-analysis .field-card { transition: border-color .15s ease, transform .15s ease; cursor: pointer; }
.pg-analysis .field-card.selected {
  border-color: var(--color-primary) !important;
  background-color: color-mix(in oklch, var(--color-primary) 6%, var(--app-surface));
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.pg-analysis .field-card:hover { border-color: var(--gray-400); transform: translateY(-1px); }
.pg-analysis .nav-tabs .nav-link.active { color: var(--color-primary); font-weight: 600; }
.pg-analysis .tab-pane { animation: st-fade-in .3s ease; }
@keyframes st-fade-in { from { opacity: 0; } to { opacity: 1; } }
.pg-analysis .stat-card { text-align: center; padding: 1rem; background: var(--app-surface-muted); border-radius: var(--radius-lg); }
.pg-analysis .stat-value { font-size: var(--fs-2xl); font-weight: 600; color: var(--gray-950); }
.pg-analysis .stat-label { font-size: var(--fs-sm); color: var(--gray-600); }
.pg-analysis #cross-analysis-map { z-index: 1; }
.pg-analysis #cross-analysis-map .leaflet-tile-pane,
.pg-analysis #cross-analysis-map .leaflet-tile-container,
.pg-analysis #cross-analysis-map .leaflet-tile { visibility: visible !important; opacity: 1 !important; }
.pg-analysis #cross-analysis-map img { max-width: none !important; max-height: none !important; }
.pg-analysis #cross-analysis-results .card,
.pg-analysis #cross-analysis-results .card:hover { transform: none; }

/* ── Rapport : aperçu PDF et graphiques ──────────────────────────────── */
.st-preview, .st-preview iframe { min-height: 600px; }
.st-preview iframe { background: var(--app-surface-muted); }
.st-spinner-xs { width: .8rem; height: .8rem; }
.st-chart-500 { width: 100%; height: 500px; }

/* ── Comparaison de formulaires (.pg-compare) ────────────────────────── */
.pg-compare .card, .pg-compare .card-body { overflow: visible; }
.pg-compare .selected-form-item {
  background-color: var(--app-surface-muted); border-radius: var(--radius-md);
  padding: .75rem; transition: background-color .2s;
}
.pg-compare .selected-form-item:hover { background-color: var(--gray-100); }
.pg-compare .form-list-scroll { max-height: 300px; overflow-y: auto; }
.pg-compare .chart-container { min-height: 250px; background-color: var(--app-surface-muted); border-radius: var(--radius-md); }

/* ── Résultats de recherche, liste simple (.sr-list) ── */
.sr-list .search-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.sr-list .search-results-meta { color: var(--gray-600); font-size: 0.875rem; }
.sr-list .search-results-meta strong { color: var(--color-text); }
.sr-list .search-result-card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; transition: all 0.2s; cursor: pointer; }
.sr-list .search-result-card:hover { border-color: var(--brand-600); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sr-list .search-result-header { display: flex; align-items: flex-start; margin-bottom: 0.75rem; }
.sr-list .search-result-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 1rem; flex-shrink: 0; }
.sr-list .search-result-icon i { font-size: 22px; }
.sr-list .search-result-title { font-size: 1.1rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.25rem; line-height: 1.3; }
.sr-list .search-result-title:hover { color: var(--brand-600); }
.sr-list .search-result-breadcrumb { font-size: 0.75rem; color: var(--gray-600); }
.sr-list .search-result-breadcrumb span { margin: 0 0.35rem; }
.sr-list .search-result-description { color: var(--gray-700); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.75rem; }
.sr-list .search-result-description mark { background: var(--warning-100); padding: 0 0.15rem; border-radius: 2px; }
.sr-list .search-result-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--gray-600); }
.sr-list .search-result-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sr-list .search-result-tag { background: #f0f0f0; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; }
.sr-list .search-result-score { display: flex; align-items: center; gap: 0.5rem; }
.sr-list .search-result-score-bar { width: 50px; height: 4px; background: var(--app-border); border-radius: 2px; overflow: hidden; }
.sr-list .search-result-score-fill { height: 100%; width: calc(var(--value, 0) * 1%); background: var(--color-primary); border-radius: 2px; }
.sr-list .search-match-types { display: flex; gap: 0.35rem; }
.sr-list .search-match-type { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 3px; text-transform: uppercase; font-weight: 500; }
.sr-list .search-match-type.exact { background: #d4edda; color: #155724; }
.sr-list .search-match-type.partial { background: var(--warning-100); color: #856404; }
.sr-list .search-match-type.semantic { background: #e7e3ff; color: #5a4fcf; }
.sr-list .search-empty-state { text-align: center; padding: 4rem 2rem; color: var(--gray-600); }
.sr-list .search-empty-state i { font-size: 80px; opacity: 0.2; margin-bottom: 1.5rem; }
.sr-list .search-empty-state h4 { color: var(--color-text); margin-bottom: 0.5rem; }
.sr-list .search-pagination { display: flex; justify-content: center; margin-top: 2rem; }


/* ── Résultats de recherche groupés par application (.sr-grouped) ── */
.sr-grouped .search-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.sr-grouped .search-results-meta { color: var(--bs-secondary-color, var(--gray-600)); font-size: 0.875rem; }
.sr-grouped .search-results-meta strong { color: var(--bs-body-color, var(--color-text)); }
.sr-grouped .search-app-group { margin-bottom: 2rem; }
.sr-grouped .search-app-header { display: flex; align-items: center; padding: 0.75rem 1rem; background: linear-gradient(135deg, var(--app-color-light, var(--bs-tertiary-bg, var(--app-surface-muted))) 0%, var(--bs-body-bg, #fff) 100%); border-radius: 10px 10px 0 0; border: 1px solid var(--app-color-border, var(--bs-border-color, var(--app-border))); border-bottom: 2px solid var(--app-color, var(--brand-600)); margin-bottom: 0; }
.sr-grouped .search-app-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 0.75rem; background: var(--app-color, var(--brand-600)); color: white; }
.sr-grouped .search-app-icon i { font-size: 20px; }
.sr-grouped .search-app-name { font-weight: 600; font-size: 1rem; color: var(--bs-body-color, var(--color-text)); }
.sr-grouped .search-app-count { margin-left: auto; font-size: 0.8rem; color: var(--bs-secondary-color, var(--gray-600)); background: var(--bs-tertiary-bg, #f0f0f0); padding: 0.2rem 0.75rem; border-radius: 20px; }
.sr-grouped .search-app-results { border: 1px solid var(--bs-border-color, var(--app-border)); border-top: none; border-radius: 0 0 10px 10px; overflow: hidden; }
.sr-grouped .search-result-card { display: flex; align-items: flex-start; padding: 1rem 1.25rem; background: var(--bs-body-bg, white); border-bottom: 1px solid var(--bs-border-color-translucent, #f0f0f0); transition: all 0.2s; text-decoration: none; color: inherit; }
.sr-grouped .search-result-card:last-child { border-bottom: none; }
.sr-grouped .search-result-card:hover { background: var(--bs-tertiary-bg, var(--app-surface-muted)); text-decoration: none; color: inherit; }
.sr-grouped .search-result-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 1rem; flex-shrink: 0; }
.sr-grouped .search-result-icon i { font-size: 20px; }
.sr-grouped .search-result-content { flex-grow: 1; min-width: 0; }
.sr-grouped .search-result-title { font-weight: 500; color: var(--bs-body-color, var(--color-text)); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sr-grouped .search-result-title-text { color: inherit; }
.sr-grouped .search-result-card:hover .search-result-title-text { color: var(--bs-primary, var(--brand-600)); }
.sr-grouped .search-result-type { font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: var(--bs-tertiary-bg, #f0f0f0); color: var(--bs-secondary-color, var(--gray-700)); text-transform: uppercase; font-weight: 500; }
.sr-grouped .search-result-description { color: var(--bs-secondary-color, var(--gray-700)); font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-grouped .search-result-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.75rem; color: var(--bs-tertiary-color, var(--gray-600)); flex-wrap: wrap; }
.sr-grouped .search-result-meta i { font-size: 14px; vertical-align: middle; margin-right: 0.25rem; }
.sr-grouped .search-result-tags { display: flex; gap: 0.35rem; }
.sr-grouped .search-result-tag { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 3px; background: var(--bs-secondary-bg, var(--app-border)); color: var(--bs-secondary-color, var(--gray-700)); }
.sr-grouped .search-result-score { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.sr-grouped .search-result-score-bar { width: 40px; height: 4px; background: var(--bs-secondary-bg, var(--app-border)); border-radius: 2px; overflow: hidden; }
.sr-grouped .search-result-score-fill { height: 100%; width: calc(var(--value, 0) * 1%); background: var(--color-primary); border-radius: 2px; }
.sr-grouped .search-match-types { display: flex; gap: 0.35rem; flex-shrink: 0; }
.sr-grouped .search-match-type { font-size: 0.6rem; padding: 0.1rem 0.35rem; border-radius: 3px; text-transform: uppercase; font-weight: 500; }
.sr-grouped .search-match-type.text { background: rgba(40, 167, 69, 0.15); color: var(--bs-success, #155724); }
.sr-grouped .search-match-type.semantic { background: color-mix(in oklch, var(--color-primary) calc(0.15 * 100%), transparent); color: var(--bs-primary, #5a4fcf); }
.sr-grouped .search-view-toggle { display: flex; gap: 0.25rem; background: var(--bs-tertiary-bg, #f0f0f0); padding: 0.25rem; border-radius: 6px; }
.sr-grouped .search-view-toggle button { background: none; border: none; padding: 0.35rem 0.5rem; border-radius: 4px; color: var(--bs-secondary-color, var(--gray-700)); cursor: pointer; transition: all 0.2s; }
.sr-grouped .search-view-toggle button.active { background: var(--bs-body-bg, white); color: var(--bs-body-color, var(--color-text)); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.sr-grouped .search-view-toggle button:hover:not(.active) { color: var(--bs-body-color, var(--color-text)); }
.sr-grouped .search-empty-state { text-align: center; padding: 4rem 2rem; color: var(--bs-secondary-color, var(--gray-600)); }
.sr-grouped .search-empty-state i { font-size: 80px; opacity: 0.2; margin-bottom: 1.5rem; }
.sr-grouped .search-empty-state h4 { color: var(--bs-body-color, var(--color-text)); margin-bottom: 0.5rem; }
.sr-grouped .app-formsbuilder { --app-color: var(--brand-600); --app-color-light: color-mix(in oklch, var(--color-primary) calc(0.1 * 100%), transparent); --app-color-border: color-mix(in oklch, var(--color-primary) calc(0.3 * 100%), transparent); }
.sr-grouped .app-users { --app-color: #17a2b8; --app-color-light: rgba(23, 162, 184, 0.1); --app-color-border: rgba(23, 162, 184, 0.3); }
.sr-grouped .app-mailing { --app-color: #ffc107; --app-color-light: rgba(255, 193, 7, 0.1); --app-color-border: rgba(255, 193, 7, 0.3); }
.sr-grouped .app-notifications { --app-color: #dc3545; --app-color-light: rgba(220, 53, 69, 0.1); --app-color-border: rgba(220, 53, 69, 0.3); }
.sr-grouped .app-geomap { --app-color: var(--gray-600); --app-color-light: rgba(108, 117, 125, 0.1); --app-color-border: rgba(108, 117, 125, 0.3); }


/* ── Barre de recherche globale (.global-search-*) ── */
.global-search-bar { position: relative; width: 100%; max-width: 400px; }
.global-search-bar .search-input-wrapper { position: relative; }
.global-search-bar input { width: 100%; height: 40px; padding: 0 40px 0 40px; border: 1px solid #e0e0e0; border-radius: 20px; font-size: 0.9rem; background: var(--app-surface-muted); transition: all 0.2s; }
.global-search-bar input:focus { outline: none; border-color: var(--brand-600); background: var(--app-surface); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) calc(0.1 * 100%), transparent); }
.global-search-bar .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-600); pointer-events: none; }
.global-search-bar .search-shortcut { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: var(--app-border); padding: 2px 6px; border-radius: 4px; font-size: 0.65rem; color: var(--gray-700); font-family: monospace; }
.global-search-bar .search-dropdown { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: var(--app-surface); border: 1px solid #e0e0e0; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 1050; display: none; max-height: 400px; overflow: hidden; }
.global-search-bar .search-dropdown.show { display: block; }
.global-search-dropdown-header { padding: 0.75rem 1rem; background: var(--app-surface-muted); border-bottom: 1px solid var(--app-border); font-size: 0.75rem; color: var(--gray-700); text-transform: uppercase; font-weight: 600; }
.global-search-dropdown-body { max-height: 300px; overflow-y: auto; }
.global-search-item { display: flex; align-items: center; padding: 0.75rem 1rem; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--app-surface-muted); }
.global-search-item:hover,
.global-search-item.active { background: var(--app-surface-muted); }
.global-search-item:last-child { border-bottom: none; }
.global-search-item-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 0.75rem; flex-shrink: 0; }
.global-search-item-icon i { font-size: 18px; }
.global-search-item-content { flex-grow: 1; min-width: 0; }
.global-search-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.global-search-item-meta { font-size: 0.7rem; color: var(--gray-600); }
.global-search-dropdown-footer { padding: 0.75rem 1rem; background: var(--app-surface-muted); border-top: 1px solid var(--app-border); text-align: center; }
.global-search-dropdown-footer a { font-size: 0.85rem; color: var(--brand-600); text-decoration: none; }
.global-search-dropdown-footer a:hover { text-decoration: underline; }
.global-search-loading { padding: 2rem; text-align: center; color: var(--gray-600); }
.global-search-empty-state { padding: 2rem; text-align: center; color: var(--gray-600); }
.global-search-empty-state i { font-size: 40px; opacity: 0.3; margin-bottom: 0.5rem; }


/* ── Widget de recherche (.search-widget*) ── */
.search-widget { position: relative; }
.search-widget-input-group { position: relative; }
.search-widget .form-control { padding-left: 2.75rem; border-radius: 8px; height: 46px; }
.search-widget-compact .form-control { height: 38px; font-size: 0.875rem; }
.search-widget-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--gray-600); z-index: 10; pointer-events: none; }
.search-widget-clear { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray-600); cursor: pointer; display: none; z-index: 10; padding: 0; }
.search-widget-clear:hover { color: var(--color-text); }
.search-widget.has-value .search-widget-clear { display: block; }
.search-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--app-surface); border: 1px solid var(--app-border); border-top: none; border-radius: 0 0 8px 8px; max-height: 300px; overflow-y: auto; z-index: 1050; display: none; box-shadow: var(--shadow-md); }
.search-suggestions.show { display: block; }
.search-suggestion-item { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background 0.15s; }
.search-suggestion-item:hover,
.search-suggestion-item.active { background: var(--app-surface-muted); }
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item i { color: var(--gray-600); margin-right: 0.75rem; font-size: 18px; vertical-align: middle; }
.search-suggestion-text { flex-grow: 1; }
.search-suggestion-type { font-size: 0.7rem; color: var(--gray-600); background: var(--app-border); padding: 0.15rem 0.5rem; border-radius: 4px; }
.search-loading { text-align: center; padding: 1rem; color: var(--gray-600); }
.search-loading .spinner-border { width: 1.25rem; height: 1.25rem; }
.search-filters { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.search-filter-chip { display: inline-flex; align-items: center; padding: 0.35rem 0.75rem; background: var(--app-surface-muted); border: 1px solid var(--app-border); border-radius: 20px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.search-filter-chip:hover { background: var(--app-border); }
.search-filter-chip.active { background: var(--brand-600); border-color: var(--brand-600); color: white; }
.search-filter-chip i { font-size: 14px; margin-right: 0.35rem; }
.search-shortcut { font-size: 0.65rem; background: var(--app-border); padding: 0.15rem 0.35rem; border-radius: 3px; margin-left: 0.5rem; color: var(--gray-700); }


/* ── Tableau de bord de recherche (.pg-search-dash) ────────────────────
   Même langage que le reste : surfaces blanches, filets fins, une couleur. */
.pg-search-dash .pp-tone-primary { background: color-mix(in oklch, var(--color-primary) 10%, transparent); color: var(--color-primary); }
.pg-search-dash .pp-tone-secondary, .pg-search-dash .pp-tone-sand { background: var(--gray-100); color: var(--gray-700); }
.pg-search-dash .pp-display { font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.pg-search-dash .pp-display em { font-style: normal; color: var(--color-primary); }
.pg-search-dash .pp-numeral { font-variant-numeric: tabular-nums; }
.pg-search-dash .pp-stat {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 18px; text-align: left;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg);
}
.pg-search-dash .pp-stat__num { font-size: 26px; font-weight: 600; color: var(--gray-950); line-height: 1.1; }
.pg-search-dash .pp-stat__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.pg-search-dash .pp-stat > .d-flex { width: 100%; }
.pg-search-dash .pp-eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 500; color: var(--gray-500); }
.pg-search-dash .pp-eyebrow--brand { color: var(--color-primary); }
.pg-search-dash .pp-eyebrow--sm { font-size: 10px; }
.pg-search-dash .pp-ornament { color: var(--gray-400); margin-inline: .35rem; }
.pg-search-dash .pp-ornament--sm { font-size: .5em; vertical-align: .3em; }
.pg-search-dash .pp-sep { opacity: .4; }
.pg-search-dash .pp-rule { height: 1px; background: var(--app-border); border: 0; }
.pg-search-dash .pp-search-hero {
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
}
.pg-search-dash .pp-search-hero__title { font-size: var(--fs-2xl); margin: 0 0 .35rem; color: var(--gray-950); }
.pg-search-dash .pp-search-hero__lead { max-width: 46ch; margin-inline: auto; }
.pg-search-dash .pp-search-hero__input { max-width: 640px; margin-inline: auto; }
.pg-search-dash .pp-search-hero__input .input-group-text { width: 3rem; justify-content: center; background: var(--app-surface); color: var(--gray-500); }
.pg-search-dash .pp-search-hero__input .form-control { height: var(--control-h-lg); font-size: var(--fs-md); background: var(--app-surface); }
.pg-search-dash .pp-search-hero__input .form-control:focus { border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.pg-search-dash .pp-quickchip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; margin: .2rem;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-md);
  color: var(--gray-800); font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.pg-search-dash .pp-quickchip:hover { color: var(--color-primary); border-color: var(--color-primary); }
.pg-search-dash .pp-quickchip i { color: var(--gray-500); }
.pg-search-dash .pp-quickchip:hover i { color: var(--color-primary); }
.pg-search-dash .pp-recent-row { display: flex; align-items: center; gap: .85rem; padding: .75rem 1rem; text-decoration: none; color: inherit; transition: background .15s; }
.pg-search-dash .pp-recent-row:hover { background: var(--gray-50); }
.pg-search-dash .pp-recent-row:hover .pp-recent-row__chev { transform: translateX(2px); color: var(--color-primary); }
.pg-search-dash .pp-recent-row__q { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-search-dash .pp-recent-row__meta { font-size: var(--fs-sm); color: var(--gray-600); margin-top: 1px; }
.pg-search-dash .pp-recent-row__chev { color: var(--gray-400); transition: transform .15s, color .15s; }
.pg-search-dash .pp-indexed-item { padding: .85rem 1rem; }
.pg-search-dash .pp-indexed-item:not(:last-child) { border-bottom: 1px solid var(--app-border); }
.pg-search-dash .pp-tag { display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-700); font-size: 11px; margin-right: .25rem; margin-top: .35rem; }
.pg-search-dash .pp-tip { padding-top: 1rem; border-top: 1px solid var(--app-border); }
.pg-search-dash .pp-tip-num { font-family: var(--font-mono); font-weight: 600; color: var(--color-primary); margin-right: .5rem; }
@keyframes pp-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pg-search-dash .pp-reveal { animation: pp-fade-up .4s ease both; animation-delay: var(--pp-d, 0s); }
@media (prefers-reduced-motion: reduce) { .pg-search-dash .pp-reveal { animation: none; } }

/* ── Page de résultats et filtres (.pg-search) ── */
.pg-search .search-sidebar { position: sticky; top: 1rem; }
.pg-search .filter-section { margin-bottom: 1.5rem; }
.pg-search .filter-section h6 { font-size: 0.8rem; text-transform: uppercase; color: var(--bs-secondary-color, var(--gray-600)); margin-bottom: 0.75rem; font-weight: 600; }
.pg-search .filter-option { display: flex; align-items: center; padding: 0.5rem 0; cursor: pointer; transition: color 0.2s; color: var(--bs-body-color); }
.pg-search .filter-option:hover { color: var(--bs-primary, var(--brand-600)); }
.pg-search .filter-option.active { color: var(--bs-primary, var(--brand-600)); font-weight: 500; }
.pg-search .filter-option .form-check-input { margin-right: 0.75rem; }
.pg-search .filter-count { margin-left: auto; background: var(--bs-tertiary-bg, #f0f0f0); padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.7rem; color: var(--bs-secondary-color, var(--gray-700)); }
.pg-search .active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pg-search .active-filter-tag { display: inline-flex; align-items: center; padding: 0.35rem 0.75rem; background: var(--bs-primary, var(--brand-600)); color: white; border-radius: 20px; font-size: 0.8rem; }
.pg-search .active-filter-tag button { background: none; border: none; color: white; margin-left: 0.5rem; padding: 0; cursor: pointer; opacity: 0.7; }
.pg-search .active-filter-tag button:hover { opacity: 1; }
.pg-search .date-filter-inputs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.pg-search .date-filter-inputs input { font-size: 0.8rem; flex: 1 1 130px; min-width: 0; }


.pg-search .sr-page-form { min-width: 320px; }

/* ── Analyses : accueil ─────────────────────────────────────────────── */
.st-trend { font-size: var(--fs-sm); font-weight: 500; }
.st-trend.is-up { color: var(--success-600); }
.st-trend.is-down { color: var(--danger-600); }
.st-activity { margin-bottom: 20px; }
.st-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 3px; height: 120px; margin-top: 12px; }
.st-bars__bar {
  height: calc(max(var(--value, 0), 1.5) * 1%); background: color-mix(in oklch, var(--color-primary) 70%, var(--app-surface));
  border-radius: 3px 3px 0 0; transition: background-color .15s ease;
}
.st-bars__bar:hover { background: var(--color-primary); }
.st-bars__axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--gray-500); margin-top: 6px; }
.st-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.st-head .pp-section__title { margin: 0; }
.st-feed { list-style: none; margin: 0; padding: 0; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg); }
.st-feed li + li { border-top: 1px solid var(--gray-100); }
.st-feed__item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: inherit; text-decoration: none; }
.st-feed__item:hover { background: var(--gray-50); }
.st-feed__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
.st-feed__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.st-feed__form { font-weight: 500; color: var(--gray-950); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-feed__meta { font-size: var(--fs-sm); color: var(--gray-500); }
@media (max-width: 991.98px) { .st-grid { grid-template-columns: 1fr; } }

/* Indication sous un titre de carte : texte normal, pas gras. */
.st-hint { font-size: var(--fs-sm); font-weight: 400; color: var(--gray-600); max-width: 60ch; }

/* ── Graphiques D3 : couleurs du thème, lisibles en clair comme en sombre.
      Le moteur pose ses couleurs en attributs SVG ; une règle CSS les
      remplace, et les gris du thème s'inversent en mode sombre. ────────── */
.d3b-svg .d3b-title { fill: var(--gray-950); }
.d3b-svg .d3b-subtitle, .d3b-svg .d3b-label { fill: var(--gray-600); }
.d3b-svg .d3b-axis text, .d3b-svg .d3b-val, .d3b-svg .d3b-legend text, .d3b-svg .d3b-donut-center { fill: var(--gray-700); }
.d3b-svg .d3b-axis path, .d3b-svg .d3b-axis line { stroke: var(--gray-300); }
.d3b-svg .d3b-grid line { stroke: var(--gray-200); stroke-opacity: 1; }
.d3b-svg .d3b-grid .domain { display: none; }
.d3b-tooltip {
  background: var(--app-surface) !important; color: var(--color-text) !important;
  border-color: var(--app-border) !important; box-shadow: var(--shadow-lg) !important;
  font-family: var(--font-sans) !important;
}

/* ==== 65-admin.css ==== */
/* =========================================================================
   ADMINISTRATION — utilisateurs, équipes, rôles, messagerie, notifications,
   MFA, référentiels, thèmes. Classes préfixées .adm-.
   ========================================================================= */

/* ── Texte ────────────────────────────────────────────────────────────── */
.adm-faint { color: var(--gray-500); }
.adm-facebook { color: #1877f2; } /* couleur de marque Facebook, imposée par la charte du réseau */

/* ── Colonnes de tableaux ─────────────────────────────────────────────── */
.adm-col-40 { width: 40px; }
.adm-col-50 { width: 50px; }
.adm-col-80 { width: 80px; }
.adm-col-90 { width: 90px; }
.adm-col-140 { width: 140px; }
.adm-col-40p { width: 40%; }
.adm-truncate-200 { max-width: 200px; }
.adm-truncate-280 { max-width: 280px; }

/* ── Avatars et pastilles ─────────────────────────────────────────────── */
.adm-avatar-xl {
  width: 120px; height: 120px; font-size: 48px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar.adm-avatar-80 { width: 80px; height: 80px; font-size: 40px; }
.avatar.adm-avatar-80 .bi { font-size: 40px; }
.adm-lead-initial { width: 24px; height: 24px; font-size: 10px; object-fit: cover; flex-shrink: 0; }
.adm-role-dot { width: 32px; height: 32px; flex-shrink: 0; }
.avatar.adm-initials {
  background: color-mix(in oklch, var(--color-primary) 18%, var(--app-surface));
  color: var(--color-primary);
}
.adm-unread-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary); flex-shrink: 0;
}

/* ── Notifications : liste déroulante ─────────────────────────────────── */
.adm-notif-scroll { max-height: 320px; overflow-y: auto; }

/* ── MFA : codes de récupération et clé TOTP ──────────────────────────── */
.adm-code {
  font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: .06em;
  background: var(--app-surface); color: var(--gray-900);
}
.adm-code--wide { letter-spacing: .12em; }

/* ── Inscription ──────────────────────────────────────────────────────── */
.adm-svg-inline { vertical-align: bottom; margin-top: -4px; }

/* ── Messagerie : aperçus ─────────────────────────────────────────────── */
.adm-email-preview {
  border: 1px solid var(--app-border); border-radius: var(--radius-lg);
  padding: 20px; background: #fff; max-height: 500px; overflow-y: auto;
}
.adm-email-frame { min-height: 420px; }

/* ── Thèmes : liste, édition, aperçu ──────────────────────────────────── */
.adm-theme-strip {
  height: 56px; overflow: hidden;
  border-top-left-radius: inherit; border-top-right-radius: inherit;
}
.adm-w-30 { width: 30%; }
.adm-w-20 { width: 20%; }
.adm-sticky-below-topbar { top: calc(var(--topbar-h) + 16px); }
.adm-theme-frame {
  display: block; width: 100%; height: 760px; border: 0;
  border-bottom-left-radius: inherit; border-bottom-right-radius: inherit;
}
.adm-preview-logo { height: 28px; }
.adm-preview-warning { max-width: var(--pp-form-max-w); margin: 0 auto 12px; }

/* Logo de marque des pages publiques : hauteur réglable par --logo-h. */
.pp-brand-logo { height: var(--logo-h, auto); max-height: 64px; width: auto; }
.pp-brand-logo--default { height: var(--logo-h, 36px); }

/* ── Liste des notifications : le menu d'actions d'une ligne déborde du
      tableau au lieu d'être coupé. ──────────────────────────────────── */
.adm-notif-table { overflow: visible; }
.adm-notif-table td { overflow: visible; }
.adm-notif-table .dropdown-menu { z-index: 1050; }


/* ── Pages allauth (reconnexion, e-mails, MFA…) : même aspect que la
      connexion. Les champs rendus par form.as_p reçoivent l'aspect des
      champs Bootstrap. ─────────────────────────────────────────────── */
.adm-auth-title { font-size: var(--fs-xl); font-weight: 600; margin: 0 0 8px; color: var(--gray-950); }
.adm-auth-subtitle { font-size: var(--fs-lg); font-weight: 600; margin: 16px 0 8px; }
.adm-auth-form { margin-top: 16px; }
.adm-auth-form__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-auth-form__actions:empty { display: none; }
.adm-auth-form .adm-auth-form__actions .btn-primary { flex: 1 1 auto; }
.adm-auth-form > p { margin-bottom: 16px; }
.adm-auth-form label:not(.form-check-label):not(.form-label) { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-900); }
.adm-auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.form-control):not(.form-check-input),
.adm-auth-form select:not(.form-select), .adm-auth-form textarea:not(.form-control) {
  display: block; width: 100%; min-height: var(--control-h-md); padding: 8px 12px;
  font: inherit; color: var(--color-text); background: var(--app-surface);
  border: 1px solid var(--app-border-strong, var(--gray-300)); border-radius: var(--radius-md);
}
.adm-auth-form .input-group > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.form-control):not(.form-check-input) { flex: 1 1 auto; width: 1%; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.adm-auth-form input:not(.form-control):focus, .adm-auth-form select:not(.form-select):focus, .adm-auth-form textarea:not(.form-control):focus {
  border-color: var(--color-primary); box-shadow: var(--shadow-focus); outline: 0;
}
.adm-auth-form .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger-600); font-size: var(--fs-sm); }
.adm-auth-form .helptext { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--gray-600); }


/* ── Arbre des groupes ──────────────────────────────────────────────── */
.adm-tree { gap: 6px; }
.adm-tree__indent { display: inline-block; width: 18px; align-self: stretch; border-left: 1px solid var(--gray-200); margin-left: 6px; }

/* ── Repasse : sous-titres de section neutres ───────────────────────── */
.adm-subhead { font-size: var(--fs-sm); font-weight: 600; color: var(--gray-800); margin: 12px 0 6px; }

/* ==== 70-builder.css ==== */
/* =========================================================================
   CONSTRUCTEUR — palette · formulaire · panneau, barre de progression.
   ========================================================================= */

.bld { display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 120px); }

/* ── Barre du haut ──────────────────────────────────────────────────── */
.bld-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg);
  position: sticky; top: 8px; z-index: 20;
}
.bld-top__name { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; min-width: 0; }
.bld-top__title {
  flex: 1; min-width: 0; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent;
  font-size: var(--fs-xl); font-weight: 600; color: var(--gray-950); padding: 4px 8px;
}
.bld-top__title:hover { border-color: var(--app-border); }
.bld-top__title:focus { outline: 0; border-color: var(--color-primary); box-shadow: var(--shadow-focus); background: var(--app-surface); }
.bld-top__actions { display: flex; gap: 8px; margin-left: auto; }

.bld-status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--fs-sm); font-weight: 500; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--gray-100); color: var(--gray-700);
}
.bld-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); }
.bld[data-status="live"] .bld-status { background: var(--success-100); color: var(--success-600); }
.bld[data-status="live"] .bld-status__dot { background: var(--success-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success-500) 25%, transparent); }
.bld[data-status="changes"] .bld-status { background: var(--warning-100); color: oklch(45% .15 var(--status-warning-hue)); }
.bld[data-status="changes"] .bld-status__dot { background: var(--warning-500); }

/* Progression : un anneau qui se remplit à chaque étape franchie. */
.bld-progress {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--app-border); background: var(--app-surface);
  border-radius: var(--radius-pill); padding: 3px 12px 3px 3px; font-size: var(--fs-sm); color: var(--gray-700); cursor: pointer;
}
.bld-progress:hover { border-color: var(--gray-400); }
.bld-progress__ring {
  --value: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--color-primary) calc(var(--value) * 1%), var(--gray-200) 0);
  transition: background .4s ease;
}
.bld-progress__ring > span {
  width: 24px; height: 24px; border-radius: 50%; background: var(--app-surface);
  display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--gray-800);
}
.bld-checklist { width: 300px; padding: 12px; }
.bld-checklist__title { font-weight: 600; margin-bottom: 8px; color: var(--gray-950); }
.bld-checklist__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bld-checklist__list li { display: flex; align-items: center; gap: 8px; color: var(--gray-700); }
.bld-checklist__list .bi-check-circle-fill { display: none; color: var(--color-primary); }
.bld-checklist__list .bi-circle { color: var(--gray-400); }
.bld-checklist__list li.is-done { color: var(--gray-500); text-decoration: line-through; }
.bld-checklist__list li.is-done .bi-check-circle-fill { display: inline; animation: bld-pop .35s ease; }
.bld-checklist__list li.is-done .bi-circle { display: none; }

/* ── Trois colonnes ─────────────────────────────────────────────────── */
.bld-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.bld-palette, .bld-panel {
  position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius-lg);
}
.bld-palette { padding: 12px; }
.bld-panel { padding: 16px; }

/* Palette */
.bld-palette__search {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; height: var(--control-h-sm);
  border: 1px solid var(--app-border); border-radius: var(--radius-md); color: var(--gray-500); margin-bottom: 12px;
}
.bld-palette__search input { border: 0; outline: 0; background: transparent; width: 100%; font: inherit; color: var(--color-text); }
.bld-palette__search:focus-within { border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.bld-palette__group + .bld-palette__group { margin-top: 12px; }
.bld-palette__heading { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); margin: 0 4px 6px; }
.bld-tile {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; padding: 7px 8px; cursor: grab;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.bld-tile:hover { background: var(--gray-50); border-color: var(--app-border); }
.bld-tile:active { transform: scale(.98); cursor: grabbing; }
.bld-tile:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }
.bld-tile__icon {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--color-primary) 10%, var(--app-surface)); color: var(--color-primary); font-size: 15px;
}
.bld-tile__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bld-tile__name { font-weight: 500; color: var(--gray-900); font-size: var(--fs-base); }
.bld-tile__desc { font-size: var(--fs-xs); color: var(--gray-500); line-height: 1.35; }
.bld-tile__plus { color: var(--gray-400); opacity: 0; transition: opacity .15s ease; }
.bld-tile:hover .bld-tile__plus { opacity: 1; color: var(--color-primary); }

/* ── Le formulaire ──────────────────────────────────────────────────── */
.bld-canvas { min-width: 0; }
.bld-paper {
  max-width: 760px; margin: 0 auto; background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); padding: 28px 28px 20px;
}
.bld-paper__head { border-bottom: 1px solid var(--app-border); padding-bottom: 16px; margin-bottom: 8px; }
.bld-paper__title { font-size: var(--fs-2xl); font-weight: 600; color: var(--gray-950); letter-spacing: -.015em; }
.bld-paper__desc {
  width: 100%; border: 1px dashed transparent; border-radius: var(--radius-md); background: transparent; resize: none;
  color: var(--gray-700); padding: 4px 6px; margin: 6px -6px 0; font: inherit; overflow: hidden;
}
.bld-paper__desc:hover { border-color: var(--app-border); }
.bld-paper__desc:focus { outline: 0; border-style: solid; border-color: var(--color-primary); box-shadow: var(--shadow-focus); }

/* Sections */
.bs { padding: 8px 0; }
.bs + .bs { border-top: 1px solid var(--gray-100); margin-top: 8px; padding-top: 16px; }
.bs__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bs__title {
  flex: 1; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent;
  font-size: var(--fs-lg); font-weight: 600; color: var(--gray-950); padding: 4px 8px; margin-left: -8px;
}
.bs__title:hover { border-color: var(--app-border); }
.bs__title:focus { outline: 0; border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.bs__questions { min-height: 8px; display: grid; gap: 6px; }
.bs__empty { display: none; }
.bs.is-empty .bs__empty {
  display: block; padding: 18px; text-align: center; color: var(--gray-500); font-size: var(--fs-sm);
  border: 1px dashed var(--gray-300); border-radius: var(--radius-md);
}
.bs[data-section=""].is-empty { padding: 0; }
.bs[data-section=""].is-empty .bs__empty { display: none; }

/* Questions */
.bq {
  position: relative; display: flex; gap: 8px; padding: 14px 14px 14px 6px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; background: var(--app-surface);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.bq:hover { border-color: var(--app-border); background: var(--gray-50); }
.bq:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }
.bq.is-selected { border-color: var(--color-primary); box-shadow: inset 3px 0 0 var(--color-primary); background: color-mix(in oklch, var(--color-primary) 4%, var(--app-surface)); }
.bq.is-dragging { opacity: .4; }
.bq.is-new { animation: bld-arrive .5s ease; }
.bq__grip {
  border: 0; background: transparent; color: var(--gray-300); cursor: grab; padding: 0 2px; align-self: flex-start; margin-top: 1px;
}
.bq:hover .bq__grip, .bq.is-selected .bq__grip { color: var(--gray-500); }
.bq__body { flex: 1; min-width: 0; }
.bq__label { font-weight: 500; color: var(--gray-950); margin-bottom: 6px; }
.bq__required { color: var(--danger-500); }
.bq__help { font-size: var(--fs-sm); color: var(--gray-600); margin: -2px 0 8px; }
.bq__tools {
  position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: var(--radius-md); background: var(--app-surface);
  opacity: 0; transition: opacity .15s ease;
}
.bq:hover .bq__tools, .bq.is-selected .bq__tools, .bq:focus-within .bq__tools { opacity: 1; }
.bq__type { font-size: var(--fs-xs); color: var(--gray-500); white-space: nowrap; margin: 6px 6px 0 0; }
.bq__tools .is-confirming { color: var(--danger-600); background: var(--danger-100); width: auto; padding: 0 8px; }

/* Aperçu des réponses dans le constructeur */
.bq__mock { pointer-events: none; }
.bq-input {
  height: var(--control-h-md); border: 1px solid var(--app-border); border-radius: var(--radius-md);
  background: var(--app-surface); padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--gray-400);
}
.bq-input--area { height: 76px; align-items: flex-start; padding-top: 10px; }
.bq-input--select { justify-content: space-between; }
.bq-input--select::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--gray-500); }
.bq-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }
.bq-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bq-options li { display: flex; align-items: center; gap: 10px; color: var(--gray-800); }
.bq-options li::before { content: ""; width: 16px; height: 16px; border: 1.5px solid var(--gray-400); border-radius: 50%; flex-shrink: 0; }
.bq-options--multi li::before { border-radius: 4px; }
.bq-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 64px;
  border: 1.5px dashed var(--gray-300); border-radius: var(--radius-md); color: var(--gray-500); background: var(--gray-50);
}
.bq-drop--tall { height: 110px; }

.bld-drop-marker { height: 3px; border-radius: 2px; background: var(--color-primary); margin: -1px 0; box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 20%, transparent); }

/* Formulaire vide : on montre par où commencer. */
.bld-start { text-align: center; padding: 40px 16px 24px; }
.bld-start__icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in oklch, var(--color-primary) 10%, var(--app-surface)); color: var(--color-primary);
}
.bld .bld-start__title { font-size: var(--fs-lg); margin: 0 0 4px; }
.bld-start__text { color: var(--gray-600); margin-bottom: 14px; }
.bld-start__chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.bld-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--app-border); background: var(--app-surface);
  border-radius: var(--radius-pill); padding: 6px 14px; color: var(--gray-800); font-weight: 500;
  transition: border-color .15s ease, transform .15s ease, background-color .15s ease;
}
.bld-chip:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-1px); }
.bld-chip i { color: var(--color-primary); }

.bld-add-section {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 16px;
  border: 1px dashed var(--gray-300); border-radius: var(--radius-md); background: transparent; color: var(--gray-600); padding: 10px;
}
.bld-add-section:hover { border-color: var(--color-primary); color: var(--color-primary); background: color-mix(in oklch, var(--color-primary) 4%, transparent); }

/* ── Panneau ────────────────────────────────────────────────────────── */
.bi-panel__type { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--gray-950); margin-bottom: 12px; }
.bi-panel__type i { color: var(--color-primary); }
.bi-panel__hint { color: var(--gray-600); font-size: var(--fs-sm); margin-bottom: 16px; }
.bi-panel__more { border-top: 1px solid var(--app-border); margin-top: 16px; padding-top: 16px; }
.bi-panel__status { min-height: 18px; font-size: var(--fs-sm); color: var(--gray-500); margin-top: 8px; }
.bi-panel__status.is-error { color: var(--danger-600); }
.pp-choices--compact { gap: 6px; }
.pp-choices--compact .pp-choice { padding: 10px 12px; }
.pp-choices--compact .pp-choice__desc { font-size: var(--fs-xs); }

/* Essai : ordinateur ou téléphone */
.bld-device { margin: 0 auto; transition: max-width .3s ease; max-width: 100%; }
.bld-device.is-phone { max-width: 390px; border: 10px solid var(--gray-900); border-radius: 28px; padding: 12px; }

.bld-drawer { width: min(560px, 100vw) !important; }
.bld-toast.is-error { background: var(--danger-100); color: var(--danger-600); }

/* Publication : petite fête. */
.bld-celebrate { overflow: hidden; position: relative; }
.bld-celebrate__burst { position: absolute; inset: 0; pointer-events: none; }
.bld-celebrate__burst span {
  position: absolute; top: 40%; left: 50%; width: 8px; height: 14px; border-radius: 2px; opacity: 0;
  background: var(--color-primary);
}
.modal.show .bld-celebrate__burst span { animation: bld-confetti 1.1s ease-out forwards; }
.bld-celebrate__burst span:nth-child(3n) { background: var(--accent-coral, #ff5757); }
.bld-celebrate__burst span:nth-child(4n) { background: var(--warning-500); }
.bld-celebrate__burst span:nth-child(1) { --dx: -180px; --dy: -120px; --r: 200deg; }
.bld-celebrate__burst span:nth-child(2) { --dx: 170px; --dy: -140px; --r: -160deg; }
.bld-celebrate__burst span:nth-child(3) { --dx: -120px; --dy: -190px; --r: 120deg; }
.bld-celebrate__burst span:nth-child(4) { --dx: 130px; --dy: -200px; --r: 260deg; }
.bld-celebrate__burst span:nth-child(5) { --dx: -230px; --dy: -40px; --r: -90deg; }
.bld-celebrate__burst span:nth-child(6) { --dx: 220px; --dy: -60px; --r: 140deg; }
.bld-celebrate__burst span:nth-child(7) { --dx: -60px; --dy: -230px; --r: 300deg; }
.bld-celebrate__burst span:nth-child(8) { --dx: 60px; --dy: -240px; --r: -220deg; }
.bld-celebrate__burst span:nth-child(9) { --dx: -200px; --dy: 40px; --r: 80deg; }
.bld-celebrate__burst span:nth-child(10) { --dx: 200px; --dy: 30px; --r: -40deg; }
.bld-celebrate__burst span:nth-child(11) { --dx: -20px; --dy: -170px; --r: 180deg; }
.bld-celebrate__burst span:nth-child(12) { --dx: 30px; --dy: -110px; --r: -300deg; }

@keyframes bld-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
}
@keyframes bld-arrive {
  0% { background: color-mix(in oklch, var(--color-primary) 18%, var(--app-surface)); transform: translateY(-4px); }
  100% { transform: none; }
}
@keyframes bld-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .bq.is-new, .bld-checklist__list li.is-done .bi-check-circle-fill, .modal.show .bld-celebrate__burst span { animation: none; }
}

@media (max-width: 1199.98px) {
  .bld-body { grid-template-columns: 220px minmax(0, 1fr); }
  .bld-panel { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 767.98px) {
  .bld-top { position: static; gap: 8px; }
  .bld-top__name { flex: 1 1 0; flex-wrap: wrap; gap: 4px; }
  .bld-top__title { font-size: var(--fs-lg); width: 100%; flex-basis: 100%; }
  .bld-progress { padding-right: 3px; }
  .bld-progress > span:not(.bld-progress__ring) { display: none; }
  .bld-top__actions { flex: 1 1 100%; justify-content: flex-end; }
  .bld-body { grid-template-columns: 1fr; }
  .bld-palette { position: static; max-height: 260px; }
  .bld-paper { padding: 18px; }
  .bld-tile__desc { display: none; }
}

/* ── Mode sombre : la question choisie et le panneau restent lisibles ── */
[data-bs-theme="dark"] .bq.is-selected { background: color-mix(in oklch, var(--color-primary) 12%, var(--app-surface)); }
[data-bs-theme="dark"] .bq-drop { background: var(--app-surface-muted); }

/* ── Essai dans le constructeur : le formulaire seul, sans le cadre « Aperçu » ── */
.bld-device .preview-form-container { border: 0; padding: 0; margin: 0; background: transparent; }
.bld-device .preview-form-container::before { display: none; }
/* Fenêtre de publication : boutons secondaires sans fond, aussi en sombre. */
.bld-celebrate .btn-outline-secondary { --bs-btn-bg: transparent; }
/* Tiroir « toutes les options » : l'ancien éditeur sur une seule colonne. */

/* ── Advanced questions on the canvas: table, Data list, source, rules ── */
.bq.has-issue { border-color: color-mix(in oklch, var(--warning-500) 55%, var(--app-border)); }
.bq__issue {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 10px;
  border-radius: var(--radius-pill); background: var(--warning-100); color: oklch(42% .14 var(--status-warning-hue));
  font-size: var(--fs-sm); font-weight: 500;
}
.bq__rule { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); color: var(--color-primary); }
.bq-source { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-xs); color: var(--gray-500); }
.bq-options__more::before { display: none !important; }
.bq-options__more { color: var(--gray-500); padding-left: 26px; }
.bq-table-wrap { overflow-x: auto; border: 1px solid var(--app-border); border-radius: var(--radius-md); }
.bq-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.bq-table th, .bq-table td { padding: 6px 10px; border-bottom: 1px solid var(--gray-100); text-align: left; white-space: nowrap; }
.bq-table th { background: var(--gray-50); color: var(--gray-700); font-weight: 600; }
.bq-table td:first-child { color: var(--gray-800); font-weight: 500; }
.bq-table tr:last-child td { border-bottom: 0; }
.bq-table__add td { color: var(--color-primary); font-weight: 500; }
.bq-cell { display: block; min-width: 56px; height: 22px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface); }
.bq-cell--boolean { width: 30px; min-width: 30px; border-radius: var(--radius-pill); }
.bq-cell--choice, .bq-cell--multiple_choice {
  background: var(--app-surface) linear-gradient(135deg, transparent 50%, var(--gray-400) 50%) no-repeat right 8px center / 6px 6px;
}
[data-bs-theme="dark"] .bq-table th { background: var(--app-surface-muted); }

/* ── Side panel: sections for advanced settings ── */
.bp-issue {
  display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 14px; padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--warning-100); color: oklch(42% .14 var(--status-warning-hue)); font-size: var(--fs-sm);
}
.bp-sec { border-top: 1px solid var(--app-border); margin-top: 16px; padding-top: 14px; }
.bp-sec__title {
  display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); font-weight: 600; color: var(--gray-950); margin: 0 0 10px;
}
.bp-sec__title i { color: var(--color-primary); }
.bp-sec__lead { font-size: var(--fs-sm); color: var(--gray-600); margin-bottom: 12px; }
fieldset.bp-sec legend { float: none; font-size: var(--fs-sm); }
.bp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--app-border); border-radius: var(--radius-md); padding: 3px; background: var(--gray-50); }
.bp-seg .btn { border: 0; border-radius: calc(var(--radius-md) - 2px); font-size: var(--fs-sm); color: var(--gray-700); padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.bp-seg .btn-check:checked + .btn { background: var(--app-surface); color: var(--color-primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.bp-seg .btn-check:disabled + .btn { opacity: .5; }
.bp-seg .btn-check:focus-visible + .btn { box-shadow: var(--shadow-focus); }
[data-bs-theme="dark"] .bp-seg { background: var(--app-surface-muted); }

.bp-cols { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; counter-reset: col; }
.bp-col { border: 1px solid var(--app-border); border-radius: var(--radius-md); padding: 8px; display: grid; gap: 6px; background: var(--app-surface); }
.bp-col__head { display: flex; align-items: center; gap: 2px; }
.bp-col__head .form-control { font-weight: 500; margin-right: 4px; }
.bp-col__row { display: flex; align-items: center; gap: 8px; }
.bp-col__row > .form-select, .bp-col__row > .form-control { flex: 1; min-width: 0; }
.bp-col__row .form-check { margin: 0; white-space: nowrap; font-size: var(--fs-sm); }

.bp-empty { text-align: center; color: var(--gray-500); padding: 14px; border: 1px dashed var(--app-border); border-radius: var(--radius-md); }
.bp-empty i { font-size: 22px; display: block; margin-bottom: 4px; }
.bp-empty p { margin: 0; font-size: var(--fs-sm); }

.bp-rules > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.bp-rules > summary::-webkit-details-marker { display: none; }
.bp-rules > summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; color: var(--gray-500); transition: transform .2s ease; }
.bp-rules[open] > summary::after { transform: rotate(180deg); }
.bp-rules[open] > summary { margin-bottom: 10px; }
.bp-rules__count:not(:empty) { font-size: var(--fs-xs); background: color-mix(in oklch, var(--color-primary) 14%, var(--app-surface)); color: var(--color-primary); border-radius: var(--radius-pill); padding: 1px 8px; }
.bp-rules__sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--gray-700); margin-bottom: 8px; }
.bp-rules__sentence .form-select { width: auto; }
.bp-rules__list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.bp-rule { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding: 8px; border-radius: var(--radius-md); background: var(--gray-50); }
.bp-rule > [data-r="source"] { grid-column: 1 / -1; }
.bp-rule > [data-r="value"] { grid-column: 2; }
.bp-rule > [data-r="operator"] { grid-column: 1; }
.bp-rule > [data-r="remove"] { grid-column: 3; grid-row: 2; }
[data-bs-theme="dark"] .bp-rule { background: var(--app-surface-muted); }

/* ── « Try it »: the real fill-in page in a frame ── */
.bld-try__dialog { max-width: min(1000px, calc(100vw - 32px)); }
.bld-try { padding: 0; background: var(--gray-100); }
.bld-try .bld-device { height: min(78vh, 900px); display: flex; }
.bld-try .bld-device.is-phone { margin: 16px auto; height: min(74vh, 820px); padding: 0; overflow: hidden; }
.bld-try__frame { flex: 1; width: 100%; height: 100%; border: 0; background: var(--app-bg); }
[data-bs-theme="dark"] .bld-try { background: var(--app-bg); }

/* The page inside the frame */
.pg-try { background: var(--app-bg); }
.try-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.try-head { margin-bottom: 20px; }
.try-title { font-size: var(--fs-2xl); font-weight: 600; color: var(--gray-950); margin: 0; }
.try-lead { color: var(--gray-600); margin: 6px 0 0; }
.try-empty { color: var(--gray-500); text-align: center; padding: 40px 0; }
.try-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--app-border); margin-top: 24px; padding-top: 16px; }
.try-result { flex: 1 1 260px; margin: 0; font-size: var(--fs-sm); }
.try-result.is-ok { color: var(--success-600); }
.try-result.is-missing { color: var(--danger-600); }

/* Phone: country with its dial code, as in the real form */
.bq-phone { display: flex; align-items: center; gap: 10px; padding-left: 0; }
.bq-phone__country { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-right: 1px solid var(--app-border); align-self: stretch; font-size: 16px; }
.bq-phone__country i { font-size: 10px; color: var(--gray-500); }
.bq-phone__dial { color: var(--gray-800); }
.bp-sec + .pp-field { margin-top: 14px; }

/* Drawer « Translations and display » */
.bp-tr__table-wrap { overflow-x: auto; }
.bp-tr__table { width: 100%; border-collapse: separate; border-spacing: 6px 6px; margin: 0 -6px; }
.bp-tr__table th { font-size: var(--fs-xs); font-weight: 600; color: var(--gray-600); }
.bp-tr__table td { min-width: 110px; }
.bp-tr__actions { display: flex; gap: 8px; border-top: 1px solid var(--app-border); margin-top: 20px; padding-top: 16px; }

/* ==== 90-system.css ==== */
/* =========================================================================
   SYSTÈME — la dernière couche, qui a le dernier mot.

   Une seule échelle de texte, un seul aspect par composant, sur toutes les
   pages (espace de travail, Studio, pages publiques). Les pages ne posent
   aucun style dans leur HTML : elles utilisent ces classes, ou des classes
   de leur domaine dans static/css/src/60-*.css.

   Ne lit que des variables (theme-tokens.css) : un thème client le recolore.
   ========================================================================= */

/* ── Texte : une échelle ─────────────────────────────────────────────────
   Titre de page 22 · section 16 · sous-section 14 · texte 14 · petit 12.
   Les h1–h6 du contenu suivent la même échelle, quelle que soit la page. */
.app-main h1, .app-main .h1, .page-header__title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.app-main h2, .app-main .h2 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.app-main h3, .app-main .h3, .app-main h4, .app-main .h4 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.35; }
.app-main h5, .app-main .h5, .app-main h6, .app-main .h6, .card-title { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }
.app-main .display-1, .app-main .display-2, .app-main .display-3,
.app-main .display-4, .app-main .display-5, .app-main .display-6 { font-size: var(--fs-3xl); font-weight: 600; }
.app-main .fs-1, .app-main .fs-2 { font-size: var(--fs-2xl) !important; }
.app-main .fs-3, .app-main .fs-4 { font-size: var(--fs-xl) !important; }
.app-main .fs-5, .app-main .fs-6 { font-size: var(--fs-lg) !important; }
.lead, .page-header__subtitle, .pp-section__lead, .card-subtitle { max-width: 72ch; }
.lead { font-size: var(--fs-md); color: var(--gray-700); }
small, .small { font-size: var(--fs-sm); }
.text-muted, .text-secondary { color: var(--gray-600) !important; }

/* Icônes : cinq tailles, alignées sur le texte. */
.icon-sm { font-size: 14px; }
.icon-md { font-size: 16px; }
.icon-lg { font-size: 18px; }
.icon-xl { font-size: 24px; }
.icon-hero { font-size: 48px; line-height: 1; color: var(--gray-400); }
.bi { vertical-align: -.125em; }
.text-brand { color: var(--color-primary) !important; }

/* ── Masquer / montrer : l'état vient des scripts (classList / hidden). ── */
.is-hidden { display: none !important; }

/* ── Cartes de choix (radio, case) : on voit ce qu'on choisit ─────────── */
.pp-choice {
  position: relative;
  transition: border-color var(--t-fast, .15s) ease, background-color var(--t-fast, .15s) ease, box-shadow var(--t-fast, .15s) ease, transform var(--t-fast, .15s) ease;
}
.pp-choice:hover { border-color: var(--gray-400); background: var(--gray-50); }
.pp-choice:active { transform: scale(.995); }
.pp-choice .form-check-input { width: 18px; height: 18px; border: 1.5px solid var(--gray-400); background-color: var(--app-surface); }
.pp-choice .form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
.pp-choice .form-check-input:focus-visible { box-shadow: var(--shadow-focus); }
.pp-choice:has(input:checked) {
  border-color: var(--color-primary);
  background: color-mix(in oklch, var(--color-primary) 6%, var(--app-surface));
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.pp-choice:has(input:checked) .pp-choice__title { color: var(--color-primary-text, var(--brand-800)); }
.pp-choice:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--color-primary), var(--shadow-focus); }
.pp-choice__title i { color: var(--gray-500); }
.pp-choice:has(input:checked) .pp-choice__title i { color: var(--color-primary); }
.pp-choice__extra[hidden] { display: none; }

/* Interrupteurs : la couleur du thème quand ils sont actifs. */
.form-switch .form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }

/* ── Tableaux : toute la ligne ouvre l'élément ───────────────────────── */
tr[data-href], tr[data-row-action] { cursor: pointer; }
tr[data-href]:hover > td, tr[data-row-action]:hover > td { background: var(--gray-50); }
tr[data-href]:focus-visible, tr[data-row-action]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.table > :not(caption) > * > * { padding: 12px 16px; vertical-align: middle; }
.table > thead th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-500); background: transparent; white-space: nowrap;
}

/* ── Vignettes (les avatars : composant .avatar de 10-base.css) ──────── */
.thumb { object-fit: cover; border-radius: var(--radius-md); background: var(--app-surface-muted); }
.thumb-sm { width: 40px; height: 40px; }
.thumb-md { width: 80px; height: 80px; }
.thumb-lg { width: 120px; height: 120px; }
.qr-img { width: 150px; height: 150px; display: block; margin: 0 auto; }

/* Couleur fournie par la donnée (pastille d'un participant, d'un rôle…) :
   le HTML ne pose qu'une variable, --swatch. */
.swatch-bg { background-color: var(--swatch, var(--gray-400)) !important; }
.swatch-fg { color: var(--swatch, var(--gray-600)) !important; }

/* ── Barres de progression : la valeur arrive par --value (0–100) ─────── */
.pp-progress { height: 6px; background: var(--app-surface-sunken, var(--gray-100)); border-radius: 3px; overflow: hidden; }
.pp-progress__bar { height: 100%; width: calc(var(--value, 0) * 1%); background: var(--color-primary); border-radius: inherit; transition: width .4s ease; }

/* ── Zones à défilement et cartes ────────────────────────────────────── */
.scroll-y { overflow-y: auto; }
.scroll-y-300 { max-height: 300px; overflow-y: auto; }
.scroll-y-400 { max-height: 400px; overflow-y: auto; }
.map-300 { height: 300px; }
.map-400 { height: 400px; }
.chart-300 { min-height: 300px; }
.measure { max-width: 920px; }
.measure-narrow { max-width: 560px; }

/* ── États vides ──────────────────────────────────────────────────────── */
.empty-state__icon i { font-size: 24px; }
.empty-state__title { font-size: var(--fs-lg); font-weight: 600; margin: 0; color: var(--gray-950); }
.empty-state__hint, .empty-state__desc { color: var(--gray-600); max-width: 48ch; margin: 0 auto; }

/* ── Cartes : en-têtes sobres partout ────────────────────────────────── */
.card-header { background: var(--app-surface); }
.card-header .card-title { margin: 0; }

/* Dégradés et en-têtes colorés hérités : neutralisés. */
.bg-gradient, .card-header.bg-primary, .card-header.bg-success, .card-header.bg-info {
  background: var(--app-surface) !important; color: var(--color-text) !important;
}
.card-header.bg-primary .card-title, .card-header.bg-success .card-title, .card-header.bg-info .card-title { color: var(--gray-950) !important; }

/* ── Cases, boutons radio, interrupteurs : le repère se voit ─────────────
   La feuille de base posait `background:` en raccourci, ce qui effaçait
   l'image de Bootstrap (point du radio, coche, pastille de l'interrupteur) :
   on ne voyait plus ce qui était choisi. */
.form-check-input {
  background-color: var(--app-surface);
  background-image: var(--bs-form-check-bg-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
.form-check-input[type="checkbox"]:indeterminate { background-color: var(--color-primary); border-color: var(--color-primary); }
.form-switch .form-check-input {
  width: 34px; height: 20px; border-radius: 10px;
  background-image: var(--bs-form-switch-bg);
  background-position: left center;
  background-size: contain;
  transition: background-position .15s ease-in-out, background-color .15s ease;
}
.form-switch .form-check-input:checked { background-position: right center; }
.form-switch .form-check-label { margin-left: 4px; }

/* ── Sous-navigation d'une rubrique (onglets) ───────────────────────── */
.pp-subnav { margin-bottom: 20px; border-bottom: 1px solid var(--app-border); gap: 4px; }
.pp-subnav .nav-link { color: var(--gray-600); font-weight: 500; padding: 8px 10px; }
.pp-subnav .nav-link:hover { color: var(--gray-950); }
.pp-subnav .nav-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ── Mode sombre : contrastes ───────────────────────────────────────── */
[data-bs-theme="dark"] .pp-choice:has(input:checked) .pp-choice__title { color: var(--brand-300); }
[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--brand-300); --bs-btn-border-color: var(--brand-400);
  --bs-btn-hover-color: var(--color-on-primary); --bs-btn-hover-bg: var(--color-primary); --bs-btn-hover-border-color: var(--color-primary);
}

/* Un titre de carte garde la même taille, quelle que soit sa balise. */
.app-main .card-title, .app-main h2.card-title, .app-main h3.card-title, .app-main h5.card-title { font-size: var(--fs-base); }

/* Pied de page : aligné sur la largeur du contenu. */
.app-footer { margin: 24px 0 -40px; padding: 12px 0; justify-content: space-between; }

/* ── Session expirée (static/js/session-guard.js) ────────────────────────
   La page reste ouverte derrière la boîte, avec ce qui y était saisi. */
.pp-session {
  width: min(400px, calc(100vw - 32px));
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.pp-session::backdrop { background: rgb(0 0 0 / .45); }
.pp-session__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-warning-bg); color: var(--color-warning);
  font-size: 22px;
}
.pp-session__title { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--space-2); color: var(--color-text-strong); }
.pp-session__body { font-size: var(--fs-base); color: var(--color-text-muted); margin: 0 0 var(--space-5); }
.pp-session__waiting { font-size: var(--fs-sm); color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.pp-session__hint { font-size: var(--fs-xs); color: var(--color-text-muted); margin: var(--space-1) 0 0; }
.pp-session-toast {
  position: fixed; left: 50%; bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 2000;
  max-width: calc(100vw - 32px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-success); color: var(--color-on-primary);
  box-shadow: var(--shadow-lg); font-size: var(--fs-sm);
}
