/* ==========================================================================
   TrustEvent — Design Tokens + UI Kit
   Source de vérité CSS pour toute la plateforme
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS — Variables globales
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --te-brand-50:  #F2FDF5;
  --te-brand-100: #E8FAF0;
  --te-brand-400: #4DD87A;
  --te-brand-500: #1DC653;
  --te-brand-600: #18A845;
  --te-brand-700: #127A33;

  /* Backgrounds */
  --te-bg-base:    #FFFFFF;
  --te-bg-subtle:  #F7F8FA;
  --te-bg-muted:   #F0F2F5;
  --te-bg-overlay: #1C2B1E;

  /* Borders */
  --te-border-subtle:  #E5E9EE;
  --te-border-default: #D1D9E0;
  --te-border-strong:  #A8B3BF;
  --te-border-brand:   #1DC653;

  /* Text */
  --te-text-primary:   #111827;
  --te-text-secondary: #4B5563;
  --te-text-tertiary:  #6B7280;
  --te-text-disabled:  #D1D5DB;
  --te-text-on-dark:   #FFFFFF;
  --te-text-brand:     #18A845;

  /* Success */
  --te-success-500: #1DC653;
  --te-success-100: #E8FAF0;
  --te-success-text: #127A33;

  /* Warning */
  --te-warning-500: #F59E0B;
  --te-warning-100: #FEF3C7;
  --te-warning-text: #92400E;

  /* Error */
  --te-error-500: #EF4444;
  --te-error-100: #FEE2E2;
  --te-error-text: #991B1B;

  /* Info */
  --te-info-500: #3B82F6;
  --te-info-100: #EFF6FF;
  --te-info-text: #1E40AF;

  /* États réseau / synchro terrain (socle NET-02, DS-04) — rôles, pas décoratif.
     Contrastes texte >= 4.5:1 sur fond clair (A11Y-01). */
  --te-status-offline-500: #6B7280; --te-status-offline-100: #F0F2F5; --te-status-offline-text: #374151;
  --te-status-syncing-500: #3B82F6; --te-status-syncing-100: #EFF6FF; --te-status-syncing-text: #1E40AF;
  --te-status-pending-500: #F59E0B; --te-status-pending-100: #FEF3C7; --te-status-pending-text: #92400E;
  --te-status-conflict-500:#A855F7; --te-status-conflict-100:#F3E8FF; --te-status-conflict-text:#6B21A8;
  --te-status-synced-500:  #1DC653; --te-status-synced-100:  #E8FAF0; --te-status-synced-text:  #127A33;

  /* Typography */
  --te-font: "Silka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --te-font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

  /* Spacing */
  --te-s1:  4px;
  --te-s2:  8px;
  --te-s3:  12px;
  --te-s4:  16px;
  --te-s5:  20px;
  --te-s6:  24px;
  --te-s8:  32px;
  --te-s10: 40px;
  --te-s12: 48px;
  --te-s16: 64px;

  /* Radii */
  --te-r-sm:   4px;
  --te-r-md:   8px;
  --te-r-lg:   12px;
  --te-r-xl:   16px;
  --te-r-full: 9999px;

  /* Shadows */
  --te-shadow-sm:    0 1px 2px 0 rgba(0,0,0,.05);
  --te-shadow-md:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --te-shadow-lg:    0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --te-shadow-focus: 0 0 0 3px rgba(29,198,83,.42);

  /* Tokens sémantiques CTA — couleurs hors brand-scale pour garantir le contraste WCAG AA */
  --te-btn-primary-bg:       #15803D; /* ~5:1 sur blanc — entre brand-600 et brand-700 */
  --te-btn-primary-bg-hover: #127A33; /* = brand-700, 5.44:1 */
  --te-btn-primary-bg-active:#0D5C2C;
}

/* --------------------------------------------------------------------------
   1b. CONTRASTE — Règles d'usage des tokens couleur pour texte
   !! brand-500 (#1DC653) sur fond blanc = 2.27:1 — INTERDIT pour texte/icône !!
   !! brand-600 (#18A845) sur fond blanc = 3.12:1 — INTERDIT pour texte normal !!
   !! brand-700 (#127A33) sur fond blanc = 5.44:1 — minimum acceptable         !!
   Utiliser --te-text-brand (brand-700) pour tout texte sur fond clair.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--te-font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--te-text-primary);
  background: var(--te-bg-subtle);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   2b. ACCESSIBILITÉ — Utilitaires
   -------------------------------------------------------------------------- */

/* Masquage visuel accessible (lecteur d'écran uniquement) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — lien de contournement, visible uniquement au focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--te-s4);
  z-index: 9999;
  padding: var(--te-s2) var(--te-s4);
  background: var(--te-brand-700);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 var(--te-r-md) var(--te-r-md);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Héritage de la typo Silka sur tous les éléments form + table (non hérité par défaut) */
button, input, select, textarea, optgroup, option,
table, th, td,
h1, h2, h3, h4, h5, h6,
.te-input, .te-select, .te-textarea, .te-btn, .te-badge, .te-chip, .te-tabs__tab, .te-menu__item {
  font-family: var(--te-font);
}
/* Exceptions explicites : classes mono conservent leur police monospace */
.te-mono, .te-input-mono, .te-input-mono *, code, kbd, samp, pre {
  font-family: var(--te-font-mono);
}

/* --------------------------------------------------------------------------
   3. BOUTONS
   -------------------------------------------------------------------------- */
.te-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--te-s2);
  height: 40px;
  padding: 0 var(--te-s4);
  font-family: var(--te-font);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
  border: 1.5px solid transparent;
  border-radius: var(--te-r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  white-space: nowrap;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
}
.te-btn:focus-visible {
  outline: none;
  box-shadow: var(--te-shadow-focus);
}

/* Tailles */
.te-btn--sm  { height: 32px; padding: 0 var(--te-s3); font-size: 0.8125rem; }
.te-btn--md  { height: 40px; padding: 0 var(--te-s4); font-size: 0.875rem; }
.te-btn--lg  { height: 48px; padding: 0 var(--te-s6); font-size: 1rem; font-weight: 600; }

/* Primaire — utilise --te-btn-primary-bg (~5:1 sur blanc, WCAG AA) */
.te-btn--primary {
  background: var(--te-btn-primary-bg);
  color: #fff;
  border-color: var(--te-btn-primary-bg);
}
.te-btn--primary:hover  { background: var(--te-btn-primary-bg-hover);  border-color: var(--te-btn-primary-bg-hover); }
.te-btn--primary:active { background: var(--te-btn-primary-bg-active); border-color: var(--te-btn-primary-bg-active); }

/* Secondaire */
.te-btn--secondary {
  background: #fff;
  color: var(--te-text-primary);
  border-color: var(--te-border-default);
}
.te-btn--secondary:hover  { background: var(--te-bg-subtle); border-color: var(--te-border-strong); }
.te-btn--secondary:active { background: var(--te-bg-muted); }

/* Ghost (light) — hover renforcé pour visibilité */
.te-btn--ghost {
  background: transparent;
  color: var(--te-text-primary);
  border-color: transparent;
}
.te-btn--ghost:hover  { background: var(--te-bg-muted); color: var(--te-text-primary); }
.te-btn--ghost:active { background: #E5E9EE; }

/* Ghost sur fond sombre — opt-in via --ghost-on-dark ou contexte nav-overlay */
.te-nav-overlay .te-btn--ghost,
.te-btn--ghost-on-dark {
  color: #fff;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
.te-nav-overlay .te-btn--ghost:hover,
.te-btn--ghost-on-dark:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
.te-nav-overlay .te-btn--ghost:active,
.te-btn--ghost-on-dark:active {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.36);
}
.te-nav-overlay .te-btn--ghost:focus-visible,
.te-btn--ghost-on-dark:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.35);
}

/* Danger — #DC2626 donne ≥ 4.5:1 avec #fff (WCAG AA) */
.te-btn--danger {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}
.te-btn--danger:hover  { background: #B91C1C; border-color: #B91C1C; }
.te-btn--danger:active { background: #991B1B; border-color: #991B1B; }

/* Danger outline */
.te-btn--danger-outline {
  background: #fff;
  color: var(--te-error-text);
  border-color: var(--te-error-500);
}
.te-btn--danger-outline:hover { background: var(--te-error-100); }

/* Désactivé */
.te-btn:disabled,
.te-btn--disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading */
.te-btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.te-btn--loading::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: te-spin .6s linear infinite;
  color: #fff;
}

@keyframes te-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes te-rotate { to { transform: rotate(360deg); } }

.te-spinner {
  display: inline-block;
  vertical-align: middle;
  animation: te-rotate .8s linear infinite;
  transform-origin: center;
}
.te-combobox__loading .te-spinner { margin-right: 6px; color: var(--te-brand-700); }

/* Icône seul */
.te-btn--icon { padding: 0; width: 40px; justify-content: center; }
.te-btn--icon.te-btn--sm { width: 32px; }
.te-btn--icon.te-btn--lg { width: 48px; }

/* --------------------------------------------------------------------------
   4. BADGES
   -------------------------------------------------------------------------- */
.te-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: var(--te-font);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--te-r-full);
  white-space: nowrap;
}
.te-badge--dot::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
  flex-shrink: 0;
}

.te-badge--success { background: var(--te-success-100); color: var(--te-success-text); }
.te-badge--warning { background: var(--te-warning-100); color: var(--te-warning-text); }
.te-badge--error   { background: var(--te-error-100);   color: var(--te-error-text); }
.te-badge--info    { background: var(--te-info-100);    color: var(--te-info-text); }
.te-badge--neutral { background: var(--te-bg-muted);    color: var(--te-text-secondary); }
.te-badge--brand   { background: var(--te-brand-100);   color: var(--te-brand-700); }

