/* ══════════════════════════════════════════════════════════════════════
   B.2.8 — DESIGN SYSTEM QMS · CENTRALISÉ
   1. TOKENS → 2. BASE/TYPO → 3. COMPOSANTS → 4. LAYOUT (sidebar/header)
   → 5. PAGES → 6. RESPONSIVE
   Une modification ici s'applique à TOUS les templates.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* --- Layout --- */
  --sidebar-width: 260px;
  --header-height: 56px;
  /* --- Palette QMS --- */
  --primary: #e63946;
  --primary-dark: #b91c1c;
  --primary-soft: rgba(230, 57, 70, .1);
  --secondary: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --neutral: #94a3b8;
  /* --- Surfaces --- */
  --color-bg: #eef1f5;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-border: #e5e9f0;
  /* --- Texte --- */
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  /* --- Radius --- */
  --radius-sm: .4rem;
  --radius-md: .65rem;
  --radius-lg: .9rem;
  /* --- Ombres --- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 28px -10px rgba(15, 23, 42, .18);
  /* --- Espacement (échelle 4px) --- */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  /* --- Typographie --- */
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Tahoma, sans-serif;
  --fs-h1: 1.5rem;    /* 24px — titre de page */
  --fs-h2: 1.25rem;   /* 20px — titre de section */
  --fs-h3: 1.0625rem; /* 17px — titre de carte */
  --fs-body: .925rem; /* ~15px */
  --fs-small: .8125rem;
  --fs-caption: .72rem;
  /* --- Sidebar (héritage B.2.7) --- */
  --sidebar-bg: #1a1a2e;
  --sidebar-hover: #16213e;
  /* --- Tokens legacy (compat) --- */
  --ds-brand: #0f8b75;
  --ds-brand-strong: #0a6b5a;
  --ds-danger: #e63946;
  --ds-radius-sm: 0.5rem;
  --ds-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  --ds-ink: #1e293b;
  --ds-muted: #6b7280;
}

/* ══════════════════════════════════════════════════════════════════════
   2. BASE & TYPOGRAPHIE
   ══════════════════════════════════════════════════════════════════════ */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}
/* Hiérarchie : H1 24px (titres de page, y compris <h1 class="h3">),
   H2 20px, H3 17px, body 15px, small 13px, caption 11.5px */
h1, h1[class], .h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.01em; }
h2, h2[class], .h2 { font-size: var(--fs-h2); font-weight: 700; }
h3, h3[class], .h3 { font-size: var(--fs-h3); font-weight: 650; }
h4, h4[class], .h4 { font-size: 1rem; font-weight: 650; }
h5, .h5 { font-size: .9375rem; font-weight: 650; }
h6, .h6 { font-size: .875rem; font-weight: 650; }
p { line-height: 1.55; }
a { text-underline-offset: .15em; }
.text-muted { color: var(--color-text-muted) !important; }
.small { font-size: var(--fs-small); }
.app-layout { min-height: 100vh; }

/* ══════════════════════════════════════════════════════════════════════
   3. COMPOSANTS — source unique de style (tous templates)
   ══════════════════════════════════════════════════════════════════════ */

/* --- Page header : titre + description + actions --- */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap;
}
.page-header .page-title { font-size: var(--fs-h1); font-weight: 700; margin: 0; }
.page-header .page-subtitle { color: var(--color-text-muted); font-size: var(--fs-small); margin: .2rem 0 0; }
.page-header .page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* --- Boutons --- */
.btn {
  --bs-btn-font-size: .875rem; --bs-btn-border-radius: var(--radius-sm);
  font-weight: 600; padding: .5rem 1rem; transition: all .15s ease;
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
.nav-link:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid rgba(230, 57, 70, .45); outline-offset: 2px;
}
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
.btn-success { --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
  --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: rgba(230, 57, 70, .45);
  --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); }
.btn-secondary { --bs-btn-bg: var(--secondary); --bs-btn-border-color: var(--secondary); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; --bs-btn-border-radius: var(--radius-sm); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }

/* --- Formulaires --- */
.form-label { font-size: var(--fs-small); font-weight: 600; color: var(--color-text); margin-bottom: .3rem; }
.form-label .text-danger, label .required { color: var(--primary); }
.form-control, .form-select {
  border-color: var(--color-border); border-radius: var(--radius-sm);
  font-size: .875rem; padding: .5rem .75rem; background-color: var(--color-surface);
}
.form-control:hover, .form-select:hover { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus {
  border-color: rgba(230, 57, 70, .55); box-shadow: 0 0 0 .18rem rgba(230, 57, 70, .12);
}
.form-control::placeholder { color: #9aa5b5; }
.form-control[aria-invalid="true"], .is-invalid { border-color: var(--danger) !important; }
.invalid-feedback { color: var(--danger); font-size: var(--fs-caption); }
.form-text, .form-help { color: var(--color-text-muted); font-size: var(--fs-caption); }
.input-group-text { border-color: var(--color-border); background: var(--color-surface-alt); font-size: .85rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: rgba(230, 57, 70, .5); box-shadow: 0 0 0 .15rem rgba(230, 57, 70, .15); }
.form-section-title {
  font-size: var(--fs-caption); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted);
  padding-bottom: .4rem; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-3);
}
.form-actions {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* --- Tableaux --- */
.table { --bs-table-bg: transparent; font-size: .875rem; color: var(--color-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--color-border); }
.table thead th {
  background: var(--color-surface-alt); color: var(--color-text-muted);
  font-size: var(--fs-caption); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover > tbody > tr:hover > * { background: rgba(230, 57, 70, .035); color: var(--color-text); }
.table-middle { vertical-align: middle; }
.table a { font-weight: 600; }
.table-responsive { border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.table-empty { text-align: center; color: var(--color-text-muted); padding: var(--space-6) !important; }

/* --- Cards --- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-header {
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  padding: .85rem 1.1rem; font-weight: 650; font-size: .9rem;
}
.card-body { padding: 1.1rem; }
.card-footer { background: var(--color-surface-alt); border-top: 1px solid var(--color-border); }
.card-title { font-size: var(--fs-h3); font-weight: 650; margin-bottom: .5rem; }
.card-soft { box-shadow: var(--shadow-md); border: none; }

/* --- Badges / statuts (système unique) --- */
.badge {
  font-weight: 650; font-size: .68rem; letter-spacing: .03em;
  padding: .3em .65em; border-radius: var(--radius-sm); vertical-align: middle;
}
.badge.bg-success { background: rgba(22, 163, 74, .12) !important; color: #15803d !important; }
.badge.bg-danger { background: rgba(220, 38, 38, .12) !important; color: #b91c1c !important; }
.badge.bg-warning { background: rgba(217, 119, 6, .14) !important; color: #b45309 !important; }
.badge.bg-info { background: rgba(8, 145, 178, .12) !important; color: #0e7490 !important; }
.badge.bg-primary { background: var(--primary-soft) !important; color: var(--primary-dark) !important; }
.badge.bg-secondary { background: #eef1f5 !important; color: var(--color-text-muted) !important; }
.badge-neutral { background: #eef1f5; color: var(--color-text-muted); }
.badge-active { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge-suspended { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.badge-pending { background: rgba(217, 119, 6, .14); color: #b45309; }
.badge.bg-warning.text-dark { color: #b45309 !important; }
.badge.bg-light.text-dark { background: var(--color-surface-alt) !important; color: var(--color-text) !important; }

/* --- Alertes / messages flash --- */
.alert {
  border-radius: var(--radius-md); font-size: .875rem; border: 1px solid transparent;
  padding: .8rem 1rem;
}
.alert-success { background: rgba(22, 163, 74, .09); color: #166534; border-color: rgba(22, 163, 74, .25); }
.alert-danger, .alert-error { background: rgba(220, 38, 38, .09); color: #991b1b; border-color: rgba(220, 38, 38, .25); }
.alert-warning { background: rgba(217, 119, 6, .1); color: #92400e; border-color: rgba(217, 119, 6, .28); }
.alert-info { background: rgba(8, 145, 178, .09); color: #155e75; border-color: rgba(8, 145, 178, .25); }
.flash-messages .alert { box-shadow: var(--shadow-sm); }
.flash-messages .alert::before {
  content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  margin-right: .55rem; opacity: .75;
}
.flash-messages .alert-danger::before { content: '\f071'; }
.flash-messages .alert-warning::before { content: '\f071'; }
.flash-messages .alert-info::before { content: '\f05a'; }

/* --- Modales --- */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header {
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem; font-weight: 650;
}
.modal-title { font-size: 1rem; }
.modal-body { padding: 1.25rem; }
.modal-footer {
  background: var(--color-surface-alt); border-top: 1px solid var(--color-border);
  padding: .85rem 1.25rem;
}
.modal-header .btn-close { padding: .5rem; margin: -.25rem -.25rem -.25rem auto; }

/* --- Dropdowns --- */
.dropdown-menu {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: .4rem; font-size: .875rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: .45rem .7rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--primary-soft); color: var(--primary-dark); }
.dropdown-divider { border-color: var(--color-border); }

/* --- Pagination --- */
.pagination { gap: .25rem; }
.page-link {
  border-radius: var(--radius-sm) !important; border: 1px solid var(--color-border);
  color: var(--color-text); font-size: .85rem; font-weight: 600; margin: 0 .1rem;
}
.page-link:hover { background: var(--primary-soft); border-color: rgba(230, 57, 70, .3); color: var(--primary-dark); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-item.disabled .page-link { color: var(--neutral); background: var(--color-surface-alt); }

/* --- Breadcrumbs --- */
.breadcrumb { font-size: var(--fs-small); gap: .35rem; margin-bottom: 0; }
.breadcrumb-item { color: var(--color-text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--neutral); }
.breadcrumb-item a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb-item.active { color: var(--color-text); font-weight: 600; }

/* --- États vides (globaux) --- */
.empty-state { padding: var(--space-6) var(--space-4); text-align: center; color: var(--neutral); }
.empty-state .empty-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1rem;
  background: var(--color-surface-alt); display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; color: #cbd5e1;
}
.empty-state .empty-title { font-size: 1rem; font-weight: 650; color: var(--color-text-muted); margin-bottom: .35rem; }
.empty-state .empty-text { font-size: var(--fs-small); max-width: 420px; margin: 0 auto 1rem; }
.empty-state .btn { margin-top: .25rem; }

/* --- Stat cards (KPI) --- */
.stat-card { border: 1px solid var(--color-border); transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) !important; }
.stat-card .stat-label {
  font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--color-text-muted); margin-bottom: .3rem;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--color-text); line-height: 1.1; }
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-icon-primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon-success { background: rgba(22, 163, 74, .1); color: var(--success); }
.stat-icon-danger { background: rgba(220, 38, 38, .1); color: var(--danger); }
.stat-icon-warning { background: rgba(217, 119, 6, .12); color: var(--warning); }
.stat-icon-info { background: rgba(8, 145, 178, .1); color: var(--info); }
.stat-icon-secondary { background: #eef1f5; color: var(--secondary); }

/* --- Chips / icônes utilitaires (remplace les style= inline) --- */
.icon-chip {
  width: 40px; height: 40px; border-radius: var(--radius-md); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: .95rem;
}
.icon-chip-sm { width: 32px; height: 32px; font-size: .8rem; border-radius: var(--radius-sm); }
.chip-primary { background: #e8f4fd; color: var(--primary); }
.chip-danger { background: #fde8e8; color: var(--danger); }
.chip-success { background: #e6f7ee; color: var(--success); }
.chip-warning { background: #fdf3e3; color: var(--warning); }
.chip-info { background: #e0f4f8; color: var(--info); }
.chip-secondary { background: #eef1f5; color: var(--secondary); }
.max-w-400 { max-width: 400px; margin-left: auto; margin-right: auto; }

/* --- Chargement / spinner --- */
.spinner {
  width: 1rem; height: 1rem; border-width: 2px; border-radius: 50%;
  display: inline-block; vertical-align: -.15em;
}
.btn-loading { position: relative; pointer-events: none; opacity: .75; }
.btn-loading .spinner { display: inline-block; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: var(--space-6); color: var(--color-text-muted); }

/* --- Pages d'erreur (403/404/429/500) --- */
.error-page { max-width: 480px; margin: 0 auto; }
.error-page .error-icon { font-size: 4.5rem; opacity: .55; margin-bottom: 1rem; }
.error-page .error-code { font-size: 4.5rem; font-weight: 800; line-height: 1; margin-bottom: .5rem; }
.error-page .error-title { font-size: 1.25rem; font-weight: 650; color: var(--color-text); margin-bottom: .75rem; }
.error-page .error-text { color: var(--color-text-muted); font-size: var(--fs-small); margin-bottom: 1.5rem; }
.error-404 .error-code { color: var(--warning); }
.error-403 .error-code { color: var(--danger); }
.error-429 .error-code { color: var(--warning); }
.error-500 .error-code { color: var(--danger); }

/* --- App shell macro (en-tête d'application interne) --- */
.app-shell { padding: 0; }
.app-header {
  display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem;
  background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.app-header-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.app-header-title { font-size: 1.15rem; font-weight: 700; color: var(--color-text); margin: 0; }
.app-header-badge { font-size: .66rem; padding: .2rem .55rem; border-radius: 999px; font-weight: 650; }
.app-tabs {
  display: flex; gap: 0; padding: 0 1.5rem; background: var(--color-surface);
  border-bottom: 1px solid var(--color-border); overflow-x: auto;
}
.app-tab {
  padding: .75rem 1rem; font-size: .85rem; font-weight: 600; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none;
}
.app-tab:hover { color: var(--color-text); }
.app-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }
.app-tab i { font-size: .8rem; }
.app-search { position: relative; margin-left: auto; }
.app-search input { width: 200px; border-radius: var(--radius-md); }
.app-content {
  padding: var(--space-5); background: var(--color-surface-alt);
  min-height: calc(100vh - 200px); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.app-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.app-tab-badge { font-size: .62rem; font-weight: 700; }
.app-stat-value { font-size: 1.5rem; line-height: 1.1; }
.app-stat-label { font-size: var(--fs-small); }
.app-filter-select { width: auto; min-width: 150px; }
.app-filter-search { width: 200px; }
.app-filter-input { width: 160px; }
@media (max-width: 768px) {
  .app-header { padding: .75rem 1rem; }
  .app-tabs { padding: 0 .5rem; }
  .app-tab { padding: .6rem .75rem; font-size: .8rem; }
  .app-content { padding: 1rem; }
  .app-search input { width: 140px; }
}

/* ══════════════════════════════════════════════════════════════════════
   4. LAYOUT — Sidebar / Header (organisation B.2.7 préservée)
   ══════════════════════════════════════════════════════════════════════ */
/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}
.sidebar .nav-link {
  color: rgba(255,255,255,.7);
  padding: .5rem .75rem;
  border-radius: .5rem;
  transition: background .2s, color .2s, transform .2s;
  font-size: .9rem;
  display: flex;
  align-items: center;
  border-left: 3px solid transparent;
}
.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  transform: translateX(2px);
}
.sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(230,57,70,.25), rgba(230,57,70,.08));
  border-left: 3px solid var(--primary);
  font-weight: 600;
}
.sidebar .nav-link:focus-visible,
.sidebar-section-header:focus-visible {
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: 2px;
}
.sidebar .nav-link .sidebar-item-icon { width: 18px; margin-right: .6rem; text-align: center; font-size: .85rem; opacity: .85; }
.sidebar .nav-link.active .sidebar-item-icon { opacity: 1; color: var(--primary); }

/* Sidebar — En-tete mode global */
.sidebar-global-header { margin-bottom: .5rem; }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: 1rem .9rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-header + .sidebar-nav { margin-top: .5rem; }
.sidebar-brand-link { color: #fff; }
.sidebar-brand-link:hover { color: #fff; }
.sidebar-close {
  background: transparent; border: none; color: rgba(255,255,255,.6);
  font-size: 1rem; padding: .25rem .5rem;
}
.sidebar-close:hover { color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 .75rem 1rem; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.sidebar-footer {
  padding: .6rem .75rem .75rem; border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
}
.sidebar-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .5rem; margin-bottom: .35rem;
  border-radius: .5rem; background: rgba(255,255,255,.05);
}
.sidebar-user-avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.sidebar-user-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-user-name { color: #fff; font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-mail { color: rgba(255,255,255,.4); font-size: .62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout {
  color: rgba(255,255,255,.65) !important;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .5rem; justify-content: center;
  font-size: .82rem; padding: .4rem .75rem !important;
}
.sidebar-logout:hover { color: #fff !important; background: rgba(230,57,70,.25) !important; border-color: rgba(230,57,70,.5); }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.4);
}
.sidebar-backdrop.show { display: block; }
.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--primary); color: #fff;
  font-size: .85rem; flex-shrink: 0;
}
.sidebar-brand { font-size: .95rem; color: #fff; }
.sidebar-brand-sub { font-size: .65rem; color: rgba(255,255,255,.4); }

/* Sidebar — En-tete mode domaine */
.sidebar-domain-header {
  display: block; padding: .6rem .75rem;
  border-radius: .5rem; text-decoration: none; color: #fff;
  transition: all .2s; margin-bottom: .5rem;
}
.sidebar-domain-header:hover { opacity: .9; transform: translateX(-2px); }
.sidebar-domain-icon { width: 30px; height: 30px; font-size: .8rem; flex-shrink: 0; }
.sidebar-domain-name { font-size: .8rem; line-height: 1.1; }
.sidebar-domain-sub { font-size: .6rem; color: rgba(255,255,255,.4); }
.sidebar-domain-arrow { font-size: .6rem; color: rgba(255,255,255,.3); }

/* Sidebar — Titre de domaine (pas pliable) */
.sidebar-domain-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: .5rem .75rem .25rem;
  display: flex; align-items: center;
}

/* Sidebar — Point colore pour les sections */
.sidebar-section-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0; margin-right: .5rem;
}
.sidebar-section-header h6 { color: rgba(255,255,255,.6); }

/* Sidebar — Raccourci domaine */
.sidebar-domain-link {
  display: flex !important; align-items: center; gap: .25rem;
  padding-left: .5rem !important;
}
.sidebar-domain-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-domain-link-arrow {
  margin-left: auto; font-size: .6rem;
  color: rgba(255,255,255,.2); transition: transform .2s, color .2s;
}
.sidebar-domain-link:hover .sidebar-domain-link-arrow {
  color: rgba(255,255,255,.5); transform: translateX(2px);
}

/* Sidebar — Retour vue globale */
.sidebar-back-link {
  color: rgba(255,255,255,.9) !important;
  font-weight: 600;
  border-left: 3px solid var(--primary);
  background: rgba(255,255,255,.08);
}

/* Sidebar — Sections */
.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: .5rem .75rem; border-radius: .5rem;
  margin-top: .35rem; margin-bottom: .125rem;
  transition: background .2s; user-select: none;
}
.sidebar-section-header:hover { background: rgba(255,255,255,.06); }
.sidebar-section-header h6 {
  margin: 0; display: flex; align-items: center;
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: rgba(255,255,255,.45);
}
.sidebar-section-header .chevron { font-size: .65rem; color: rgba(255,255,255,.3); transition: transform .25s; margin-left: auto; }
.sidebar-section-header .chevron.open { transform: rotate(180deg); }
.sidebar-collapse { overflow: hidden; transition: max-height .3s ease; max-height: 0; }
.sidebar-collapse.open { max-height: 800px; }
.sidebar-collapse .nav-item:first-child { margin-top: .25rem; }
.sidebar-section:first-child .sidebar-section-header { margin-top: .5rem; }

/* ===== Content ===== */
.content {
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
  min-height: 100vh;
}
.navbar-top {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
  padding: .45rem 1.5rem;
  margin: -1.5rem -1.5rem 1.5rem;
  position: sticky; top: 0; z-index: 990;
}
.navbar-top .page_title, .navbar-top #page_title { font-weight: 650; }
.navbar-top .btn-link.text-dark { color: var(--color-text) !important; }
.navbar-top .btn-link:hover { background: var(--color-surface-alt); }
.navbar-top .dropdown-menu { margin-top: 1.25rem; }
.avatar-initials {
  width: 30px; height: 30px; font-size: .72rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  transition: transform .2s;
}
.avatar-initials:hover { transform: scale(1.08); }

/* ===== App Switcher (topbar) ===== */
.app-switcher-btn {
  border-radius: .5rem; font-size: .8rem;
  border: 1px solid #e5e7eb;
}
.app-switcher-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.app-switcher-dropdown {
  min-width: 260px; padding: 0;
}
.app-switcher-header {
  padding: .6rem .8rem .3rem;
  border-bottom: 1px solid #f1f3f5;
}
.app-switcher-header small {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .04em;
}
.app-switcher-divider {
  height: 1px; background: #e9ecef; margin: .25rem 0;
}
.app-switcher-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .8rem; text-decoration: none;
  color: inherit; transition: background .1s;
  border-left: 3px solid transparent;
}
.app-switcher-item:hover {
  background: #f8f9fa; text-decoration: none; color: inherit;
}
.app-switcher-item.active {
  background: #f0f4ff; border-left-color: var(--ds-primary, #3b82f6);
}
.app-switcher-item-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.app-switcher-item-info {
  flex: 1; min-width: 0;
}
.app-switcher-item-name {
  display: block; font-size: .85rem; font-weight: 600; color: #1f2937;
}
.app-switcher-item small {
  font-size: .7rem;
}
.app-switcher-item .fa-check {
  font-size: .75rem; flex-shrink: 0;
}

/* Notifications */
.notif-dropdown {
  width: 520px;
  max-height: min(450px, calc(100vh - var(--header-height) - 3rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}
.notif-table-wrap { font-size: .8rem; }
.notif-table-head {
  display: grid;
  grid-template-columns: 110px 100px 1fr;
  gap: .5rem;
  padding: .5rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6b7280;
  position: sticky;
  top: 0;
  z-index: 1;
}
.notif-row {
  display: grid;
  grid-template-columns: 110px 100px 1fr;
  gap: .5rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  cursor: pointer;
  align-items: center;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: #f8f9fa; }
.notif-row.unread { background: #fff5f5; }
.notif-row.unread:hover { background: #fee2e2; }
.notif-col-source {
  white-space: nowrap;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-col-date {
  white-space: nowrap;
  font-size: .72rem;
  color: #9ca3af;
}
.notif-col-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4b5563;
}
.notif-badge { position: absolute; top: -4px; right: -6px; font-size: .6rem; padding: .15em .45em; }
@media (max-width: 576px) {
  .notif-dropdown { width: 100vw; max-width: 360px; }
  .notif-table-head, .notif-row { grid-template-columns: 90px 1fr; }
  .notif-col-date { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .content { margin-left: 0; }
}

@media (min-width: 769px) {
  .sidebar-backdrop { display: none !important; }
  .sidebar-close { display: none; }
}

/* Flash messages */
.flash-messages { position: fixed; top: calc(var(--header-height) + 1rem); right: 1rem; z-index: 9999; max-width: 420px; }
.flash-messages .alert { animation: slideInRight .3s ease; box-shadow: 0 4px 12px rgba(0,0,0,.12); border: none; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Password */
.password-toggle { cursor: pointer; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 5; color: #6c757d; }
.password-toggle:hover { color: #343a40; }
.password-wrapper { position: relative; }
.password-strength-bar { height: 4px; border-radius: 2px; transition: all .3s; margin-top: 4px; background: #e9ecef; overflow: hidden; }
.password-strength-bar .fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; }
.password-strength-text { font-size: .75rem; margin-top: 2px; }

/* Avatars & stats */
.avatar-initials { transition: transform .2s; }
.avatar-initials:hover { transform: scale(1.1); }
.stat-card { transition: transform .2s, box-shadow .2s; cursor: pointer; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #e9ecef 25%, #f5f6fa 50%, #e9ecef 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 1.2rem; width: 60%; margin-bottom: .5rem; }
.skeleton-badge { height: 1.2rem; width: 4rem; display: inline-block; }

/* Loading */
.btn-loading { position: relative; pointer-events: none; opacity: .8; }
.btn-loading::after { content: ''; position: absolute; inset: 0; background: inherit; border-radius: inherit; }
.btn-loading .spinner { display: inline-block; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Card components (create.html etc.) ===== */
.card-create {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  overflow: hidden;
}
.card-create .card-header-create {
  background: linear-gradient(135deg, #b91c1c 0%, #e63946 100%);
  padding: .9rem 1.25rem .9rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.card-create .card-header-create h5 { color: #fff; margin: 0; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .6rem; padding-left: .3rem; }
.card-create .card-header-create h5 i { width: 1.4rem; text-align: center; display: inline-block; }
.card-create .card-header-create p { color: rgba(255,255,255,.65); font-size: .85rem; margin: .25rem 0 0; }
.card-create .card-body { padding: 1rem 1.25rem; }

/* Form */
.section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  padding-bottom: .5rem;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 1rem;
}
.form-label-custom {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .25rem;
}
.form-control-custom, .form-select-custom {
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-size: .875rem;
  padding: .5rem .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control-custom:focus, .form-select-custom:focus {
  border-color: #e63946;
  box-shadow: 0 0 0 3px rgba(230,57,70,.12);
}
.form-text-custom { font-size: .75rem; color: #9ca3af; margin-top: .25rem; }

/* Buttons */
.btn-create {
  background: #e63946;
  border: none;
  color: #fff;
  padding: .5rem 2rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .875rem;
  transition: background .15s;
}
.btn-create:hover { background: #b91c1c; color: #fff; }

/* Info card */
.info-card {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: .5rem;
  padding: .75rem 1rem;
}

/* Module groups */
.mod-group-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6b7280;
  margin-bottom: .5rem;
  padding-left: .15rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.mod-group-label i { color: #e63946; font-size: .85rem; width: 1.1rem; text-align: center; }
.form-switch .form-check-input { width: 2.2em; }
.form-switch .form-check-label { font-size: .8rem; padding-top: .05rem; }

/* Plan options */
.plan-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
}
.plan-option .badge-plan { font-size: .7rem; font-weight: 600; }
.help-icon { color: #9ca3af; font-size: .75rem; cursor: help; }

/* ===== Admin roles ===== */
.role-card { transition: transform .2s, box-shadow .2s; border-radius: .75rem !important; }
.role-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.08) !important; }
.permissions-preview { display: flex; flex-wrap: wrap; gap: .4rem; }
.perm-module-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: 999px;
  background: #f1f5f9; color: #475569; font-size: .75rem;
}
.perm-module-tag .perm-count { font-size: .65rem; color: #94a3b8; }
.modal-content { border-radius: 1rem; border: none; }
.modal-header { border-radius: 1rem 1rem 0 0; }

/* ===== Home Page ===== */
.home-kpi-card { transition: transform .15s, box-shadow .15s; }
.home-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08) !important; }
.home-app-card {
  padding: .5rem .75rem;
  border-radius: .5rem;
  border: 1px solid #e9ecef;
  transition: all .15s;
  white-space: nowrap;
}
.home-app-card:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: inherit;
}

/* ===== Domain Banner ===== */
.domain-banner { transition: box-shadow .2s; }
.domain-banner:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.06); }

/* ===== Domain Launcher ===== */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.domain-tile {
  background: #fff;
  border: none;
  border-radius: 1rem;
  padding: 1.75rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.domain-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.1);
  color: inherit;
}
.domain-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .85rem;
  transition: transform .2s;
}
.domain-tile:hover .domain-icon {
  transform: scale(1.08);
}
.domain-tile h6 {
  margin: 0 0 .25rem;
  font-weight: 600;
  font-size: .95rem;
}
.domain-tile .text-muted {
  font-size: .8rem;
}
@media (max-width: 992px) {
  .domain-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .domain-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .domain-tile { padding: 1.25rem 1rem; }
  .domain-icon { width: 52px; height: 52px; font-size: 1.25rem; }
}
@media (max-width: 576px) {
  .domain-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .domain-tile { padding: 1rem .75rem; }
}

/* ===== Mobile / PWA ===== */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 1050; transform: translateX(-100%); transition: transform .3s; }
  .sidebar.show { transform: translateX(0); }
  .app-layout { padding-left: 0 !important; }
  .container-fluid { padding-left: 12px; padding-right: 12px; }
  .table-responsive { font-size: .85rem; }
  .card-body { padding: .75rem; }
  h4 { font-size: 1.1rem; }
  .btn-sm { font-size: .8rem; padding: .25rem .5rem; }
  .modal-dialog { margin: .5rem; }
  #pwa-install-banner { font-size: .9rem; }
}
@media (max-width: 576px) {
  .row.g-3 > [class*="col-"] { flex: 0 0 50%; max-width: 50%; }
  .d-flex.justify-content-between { flex-wrap: wrap; gap: .5rem; }
}

/* ===== Wizard création Compte Client ===== */
.wizard-steps { position: relative; }
.wizard-steps .progress { top: 14px; height: 4px; background: #e5e7eb; }
.wizard-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  box-shadow: 0 0 0 3px #fff;
}
.wizard-step.is-done .wizard-step-dot { background: #16a34a !important; color: #fff !important; }
.wizard-step.is-current .wizard-step-dot { background: var(--primary) !important; color: #fff !important; box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(230,57,70,.25); }
.wizard-step.is-todo .wizard-step-dot { background: #f3f4f6; color: #9ca3af; border: 1px solid #e5e7eb; }
.wizard-step-label { font-size: .7rem; color: #9ca3af; }
.wizard-step.is-current .wizard-step-label { color: var(--primary); font-weight: 700; }
.wizard-step.is-done .wizard-step-label { color: #16a34a; }
.wizard-card .card-header { background: #fff; border-bottom: 1px solid #f1f5f9; }
.wizard-step-title { display: flex; align-items: center; gap: .6rem; }
.wizard-step-title .icon-bubble {
  width: 36px; height: 36px; border-radius: .6rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(230,57,70,.1); color: var(--primary); font-size: .95rem;
}
.plan-option { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.plan-option:hover { transform: translateY(-3px); box-shadow: var(--ds-shadow); border-color: var(--primary); }
.plan-option:has(input:checked) { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(230,57,70,.15); }
.module-switch {
  border: 1px solid #e5e7eb; border-radius: .75rem; padding: .75rem .9rem;
  background: #fff; transition: border-color .15s, background .15s; height: 100%;
}
.module-switch:hover { border-color: var(--primary); }
.module-switch:has(input:checked) { border-color: var(--primary); background: rgba(230,57,70,.04); }
.module-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.wizard-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; border-top: 1px solid #f1f5f9; padding-top: 1rem; margin-top: 1.25rem;
}
.recap-item { border: 1px solid #eef2f7; border-radius: .75rem; height: 100%; background: #fbfcfe; }
.recap-item .recap-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.recap-item .recap-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 700; }
.recap-edit { font-size: .72rem; padding: .15rem .5rem; }

/* ===== Liste Comptes clients ===== */
.cc-stat-card { border: 0; border-radius: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.cc-stat-card .cc-stat-icon {
  width: 42px; height: 42px; border-radius: .75rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.cc-search-wrap { position: relative; }
.cc-search-wrap i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: .85rem; }
.cc-search-wrap input { padding-left: 2.3rem; border-radius: 2rem; }
.cc-empty-state { padding: 3rem 1rem; text-align: center; color: #94a3b8; }
.cc-empty-state .cc-empty-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1rem;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #cbd5e1;
}
.cc-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(230,57,70,.12); color: var(--primary);
  font-size: .75rem; font-weight: 700; margin-right: .55rem;
}
@media (max-width: 768px) {
  .wizard-step-label { display: none; }
  .wizard-steps .progress { top: 12px; }
}

/* ===== CC detail : hero header ===== */
.cc-hero {
  background: linear-gradient(120deg, #1e293b 0%, #334155 55%, #7f1d1d 130%);
  border-radius: .9rem; padding: 1.25rem 1.4rem; color: #e2e8f0;
  box-shadow: 0 10px 25px -12px rgba(30,41,59,.55); position: relative; overflow: hidden;
}
.cc-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(230,57,70,.35), transparent 70%); border-radius: 50%; pointer-events: none;
}
.cc-hero-avatar {
  width: 58px; height: 58px; border-radius: 1rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: .04em;
}
.cc-hero-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .45rem; font-size: .78rem; color: #cbd5e1; }
.cc-hero .badge { font-weight: 600; }
.btn-cc-action {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: .55rem; font-weight: 600; font-size: .78rem;
}
.btn-cc-action:hover { background: rgba(255,255,255,.24); color: #fff; transform: translateY(-1px); }
.btn-cc-action-danger { background: rgba(220,38,38,.35); border-color: rgba(248,113,113,.55); }
.btn-cc-action-danger:hover { background: rgba(220,38,38,.65); }
.btn-cc-action-success { background: rgba(22,163,74,.35); border-color: rgba(74,222,128,.55); }
.btn-cc-action-success:hover { background: rgba(22,163,74,.6); }

/* ===== CC detail : onglets ===== */
.cc-tabs { border-bottom: 2px solid #eef1f5; gap: .15rem; }
.cc-tabs .nav-link {
  border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: #64748b; font-weight: 600; font-size: .86rem; padding: .55rem .8rem;
  border-radius: .45rem .45rem 0 0; background: transparent;
}
.cc-tabs .nav-link:hover { color: var(--primary); background: rgba(230,57,70,.06); border-bottom-color: rgba(230,57,70,.35); }
.cc-tabs .nav-link.active {
  color: var(--primary); background: transparent;
  border-bottom-color: var(--primary); box-shadow: none;
}
.cc-tabs .nav-link i { font-size: .8rem; }

/* ===== CC detail : KPI ===== */
.cc-kpi { border-radius: .8rem; transition: transform .15s ease, box-shadow .15s ease; }
.cc-kpi:hover { transform: translateY(-2px); box-shadow: 0 .6rem 1.2rem -0.6rem rgba(15,23,42,.25) !important; }
.cc-kpi-icon {
  width: 44px; height: 44px; border-radius: .75rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.cc-kpi-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; color: #0f172a; }
.cc-kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 600; }
.cc-kpi-link { color: #cbd5e1; font-size: .8rem; align-self: center; }
.cc-kpi-link:hover { color: var(--primary); }

/* ===== CC detail : pills / modules / progression ===== */
.cc-entity-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 2rem;
  padding: .38rem .8rem; font-size: .82rem; color: #334155; transition: all .15s ease;
}
.cc-entity-pill:hover { border-color: rgba(230,57,70,.45); background: rgba(230,57,70,.06); color: var(--primary); }
.cc-entity-pill i { color: #94a3b8; font-size: .78rem; }
.cc-module-chip { font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: .35rem .6rem; border-radius: .5rem; }
.cc-progress { background: #eef1f5; border-radius: 1rem; overflow: hidden; }
@media (max-width: 768px) {
  .cc-hero-top { flex-direction: column; }
  .cc-hero-top .d-flex.gap-2.flex-wrap { justify-content: flex-start !important; }
  .cc-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ══════════════════════════════════════════════════════════════════════
   5. PAGES — compositions (ex-<style> centralisés ici)
   ══════════════════════════════════════════════════════════════════════ */

/* --- Home / Domaines --- */
.domain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08) !important;
}
.home-app-card {
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: all .15s;
}
.home-app-card:hover { background: var(--color-surface-alt); border-color: #d1d5db; }

/* --- Domain dashboard (couleur dynamique via --domain-color) --- */
.domain-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.domain-app-card {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 1px solid var(--color-border);
  text-decoration: none; color: inherit;
  transition: all .2s;
}
.domain-app-card:hover {
  border-color: color-mix(in srgb, var(--domain-color, #e63946) 30%, transparent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
  transform: translateY(-2px);
  color: inherit;
}
.domain-app-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--domain-color, #e63946) 8%, transparent);
  color: var(--domain-color, #e63946);
  flex-shrink: 0; font-size: 1rem;
}
.domain-app-name { font-weight: 650; font-size: .9rem; color: var(--color-text); }
.domain-app-desc { font-size: var(--fs-caption); color: var(--color-text-muted); }

/* --- Services système --- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.service-card { border-radius: var(--radius-lg); transition: transform .15s, box-shadow .15s; }
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.service-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.service-name { font-size: 1.05rem; font-weight: 650; }
.service-detail { font-size: .82rem; color: var(--color-text-muted); }
.service-hint {
  font-size: .78rem; padding: 6px 12px; border-radius: var(--radius-md);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}

/* --- Préférences notifications --- */
.pref-icon-wrap {
  width: 42px; height: 42px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.table-info-subtle { background-color: #eff6ff; }
.table-danger-subtle { background-color: #fef2f2; }
.table-comfy > :not(caption) > * > * { padding: 1rem 1.25rem; }
.pref-toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pref-toggle-label { font-size: .68rem; color: var(--color-text-muted); font-weight: 500; }
.save-btn-wrap {
  position: sticky; bottom: 0; background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem; z-index: 10;
}

/* --- Utilitaires (remplacent les style= inline) --- */
.badge-xs { font-size: .64rem !important; padding: .2em .5em !important; white-space: nowrap; }
.pulse { animation: pulse 2s infinite; }
.code-block {
  background: var(--color-surface-alt); font-size: .82rem;
  overflow-x: auto; border-radius: var(--radius-md);
}

/* --- Chips dynamiques (couleurs data via --chip-bg / --chip-fg) --- */
.icon-chip-dyn { background: var(--chip-bg, var(--primary-soft)); color: var(--chip-fg, var(--primary)); }
.icon-chip-tiny { width: 36px; height: 36px; font-size: .9rem; border-radius: var(--radius-md); }
.icon-chip-xs { width: 28px; height: 28px; font-size: .7rem; border-radius: 50%; }
.icon-chip-lg { width: 48px; height: 48px; font-size: 1.2rem; }
.icon-chip-xl { width: 56px; height: 56px; font-size: 1.5rem; }
.badge-dyn { background: var(--chip-bg) !important; color: var(--chip-fg) !important; }
.kpi-value-dyn { color: var(--chip-fg); }
.container-home { max-width: 1280px; }
.container-narrow { max-width: 760px; }
.glyph-empty { font-size: 2.5rem; opacity: .3; }
.domain-card { border-color: color-mix(in srgb, var(--domain-color, #e63946) 18%, transparent) !important; transition: all .2s; }
.domain-card .domain-icon-dyn { background: color-mix(in srgb, var(--domain-color, #e63946) 10%, transparent); color: var(--domain-color, #e63946); }
.auth-card { max-width: 520px; }
.form-panel { max-width: 760px; }
.stat-icon-blue { background: #e8f4fd; color: #0284c7; }
.stat-icon-purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon-teal { background: #e0f2f1; color: #0d9488; }
.row-unread { background: #f0f7ff; }
.chart-box { min-height: 280px; }
.chart-box canvas { max-height: 250px; }
.cursor-pointer { cursor: pointer; }
.cell-truncate { max-width: 260px; }
.container-narrow { max-width: 1100px; }
.container-home { max-width: 1280px; } /* alias sécurité */
.avatar-square {
  width: 36px; height: 36px; font-size: .8rem; font-weight: 700;
  border-radius: var(--radius-md); display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-round-sm { width: 32px; height: 32px; }
.text-pre { white-space: pre-wrap; line-height: 1.5; }
.resize-none { resize: none; }
.scroll-y-60 { max-height: 60vh; overflow-y: auto; }
.scroll-y-200 { max-height: 200px; overflow: auto; }
.msg-bubble { max-width: 75%; }
.msg-bubble-wide { max-width: 90%; }
.container-limit { max-width: 1200px; margin-left: auto; margin-right: auto; }
.avatar-circle-36 {
  width: 36px; height: 36px; font-size: .8rem; font-weight: 700;
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.pwa-install-banner {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--sidebar-bg); color: #fff; padding: .75rem 1.25rem;
  z-index: 9999; align-items: center; justify-content: space-between;
}
.avatar-circle-26 {
  width: 26px; height: 26px; font-size: .68rem; font-weight: 700;
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-circle-56 {
  width: 56px; height: 56px; font-size: 1.4rem; font-weight: 700;
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.dot-unread { display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.truncate-200 { max-width: 200px; }
.truncate-250 { max-width: 250px; }
.truncate-300 { max-width: 300px; }
.login-card { width: 400px; max-width: 92vw; }
.login-icon { font-size: 2.5rem; }

/* --- B.2.15 — Page d'action publique (email → lien → confirmation → POST) ---
   Étend base.html : aucun sidebar, topbar, menu utilisateur ou notification.
   Cartouche centré, plein écran, tokens du Design System uniquement. */
.public-action-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-3);
  background: var(--color-bg);
  font-family: var(--font-family);
  font-size: var(--fs-body);
  color: var(--color-text);
}
.public-action-brand { display: flex; align-items: center; gap: var(--space-2); }
.public-action-logo {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
}
.public-action-brand-name { font-weight: 700; font-size: var(--fs-h3); letter-spacing: -.01em; }
.public-action-card {
  width: 100%; max-width: 520px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}
.public-action-card h1 { font-size: var(--fs-h2); font-weight: 700; margin: 0 0 var(--space-3); }
.public-action-lead { color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.public-action-hint { font-size: var(--fs-small); }
.public-action-slot {
  display: inline-block; font-weight: 700; color: var(--color-text);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .1rem .45rem; white-space: nowrap;
}
.public-action-icon { font-size: 2rem; margin-bottom: var(--space-2); }
.public-action-icon-success { color: var(--success); }
.public-action-icon-warning { color: var(--warning); }
.public-action-icon-danger { color: var(--danger); }
.public-action-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
/* Mobile : boutons pleine largeur, cibles tactiles confortables. */
.public-action-actions .btn { flex: 1 1 100%; }
@media (min-width: 576px) {
  .public-action-actions .btn { flex: 0 1 auto; }
}
.box-soft { background: var(--color-surface-alt); min-height: 60px; }
.box-selected { background: #f0fdf4; border: 1px solid #bbf7d0; }
.notif-row { border-left: 4px solid transparent; }
.notif-row-unread { background: #f0f7ff; border-left-color: var(--notif-color, var(--primary)); }
.min-h-60 { min-height: 60px; }