/* Solid badges — fonds assombris pour contraste ≥ 4.5:1 avec #fff */
.te-badge--success-solid { background: #15803D; color: #fff; }
.te-badge--warning-solid { background: var(--te-warning-500); color: #451A03; }
.te-badge--error-solid   { background: #DC2626; color: #fff; }
.te-badge--info-solid    { background: #1D4ED8; color: #fff; }

/* --------------------------------------------------------------------------
   5. FORMULAIRES — Champs
   -------------------------------------------------------------------------- */
.te-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--te-s1);
}

.te-label {
  font-family: var(--te-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text-primary);
  line-height: 1.4;
}
.te-label--required::after {
  content: ' *';
  color: var(--te-error-500);
}

.te-input,
.te-select,
.te-textarea {
  width: 100%;
  font-family: var(--te-font);
  font-size: 0.875rem;
  color: var(--te-text-primary);
  background: var(--te-bg-base);
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  padding: var(--te-s3) var(--te-s4);
  line-height: 1.5;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.te-input:focus,
.te-select:focus,
.te-textarea:focus {
  outline: none;
  border-color: var(--te-brand-500);
  box-shadow: var(--te-shadow-focus);
}
.te-input::placeholder,
.te-textarea::placeholder { color: var(--te-text-tertiary); }
.te-input:disabled,
.te-select:disabled,
.te-textarea:disabled {
  background: var(--te-bg-muted);
  color: var(--te-text-disabled);
  cursor: not-allowed;
}
.te-input--error,
.te-select--error,
.te-textarea--error {
  border-color: var(--te-error-500);
}
.te-input--error:focus,
.te-select--error:focus,
.te-textarea--error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,.2);
}

.te-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  text-overflow: ellipsis;
}
.te-select--sm { height: 36px; padding-top: 0; padding-bottom: 0; padding-left: var(--te-s3); padding-right: 32px; font-size: 0.8125rem; background-position: right 10px center; }
.te-input--sm  { height: 36px; padding-top: 0; padding-bottom: 0; font-size: 0.8125rem; }

.te-textarea { resize: vertical; min-height: 88px; }

.te-field-help  { font-size: 0.8125rem; color: var(--te-text-tertiary); }
.te-field-error { font-size: 0.8125rem; color: #DC2626; }

/* Input avec icône */
.te-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.te-input-wrap .te-input { padding-left: 40px; }
.te-input-wrap .te-input-icon {
  position: absolute;
  left: 12px;
  color: var(--te-text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   6. CHECKBOX / RADIO / SWITCH
   -------------------------------------------------------------------------- */

/* Base globale : tous les checkboxes de la plateforme, quel que soit le contexte.
   Les règles .te-check-item et .te-table (plus spécifiques) surchargent au besoin. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
  margin: 0;
}
input[type="checkbox"]:hover {
  border-color: var(--te-brand-500);
}
input[type="checkbox"]:checked {
  border-color: var(--te-brand-500);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: translate(-55%, -62%) rotate(45deg);
}
input[type="checkbox"]:indeterminate {
  border-color: var(--te-brand-500);
}
input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--te-shadow-focus);
  border-color: var(--te-brand-500);
}
input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.te-check-group {
  display: flex;
  flex-direction: column;
  gap: var(--te-s2);
}
.te-check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--te-s3);
  cursor: pointer;
}
.te-check-item input[type="checkbox"],
.te-check-item input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.te-check-item input[type="radio"] {
  border-radius: 50%;
}
.te-check-item input[type="checkbox"]:checked {
  border-color: var(--te-brand-500);
}
.te-check-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: translate(-55%, -62%) rotate(45deg);
}
.te-check-item input[type="radio"]:checked {
  border-color: var(--te-brand-500);
}
.te-check-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
}
.te-check-item input:focus-visible {
  outline: none;
  box-shadow: var(--te-shadow-focus);
}
.te-check-label { font-size: 0.875rem; color: var(--te-text-primary); line-height: 1.5; }
.te-check-label small { display: block; font-size: 0.8125rem; color: var(--te-text-tertiary); margin-top: 1px; }

/* Switch */
.te-switch {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  cursor: pointer;
}
.te-switch__track {
  position: relative;
  width: 40px; height: 22px;
  background: var(--te-border-default);
  border-radius: var(--te-r-full);
  transition: background 150ms ease;
  flex-shrink: 0;
}
.te-switch__track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--te-shadow-sm);
  transition: transform 150ms ease;
}
.te-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.te-switch input:checked ~ .te-switch__track { background: var(--te-brand-500); }
.te-switch input:checked ~ .te-switch__track::after { transform: translateX(18px); }
.te-switch input:focus-visible ~ .te-switch__track { box-shadow: var(--te-shadow-focus); }
.te-switch__label { font-size: 0.875rem; color: var(--te-text-primary); }

/* Switch danger (annulation, statuts sensibles) — rouge quand activé */
.te-switch--danger input:checked ~ .te-switch__track { background: #DC2626; }
.te-switch--danger input:focus-visible ~ .te-switch__track { box-shadow: 0 0 0 3px rgba(220,38,38,.35); }

/* Switch warning (alerte, modération) */
.te-switch--warning input:checked ~ .te-switch__track { background: var(--te-warning-500); }
.te-switch--warning input:focus-visible ~ .te-switch__track { box-shadow: 0 0 0 3px rgba(245,158,11,.35); }

/* --------------------------------------------------------------------------
   6b. CHECKBOX GLOBALE BRANDÉE (tables + hors .te-check-item)
   Homogénéise tous les <input type="checkbox"> du produit avec le vert brand.
   -------------------------------------------------------------------------- */
.te-table input[type="checkbox"],
.te-checkbox-brand,
input[type="checkbox"].te-checkbox-brand {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
  margin: 0;
}
.te-table input[type="checkbox"]:hover,
.te-checkbox-brand:hover { border-color: var(--te-brand-500); }
.te-table input[type="checkbox"]:checked,
.te-checkbox-brand:checked {
  background: var(--te-brand-500);
  border-color: var(--te-brand-500);
}
.te-table input[type="checkbox"]:checked::after,
.te-checkbox-brand:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: translate(-55%, -62%) rotate(45deg);
}
.te-table input[type="checkbox"]:indeterminate,
.te-checkbox-brand:indeterminate {
  background: var(--te-brand-500);
  border-color: var(--te-brand-500);
}
.te-table input[type="checkbox"]:indeterminate::after,
.te-checkbox-brand:indeterminate::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}
.te-table input[type="checkbox"]:focus-visible,
.te-checkbox-brand:focus-visible {
  outline: none;
  box-shadow: var(--te-shadow-focus);
  border-color: var(--te-brand-500);
}

/* --------------------------------------------------------------------------
   7. TABLEAU
   -------------------------------------------------------------------------- */
.te-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-sm);
}
.te-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.te-table thead tr {
  background: var(--te-bg-subtle);
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-table thead th {
  padding: var(--te-s3) var(--te-s4);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--te-text-secondary);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.te-table thead th:hover { color: var(--te-text-primary); }
.te-table thead th.sorted { color: var(--te-brand-700); }
.te-table thead th .sort-icon { opacity: .4; margin-left: 4px; vertical-align: middle; }
.te-table thead th.sorted .sort-icon { opacity: 1; color: var(--te-brand-500); }

.te-table tbody tr {
  border-bottom: 1px solid var(--te-border-subtle);
  transition: background 80ms ease;
}
.te-table tbody tr:last-child { border-bottom: none; }
.te-table tbody tr:hover { background: var(--te-brand-50); }
.te-table tbody tr.selected { background: var(--te-brand-50); }

.te-table tbody td {
  padding: var(--te-s3) var(--te-s4);
  color: var(--te-text-primary);
  vertical-align: middle;
}
.te-table tbody td.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
}
.te-table tbody td.secondary { color: var(--te-text-secondary); }
.te-table tbody td.actions { text-align: right; white-space: nowrap; }

/* Checkbox colonne */
.te-table thead th:first-child,
.te-table tbody td:first-child {
  padding-left: var(--te-s4);
}
.te-col-check { width: 40px; }

/* --------------------------------------------------------------------------
   8. CARTES
   -------------------------------------------------------------------------- */
.te-card {
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-sm);
  padding: var(--te-s6);
}
.te-card--hoverable { cursor: pointer; transition: box-shadow 150ms ease, border-color 150ms ease; }
.te-card--hoverable:hover { box-shadow: var(--te-shadow-md); border-color: var(--te-border-default); }

/* Carte statistique */
.te-stat-card {
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-sm);
  padding: var(--te-s5) var(--te-s6);
  display: flex;
  flex-direction: column;
  gap: var(--te-s2);
}
.te-stat-card__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--te-text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.te-stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--te-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.te-stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8125rem;
  font-weight: 500;
}
.te-stat-card__trend--up   { color: var(--te-success-text); }
.te-stat-card__trend--down { color: var(--te-error-text); }
.te-stat-card__trend--neutral { color: var(--te-text-tertiary); }
.te-stat-card__sub { font-size: 0.8125rem; color: var(--te-text-tertiary); }

/* --------------------------------------------------------------------------
   9. ALERTES INLINE
   -------------------------------------------------------------------------- */
.te-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--te-s3);
  padding: var(--te-s4);
  border-radius: var(--te-r-md);
  font-size: 0.875rem;
  line-height: 1.5;
}
.te-alert__icon { flex-shrink: 0; margin-top: 1px; }
.te-alert__body { flex: 1; }
.te-alert__title { font-weight: 600; margin-bottom: 2px; }
.te-alert__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: currentColor;
  opacity: .6;
  line-height: 1;
}
.te-alert__close:hover { opacity: 1; }

.te-alert--success { background: var(--te-success-100); color: var(--te-success-text); }
.te-alert--warning { background: var(--te-warning-100); color: var(--te-warning-text); }
.te-alert--error   { background: var(--te-error-100);   color: var(--te-error-text); }
.te-alert--info    { background: var(--te-info-100);    color: var(--te-info-text); }

/* --------------------------------------------------------------------------
   10. TOASTS
   -------------------------------------------------------------------------- */
.te-toast-zone {
  position: fixed;
  top: var(--te-s4);
  right: var(--te-s4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--te-s2);
  pointer-events: none;
}
.te-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--te-s3);
  background: #fff;
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-lg);
  padding: var(--te-s4);
  min-width: 280px;
  max-width: 360px;
  font-size: 0.875rem;
  pointer-events: all;
  animation: te-toast-in .2s ease;
}
@keyframes te-toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.te-toast--success .te-toast__icon { color: var(--te-brand-500); }
.te-toast--warning .te-toast__icon { color: var(--te-warning-500); }
.te-toast--error   .te-toast__icon { color: var(--te-error-500); }
.te-toast--info    .te-toast__icon { color: var(--te-info-500); }
.te-toast__body { flex: 1; }
.te-toast__title { font-weight: 600; color: var(--te-text-primary); margin-bottom: 2px; }
.te-toast__msg   { color: var(--te-text-secondary); }
.te-toast__close {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary); padding: 0; line-height: 1;
}
.te-toast__close:hover { color: var(--te-text-primary); }

/* --------------------------------------------------------------------------
   11. PAGINATION
   -------------------------------------------------------------------------- */
.te-pagination {
  display: flex;
  align-items: center;
  gap: var(--te-s1);
}
.te-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 var(--te-s2);
  font-family: var(--te-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--te-r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 100ms, border-color 100ms, color 100ms;
}
.te-pagination__btn:hover { background: var(--te-bg-subtle); color: var(--te-text-primary); }
.te-pagination__btn--active {
  background: var(--te-brand-500);
  color: #fff;
  border-color: var(--te-brand-500);
}
.te-pagination__btn--active:hover { background: var(--te-brand-600); }
.te-pagination__btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.te-pagination__dots { color: var(--te-text-tertiary); padding: 0 var(--te-s1); }
.te-pagination__info { font-size: 0.8125rem; color: var(--te-text-tertiary); margin-left: var(--te-s4); }

/* --------------------------------------------------------------------------
   12. TABS
   -------------------------------------------------------------------------- */
.te-tabs {
  display: flex;
  border-bottom: 2px solid var(--te-border-subtle);
  gap: 0;
}
.te-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--te-s2);
  padding: var(--te-s3) var(--te-s4);
  font-family: var(--te-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  margin-bottom: -2px;
  transition: color 120ms, border-color 120ms;
}
.te-tabs__tab:hover { color: var(--te-text-primary); }
.te-tabs__tab--active {
  color: var(--te-brand-700);
  border-bottom-color: var(--te-brand-500);
  font-weight: 600;
}
.te-tabs__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--te-r-full);
  background: var(--te-info-100);
  color: var(--te-info-text);
  font-variant-numeric: tabular-nums;
}
.te-tabs__tab--active .te-tabs__badge {
  background: var(--te-brand-100);
  color: var(--te-brand-700);
}
/* Variantes sémantiques pour compteurs signalant un état */
.te-tabs__badge--warning { background: var(--te-warning-100); color: var(--te-warning-text); }
.te-tabs__badge--error   { background: var(--te-error-100);   color: var(--te-error-text); }
.te-tabs__badge--neutral { background: var(--te-bg-muted);    color: var(--te-text-secondary); }

/* --------------------------------------------------------------------------
   13. NAVIGATION LATÉRALE (preview)
   -------------------------------------------------------------------------- */
.te-nav {
  background: var(--te-bg-overlay);
  width: 240px;
  min-height: 400px;
  border-radius: var(--te-r-xl);
  padding: var(--te-s4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--te-s1);
}
.te-nav__header {
  padding: var(--te-s2) var(--te-s4) var(--te-s4);
  display: flex;
  align-items: center;
  gap: var(--te-s3);
}
.te-nav__logo {
  width: 32px; height: 32px;
  border-radius: var(--te-r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  text-decoration: none;
}
.te-nav__logo img {
  width: 32px; height: 32px;
  object-fit: contain;
  display: block;
}
.te-nav__brand {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}
.te-nav__section {
  padding: var(--te-s3) var(--te-s4) var(--te-s1);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.55);
}
.te-nav__item {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s2) var(--te-s4);
  margin: 0 var(--te-s2);
  border-radius: var(--te-r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
.te-nav__item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.te-nav__item--active { background: var(--te-brand-700); color: #fff; }
.te-nav__item--active:hover { background: #15803D; }
.te-nav__item svg { flex-shrink: 0; opacity: .8; }
.te-nav__item--active svg { opacity: 1; }
.te-nav__sep {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: var(--te-s2) var(--te-s4);
}

/* --------------------------------------------------------------------------
   14. ÉTAT VIDE
   -------------------------------------------------------------------------- */
.te-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--te-s16) var(--te-s8);
  text-align: center;
  gap: var(--te-s4);
}
.te-empty__icon {
  width: 56px; height: 56px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-xl);
  display: flex; align-items: center; justify-content: center;
  color: var(--te-text-tertiary);
}
.te-empty__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--te-text-primary);
  margin: 0;
}
.te-empty__desc {
  font-size: 0.875rem;
  color: var(--te-text-secondary);
  max-width: 280px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   15. MODALE
   -------------------------------------------------------------------------- */
.te-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--te-s4);
  animation: te-backdrop-in .15s ease;
}
@keyframes te-backdrop-in {
  from { opacity: 0; } to { opacity: 1; }
}
.te-modal-backdrop.hidden { display: none; }
.te-modal {
  background: var(--te-bg-base);
  border-radius: var(--te-r-xl);
  box-shadow: var(--te-shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: te-modal-in .15s ease;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.te-modal--lg { max-width: 640px; }
.te-modal--xl { max-width: 820px; }
.te-modal__body { overflow-y: auto; }
@keyframes te-modal-in {
  from { opacity: 0; transform: scale(.96) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.te-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--te-s5) var(--te-s6);
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-modal__title { font-size: 1rem; font-weight: 600; color: var(--te-text-primary); margin: 0; }
.te-modal__close {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary); padding: 4px; border-radius: var(--te-r-sm);
  display: flex; align-items: center;
}
.te-modal__close:hover { color: var(--te-text-primary); background: var(--te-bg-subtle); }
.te-modal__body { padding: var(--te-s6); }
.te-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--te-s3);
  padding: var(--te-s4) var(--te-s6);
  border-top: 1px solid var(--te-border-subtle);
}

/* --------------------------------------------------------------------------
   16. PROGRESS / STEPS
   -------------------------------------------------------------------------- */
.te-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding-bottom: 28px;
}
.te-steps__item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.te-steps__dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  line-height: 1;
}
.te-steps__dot svg { display: block; }
.te-steps__dot--done    { background: var(--te-brand-500); color: #fff; }
.te-steps__dot--current { background: var(--te-brand-500); color: #fff; box-shadow: var(--te-shadow-focus); }
.te-steps__dot--todo    { background: var(--te-bg-muted); color: var(--te-text-tertiary); border: 2px solid var(--te-border-default); }
.te-steps__line {
  flex: 1 1 auto;
  height: 2px;
  background: var(--te-border-subtle);
  min-width: 24px;
}
.te-steps__line--done { background: var(--te-brand-400); }
.te-steps__label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--te-text-secondary);
  font-weight: 500;
  line-height: 1.3;
  font-family: var(--te-font);
}
.te-steps__label--current { color: var(--te-brand-700); font-weight: 600; }

/* --------------------------------------------------------------------------
   17. SKELETON LOADER
   -------------------------------------------------------------------------- */
.te-skeleton {
  background: linear-gradient(90deg, var(--te-bg-muted) 25%, #e8eaed 50%, var(--te-bg-muted) 75%);
  background-size: 200% 100%;
  animation: te-skeleton-pulse 1.4s ease infinite;
  border-radius: var(--te-r-sm);
}
@keyframes te-skeleton-pulse {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* --------------------------------------------------------------------------
   18. UTILITAIRES — usage interne UI kit
   -------------------------------------------------------------------------- */
.te-text-primary   { color: var(--te-text-primary); }
.te-text-secondary { color: var(--te-text-secondary); }
.te-text-tertiary  { color: var(--te-text-tertiary); }
.te-text-brand     { color: var(--te-text-brand); }
.te-text-error     { color: var(--te-error-500); }

.te-fw-normal  { font-weight: 400; }
.te-fw-medium  { font-weight: 500; }
.te-fw-semibold{ font-weight: 600; }
.te-fw-bold    { font-weight: 700; }

.te-mono { font-family: var(--te-font-mono); }

/* Visuellement caché mais accessible aux lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   19. BARRE DE FILTRES AVANCÉS + CHIPS ACTIFS
   -------------------------------------------------------------------------- */
.te-filter-bar {
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  padding: var(--te-s4) var(--te-s5);
}
.te-filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--te-s3);
}
.te-filter-bar__field {
  display: flex;
  flex-direction: column;
  gap: var(--te-s1);
  flex: 1;
  min-width: 140px;
}
.te-filter-bar__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--te-text-secondary);
}
.te-filter-bar__actions {
  display: flex;
  gap: var(--te-s2);
  align-items: flex-end;
}
.te-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--te-s2);
  align-items: center;
  padding-top: var(--te-s3);
  border-top: 1px solid var(--te-border-subtle);
  margin-top: var(--te-s3);
}
.te-filter-chips__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--te-text-secondary);
}
.te-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--te-s1);
  padding: 3px var(--te-s2) 3px var(--te-s3);
  background: var(--te-brand-100);
  color: var(--te-brand-700);
  border: 1px solid var(--te-border-brand);
  border-radius: var(--te-r-full);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}
.te-filter-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: currentColor;
  opacity: .6;
  display: flex;
  align-items: center;
  line-height: 1;
}
.te-filter-chip__remove:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   20. OFF-CANVAS PANEL
   -------------------------------------------------------------------------- */
.te-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.te-offcanvas.is-open { display: block; }
.te-offcanvas__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  animation: te-backdrop-in .15s ease;
}
.te-offcanvas__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--te-bg-base);
  border-left: 1px solid var(--te-border-subtle);
  box-shadow: var(--te-shadow-lg);
  display: flex;
  flex-direction: column;
  animation: te-offcanvas-in .2s ease;
}
@media (max-width: 768px) {
  .te-offcanvas__panel { width: 100vw; border-left: none; }
  .te-offcanvas__header,
  .te-offcanvas__body,
  .te-offcanvas__footer { padding-left: var(--te-s4); padding-right: var(--te-s4); }
  .te-offcanvas__footer { flex-direction: column-reverse; align-items: stretch; }
  .te-offcanvas__footer .te-btn { width: 100%; }
}
@keyframes te-offcanvas-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.te-offcanvas__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--te-s4);
  padding: var(--te-s5) var(--te-s6);
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-offcanvas__title  { font-size: 1rem; font-weight: 600; color: var(--te-text-primary); margin: 0; }
.te-offcanvas__sub    { font-size: 0.8125rem; color: var(--te-text-tertiary); margin-top: 2px; }
.te-offcanvas__close  {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary);
  width: 36px; height: 36px;
  border-radius: var(--te-r-sm);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.te-offcanvas__close:hover { color: var(--te-text-primary); background: var(--te-bg-muted); }
.te-offcanvas__close:focus-visible { outline: none; box-shadow: var(--te-shadow-focus); }
.te-offcanvas__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--te-s5) var(--te-s6);
}
.te-offcanvas__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--te-s3);
  padding: var(--te-s4) var(--te-s6);
  border-top: 1px solid var(--te-border-subtle);
}

/* --------------------------------------------------------------------------
   21. CHART CARD
   -------------------------------------------------------------------------- */
.te-chart-card {
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-sm);
  padding: var(--te-s5) var(--te-s6);
  display: flex;
  flex-direction: column;
  gap: var(--te-s4);
}
.te-chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--te-s4);
}
.te-chart-card__title { font-size: 0.9375rem; font-weight: 600; color: var(--te-text-primary); }
.te-chart-card__sub   { font-size: 0.8125rem; color: var(--te-text-tertiary); margin-top: 2px; }
.te-chart-card__meta  { font-size: 0.75rem; color: var(--te-text-tertiary); white-space: nowrap; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   22. BARRE DE PROGRESSION (inline)
   -------------------------------------------------------------------------- */
.te-progress {
  height: 6px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-full);
  overflow: hidden;
  width: 100%;
}
.te-progress__bar {
  height: 100%;
  border-radius: var(--te-r-full);
  background: var(--te-brand-500);
  transition: width .3s ease;
}
.te-progress__bar--warn  { background: var(--te-warning-500); }
.te-progress__bar--error { background: var(--te-error-500); }
.te-progress__bar--info  { background: var(--te-info-500); }

/* --------------------------------------------------------------------------
   23. EMAILING — Composants vue liste & compose
   -------------------------------------------------------------------------- */
.te-campaign-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--te-s3) var(--te-s4);
  padding: var(--te-s4) 0;
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-campaign-row:last-child { border-bottom: none; }
.te-campaign-row__icon {
  width: 40px; height: 40px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--te-text-tertiary);
  flex-shrink: 0;
}
.te-campaign-row__body { flex: 1; min-width: 180px; }
.te-campaign-row__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--te-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.te-campaign-row__meta {
  font-size: 0.8125rem;
  color: var(--te-text-tertiary);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--te-s1);
}
.te-campaign-row__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--te-s3) var(--te-s5);
  flex-shrink: 0;
  align-items: center;
}
.te-campaign-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 56px;
}
.te-campaign-stat__value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--te-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.te-campaign-stat__label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--te-text-tertiary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.te-campaign-stat__value--proj { font-style: italic; font-weight: 600; opacity: .85; }
.te-campaign-row__actions {
  display: flex;
  gap: var(--te-s1);
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.te-campaign-row__actions .te-btn--icon { padding: 0; width: 32px; height: 32px; }

/* Mise en page compose (2 colonnes) */
.te-compose-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--te-s6);
  align-items: start;
}
@media (max-width: 900px) { .te-compose-layout { grid-template-columns: 1fr; } }

/* Aperçu email simplifié */
.te-email-preview {
  background: #F4F6F8;
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  overflow: hidden;
}
.te-email-preview__topbar {
  background: var(--te-bg-overlay);
  padding: var(--te-s2) var(--te-s4);
  display: flex;
  align-items: center;
  gap: var(--te-s2);
}
.te-email-preview__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.te-email-preview__body {
  padding: var(--te-s5);
  display: flex;
  flex-direction: column;
  gap: var(--te-s4);
}
.te-email-preview__header-band {
  background: #15803D;
  border-radius: var(--te-r-md);
  height: 56px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.te-email-preview__line {
  height: 10px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-sm);
}
.te-email-preview__line--short { width: 60%; }
.te-email-preview__line--xs    { width: 40%; height: 8px; }

/* --------------------------------------------------------------------------
   24. BREADCRUMBS
   -------------------------------------------------------------------------- */
.te-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--te-s1);
  font-size: 0.8125rem;
  color: var(--te-text-tertiary);
}
.te-breadcrumbs a {
  color: var(--te-text-secondary);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--te-r-sm);
  transition: background 100ms, color 100ms;
}
.te-breadcrumbs a:hover { background: var(--te-bg-subtle); color: var(--te-text-primary); }
.te-breadcrumbs__sep { color: var(--te-text-disabled); user-select: none; }
.te-breadcrumbs__current {
  color: var(--te-brand-700);
  font-weight: 700;
  padding: 2px 8px;
  background: var(--te-brand-50);
  border-radius: var(--te-r-sm);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.te-breadcrumbs__overflow {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary); padding: 0 4px;
  font-weight: 600;
  border-radius: var(--te-r-sm);
}
.te-breadcrumbs__overflow:hover { background: var(--te-bg-subtle); color: var(--te-text-primary); }

/* --------------------------------------------------------------------------
   25. TOPBAR / PAGE HEADER
   -------------------------------------------------------------------------- */
.te-topbar {
  display: flex;
  align-items: center;
  gap: var(--te-s4);
  padding: var(--te-s3) var(--te-s5);
  background: var(--te-bg-base);
  border-bottom: 1px solid var(--te-border-subtle);
  min-height: 60px;
}
.te-topbar__search { flex: 1; max-width: 520px; position: relative; }
.te-topbar__search .te-input {
  height: 40px;
  padding: 0 92px 0 40px; /* +espace droit pour shortcut ⌘K */
  font-size: 0.875rem;
}
.te-topbar__search .te-input-icon { top: 50%; transform: translateY(-50%); }
.te-topbar__search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.te-topbar__search-kbd span {
  font-family: var(--te-font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--te-bg-muted);
  color: var(--te-text-secondary);
  border-radius: var(--te-r-sm);
  line-height: 1.4;
}
.te-topbar__actions { display: flex; align-items: center; gap: var(--te-s2); margin-left: auto; }
.te-topbar__icon-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  border-radius: var(--te-r-md);
  color: var(--te-text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: background 100ms, color 100ms;
}
.te-topbar__icon-btn:hover { background: var(--te-bg-subtle); color: var(--te-text-primary); }
.te-topbar__icon-btn .te-topbar__dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--te-error-500);
  border: 2px solid var(--te-bg-base);
}

.te-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--te-s4);
  padding: var(--te-s6) 0 var(--te-s5);
  flex-wrap: wrap;
}
.te-page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--te-text-primary);
  margin: 0;
  line-height: 1.2;
}
.te-page-header__sub {
  font-size: 0.875rem;
  color: var(--te-text-secondary);
  margin: 4px 0 0;
}
.te-page-header__actions { display: flex; gap: var(--te-s2); align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   26. AVATAR
   -------------------------------------------------------------------------- */
.te-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--te-bg-muted);
  color: var(--te-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
  position: relative;
}
.te-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.te-avatar--xs { width: 20px; height: 20px; font-size: 0.625rem; }
.te-avatar--sm { width: 28px; height: 28px; font-size: 0.6875rem; }
.te-avatar--lg { width: 48px; height: 48px; font-size: 1rem; }
.te-avatar--xl { width: 64px; height: 64px; font-size: 1.25rem; }
.te-avatar--brand { background: var(--te-brand-100); color: var(--te-brand-700); }
.te-avatar--status::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--te-text-disabled);
  border: 2px solid var(--te-bg-base);
}
.te-avatar--status-online::after { background: #15803D; }
.te-avatar--status-away::after   { background: var(--te-warning-500); }
.te-avatar--status-busy::after   { background: #DC2626; }

.te-avatar-group { display: inline-flex; align-items: center; }
.te-avatar-group .te-avatar { border: 2px solid var(--te-bg-base); }
.te-avatar-group .te-avatar + .te-avatar { margin-left: -8px; }
.te-avatar-group__more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--te-bg-muted); color: var(--te-text-secondary);
  font-size: 0.75rem; font-weight: 600;
  border: 2px solid var(--te-bg-base);
  margin-left: -8px;
}

/* --------------------------------------------------------------------------
   27. CHIP / TAG
   -------------------------------------------------------------------------- */
.te-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--te-s1);
  padding: 3px var(--te-s3);
  background: var(--te-bg-muted);
  color: var(--te-text-secondary);
  border-radius: var(--te-r-full);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: default;
  max-width: 220px;
}
.te-chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-chip--removable { padding-right: 4px; }
.te-chip__remove {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: currentColor; opacity: .6;
  display: inline-flex; align-items: center;
  border-radius: var(--te-r-full);
  line-height: 1;
}
.te-chip__remove:hover { opacity: 1; background: rgba(0,0,0,.06); }
.te-chip--brand   { background: var(--te-brand-100); color: var(--te-brand-700); }
.te-chip--success { background: var(--te-success-100); color: var(--te-success-text); }
.te-chip--warning { background: var(--te-warning-100); color: var(--te-warning-text); }
.te-chip--error   { background: var(--te-error-100); color: var(--te-error-text); }
.te-chip--info    { background: var(--te-info-100); color: var(--te-info-text); }
.te-chip--clickable { cursor: pointer; transition: background 100ms; }
.te-chip--clickable:hover { background: var(--te-border-subtle); }
.te-chip--outline {
  background: var(--te-bg-base);
  border-color: var(--te-border-default);
  color: var(--te-text-secondary);
}

/* --------------------------------------------------------------------------
   28. TOOLTIP / POPOVER
   -------------------------------------------------------------------------- */
.te-tooltip-wrap { position: relative; display: inline-flex; }
.te-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--te-r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 500;
}
.te-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #111827;
}
.te-tooltip-wrap:hover .te-tooltip,
.te-tooltip-wrap:focus-within .te-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}
.te-tooltip--bottom { bottom: auto; top: calc(100% + 6px); }
.te-tooltip--bottom::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111827; }
.te-tooltip--list { white-space: normal; text-align: left; line-height: 1.55; min-width: 120px; max-width: 200px; padding: 8px 12px; }
.te-avatar-group .te-tooltip-wrap { outline: none; }
.te-avatar-group .te-tooltip-wrap + .te-tooltip-wrap { margin-left: -8px; }
.te-avatar-group .te-tooltip-wrap .te-avatar,
.te-avatar-group .te-tooltip-wrap .te-avatar-group__more { border: 2px solid var(--te-bg-base); transition: transform 120ms; }
.te-avatar-group .te-tooltip-wrap:hover .te-avatar,
.te-avatar-group .te-tooltip-wrap:focus-visible .te-avatar { transform: translateY(-2px); z-index: 2; position: relative; }
.te-avatar-group .te-tooltip-wrap:focus-visible { outline: none; }
.te-avatar-group .te-tooltip-wrap:focus-visible .te-avatar { box-shadow: 0 0 0 3px var(--te-brand-200); }

.te-popover {
  position: absolute;
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-md);
  box-shadow: var(--te-shadow-lg);
  padding: var(--te-s4);
  min-width: 240px;
  max-width: 320px;
  z-index: 500;
  font-size: 0.875rem;
  color: var(--te-text-primary);
  line-height: 1.5;
}
.te-popover__title { font-weight: 600; margin: 0 0 4px; }
.te-popover__desc { color: var(--te-text-secondary); margin: 0 0 var(--te-s3); font-size: 0.8125rem; }
.te-popover__footer { display: flex; justify-content: flex-end; gap: var(--te-s2); margin-top: var(--te-s3); }

/* --------------------------------------------------------------------------
   29. ACCORDION
   -------------------------------------------------------------------------- */
.te-accordion {
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  overflow: hidden;
  background: var(--te-bg-base);
}
.te-accordion__item + .te-accordion__item { border-top: 1px solid var(--te-border-subtle); }
.te-accordion__trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--te-s4) var(--te-s5);
  font-family: var(--te-font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--te-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--te-s3);
  transition: background 100ms;
}
.te-accordion__trigger:hover { background: var(--te-bg-subtle); }
.te-accordion__trigger:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--te-brand-500); }
.te-accordion__icon { transition: transform 150ms ease; flex-shrink: 0; color: var(--te-text-tertiary); }
.te-accordion__item.is-open .te-accordion__icon { transform: rotate(180deg); }
.te-accordion__content {
  display: none;
  padding: var(--te-s2) var(--te-s5) var(--te-s5);
  margin-top: var(--te-s1);
  border-top: 1px solid var(--te-border-subtle);
  font-size: 0.875rem;
  color: var(--te-text-secondary);
  line-height: 1.65;
}
.te-accordion__item.is-open .te-accordion__content { display: block; padding-top: var(--te-s4); }
.te-accordion__sub { font-size: 0.8125rem; color: var(--te-text-tertiary); font-weight: 400; margin-top: 4px; }

/* --------------------------------------------------------------------------
   30. DROPDOWN / MENU
   -------------------------------------------------------------------------- */
.te-dropdown { position: relative; display: inline-flex; }
.te-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-md);
  box-shadow: var(--te-shadow-lg);
  padding: 4px;
  z-index: 400;
  animation: te-menu-in .12s ease;
}
.te-menu--right { left: auto; right: 0; }
@keyframes te-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.te-menu[hidden] { display: none !important; }
.te-menu__item {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  width: 100%;
  padding: var(--te-s2) var(--te-s3);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--te-font);
  font-size: 0.875rem;
  color: var(--te-text-primary);
  border-radius: var(--te-r-sm);
  text-align: left;
  text-decoration: none;
  transition: background 80ms;
  white-space: nowrap;
}
.te-menu__item:hover,
.te-menu__item:focus-visible { background: var(--te-bg-subtle); outline: none; }
.te-menu__item--danger { color: var(--te-error-text); }
.te-menu__item--danger:hover { background: var(--te-error-100); }
.te-menu__item[aria-disabled="true"],
.te-menu__item:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.te-menu__icon { width: 16px; flex-shrink: 0; color: var(--te-text-tertiary); }
.te-menu__item:hover .te-menu__icon { color: currentColor; }
.te-menu__shortcut {
  margin-left: auto;
  font-size: 0.75rem;
  font-family: var(--te-font-mono);
  color: var(--te-text-tertiary);
  padding: 1px 5px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-sm);
}
.te-menu__sep { height: 1px; background: var(--te-border-subtle); margin: 4px 0; }
.te-menu__heading {
  padding: var(--te-s2) var(--te-s3) var(--te-s1);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--te-text-tertiary);
}

/* --------------------------------------------------------------------------
   31. COMBOBOX / ASYNC SEARCH
   -------------------------------------------------------------------------- */
.te-combobox { position: relative; }
.te-combobox__input {
  width: 100%;
  padding-left: 38px;
  padding-right: 38px;
}
.te-combobox__icon {
  position: absolute;
  top: 50%; left: 12px;
  transform: translateY(-50%);
  color: var(--te-text-tertiary);
  pointer-events: none;
}
.te-combobox__clear {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary);
  padding: 0; border-radius: var(--te-r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; min-height: 28px;
}
.te-combobox__clear:hover { color: var(--te-text-primary); background: var(--te-bg-subtle); }
.te-combobox__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-md);
  box-shadow: var(--te-shadow-lg);
  padding: 4px;
  z-index: 400;
}
.te-combobox__results[hidden] { display: none; }
.te-combobox__option {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s2) var(--te-s3);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--te-text-primary);
}
.te-combobox__option:hover,
.te-combobox__option--active { background: var(--te-bg-subtle); }
.te-combobox__option-sub { font-size: 0.75rem; color: var(--te-text-tertiary); margin-top: 1px; }
.te-combobox__option mark { background: var(--te-brand-100); color: var(--te-brand-700); padding: 0 1px; border-radius: 2px; }
.te-combobox__loading,
.te-combobox__empty {
  padding: var(--te-s3);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--te-text-tertiary);
}
.te-combobox__group-label {
  padding: var(--te-s2) var(--te-s3) var(--te-s1);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--te-text-tertiary);
}

/* --------------------------------------------------------------------------
   32. DATE PICKER
   -------------------------------------------------------------------------- */
.te-datepicker {
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-lg);
  padding: var(--te-s4);
  width: 290px;
  font-family: var(--te-font);
  position: relative;
  border-top: 3px solid var(--te-brand-500); /* accent brand */
}
.te-datepicker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--te-s3);
}
.te-datepicker__month {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--te-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--te-r-sm);
}
.te-datepicker__month:hover { background: var(--te-brand-50); color: var(--te-brand-700); }
.te-datepicker__nav {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-secondary);
  width: 28px; height: 28px;
  border-radius: var(--te-r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 80ms, color 80ms;
}
.te-datepicker__nav:hover { background: var(--te-brand-50); color: var(--te-brand-700); }
.te-datepicker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.te-datepicker__dow {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--te-text-tertiary);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.te-datepicker__day {
  background: none; border: none; cursor: pointer;
  font-family: var(--te-font);
  font-size: 0.8125rem;
  color: var(--te-text-primary);
  height: 34px;
  border-radius: var(--te-r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 80ms, color 80ms, transform 80ms;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.te-datepicker__day:hover {
  background: var(--te-brand-50);
  color: var(--te-brand-700);
}
.te-datepicker__day--muted { color: var(--te-text-disabled); }
/* Aujourd'hui : pastille verte sous le chiffre */
.te-datepicker__day--today {
  font-weight: 700;
  color: var(--te-brand-700);
}
.te-datepicker__day--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--te-brand-500);
}
.te-datepicker__day--selected {
  background: var(--te-brand-500);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(29,198,83,.35);
}
.te-datepicker__day--selected::after { background: #fff; }
.te-datepicker__day--in-range {
  background: var(--te-brand-100);
  color: var(--te-brand-700);
  border-radius: 0;
}
.te-datepicker__day--range-start {
  background: var(--te-brand-500);
  color: #fff;
  font-weight: 700;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.te-datepicker__day--range-end {
  background: var(--te-brand-500);
  color: #fff;
  font-weight: 700;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.te-datepicker__day:disabled { opacity: .35; cursor: not-allowed; }
.te-datepicker__day:disabled:hover { background: none; color: var(--te-text-disabled); }
.te-datepicker__day:focus-visible {
  outline: none;
  box-shadow: var(--te-shadow-focus);
}
.te-datepicker__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--te-s2);
  margin-top: var(--te-s3);
  padding-top: var(--te-s3);
  border-top: 1px solid var(--te-border-subtle);
}
.te-datepicker__shortcut {
  font-size: 0.75rem;
  color: var(--te-brand-700);
  background: var(--te-brand-50);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 80ms, border-color 80ms;
}
.te-datepicker__shortcut:hover {
  background: var(--te-brand-100);
  border-color: var(--te-brand-500);
}

.te-datepicker--range { width: auto; display: inline-flex; gap: var(--te-s4); }
.te-datepicker--range .te-datepicker__panel { min-width: 260px; }

.te-time-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  padding: 0 var(--te-s3);
  background: var(--te-bg-base);
  height: 40px;
}
.te-time-input:focus-within { border-color: var(--te-brand-500); box-shadow: var(--te-shadow-focus); }
.te-time-input input {
  width: 24px;
  border: none; outline: none;
  font-family: var(--te-font); font-size: 0.875rem;
  text-align: center;
  color: var(--te-text-primary);
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.te-time-input__sep { color: var(--te-text-tertiary); }

/* --------------------------------------------------------------------------
   33. UPLOAD / DROPZONE
   -------------------------------------------------------------------------- */
.te-dropzone {
  border: 1.5px dashed var(--te-border-default);
  border-radius: var(--te-r-lg);
  background: var(--te-bg-subtle);
  padding: var(--te-s8) var(--te-s5);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.te-dropzone:hover,
.te-dropzone--drag {
  border-color: var(--te-brand-500);
  background: var(--te-brand-50);
}
.te-dropzone__icon {
  width: 48px; height: 48px;
  background: var(--te-bg-base);
  border-radius: var(--te-r-full);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--te-brand-700);
  margin-bottom: var(--te-s3);
  box-shadow: var(--te-shadow-sm);
}
.te-dropzone__title { font-size: 0.9375rem; font-weight: 600; color: var(--te-text-primary); margin: 0 0 4px; }
.te-dropzone__hint { font-size: 0.8125rem; color: var(--te-text-tertiary); margin: 0; }
.te-dropzone__link { color: var(--te-brand-700); font-weight: 600; }
.te-dropzone--error { border-color: var(--te-error-500); background: var(--te-error-100); }
.te-dropzone--error .te-dropzone__icon { color: var(--te-error-700); background: #fff; }

.te-dropzone-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--te-s3);
  margin-top: var(--te-s2);
  padding: 0 var(--te-s1);
  font-size: 0.75rem;
  color: var(--te-text-tertiary);
}
.te-dropzone-counter strong { color: var(--te-text-secondary); font-weight: 600; }
.te-dropzone-counter--over strong,
.te-dropzone-counter--over { color: var(--te-error-700); }
.te-dropzone-counter__bar {
  flex: 0 0 120px;
  height: 4px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-full);
  overflow: hidden;
}
.te-dropzone-counter__bar > span {
  display: block;
  height: 100%;
  background: var(--te-brand-500);
  transition: width 160ms;
}
.te-dropzone-counter--over .te-dropzone-counter__bar > span { background: var(--te-error-500); }

.te-file-list { display: flex; flex-direction: column; gap: var(--te-s2); margin-top: var(--te-s3); }
.te-file-item {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s3);
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-md);
}
.te-file-item__thumb {
  width: 40px; height: 40px;
  border-radius: var(--te-r-sm);
  background: var(--te-bg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--te-text-tertiary);
  flex-shrink: 0;
  overflow: hidden;
}
.te-file-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.te-file-item__body { flex: 1; min-width: 0; }
.te-file-item__name {
  font-size: 0.875rem; font-weight: 500; color: var(--te-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.te-file-item__meta { font-size: 0.75rem; color: var(--te-text-tertiary); margin-top: 2px; }
.te-file-item__progress { margin-top: 6px; }
.te-file-item__remove {
  background: none; border: none; cursor: pointer;
  color: var(--te-text-tertiary); padding: 4px;
  border-radius: var(--te-r-sm);
  flex-shrink: 0;
}
.te-file-item__remove:hover { color: var(--te-error-500); background: var(--te-error-100); }
.te-file-item--error { border-color: var(--te-error-500); background: var(--te-error-100); }
.te-file-item--success .te-file-item__thumb { background: var(--te-success-100); color: var(--te-success-text); }

/* --------------------------------------------------------------------------
   34. INPUTS SPÉCIALISÉS — tel, IBAN, SIRET, %, €, promo
   -------------------------------------------------------------------------- */
.te-input-addon {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  background: var(--te-bg-base);
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms;
}
.te-input-addon:focus-within { border-color: var(--te-brand-500); box-shadow: var(--te-shadow-focus); }
.te-input-addon > input,
.te-input-addon > select {
  flex: 1;
  border: none;
  outline: none;
  padding: var(--te-s3) var(--te-s4);
  font-family: var(--te-font);
  font-size: 0.875rem;
  color: var(--te-text-primary);
  background: transparent;
  min-width: 0;
}
.te-input-addon__prefix,
.te-input-addon__suffix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--te-s3);
  background: var(--te-bg-subtle);
  color: var(--te-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.te-input-addon__prefix { border-right: 1px solid var(--te-border-subtle); }
.te-input-addon__suffix { border-left: 1px solid var(--te-border-subtle); }
.te-input-addon__flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.te-input-addon__flag svg { width: 100%; height: 100%; display: block; }
.te-input-addon--invalid { border-color: var(--te-error-500); }

.te-input-addon__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--te-s4);
  background: var(--te-brand-500);
  color: #fff;
  border: none;
  font-family: var(--te-font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 120ms;
}
.te-input-addon__btn:hover { background: var(--te-brand-600); }
.te-input-addon__btn:active { background: var(--te-brand-700); }
.te-input-addon__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--te-brand-700); }
.te-input-addon__btn:disabled { background: var(--te-neutral-300); color: var(--te-text-tertiary); cursor: not-allowed; }

.te-input-mono { font-family: var(--te-font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* --------------------------------------------------------------------------
   35. TAG INPUT / MULTI-SELECT
   -------------------------------------------------------------------------- */
.te-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px var(--te-s2) 4px;
  min-height: 40px;
  border: 1.5px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  background: var(--te-bg-base);
  cursor: text;
  transition: border-color 120ms, box-shadow 120ms;
}
.te-tag-input:focus-within { border-color: var(--te-brand-500); box-shadow: var(--te-shadow-focus); }
.te-tag-input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 4px;
  min-width: 80px;
  font-family: var(--te-font);
  font-size: 0.875rem;
  background: transparent;
}
.te-tag-input__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--te-s1) 2px var(--te-s2);
  background: var(--te-brand-100);
  color: var(--te-brand-700);
  border-radius: var(--te-r-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  max-width: 180px;
}
.te-tag-input__pill-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-tag-input__pill-remove {
  background: none; border: none; cursor: pointer;
  color: currentColor; opacity: .6;
  display: inline-flex; align-items: center;
  padding: 2px;
  border-radius: var(--te-r-sm);
}
.te-tag-input__pill-remove:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* --------------------------------------------------------------------------
   36. INLINE EDIT
   -------------------------------------------------------------------------- */
.te-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--te-r-sm);
  cursor: text;
  transition: background 100ms, border-color 100ms, box-shadow 100ms;
  position: relative;
  max-width: 100%;
  /* Bordure pointillée permanente pour signaler "éditable" */
  border: 1px dashed var(--te-border-default);
  background: transparent;
}
.te-inline-edit:hover {
  background: var(--te-brand-50);
  border-color: var(--te-brand-500);
  border-style: solid;
}
.te-inline-edit__value {
  font: inherit;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Icône crayon TOUJOURS visible (plus seulement au hover) */
.te-inline-edit__icon {
  color: var(--te-text-tertiary);
  flex-shrink: 0;
  transition: color 100ms, transform 100ms;
  opacity: .7;
}
.te-inline-edit:hover .te-inline-edit__icon {
  color: var(--te-brand-600);
  opacity: 1;
  transform: scale(1.08);
}
.te-inline-edit:focus-within .te-inline-edit__icon { color: var(--te-brand-600); opacity: 1; }
.te-inline-edit input {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  min-width: 60px;
}
.te-inline-edit.is-editing {
  background: var(--te-bg-base);
  border-style: solid;
  border-color: var(--te-brand-500);
  box-shadow: var(--te-shadow-focus);
}
/* Variante "discrète" quand on ne veut pas la bordure pointillée permanente */
.te-inline-edit--quiet {
  border-color: transparent;
  border-style: solid;
}
.te-inline-edit--quiet:hover {
  border-color: var(--te-brand-500);
  border-style: dashed;
}

/* --------------------------------------------------------------------------
   37. COPY TO CLIPBOARD
   -------------------------------------------------------------------------- */
.te-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--te-s2);
  padding: 4px var(--te-s2) 4px var(--te-s3);
  background: var(--te-bg-subtle);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-md);
  font-family: var(--te-font-mono);
  font-size: 0.8125rem;
  color: var(--te-text-primary);
  max-width: 100%;
}
.te-copy__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.te-copy__btn {
  background: none; border: none; cursor: pointer;
  padding: 4px;
  color: var(--te-text-tertiary);
  display: inline-flex; align-items: center;
  border-radius: var(--te-r-sm);
  flex-shrink: 0;
}
.te-copy__btn:hover { color: var(--te-brand-700); background: var(--te-brand-100); }
.te-copy__btn.is-copied { color: var(--te-brand-700); }
.te-copy--block {
  display: flex;
  width: 100%;
  padding: var(--te-s3) var(--te-s4);
}

/* --------------------------------------------------------------------------
   38. COMMAND PALETTE / RECHERCHE GLOBALE
   -------------------------------------------------------------------------- */
.te-cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  z-index: 900;
  display: flex;
  justify-content: center;
  padding-top: 12vh;
  animation: te-backdrop-in .12s ease;
}
.te-cmdk-backdrop[hidden] { display: none !important; }
.te-cmdk {
  width: 100%;
  max-width: 560px;
  background: var(--te-bg-base);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-lg);
  overflow: hidden;
  animation: te-modal-in .15s ease;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.te-cmdk__search {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s4) var(--te-s5);
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-cmdk__search svg { color: var(--te-text-tertiary); flex-shrink: 0; }
.te-cmdk__search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--te-font);
  font-size: 0.9375rem;
  color: var(--te-text-primary);
  background: transparent;
}
.te-cmdk__kbd {
  font-family: var(--te-font-mono);
  font-size: 0.6875rem;
  padding: 2px 6px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-sm);
  color: var(--te-text-secondary);
  font-weight: 600;
}
.te-cmdk__results { overflow-y: auto; padding: var(--te-s2); }
.te-cmdk__group-label {
  padding: var(--te-s2) var(--te-s3) var(--te-s1);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--te-text-tertiary);
}
.te-cmdk__item {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s2) var(--te-s3);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--te-text-primary);
}
.te-cmdk__item:hover,
.te-cmdk__item--active { background: var(--te-bg-subtle); }
.te-cmdk__item-icon { color: var(--te-text-tertiary); }
.te-cmdk__item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-cmdk__item-sub { font-size: 0.75rem; color: var(--te-text-tertiary); }
.te-cmdk__footer {
  display: flex;
  align-items: center;
  gap: var(--te-s4);
  padding: var(--te-s2) var(--te-s4);
  border-top: 1px solid var(--te-border-subtle);
  font-size: 0.75rem;
  color: var(--te-text-tertiary);
}
.te-cmdk__footer .te-cmdk__kbd { background: var(--te-bg-base); border: 1px solid var(--te-border-subtle); }

/* --------------------------------------------------------------------------
   39. NOTIFICATION CENTER
   -------------------------------------------------------------------------- */
.te-notif-center {
  width: 360px;
  max-width: 100%;
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 480px;
}
.te-notif-center__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--te-s3) var(--te-s4);
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-notif-center__title { font-size: 0.9375rem; font-weight: 600; color: var(--te-text-primary); }
.te-notif-center__mark {
  background: none; border: none; cursor: pointer;
  font-size: 0.75rem; font-weight: 500;
  color: var(--te-brand-700);
  padding: 2px 6px;
  border-radius: var(--te-r-sm);
}
.te-notif-center__mark:hover { background: var(--te-brand-100); }
.te-notif-center__list { overflow-y: auto; flex: 1; }
.te-notif-item {
  display: flex;
  gap: var(--te-s3);
  padding: var(--te-s3) var(--te-s4);
  border-bottom: 1px solid var(--te-border-subtle);
  cursor: pointer;
  position: relative;
  transition: background 80ms;
}
.te-notif-item:last-child { border-bottom: none; }
.te-notif-item:hover { background: var(--te-bg-subtle); }
.te-notif-item--unread { background: var(--te-brand-50); }
.te-notif-item--unread::before {
  content: '';
  position: absolute;
  top: 16px; left: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--te-brand-500);
}
.te-notif-item__icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: var(--te-r-full);
  background: var(--te-bg-muted);
  color: var(--te-text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
}
.te-notif-item__body { flex: 1; min-width: 0; }
.te-notif-item__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text-primary);
  line-height: 1.4;
}
.te-notif-item__title strong { font-weight: 700; }
.te-notif-item__sub { font-size: 0.75rem; color: var(--te-text-tertiary); margin-top: 2px; }
.te-notif-center__empty {
  padding: var(--te-s8) var(--te-s4);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--te-text-tertiary);
}
.te-notif-center__footer {
  padding: var(--te-s3) var(--te-s4);
  border-top: 1px solid var(--te-border-subtle);
  text-align: center;
}
.te-notif-center__link {
  font-size: 0.8125rem;
  color: var(--te-brand-700);
  text-decoration: none;
  font-weight: 500;
}
.te-notif-center__link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   40. STICKY ACTION BAR
   -------------------------------------------------------------------------- */
.te-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s3) var(--te-s5);
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  box-shadow: var(--te-shadow-lg);
  flex-wrap: wrap;
}
.te-action-bar__info { flex: 1; font-size: 0.875rem; color: var(--te-text-secondary); min-width: 180px; }
.te-action-bar__info strong { color: var(--te-text-primary); }
.te-action-bar__actions { display: flex; gap: var(--te-s2); align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .te-action-bar {
    position: fixed;
    left: var(--te-s3);
    right: var(--te-s3);
    bottom: var(--te-s3);
    border-radius: var(--te-r-lg);
    padding-bottom: calc(var(--te-s3) + env(safe-area-inset-bottom, 0));
  }
}

/* --------------------------------------------------------------------------
   41. DATA TABLE ENTERPRISE — TOOLBAR
   Barre d'outils au-dessus du tableau : vues sauvegardées, recherche, filtres,
   densité, colonnes, export. Regroupe tous les contrôles hors ligne.
   -------------------------------------------------------------------------- */
.te-dt {
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--te-r-lg);
  background: var(--te-bg-base);
  box-shadow: var(--te-shadow-sm);
  /* overflow:visible pour que les dropdowns (vues, colonnes, export) échappent */
  overflow: visible;
  position: relative;
}
.te-dt > :first-child { border-top-left-radius: calc(var(--te-r-lg) - 1px); border-top-right-radius: calc(var(--te-r-lg) - 1px); }
.te-dt > :last-child  { border-bottom-left-radius: calc(var(--te-r-lg) - 1px); border-bottom-right-radius: calc(var(--te-r-lg) - 1px); }
.te-dt__toolbar {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: var(--te-s3) var(--te-s4);
  border-bottom: 1px solid var(--te-border-subtle);
  flex-wrap: wrap;
  background: var(--te-bg-base);
}
.te-dt__toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: var(--te-s2);
}
.te-dt__toolbar-spacer { flex: 1; }

/* Sélecteur de vue sauvegardée */
.te-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  background: var(--te-bg-base);
  color: var(--te-text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
}
.te-view-switch:hover { border-color: var(--te-brand-500); color: var(--te-brand-700); }
.te-view-switch--dirty::after {
  content: "•";
  color: var(--te-warning-500);
  font-size: 1.4em;
  line-height: 0;
  margin-left: 2px;
}
.te-view-switch__label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-view-menu { min-width: 280px; padding: 4px; }
.te-view-menu__item {
  display: flex;
  align-items: center;
  gap: var(--te-s2);
  padding: 8px 10px;
  border-radius: var(--te-r-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--te-text-primary);
}
.te-view-menu__item:hover { background: var(--te-bg-subtle); }
.te-view-menu__item--active { background: var(--te-brand-50); color: var(--te-brand-700); font-weight: 600; }
.te-view-menu__check { width: 16px; color: var(--te-brand-500); opacity: 0; flex-shrink: 0; }
.te-view-menu__item--active .te-view-menu__check { opacity: 1; }
.te-view-menu__name { flex: 1; }
.te-view-menu__count {
  font-size: 0.75rem;
  color: var(--te-text-tertiary);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.te-view-menu__meta {
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--te-text-tertiary);
  border-top: 1px solid var(--te-border-subtle);
  margin-top: 4px;
}

/* Segmented control (densité) */
.te-segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--te-bg-muted);
  border-radius: var(--te-r-md);
}
.te-segmented__btn {
  padding: 5px 10px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--te-text-secondary);
  border-radius: calc(var(--te-r-md) - 2px);
  cursor: pointer;
  line-height: 1;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.te-segmented__btn:hover { color: var(--te-text-primary); }
.te-segmented__btn--active {
  background: var(--te-bg-base);
  color: var(--te-brand-700);
  box-shadow: var(--te-shadow-sm);
}

/* Icône-bouton outil (filtres, colonnes, export) */
.te-dt__tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  background: var(--te-bg-base);
  color: var(--te-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
}
.te-dt__tool-btn:hover { color: var(--te-text-primary); border-color: var(--te-border-strong); }
.te-dt__tool-btn--active {
  color: var(--te-brand-700);
  border-color: var(--te-brand-500);
  background: var(--te-brand-50);
}
.te-dt__tool-btn__badge {
  background: var(--te-brand-500);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}

/* Menu de colonnes */
.te-column-menu {
  min-width: 260px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}
.te-column-menu__item {
  display: flex;
  align-items: center;
  gap: var(--te-s2);
  padding: 6px 10px;
  border-radius: var(--te-r-sm);
  cursor: pointer;
  font-size: 0.875rem;
}
.te-column-menu__item:hover { background: var(--te-bg-subtle); }
.te-column-menu__handle {
  color: var(--te-text-tertiary);
  cursor: grab;
  line-height: 0;
}
.te-column-menu__label { flex: 1; color: var(--te-text-primary); }
.te-column-menu__pin {
  color: var(--te-text-tertiary);
  padding: 2px;
  border-radius: var(--te-r-sm);
  line-height: 0;
  cursor: pointer;
}
.te-column-menu__pin:hover { color: var(--te-brand-600); background: var(--te-brand-50); }
.te-column-menu__pin--active { color: var(--te-brand-600); }

/* --------------------------------------------------------------------------
   42. DATA TABLE — BULK BAR (sélection persistante)
   Visible dès qu'au moins une ligne est sélectionnée. Persistante entre pages.
   -------------------------------------------------------------------------- */
.te-dt__bulk {
  display: none;
  align-items: center;
  gap: var(--te-s3);
  padding: 10px var(--te-s4);
  background: var(--te-brand-50);
  border-bottom: 1px solid var(--te-brand-200, #D1F2DD);
  color: var(--te-brand-700);
  font-size: 0.8125rem;
  flex-wrap: wrap;
}
.te-dt__bulk.is-visible { display: flex; }
.te-dt__bulk-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.te-dt__bulk-actions { display: inline-flex; gap: var(--te-s2); align-items: center; flex-wrap: wrap; }
.te-dt__bulk-spacer { flex: 1; }
.te-dt__bulk-clear {
  background: none;
  border: none;
  color: var(--te-brand-700);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 6px;
  border-radius: var(--te-r-sm);
  min-height: 28px;
}
.te-dt__bulk-clear:hover { background: rgba(0,0,0,.04); }
.te-dt__bulk-select-all {
  background: none;
  border: 1px dashed var(--te-brand-500);
  color: var(--te-brand-700);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.te-dt__bulk-select-all:hover { background: rgba(29,198,83,.08); }

/* --------------------------------------------------------------------------
   43. DATA TABLE — TRI MULTI-COLONNES
   Indicateur d'ordre (1, 2, 3…) quand plusieurs colonnes sont triées.
   -------------------------------------------------------------------------- */
.te-table thead th.te-th--sortable { cursor: pointer; position: relative; }
.te-table thead th.te-th--sortable .te-sort-stack {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.te-table thead th .te-sort-order {
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--te-brand-500);
  color: #fff;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.te-table thead th.te-th--sorted-asc .sort-icon,
.te-table thead th.te-th--sorted-desc .sort-icon { opacity: 1; color: var(--te-brand-600); }
.te-table thead th.te-th--sorted-desc .sort-icon { transform: rotate(180deg); display: inline-block; }

/* --------------------------------------------------------------------------
   44. DATA TABLE — COLONNES FIGÉES & RESIZE
   Colonnes collantes à gauche (checkbox + première col). Poignée de resize.
   -------------------------------------------------------------------------- */
.te-dt__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
}
.te-dt__scroll .te-table { min-width: 960px; }

.te-th--frozen,
.te-td--frozen {
  position: sticky;
  left: 0;
  background: var(--te-bg-base);
  z-index: 2;
}
.te-table thead th.te-th--frozen {
  background: var(--te-bg-subtle);
  z-index: 3;
}
.te-td--frozen--shadow,
.te-th--frozen--shadow {
  box-shadow: 6px 0 6px -4px rgba(17,24,39,.08);
}
.te-table tbody tr:hover .te-td--frozen { background: var(--te-brand-50); }
.te-table tbody tr.is-selected .te-td--frozen { background: var(--te-brand-50); }

/* Poignée de resize sur th */
.te-th__resizer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  background: transparent;
  transition: background 80ms ease;
}
.te-th__resizer:hover,
.te-th__resizer.is-resizing { background: var(--te-brand-500); }

/* --------------------------------------------------------------------------
   45. DATA TABLE — DENSITÉS
   Compact, confort (défaut), spacieux.
   -------------------------------------------------------------------------- */
.te-table--compact thead th { padding: 6px var(--te-s3); font-size: 0.75rem; }
.te-table--compact tbody td { padding: 6px var(--te-s3); font-size: 0.8125rem; }
.te-table--spacious thead th { padding: var(--te-s4) var(--te-s5); }
.te-table--spacious tbody td { padding: var(--te-s4) var(--te-s5); }

/* Row hover actions (affichées au survol de ligne) */
.te-table tbody td.te-td--actions { text-align: right; white-space: nowrap; }
.te-table tbody td.te-td--actions .te-row-actions {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 80ms ease;
}
.te-table tbody tr:hover td.te-td--actions .te-row-actions,
.te-table tbody tr:focus-within td.te-td--actions .te-row-actions { opacity: 1; }
.te-row-actions__btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--te-text-tertiary);
  border-radius: var(--te-r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.te-row-actions__btn:hover { background: var(--te-bg-muted); color: var(--te-text-primary); }

/* --------------------------------------------------------------------------
   46. DATA TABLE — FOOTER (pagination + total sélection)
   -------------------------------------------------------------------------- */
.te-dt__footer {
  display: flex;
  align-items: center;
  gap: var(--te-s3);
  padding: 10px var(--te-s4);
  border-top: 1px solid var(--te-border-subtle);
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  flex-wrap: wrap;
}
.te-dt__footer-spacer { flex: 1; }
.te-dt__page-size {
  height: 30px;
  padding: 0 28px 0 10px;
  font-size: 0.8125rem;
  border: 1px solid var(--te-border-default);
  border-radius: var(--te-r-sm);
  background: var(--te-bg-base);
  cursor: pointer;
}
.te-dt__pager { display: inline-flex; gap: 2px; }
.te-dt__pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--te-border-default);
  background: var(--te-bg-base);
  color: var(--te-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--te-r-sm);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.te-dt__pager-btn:hover { color: var(--te-text-primary); border-color: var(--te-border-strong); }
.te-dt__pager-btn--active {
  background: var(--te-brand-500);
  color: #fff;
  border-color: var(--te-brand-500);
}
.te-dt__pager-btn:disabled { opacity: .4; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   47. EXPORT PANEL
   -------------------------------------------------------------------------- */
.te-export-panel {
  min-width: 320px;
  padding: var(--te-s3);
}
.te-export-panel__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--te-text-tertiary);
  margin-bottom: var(--te-s2);
}
.te-export-panel__section { margin-bottom: var(--te-s3); }
.te-export-panel__formats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.te-export-panel__format {
  padding: 8px;
  border: 1px solid var(--te-border-default);
  border-radius: var(--te-r-md);
  background: var(--te-bg-base);
  cursor: pointer;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--te-text-secondary);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.te-export-panel__format:hover { border-color: var(--te-brand-500); color: var(--te-brand-700); }
.te-export-panel__format--active {
  border-color: var(--te-brand-500);
  background: var(--te-brand-50);
  color: var(--te-brand-700);
}
.te-export-panel__footer {
  display: flex;
  gap: var(--te-s2);
  margin-top: var(--te-s3);
  padding-top: var(--te-s3);
  border-top: 1px solid var(--te-border-subtle);
}

/* --------------------------------------------------------------------------
   PAGINATION
   -------------------------------------------------------------------------- */
.te-paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--te-s3);
  margin-top: var(--te-s5);
  padding-top: var(--te-s4);
  border-top: 1px solid var(--te-border-subtle);
  flex-wrap: wrap;
}
.te-paginator__pages {
  display: flex;
  align-items: center;
  gap: 2px;
}
.te-paginator__nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--te-r-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--te-text-primary);
  background: var(--te-bg-base);
  border: 1px solid var(--te-border-default);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  box-shadow: var(--te-shadow-sm);
}
.te-paginator__nav:hover {
  background: var(--te-bg-subtle);
  border-color: var(--te-brand-500);
  color: var(--te-brand-700);
}
.te-paginator__nav--off {
  opacity: 0.35;
  pointer-events: none;
  box-shadow: none;
}
.te-paginator__divider {
  width: var(--te-s3);
  flex-shrink: 0;
}
.te-paginator__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 4px;
  border-radius: var(--te-r-md);
  font-size: 0.875rem;
  color: var(--te-text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.te-paginator__page:hover {
  background: var(--te-bg-muted);
  color: var(--te-text-primary);
}
.te-paginator__page--active {
  background: var(--te-brand-600);
  color: #fff;
  font-weight: 600;
  border-color: transparent;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(24,168,69,.35);
}
.te-paginator__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: var(--te-text-tertiary);
  font-size: 0.875rem;
  user-select: none;
  letter-spacing: .05em;
}
.te-paginator__info {
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   ACCESSIBILITÉ — prefers-reduced-motion
   Désactive les animations non essentielles pour les utilisateurs sensibles.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   ÉTATS RÉSEAU / SYNCHRO — terrain (socle NET-01/02/10, IF-05, DS-04)
   Toujours >= 2 canaux : texte + pastille + libellé (jamais couleur seule).
   ========================================================================== */

/* Badge d'état réseau/synchro (NET-10 : 5 états distincts, jamais couleur seule) */
.te-netbadge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--te-r-full);
  font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent;
}
.te-netbadge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: currentColor;
}
.te-netbadge--offline  { background: var(--te-status-offline-100);  color: var(--te-status-offline-text);  border-color: var(--te-status-offline-500); }
.te-netbadge--syncing  { background: var(--te-status-syncing-100);  color: var(--te-status-syncing-text);  border-color: var(--te-status-syncing-500); }
.te-netbadge--pending  { background: var(--te-status-pending-100);  color: var(--te-status-pending-text);  border-color: var(--te-status-pending-500); }
.te-netbadge--conflict { background: var(--te-status-conflict-100); color: var(--te-status-conflict-text); border-color: var(--te-status-conflict-500); }
.te-netbadge--synced   { background: var(--te-status-synced-100);   color: var(--te-status-synced-text);   border-color: var(--te-status-synced-500); }
/* animation pastille en cours de synchro (respecte prefers-reduced-motion via le bloc global) */
.te-netbadge--syncing::before { animation: te-pulse 1.2s ease-in-out infinite; }
@keyframes te-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Bandeau réseau persistant (NET-01) — header opérationnel */
.te-netbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--te-s3);
  padding: var(--te-s2) var(--te-s4); font-size: 0.8125rem; font-weight: 600;
  border-bottom: 1px solid var(--te-border-subtle);
}
.te-netbar__last { font-weight: 400; color: var(--te-text-tertiary); font-variant-numeric: tabular-nums; }
.te-netbar--offline  { background: var(--te-status-offline-100);  color: var(--te-status-offline-text); }
.te-netbar--syncing  { background: var(--te-status-syncing-100);  color: var(--te-status-syncing-text); }
.te-netbar--synced   { background: var(--te-status-synced-100);   color: var(--te-status-synced-text); }

/* Bandeau offline non anxiogène (NET-11) — mode dégradé explicite */
.te-offline-banner {
  display: flex; align-items: flex-start; gap: var(--te-s3);
  padding: var(--te-s4); border-radius: var(--te-r-md);
  background: var(--te-status-offline-100); color: var(--te-status-offline-text);
  font-size: 0.875rem; line-height: 1.5;
}
.te-offline-banner__title { font-weight: 700; }

/* Compteur de file de synchro (NET-05) */
.te-syncqueue { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--te-status-syncing-text); }
.te-syncqueue__count { font-variant-numeric: tabular-nums; }
