/* ================================================
   DENTOS — Design System Premium v3.0
   Style médical moderne • Élégant • Professionnel
   ================================================ */

:root {
  --apex-primary:      #0D7A6E;
  --apex-primary-dark: #0A5F56;
  --apex-primary-light:#E6F4F2;
  --apex-secondary:    #1BAF9E;
  --apex-accent:       #00C2A8;
  --apex-blue:         #0B5FFF;
  --apex-blue-light:   #EEF3FF;
  --apex-violet:       #7C3AED;
  --apex-violet-light: #F3EEFF;
  --apex-amber:        #D97706;
  --apex-amber-light:  #FFFBEB;
  --apex-red:          #DC2626;
  --apex-red-light:    #FEF2F2;
  --apex-green:        #059669;
  --apex-green-light:  #ECFDF5;

  --apex-bg:        #F4F6F9;
  --apex-surface:   #FFFFFF;
  --apex-border:    #E2E8F0;
  --apex-border-light: #F1F5F9;
  --apex-text:      #0F172A;
  --apex-text-2:    #334155;
  --apex-muted:     #64748B;
  --apex-muted-light:#94A3B8;

  --sidebar-w: 242px;
  --sidebar-collapsed-w: 60px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 2px 8px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.05);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.12), 0 4px 12px rgba(15,23,42,0.06);
  --shadow-xl: 0 24px 48px rgba(15,23,42,0.18);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl:24px;
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--apex-bg);
  color: var(--apex-text);
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  line-height: 1.5;
  /* Fix mobile : empêcher fond noir sur mobile */
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ============================================================
   SHELL LAYOUT — Sidebar collapsible
   ============================================================ */
.apex-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--apex-bg);
  transition: grid-template-columns .28s cubic-bezier(.4,0,.2,1);
}

/* Sidebar collapsed sur DESKTOP */
.apex-shell:has(.apex-sidebar.sidebar-collapsed) {
  grid-template-columns: var(--sidebar-collapsed-w) 1fr;
}

.apex-main {
  padding: 24px 28px 56px;
  min-width: 0;
  overflow-x: hidden;
}

/* ── OVERLAY mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 49;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
  .apex-shell {
    grid-template-columns: 1fr !important;
    display: block !important; /* fix décalage mobile */
    width: 100%;
    overflow-x: hidden;
  }
  .apex-sidebar {
    position: fixed; z-index: 50;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); width: var(--sidebar-w) !important;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    height: 100vh;
    overflow-y: auto;
  }
  .apex-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .apex-main {
    padding: 14px 14px 40px;
    padding-top: calc(60px + 14px); /* espace pour la topbar fixe */
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Fix mobile complémentaire — très petits écrans */
@media (max-width: 640px) {
  .apex-main {
    padding: 10px 10px 32px;
    padding-top: calc(56px + 10px);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Topbar fixe sur mobile */
@media (max-width: 1024px) {
  .apex-topbar {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 40;
    width: 100% !important;
  }
}

/* ============================================================
   SIDEBAR — Collapsible
   ============================================================ */
.apex-sidebar {
  background: #fff;
  border-right: 1px solid var(--apex-border);
  padding: 10px 8px 16px;
  position: sticky; top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: width .28s cubic-bezier(.4,0,.2,1), padding .28s;
}

/* ── Sidebar collapsed (desktop) ── */
.apex-sidebar.sidebar-collapsed {
  width: var(--sidebar-collapsed-w);
  padding: 10px 6px 16px;
  overflow: visible;
}
.apex-sidebar.sidebar-collapsed .sidebar-logo-text,
.apex-sidebar.sidebar-collapsed .sidebar-clinic-text,
.apex-sidebar.sidebar-collapsed .nav-label,
.apex-sidebar.sidebar-collapsed .nav-badge,
.apex-sidebar.sidebar-collapsed .sidebar-brand-sub {
  display: none !important;
}
.apex-sidebar.sidebar-collapsed .sidebar-clinic-badge {
  justify-content: center;
  padding: 8px 4px;
}
.apex-sidebar.sidebar-collapsed .sidebar-clinic-dot {
  margin: 0;
}
.apex-sidebar.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  position: relative;
}
.apex-sidebar.sidebar-collapsed .nav-icon {
  width: 20px; font-size: 15px;
}
/* Tooltip au hover en mode collapsed */
.apex-sidebar.sidebar-collapsed .nav-item::after {
  content: attr(title);
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%);
  background: var(--apex-text); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 999;
}
.apex-sidebar.sidebar-collapsed .nav-item:hover::after { opacity: 1; }
.apex-sidebar.sidebar-collapsed .sidebar-header-row {
  flex-direction: column; align-items: center; gap: 8px;
}
.apex-sidebar.sidebar-collapsed .sidebar-logo-wrap {
  padding: 4px; justify-content: center;
}
.apex-sidebar.sidebar-collapsed .sidebar-collapse-btn {
  margin: 0 auto;
}

/* ── Header row (logo + bouton collapse) ── */
.sidebar-header-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* .sidebar-collapse-btn supprimé — le toggle est dans la Topbar */
.sidebar-collapse-btn { display: none !important; }

/* ── Logo ──
   ✅ FIX #1 (mai 2026) : on augmente gap + padding-left du texte
   pour que la partie cachée du logo (couronne dentaire à gauche)
   soit pleinement visible. Le texte « DENTOS » est décalé à droite. */
.sidebar-logo-wrap {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 4px 6px 6px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background .15s;
  flex: 1; min-width: 0;
}
.sidebar-logo-wrap:hover { background: var(--apex-primary-light); }

.sidebar-logo-text { min-width: 0; padding-left: 4px; }

.sidebar-logo-icon {
  width: 44px; height: 44px;
  border-radius: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: visible; flex-shrink: 0;
  box-shadow: none;
}
.sidebar-logo-icon img {
  width: 44px; height: 44px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.sidebar-brand-name {
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -.025em;
  color: var(--apex-text);
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: 9.5px; color: var(--apex-muted);
  line-height: 1.3; margin-top: 1px;
}

/* ── Cabinet badge ── */
.sidebar-clinic-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px;
  background: var(--apex-primary-light);
  border-radius: var(--radius);
  border: 1px solid rgba(13,122,110,.15);
  margin-bottom: 8px;
}
.sidebar-clinic-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--apex-secondary);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(27,175,158,.3);
}
.sidebar-clinic-name { font-size: 12.5px; font-weight: 600; color: var(--apex-text); }
.sidebar-clinic-meta { font-size: 10px; color: var(--apex-primary); }

/* ── Nav items ── */
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.nav-section-label {
  padding: 12px 8px 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--apex-muted-light);
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--apex-text-2);
  text-decoration: none;
  transition: background .14s, color .14s;
  position: relative;
}
.nav-item:hover { background: var(--apex-bg); color: var(--apex-text); }
.nav-item.active {
  background: linear-gradient(135deg, #0D7A6E11, #1BAF9E18);
  color: var(--apex-primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--apex-primary);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 16px; text-align: center;
  font-size: 13px; color: var(--apex-muted);
  flex-shrink: 0; transition: color .14s;
}
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: var(--apex-primary); }
.nav-label { flex: 1; min-width: 0; }
.nav-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  flex-shrink: 0;
}
.badge-ai      { background: linear-gradient(135deg,#7C3AED,#A855F7); color:#fff; }
.badge-wa      { background: linear-gradient(135deg,#25D366,#128C7E); color:#fff; }
.badge-default { background: #F1F5F9; color: var(--apex-muted); }
.nav-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--apex-red); flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff;
}

/* ============================================================
   TOPBAR — Hamburger + Boutons d'action
   ============================================================ */
.glass {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Hamburger (3 lignes) — visible uniquement sur Mobile ── */
.sidebar-toggle-btn {
  display: none; /* masqué par défaut sur desktop */
  flex-direction: column;
  justify-content: center; align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 6px;
  flex-shrink: 0;
  transition: background .14s;
}
.sidebar-toggle-btn:hover { background: var(--apex-bg); }

.burger-line {
  display: block;
  width: 20px; height: 2.5px;
  background: var(--apex-text);
  border-radius: 2px;
  transition: all .2s;
}
.sidebar-toggle-btn:hover .burger-line { background: var(--apex-primary); }

/* ── Bouton collapse Desktop — dans la sidebar ── */
.sidebar-desktop-toggle-btn {
  display: flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--apex-primary-light);
  border: 1px solid rgba(13,122,110,.2);
  border-radius: 8px;
  cursor: pointer;
  color: var(--apex-primary);
  font-size: 13px;
  flex-shrink: 0;
  transition: all .15s;
}
.sidebar-desktop-toggle-btn:hover {
  background: var(--apex-primary);
  color: #fff;
  border-color: transparent;
}

/* Mobile : afficher le hamburger, masquer le desktop toggle dans topbar */
@media (max-width: 1023px) {
  .sidebar-toggle-btn { display: flex !important; }
  .sidebar-desktop-toggle-btn { display: none !important; }
}

/* ============================================================
   TOPBAR SEARCH — Contraint, ne déborde jamais sur la sidebar
   ============================================================ */
.topbar-search-wrap {
  flex: 0 1 420px;
  min-width: 0;
  max-width: 420px;
  position: relative;
}
.topbar-search-input {
  width: 100% !important;
  max-width: 100%;
  padding-left: 36px !important;
  padding-right: 36px !important;
  box-sizing: border-box;
  height: 36px;
  border-radius: 10px;
}
@media (max-width: 1280px) {
  .topbar-search-wrap { flex: 0 1 320px; max-width: 320px; }
}
@media (max-width: 1100px) {
  .topbar-search-wrap { flex: 0 1 240px; max-width: 240px; }
}
@media (max-width: 900px) {
  .topbar-search-wrap { display: none !important; }
}
/* Garantir que la topbar elle-même ne déborde pas */
.apex-topbar {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* ── Fallback hamburger DESKTOP : visible quand sidebar est repliée ── */
/* Quand la sidebar est en mode collapsed, on affiche aussi le hamburger
   topbar pour que l'utilisateur puisse facilement la déplier */
@media (min-width: 1024px) {
  .apex-shell:has(.apex-sidebar.sidebar-collapsed) .sidebar-toggle-btn {
    display: flex !important;
  }
}

/* ── Animation feedback sur le toggle ── */
.sidebar-desktop-toggle-btn:active,
.sidebar-toggle-btn:active {
  transform: scale(0.92);
}
.sidebar-desktop-toggle-btn {
  transition: all .15s, transform .08s;
}

/* ── Le bouton desktop est plus visible ── */
.apex-sidebar.sidebar-collapsed .sidebar-desktop-toggle-btn {
  background: var(--apex-primary);
  color: #fff;
  border-color: transparent;
}

/* ── Topbar action buttons — DENTOS HEADER UNIFIÉ (boutons avec icône + texte) ── */
.topbar-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
  transition: all .15s; white-space: nowrap; line-height: 1;
  min-height: 34px;
}
.topbar-action-btn i { font-size: 13px; }
.topbar-action-btn .topbar-action-label { display: inline; }
/* Garantit l'affichage du libellé sur desktop / tablette ≥768px,
   peu importe le breakpoint Tailwind utilisé dans le JSX */
@media (min-width: 768px) {
  .topbar-action-btn .topbar-action-label { display: inline !important; }
}
/* Mobile <768px : on cache le libellé pour ne garder que l'icône */
@media (max-width: 767.98px) {
  .topbar-action-btn .topbar-action-label { display: none !important; }
  .topbar-action-btn { padding: 7px 9px; }
}
.topbar-btn-rdv {
  background: linear-gradient(135deg, #0D7A6E, #1BAF9E);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,122,110,.3);
}
.topbar-btn-rdv:hover { opacity:.9; box-shadow: 0 4px 12px rgba(13,122,110,.4); }
.topbar-btn-invoice {
  background: #0B5FFF; color: #fff;
  box-shadow: 0 2px 8px rgba(11,95,255,.25);
}
.topbar-btn-invoice:hover { opacity:.9; }
.topbar-btn-patient {
  background: #7C3AED; color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
}
.topbar-btn-patient:hover { opacity:.9; }
/* Bouton Ordonnance — couleur orangée */
.topbar-btn-ordonnance {
  background: linear-gradient(135deg, #EA580C, #F97316);
  color: #fff;
  box-shadow: 0 2px 8px rgba(234,88,12,.3);
}
.topbar-btn-ordonnance:hover { opacity:.9; box-shadow: 0 4px 12px rgba(234,88,12,.4); }

.topbar-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px; border-radius: var(--radius-sm);
  background: none; border: none; cursor: pointer;
  transition: background .14s; position: relative;
}
.topbar-icon-btn:hover { background: var(--apex-bg); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.apex-title    { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--apex-text); line-height: 1.3; }
.apex-title-lg { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--apex-text); }
.apex-subtitle { font-size: 13.5px; color: var(--apex-muted); margin-top: 3px; }
.page-header   { margin-bottom: 24px; }

/* ============================================================
   DASHBOARD — Header row avec Apexy IA inline
   ============================================================ */
.dashboard-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dashboard-header-title { flex-shrink: 0; }

/* Barre Apexy IA compacte inline */
.apexy-inline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
  min-width: 240px;
  max-width: 560px;
  box-shadow: 0 2px 12px rgba(37,99,235,.2);
}
.apexy-inline-avatar {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.apexy-inline-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.apexy-inline-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1;
}
.apexy-inline-msg {
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apexy-inline-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.apexy-inline-btn:hover { background: rgba(255,255,255,0.35); color: #fff; }
.apexy-inline-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color .15s;
}
.apexy-inline-close:hover { color: #fff; background: rgba(255,255,255,0.15); }

@media (max-width: 768px) {
  .dashboard-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .apexy-inline-bar { max-width: 100%; width: 100%; }
  .apexy-inline-msg { white-space: normal; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--apex-surface);
  border: 1px solid var(--apex-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s;
}
.card:hover  { box-shadow: var(--shadow-sm); }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card-elevated { box-shadow: var(--shadow); border-color: transparent; }
.card-compact  { padding: 14px 16px; }
.card-flush    { padding: 0; overflow: hidden; }

/* ============================================================
   KPI CARDS — Compact (Point 4)
   Icône petite en haut gauche, nombre en dessous de l'icône,
   label à droite de l'icône, légende à droite du nombre
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.kpi {
  background: var(--apex-surface);
  border: 1px solid var(--apex-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
  /* Layout horizontal compact */
  display: grid;
  grid-template-areas:
    "icon label"
    "icon value"
    "delta delta";
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 9px;
  row-gap: 1px;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-color, var(--apex-primary));
}

.kpi-icon {
  grid-area: icon;
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  flex-shrink: 0;
  align-self: center;
}
.kpi-label {
  grid-area: label;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--apex-muted);
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  align-self: end;
}
.kpi-value {
  grid-area: value;
  font-size: 18px; font-weight: 800;
  letter-spacing: -.03em; color: var(--apex-text); line-height: 1.1;
  align-self: start;
}
.kpi-delta {
  grid-area: delta;
  font-size: 10.5px; margin-top: 4px;
  display: flex; align-items: center; gap: 3px;
}
.kpi-delta.up     { color: var(--apex-green); }
.kpi-delta.down   { color: var(--apex-red); }
.kpi-delta.neutral{ color: var(--apex-muted); }

/* Ancien layout (non compact) conservé pour rétrocompat */
.kpi-legacy { display: block; padding: 16px 18px; }
.kpi-legacy .kpi-icon { width: 38px; height: 38px; font-size: 15px; margin-bottom: 10px; }
.kpi-legacy .kpi-value { font-size: 22px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--apex-border);
  background: var(--apex-surface);
  color: var(--apex-text);
  cursor: pointer; text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { background: var(--apex-bg); box-shadow: var(--shadow-xs); }

.btn-primary {
  background: linear-gradient(135deg, var(--apex-primary), var(--apex-secondary));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(13,122,110,.3);
}
.btn-primary:hover { opacity: .92; box-shadow: 0 4px 12px rgba(13,122,110,.4); background: linear-gradient(135deg, var(--apex-primary-dark), var(--apex-primary)); }

.btn-blue {
  background: var(--apex-blue); color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(11,95,255,.25);
}
.btn-blue:hover { opacity: .9; }

.btn-danger  { background: var(--apex-red); color: #fff; border-color: transparent; }
.btn-danger:hover { opacity: .9; }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--apex-bg); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 11px 22px; font-size: 14.5px; border-radius: var(--radius); }
.btn-icon { padding: 8px; aspect-ratio: 1; }
.btn-icon.btn-sm { padding: 6px; }

/* ============================================================
   FORMS
   ============================================================ */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--apex-border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--apex-text);
  background: #fff;
  transition: border .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 3px rgba(13,122,110,.12);
}
.input::placeholder { color: var(--apex-muted-light); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.textarea { resize: vertical; min-height: 80px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--apex-text-2); margin-bottom: 5px; display: block; }
.form-group { margin-bottom: 16px; }
.form-hint  { font-size: 11.5px; color: var(--apex-muted); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--apex-red); margin-top: 4px; }
.input-sm, .select-sm { padding: 6px 10px; font-size: 12.5px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  padding: 10px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--apex-muted);
  background: var(--apex-bg);
  border-bottom: 1px solid var(--apex-border);
  white-space: nowrap;
  text-align: left;
}
tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--apex-text-2);
  border-bottom: 1px solid var(--apex-border-light);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFD; }
.table-actions { display: flex; gap: 6px; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  line-height: 1.4; white-space: nowrap;
}
.badge-green   { background: var(--apex-green-light);  color: var(--apex-green); }
.badge-blue    { background: var(--apex-blue-light);   color: var(--apex-blue); }
.badge-amber   { background: var(--apex-amber-light);  color: var(--apex-amber); }
.badge-red     { background: var(--apex-red-light);    color: var(--apex-red); }
.badge-violet  { background: var(--apex-violet-light); color: var(--apex-violet); }
.badge-teal    { background: var(--apex-primary-light);color: var(--apex-primary); }
.badge-gray    { background: #F1F5F9; color: var(--apex-muted); }
.badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

/* ── modal-backdrop (pattern Stock & autres modules) ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal-backdrop.hidden { display: none !important; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { transform: translateY(16px) scale(.97); opacity: .6; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(12px) scale(.98);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }
.modal-header { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--apex-text); }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 0 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-close  { background: none; border: none; font-size: 18px; color: var(--apex-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--apex-bg); color: var(--apex-text); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--apex-text);
  color: #fff;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 400px;
  animation: slideIn .25s ease;
}
.toast-success { background: var(--apex-green); }
.toast-error   { background: var(--apex-red); }
.toast-warning { background: var(--apex-amber); color: #fff; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.animate-in { animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--apex-muted); font-size: 13px; pointer-events: none; }
.search-input { padding-left: 34px !important; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--apex-muted);
}
.empty-state-icon { font-size: 48px; color: var(--apex-border); margin-bottom: 16px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--apex-text-2); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13.5px; }

/* ============================================================
   PAGE HEADER SECTION
   ============================================================ */
.page-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--apex-border);
  margin-bottom: 20px;
}
.tab-item {
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 500;
  color: var(--apex-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.tab-item:hover { color: var(--apex-text); }
.tab-item.active { color: var(--apex-primary); border-bottom-color: var(--apex-primary); font-weight: 600; }

/* ============================================================
   ALERTS / NOTICE
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; display: flex; align-items: flex-start; gap: 10px; }
.alert-info    { background: var(--apex-blue-light);   border-left: 3px solid var(--apex-blue); }
.alert-success { background: var(--apex-green-light);  border-left: 3px solid var(--apex-green); }
.alert-warning { background: var(--apex-amber-light);  border-left: 3px solid var(--apex-amber); }
.alert-danger  { background: var(--apex-red-light);    border-left: 3px solid var(--apex-red); }

/* ============================================================
   UTILS
   ============================================================ */
.divider { height: 1px; background: var(--apex-border); margin: 16px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--apex-muted); }
.text-small { font-size: 12px; }
.font-mono  { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--apex-border);
  background: var(--apex-surface);
  color: var(--apex-text-2);
  cursor: pointer; text-decoration: none;
  transition: all .14s;
}
.page-btn:hover { background: var(--apex-bg); }
.page-btn.active { background: var(--apex-primary); color: #fff; border-color: var(--apex-primary); }
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress { height: 6px; background: var(--apex-bg); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--apex-primary); border-radius: 99px; transition: width .5s ease; }
.progress-sm { height: 4px; }
.progress-lg { height: 8px; }

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--apex-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 50;
  padding: 4px 0;
  overflow: hidden;
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 13px; color: var(--apex-text-2);
  cursor: pointer; transition: background .12s;
  text-decoration: none; border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--apex-bg); }
.dropdown-item.danger { color: var(--apex-red); }
.dropdown-item.danger:hover { background: var(--apex-red-light); }
.dropdown-divider { height: 1px; background: var(--apex-border); margin: 4px 0; }

/* ============================================================
   CALENDAR / AGENDA SPECIFICS
   ============================================================ */
.fc .fc-toolbar-title { font-size: 17px; font-weight: 700; }
.fc .fc-button { border-radius: var(--radius-sm) !important; font-size: 12.5px !important; font-weight: 600 !important; }
.fc .fc-button-primary { background: var(--apex-primary) !important; border-color: var(--apex-primary) !important; }
.fc .fc-event { border-radius: 5px !important; border: none !important; padding: 2px 6px !important; font-size: 12px !important; }
.fc-today-button { text-transform: capitalize !important; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0A5F56 0%, #0D7A6E 40%, #1BAF9E 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl);
  position: relative;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #0D7A6E, #1BAF9E);
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  box-shadow: 0 8px 24px rgba(13,122,110,.35);
  margin-bottom: 12px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0A5F56 0%, #0D7A6E 50%, #1BAF9E 100%);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 60px 20px;
  position: relative; overflow: hidden;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .apex-sidebar, header, .btn, .no-print { display: none !important; }
  .apex-shell { grid-template-columns: 1fr; }
  .apex-main  { padding: 0; }
  .card { box-shadow: none; border: 1px solid #e5e7eb; }
}

/* ============================================================
   DARK MODE (préparation)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  /* À activer si dark mode demandé */
}

/* ============================================================
   AGENDA — Vue Jour & Semaine améliorées (Point 9)
   ============================================================ */
.agenda-grid {
  display: grid;
  grid-template-columns: 60px repeat(var(--cols, 1), 1fr);
  border: 1px solid var(--apex-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 12px;
}

.agenda-head {
  background: #F8FAFC;
  border-bottom: 2px solid var(--apex-border);
  border-right: 1px solid var(--apex-border-light);
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  color: var(--apex-muted);
}
.agenda-head.today { background: #EEF8FF; color: var(--apex-blue); }
.agenda-head .day-num {
  font-size: 18px; font-weight: 800; color: var(--apex-text); line-height: 1;
}
.agenda-head.today .day-num {
  background: var(--apex-blue); color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}

.agenda-time {
  background: #F8FAFC;
  border-right: 1px solid var(--apex-border);
  border-bottom: 1px solid var(--apex-border-light);
  padding: 4px 6px;
  text-align: right;
  color: var(--apex-muted);
  font-size: 10.5px; font-weight: 500;
  vertical-align: top;
}

.agenda-cell {
  border-right: 1px solid var(--apex-border-light);
  border-bottom: 1px solid var(--apex-border-light);
  /* Hauteur généreuse par créneau horaire — au moins 84px pour 1 RDV sans chevauchement */
  min-height: 84px;
  cursor: pointer;
  transition: background .12s;
  /* Flex column : les RDV s'empilent verticalement sans se chevaucher */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 5px 5px 8px 5px;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}
.agenda-cell:hover { background: #F0FDF9; }

/* Quand une cellule contient plusieurs RDV, elle s'agrandit automatiquement */
.agenda-cell:has(.appt-block + .appt-block) {
  min-height: 168px;
}
.agenda-cell:has(.appt-block + .appt-block + .appt-block) {
  min-height: 252px;
}
.agenda-cell:has(.appt-block + .appt-block + .appt-block + .appt-block) {
  min-height: 336px;
}

/* ── Blocs de rendez-vous — flux flex, jamais en position absolue ── */
.appt-block {
  /* Flux normal dans la cellule — empilage vertical garanti */
  position: relative;
  left: auto; right: auto; top: auto;
  width: 100%;
  border-radius: 7px;
  padding: 6px 8px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  border-left: 3px solid rgba(255,255,255,.4);
  transition: transform .12s, box-shadow .12s;
  z-index: 2;
  /* Hauteur minimale garantissant la lisibilité */
  min-height: 44px;
  flex-shrink: 0;
  box-sizing: border-box;
  /* Espacement interne clair */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.appt-block:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  z-index: 10;
}
.ab-title {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.ab-time {
  font-size: 10px;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* ── Couleurs par type de soin ── */
.soin-consultation    { background: linear-gradient(135deg,#0B5FFF,#3B82F6) !important; }
.soin-detartrage      { background: linear-gradient(135deg,#059669,#10B981) !important; }
.soin-extraction      { background: linear-gradient(135deg,#DC2626,#EF4444) !important; }
.soin-implant         { background: linear-gradient(135deg,#7C3AED,#A855F7) !important; }
.soin-orthodontie     { background: linear-gradient(135deg,#D97706,#F59E0B) !important; }
.soin-prothese        { background: linear-gradient(135deg,#0891B2,#22D3EE) !important; }
.soin-blanchiment     { background: linear-gradient(135deg,#DB2777,#EC4899) !important; }
.soin-radiologie      { background: linear-gradient(135deg,#475569,#64748B) !important; }
.soin-default         { background: linear-gradient(135deg,#0D7A6E,#1BAF9E) !important; }

/* Légende couleurs agenda */
.agenda-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px;
  background: #F8FAFC; border-top: 1px solid var(--apex-border);
}
.legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--apex-muted);
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

/* ── Modal Agenda ── */
#apptModal {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
#apptModal.open { display: flex; }

/* ============================================================
   AGENDA — Labels sidebar (sidebar-user-block retiré)
   ============================================================ */
.sidebar-user-block {
  display: none; /* Supprimé — infos user maintenant dans topbar */
}

/* ============================================================
   CONV & ASSUR — KPI compacts
   ============================================================ */
.ca-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.ca-kpi {
  background: var(--apex-surface);
  border: 1px solid var(--apex-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  position: relative; overflow: hidden;
}
.ca-kpi::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--kpi-color, var(--apex-primary));
}
.ca-kpi-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex-shrink: 0;
}
.ca-kpi-body { min-width: 0; flex: 1; }
.ca-kpi-label { font-size: 9.5px; font-weight: 600; color: var(--apex-muted); text-transform: uppercase; letter-spacing: .04em; }
.ca-kpi-value { font-size: 15px; font-weight: 800; color: var(--apex-text); line-height: 1.2; }
.ca-kpi-sub   { font-size: 9.5px; color: var(--apex-muted); }

/* ============================================================
   EXPORT / PDF Buttons (patients)
   ============================================================ */
.btn-export-xlsx {
  background: #217346; color: #fff; border: none;
  box-shadow: 0 2px 8px rgba(33,115,70,.25);
}
.btn-export-xlsx:hover { opacity:.9; }
.btn-export-pdf {
  background: #DC2626; color: #fff; border: none;
  box-shadow: 0 2px 8px rgba(220,38,38,.25);
}
.btn-export-pdf:hover { opacity:.9; }

/* ============================================================
   COUNTRIES SELECT — standardisé
   ============================================================ */
.select-country { /* Utilise la classe .select standard */ }

/* ============================================================
   RESPONSIVE — tablette
   ============================================================ */
@media (max-width: 768px) {
  .kpi { grid-template-columns: 28px 1fr; }
  .apex-main { padding: 12px 10px 36px; }
  /* NOTE : on ne masque PLUS les labels via .topbar-action-btn span,
     cela écrasait les libellés Tailwind. La gestion responsive
     du label est désormais centralisée via .topbar-action-label. */
  .agenda-grid { font-size: 10px; }
  .ab-time { display: none; }
}

/* Sur très petit écran (téléphone portrait) on garde le bouton Patient
   visible mais en mode icône seule (label masqué par .topbar-action-label) */
@media (max-width: 360px) {
  .topbar-btn-patient { display: none !important; }
}

/* ============================================================
   DENTOS — RTL Support (Arabe)
   Appliqué quand html[dir="rtl"] ou body.rtl
   ============================================================ */

/* ── Police arabe ── */
[dir="rtl"],
/* ══ DENTOS — RTL ARABE — Police premium ══ */
body.rtl,
[dir="rtl"] body,
body.lang-ar {
  font-family: 'Cairo', 'Noto Sans Arabic', 'Tajawal', 'Inter', sans-serif !important;
  font-feature-settings: normal;
  line-height: 1.7;
}

/* Amélioration lisibilité arabe */
[dir="rtl"] * {
  letter-spacing: 0 !important;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
  font-family: 'Cairo', 'Noto Sans Arabic', sans-serif !important;
  font-weight: 700;
}

[dir="rtl"] .apex-title {
  font-weight: 800;
}

/* Inputs et labels arabes */
[dir="rtl"] .label {
  text-align: right;
  display: block;
}

[dir="rtl"] .input:not([type="email"]):not([type="password"]):not([type="number"]):not([dir="ltr"]) {
  text-align: right;
  direction: rtl;
}

/* Tables arabes */
[dir="rtl"] .table-wrapper {
  direction: rtl;
}

/* Transition douce changement de direction */
html {
  transition: direction 0.15s ease;
}

/* ── Layout principal inversé ── */
[dir="rtl"] .apex-shell {
  direction: rtl;
}

/* ── Sidebar à droite en RTL ── */
[dir="rtl"] .apex-shell {
  grid-template-columns: 1fr var(--sidebar-w);
}

[dir="rtl"] .apex-shell:has(.apex-sidebar.sidebar-collapsed) {
  grid-template-columns: 1fr var(--sidebar-collapsed-w);
}

[dir="rtl"] .apex-sidebar {
  right: 0;
  left: auto;
  border-right: none;
  border-left: 1px solid var(--apex-border);
}

@media (max-width: 1024px) {
  [dir="rtl"] .apex-sidebar {
    right: -100%;
    left: auto;
    transform: translateX(100%);
  }
  [dir="rtl"] .apex-sidebar.open {
    right: 0;
    left: auto;
    transform: translateX(0);
  }
}

/* ── Flex inversé ── */
[dir="rtl"] .flex {
  direction: rtl;
}

/* ── Header topbar ── */
[dir="rtl"] header {
  direction: rtl;
}

[dir="rtl"] .sidebar-logo-wrap {
  flex-direction: row-reverse;
}

/* ── Sidebar nav ── */
[dir="rtl"] .nav-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .nav-icon {
  margin-left: 10px;
  margin-right: 0;
}

[dir="rtl"] .nav-badge {
  margin-left: 0;
  margin-right: auto;
}

/* ── Sidebar clinic badge ── */
[dir="rtl"] .sidebar-clinic-badge {
  flex-direction: row-reverse;
  text-align: right;
}

/* ── Dropdowns ── */
[dir="rtl"] .dropdown-menu {
  right: auto;
  left: 0;
  text-align: right;
}

[dir="rtl"] .dropdown-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .dropdown-item i {
  margin-right: 0;
  margin-left: 8px;
}

/* ── Search ── */
[dir="rtl"] #global-search {
  padding-right: 36px;
  padding-left: 40px;
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .fa-magnifying-glass.absolute {
  left: auto;
  right: 12px;
}

/* ── KPIs ── */
[dir="rtl"] .kpi {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .kpi-delta {
  direction: rtl;
}

/* ── Cards ── */
[dir="rtl"] .card {
  direction: rtl;
  text-align: right;
}

/* ── Tableaux ── */
[dir="rtl"] .apex-table {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .apex-table th,
[dir="rtl"] .apex-table td {
  text-align: right;
}

[dir="rtl"] .apex-table th:last-child,
[dir="rtl"] .apex-table td:last-child {
  text-align: left;
}

/* ── Formulaires ── */
[dir="rtl"] .input,
[dir="rtl"] .select,
[dir="rtl"] .textarea {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .label {
  text-align: right;
  display: block;
}

[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="password"],
[dir="rtl"] textarea,
[dir="rtl"] select {
  direction: rtl;
  text-align: right;
}

/* ── Boutons ── */
[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn i {
  margin-right: 0 !important;
  margin-left: 6px;
}

/* ── Toast (notifications) ── */
[dir="rtl"] #toast-root {
  right: auto;
  left: 24px;
  direction: rtl;
}

[dir="rtl"] .toast {
  flex-direction: row-reverse;
}

[dir="rtl"] .toast i {
  margin-right: 0;
  margin-left: 10px;
}

/* ── Avatar ── */
[dir="rtl"] .flex.items-center.gap-2 {
  direction: rtl;
}

/* ── Tabs ── */
[dir="rtl"] .finance-tab-btn,
[dir="rtl"] .settings-tab-btn {
  direction: rtl;
  flex-direction: row-reverse;
}

/* ── Page heading ── */
[dir="rtl"] .page-heading {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .apex-title,
[dir="rtl"] .apex-subtitle {
  text-align: right;
  direction: rtl;
}

/* ── Section labels ── */
[dir="rtl"] .section-label {
  text-align: right;
  direction: rtl;
  flex-direction: row-reverse;
}

/* ── Icônes inline ── */
[dir="rtl"] .fa-solid.mr-1,
[dir="rtl"] .fa-solid.mr-1\.5,
[dir="rtl"] .fa-solid.mr-2,
[dir="rtl"] .fa-solid.mr-3 {
  margin-right: 0;
  margin-left: 0.25rem;
}

/* ── Agenda RTL ── */
[dir="rtl"] .agenda-time {
  text-align: left;
  border-right: none;
  border-left: 1px solid var(--apex-border);
}

[dir="rtl"] .agenda-grid {
  direction: rtl;
}

/* ── Modals RTL ── */
[dir="rtl"] .modal-overlay,
[dir="rtl"] [class*="modal"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .modal-overlay .flex.items-center.justify-between {
  flex-direction: row-reverse;
}

/* ── Topbar actions RTL ── */
[dir="rtl"] .flex.items-center.gap-1\.5 {
  flex-direction: row-reverse;
}

[dir="rtl"] .topbar-action-btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .topbar-action-btn span {
  margin-left: 0;
  margin-right: 4px;
}

/* ── Profil user RTL ── */
[dir="rtl"] #user-profile-menu {
  right: auto;
  left: 0;
  direction: rtl;
  text-align: right;
}

/* ── Notif menu RTL ── */
[dir="rtl"] #notif-menu {
  right: auto;
  left: 0;
  direction: rtl;
  text-align: right;
}

[dir="rtl"] #notif-menu .flex.items-start {
  flex-direction: row-reverse;
}

/* ── Lang menu RTL ── */
[dir="rtl"] #lang-menu {
  right: auto;
  left: 0;
  direction: rtl;
  text-align: right;
}

/* ── Burger mobile RTL ── */
[dir="rtl"] .sidebar-toggle-btn {
  margin-right: 0;
  margin-left: 4px;
}

/* ── Collapse / Accordion ── */
[dir="rtl"] [data-collapse-icon] {
  margin-right: auto;
  margin-left: 0;
}

/* ── Badges RTL ── */
[dir="rtl"] .badge {
  direction: rtl;
}

/* ── KPI delta arrows ── */
[dir="rtl"] .kpi-delta {
  flex-direction: row-reverse;
}

/* ── Sidebar header RTL ── */
[dir="rtl"] .sidebar-header-row {
  flex-direction: row-reverse;
}

/* ── Client-badge RTL ── */
[dir="rtl"] .sidebar-clinic-dot {
  margin-right: 0;
  margin-left: 8px;
}

/* ── Grid responsif RTL ── */
[dir="rtl"] .grid {
  direction: rtl;
}

/* ── Stat cards ── */
[dir="rtl"] .ca-kpi {
  flex-direction: row-reverse;
}

[dir="rtl"] .ca-kpi::before {
  left: auto;
  right: 0;
}

/* ── Login page RTL ── */
[dir="rtl"] .login-form-side {
  direction: rtl;
  text-align: right;
}

/* ── Search results RTL ── */
[dir="rtl"] #global-search-results {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] #global-search-results .flex.items-center {
  flex-direction: row-reverse;
}

/* ── Super Admin RTL ── */
[dir="rtl"] .sa-layout {
  direction: rtl;
}

[dir="rtl"] .sa-sidebar {
  right: 0;
  left: auto;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.1);
}

/* ── Printing / PDF preview ── */
@media print {
  [dir="rtl"] * {
    direction: rtl;
    text-align: right;
  }
}

/* ── Smooth transition lors du changement de langue ── */
body {
  transition: direction 0.1s ease;
}

/* ── Indicateur de langue dans le bouton ── */
.lang-btn-active {
  background: var(--apex-primary-light) !important;
  color: var(--apex-primary) !important;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════
   DENTOS — RTL ARABE SUPPLÉMENTAIRE v4.0
   ══════════════════════════════════════════════════════════════════ */

/* Patient tabs RTL */
[dir="rtl"] .patient-tab-btn {
  flex-direction: row-reverse;
}

/* Breadcrumb RTL */
[dir="rtl"] .flex.items-center.gap-2.text-\[13px\] {
  flex-direction: row-reverse;
}

/* Page heading RTL */
[dir="rtl"] .page-heading {
  flex-direction: row-reverse;
  text-align: right;
}

/* Card compact RTL */
[dir="rtl"] .card-compact {
  direction: rtl;
  text-align: right;
}

/* Table wrap RTL */
[dir="rtl"] .table-wrap {
  direction: rtl;
}
[dir="rtl"] table th,
[dir="rtl"] table td {
  text-align: right;
}
[dir="rtl"] table .text-right {
  text-align: left !important;
}
[dir="rtl"] table .text-center {
  text-align: center;
}

/* Modal RTL */
[dir="rtl"] .modal-overlay,
[dir="rtl"] .fixed.inset-0 {
  direction: rtl;
}
[dir="rtl"] .fixed.inset-0 .flex.items-center.justify-between {
  flex-direction: row-reverse;
}

/* Form RTL */
[dir="rtl"] .grid.gap-3 label,
[dir="rtl"] form label {
  text-align: right;
  display: block;
}

/* Avatar RTL */
[dir="rtl"] .flex.items-center.gap-2\.5 {
  flex-direction: row-reverse;
}

/* KPI RTL */
[dir="rtl"] .kpi {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .kpi-icon {
  align-self: flex-end;
}

/* Button with icon RTL */
[dir="rtl"] .btn i + span,
[dir="rtl"] .btn .fa-solid + span {
  margin-left: 0;
  margin-right: 0.25rem;
}

/* Toast RTL position */
[dir="rtl"] #toast-root {
  left: 1rem;
  right: auto !important;
}

/* Notif menu RTL */
[dir="rtl"] #notif-menu {
  right: auto;
  left: 0;
}

/* User menu RTL */
[dir="rtl"] #user-profile-menu {
  right: auto;
  left: 0;
}

/* Tab bar scrollable RTL */
[dir="rtl"] #patient-tab-bar {
  direction: rtl;
}

/* Tabs mini (soins subtabs) RTL */
[dir="rtl"] .flex.gap-1.bg-slate-100.p-1.rounded-xl.w-fit {
  flex-direction: row-reverse;
}

/* Stat cards RTL */
[dir="rtl"] .grid.grid-cols-2 .card.card-compact,
[dir="rtl"] .grid.grid-cols-4 .card.card-compact {
  direction: rtl;
  text-align: right;
}

/* Font arabe globale */
[dir="rtl"], [lang="ar"] {
  font-family: 'Cairo', 'Tajawal', 'Noto Sans Arabic', 'Arial', sans-serif;
  line-height: 1.7;
  letter-spacing: 0;
}

/* Section label RTL */
[dir="rtl"] .section-label {
  flex-direction: row-reverse;
  gap: 0.5rem;
}

/* ============================================================
   DENTOS v4.0 — Styles supplémentaires UX Ultra-Optimisé
   Sidebar V2 · Recherche · Dashboard · Responsive · APEXY
   ============================================================ */

/* === SIDEBAR V2 — Variables et transitions globales === */
:root {
  --sidebar-w: 264px;
  --sidebar-collapsed-w: 64px;
}

/* Transition fluide de la grille principale */
.apex-shell {
  transition: grid-template-columns .3s cubic-bezier(.4,0,.2,1);
}

/* === CHAMP DE RECHERCHE — Fix position et débordement === */
.topbar-search-wrap {
  position: relative;
  flex-shrink: 1;
}
.topbar-search-wrap input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* Résultats de recherche — dropdown bien positionné */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 300px;
  max-width: 460px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15,23,42,.12), 0 2px 8px rgba(15,23,42,.06);
  z-index: 2000;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #1E293B;
  transition: background .12s ease;
  border-bottom: 1px solid #F1F5F9;
}
.search-result-item:last-of-type { border-bottom: none; }
.search-result-item:hover { background: #F8FAFC; }
.search-result-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg,#0D7A6E,#1BAF9E);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.search-result-name { font-size: 13.5px; font-weight: 600; color: #1E293B; }
.search-result-meta { font-size: 11.5px; color: #94A3B8; margin-top: 1px; }
.search-result-footer {
  display: block;
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #0B5FFF;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  text-decoration: none;
  transition: background .12s ease;
}
.search-result-footer:hover { background: #EFF6FF; }

/* === DASHBOARD — Animations KPIs asynchrones === */
.kpi {
  animation: kpiFadeIn .35s ease forwards;
  animation-delay: calc(var(--kpi-index, 0) * 60ms);
  opacity: 0;
}
@keyframes kpiFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Boutons période graphique */
[data-chart-period].active {
  background: #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.12) !important;
  color: #1E293B !important;
  font-weight: 700;
}

/* === APEXY — Boutons actions (correction dysfonctionnements) === */
[data-apexy-ask],
[data-apexy-analyze],
[data-apexy-engine],
[data-apexy-cockpit],
[data-apexy-demo] {
  cursor: pointer;
}
[data-apexy-ask]:hover,
[data-apexy-analyze]:hover { filter: brightness(1.08); }

/* Bouton "Demander à APEXY" standardisé */
.btn-apexy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg,#7C3AED,#A855F7);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn-apexy:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124,58,237,.35);
}
.btn-apexy:active { transform: scale(.97); }
.btn-apexy-secondary {
  background: linear-gradient(135deg,#0D7A6E,#1BAF9E);
}
.btn-apexy-finance {
  background: linear-gradient(135deg,#0891B2,#0EA5E9);
}

/* === RESPONSIVE GLOBAL — Mobile / Tablette === */
@media (max-width: 768px) {
  /* Dashboard responsive */
  .dashboard-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  /* Cacher la barre Apexy inline sur mobile */
  .apexy-inline-bar { display: none !important; }
  /* Raccourcis — 3 colonnes sur mobile */
  #quick-actions-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  /* Graphiques — hauteur adaptée */
  .h-64 { height: 200px !important; }
  .h-60 { height: 180px !important; }
  /* Cards compact */
  .card { padding: 14px !important; }
  /* Grille KPIs — 2 colonnes */
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  /* Texte tronqué */
  .truncate-mobile { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
}

@media (max-width: 480px) {
  #quick-actions-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .apex-main {
    padding: 8px 8px 28px !important;
    padding-top: calc(56px + 8px) !important;
  }
  /* KPIs — 2 colonnes strictes */
  .grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .sm\:grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* === SIDEBAR MOBILE — overlay amélioré === */
@media (max-width: 1023px) {
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 49;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  .sidebar-overlay.active { display: block !important; }
}

/* === TOPBAR — bouton hamburger mobile === */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--apex-border);
  cursor: pointer;
  color: var(--apex-text-2);
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: var(--apex-bg);
  border-color: var(--apex-primary);
  color: var(--apex-primary);
}
@media (max-width: 1023px) {
  .sidebar-toggle-btn { display: flex !important; }
}

/* === CORRECTION APEX-SHELL sur tablette === */
@media (min-width: 1025px) and (max-width: 1280px) {
  .apex-main { padding: 18px 20px 48px; }
}

/* === ANIMATION ENTRÉE PAGES === */
.animate-in {
  animation: pageIn .25s ease forwards;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DASHBOARD V2 — UX OFFICIELLE DENTOS v6.0 (additif)
   ============================================================ */

/* ── KPI GRID — responsive harmonieux ────────────────────────── */
.dashboard-v2 .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1024px) {
  .dashboard-v2 .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dashboard-v2 .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* ── Raccourcis HAUT (Quick top) ─────────────────────────────── */
.dashboard-v2-quick-top {
  background: linear-gradient(135deg, rgba(13,122,110,.04), rgba(11,95,255,.04));
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 10px;
}
.dashboard-v2 .quick-top-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.dashboard-v2 .quick-top-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  text-decoration: none;
  color: #1E293B;
  font-size: 12.5px;
  font-weight: 600;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  min-height: 44px;
}
.dashboard-v2 .quick-top-item:hover {
  transform: translateY(-1px);
  border-color: var(--color, #0D7A6E);
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.dashboard-v2 .quick-top-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color, #0D7A6E) 14%, transparent);
  color: var(--color, #0D7A6E);
  font-size: 13px;
  flex-shrink: 0;
}
.dashboard-v2 .quick-top-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .dashboard-v2 .quick-top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dashboard-v2 .quick-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-v2 .quick-top-item { padding: 8px 10px; font-size: 11.5px; }
}

/* ── Raccourcis BAS (Quick bottom) — FORMAT CARRÉ aligné ─────── */
.dashboard-v2 .quick-bottom-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-v2 .quick-bottom-item {
  /* Format CARRÉ : aspect 1/1 garanti */
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  text-decoration: none;
  color: #475569;
  text-align: center;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  min-width: 0;
}
.dashboard-v2 .quick-bottom-item:hover {
  transform: translateY(-2px);
  border-color: var(--color, #0D7A6E);
  background: color-mix(in srgb, var(--color, #0D7A6E) 5%, #fff);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
}
.dashboard-v2 .quick-bottom-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color, #0D7A6E), color-mix(in srgb, var(--color, #0D7A6E) 70%, white));
  color: #fff;
  font-size: 16px;
  transition: transform .15s ease;
}
.dashboard-v2 .quick-bottom-item:hover .quick-bottom-icon {
  transform: scale(1.08);
}
.dashboard-v2 .quick-bottom-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}

@media (max-width: 1280px) {
  .dashboard-v2 .quick-bottom-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dashboard-v2 .quick-bottom-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .dashboard-v2 .quick-bottom-icon { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
  .dashboard-v2 .quick-bottom-label { font-size: 10.5px; }
}
@media (max-width: 480px) {
  .dashboard-v2 .quick-bottom-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── TREEMAP — rendu CSS de fallback (squarified flexbox) ──── */
.dashboard-v2 .treemap-container {
  position: relative;
  background: #F8FAFC;
  border-radius: 12px;
  overflow: hidden;
}
.dashboard-v2 .treemap-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
}
.dashboard-v2 .treemap-cell {
  position: relative;
  min-width: 80px;
  min-height: 50px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-basis: 0;
  transition: transform .15s ease, filter .15s ease;
  cursor: default;
}
.dashboard-v2 .treemap-cell:hover {
  filter: brightness(1.1);
  transform: scale(1.005);
  z-index: 2;
}
.dashboard-v2 .treemap-cell-inner {
  text-align: center;
  padding: 8px 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.dashboard-v2 .treemap-cell-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}
.dashboard-v2 .treemap-cell-value {
  font-size: 12px;
  font-weight: 600;
  opacity: .92;
  margin-top: 2px;
}
@media (max-width: 600px) {
  .dashboard-v2 .treemap-cell-label { font-size: 11.5px; }
  .dashboard-v2 .treemap-cell-value { font-size: 10.5px; }
}

/* ── Chart containers : empêcher l'overflow ───────────────── */
.dashboard-v2 .chart-card { overflow: hidden; }
.dashboard-v2 .chart-container { width: 100%; min-width: 0; }
.dashboard-v2 .chart-container canvas {
  max-width: 100%;
  height: 100% !important;
}

/* ============================================================
   FIX CHAMP RECHERCHE — débordement, superposition, responsive
   ============================================================ */
.apex-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow: visible; /* dropdowns recherche */
}
.topbar-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.topbar-search-wrap input.topbar-search-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 36px 0 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(241,245,249,0.7);
  font-size: 13.5px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.topbar-search-wrap input.topbar-search-input:focus {
  background: #fff;
  border-color: var(--apex-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13,122,110,.12);
}
/* Dropdown résultats : positionnement fiable */
#global-search-results,
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  width: 100%;
  max-width: 460px;
  min-width: 280px;
  z-index: 100;
}

/* Responsive : largeurs adaptatives sans superposition */
@media (min-width: 1280px) {
  .topbar-search-wrap { flex: 0 1 420px; max-width: 420px; }
}
@media (max-width: 1280px) and (min-width: 1101px) {
  .topbar-search-wrap { flex: 0 1 320px; max-width: 320px; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .topbar-search-wrap { flex: 0 1 220px; max-width: 220px; }
}
@media (max-width: 900px) {
  .topbar-search-wrap { display: none !important; }
}

/* ============================================================
   PERFORMANCE — Transitions fluides
   ============================================================ */
.dashboard-v2 .kpi,
.dashboard-v2 .card {
  transition: transform .18s cubic-bezier(.4,0,.2,1),
              box-shadow .18s cubic-bezier(.4,0,.2,1),
              border-color .18s ease;
  will-change: transform;
}
.dashboard-v2 .kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,23,42,.08);
}
/* Skeleton loader pour graphiques */
.dashboard-v2 .chart-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 200% 100%;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  animation: chartShimmer 1.5s infinite linear;
}
.dashboard-v2 .chart-container canvas { position: relative; z-index: 1; }
@keyframes chartShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   MOBILE — Dashboard responsive complet
   ============================================================ */
@media (max-width: 768px) {
  .dashboard-v2 .section-label { font-size: 13px; }
  .dashboard-v2 .kpi { padding: 12px; }
  .dashboard-v2 .kpi-value { font-size: 18px; }
  .dashboard-v2 .kpi-icon { width: 32px; height: 32px; font-size: 14px; }
  /* Graphiques plus compacts */
  .dashboard-v2 .h-64 { height: 220px !important; }
  /* Stack des grids xl à 1 col */
  .dashboard-v2 .grid.xl\:grid-cols-3 { grid-template-columns: 1fr !important; }
  .dashboard-v2 .grid.xl\:grid-cols-2 { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .dashboard-v2 .kpi-value { font-size: 16px; }
  .dashboard-v2 .h-64 { height: 200px !important; }
}

/* ============================================================
   🆕 HUB IA UNIFIÉ — Toutes les rubriques IA côte à côte
   Remplace l'ancien "IA Insights Cabinet" (doublon non actualisé)
   ============================================================ */
.dashboard-v2 .ia-hub-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(168, 85, 247, 0.06));
  border-color: rgba(124, 58, 237, 0.14);
}
.dashboard-v2 .ia-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-v2 .ia-hub-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 14px 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  text-decoration: none;
  color: #1E293B;
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  min-width: 0;
  overflow: hidden;
}
.dashboard-v2 .ia-hub-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ia-color, #7C3AED);
  opacity: .85;
}
.dashboard-v2 .ia-hub-tile:hover {
  transform: translateY(-3px);
  border-color: var(--ia-color, #7C3AED);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}
.dashboard-v2 .ia-hub-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
  transition: transform .2s ease;
}
.dashboard-v2 .ia-hub-tile:hover .ia-hub-icon {
  transform: scale(1.08) rotate(-2deg);
}
.dashboard-v2 .ia-hub-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
  margin-top: 4px;
  line-height: 1.1;
}
.dashboard-v2 .ia-hub-sub {
  font-size: 10.5px;
  color: #64748B;
  line-height: 1.15;
}
.dashboard-v2 .ia-hub-stat {
  margin-top: 6px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--ia-color, #7C3AED) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--ia-color, #7C3AED) 18%, #fff);
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.dashboard-v2 .ia-hub-stat-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--ia-color, #7C3AED);
  line-height: 1;
}
.dashboard-v2 .ia-hub-stat-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.dashboard-v2 .ia-hub-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(124, 58, 237, 0.18);
}
.dashboard-v2 .ia-hub-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
}
.dashboard-v2 .ia-hub-insight > i {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
.dashboard-v2 .ia-hub-insight-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94A3B8;
  margin-bottom: 2px;
}
.dashboard-v2 .ia-hub-insight-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

/* Responsive Hub IA */
@media (max-width: 1280px) {
  .dashboard-v2 .ia-hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .dashboard-v2 .ia-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-v2 .ia-hub-tile { padding: 12px 8px 10px; }
  .dashboard-v2 .ia-hub-icon { width: 38px; height: 38px; font-size: 15px; }
  .dashboard-v2 .ia-hub-insights { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dashboard-v2 .ia-hub-label { font-size: 11.5px; }
  .dashboard-v2 .ia-hub-sub { font-size: 9.5px; }
  .dashboard-v2 .ia-hub-stat-value { font-size: 12px; }
}

/* ============================================================
   🆕 WHATSAPP — Panel sous Agenda (messages individuels/groupés)
   ============================================================ */
.dashboard-v2 .whatsapp-agenda-panel .btn {
  font-size: 11.5px;
  padding: 6px 10px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .dashboard-v2 .whatsapp-agenda-panel .btn {
    flex: 1 1 100%;
  }
}

/* ============================================================
   🆕 FIX DÉFINITIF — Champ recherche (toutes pages)
   - empêcher tout débordement / superposition menu
   - largeur dynamique fluide
   - alignement propre fixé
   ============================================================ */
.apex-topbar {
  overflow: visible !important; /* dropdowns recherche restent visibles */
}
.topbar-search-wrap {
  position: relative !important;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 460px;
  display: flex !important;
  align-items: center;
  /* empêcher chevauchement avec menus voisins */
  z-index: 5;
}
.topbar-search-wrap input.topbar-search-input,
.topbar-search-wrap input#global-search {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 38px;
  padding: 0 38px 0 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(241, 245, 249, 0.7);
  font-size: 13.5px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-sizing: border-box !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.topbar-search-wrap input.topbar-search-input:focus,
.topbar-search-wrap input#global-search:focus {
  background: #fff;
  border-color: var(--apex-primary, #0D7A6E);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 122, 110, 0.12);
}
/* Dropdown résultats : ancré sous l'input, jamais débordant à droite */
#global-search-results,
.search-results-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: auto !important;
  width: 100% !important;
  max-width: 460px;
  min-width: 280px;
  z-index: 1000 !important;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow-y: auto;
  max-height: 380px;
}

/* Responsive search — adaptation fluide sans superposition */
@media (min-width: 1280px) {
  .topbar-search-wrap { flex: 0 1 420px; max-width: 420px; }
}
@media (max-width: 1279px) and (min-width: 1101px) {
  .topbar-search-wrap { flex: 0 1 300px; max-width: 300px; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .topbar-search-wrap { flex: 0 1 220px; max-width: 220px; }
}
@media (max-width: 900px) and (min-width: 769px) {
  .topbar-search-wrap { flex: 0 1 180px; max-width: 180px; }
  .topbar-search-wrap input.topbar-search-input { font-size: 12.5px; padding-left: 32px; }
}
@media (max-width: 768px) {
  /* En mobile : recherche masquée dans la barre, on garde l'accès via dropdown */
  .topbar-search-wrap { display: none !important; }
}

/* ============================================================
   🆕 PERFORMANCE — Optimisations UX premium médicale
   ============================================================ */
.apex-main {
  contain: layout style;
}
.dashboard-v2 .card,
.dashboard-v2 .kpi,
.dashboard-v2 .ia-hub-tile,
.dashboard-v2 .quick-bottom-item {
  contain: layout style;
}
/* Lissage des transitions sidebar */
.apex-sidebar,
.apex-shell {
  will-change: transform, grid-template-columns;
  transform: translateZ(0);
}
/* Réduction des animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  .dashboard-v2 *,
  .dashboard-v2 *::before,
  .dashboard-v2 *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   🆕 MOBILE — Optimisations supplémentaires Dashboard officiel
   ============================================================ */
@media (max-width: 768px) {
  /* Header dashboard : compact */
  .dashboard-v2 .dashboard-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .dashboard-v2 .apex-title { font-size: 18px; }
  .dashboard-v2 .apex-subtitle { font-size: 11.5px; }
  /* Treemap plus haut sur mobile pour rester lisible */
  .dashboard-v2 #soinsTreemap { height: 260px !important; }
  /* KPI grids : 2 colonnes plutôt que 4 */
  .dashboard-v2 .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  /* Section labels plus compactes (mais lisibles — pas d'uppercase) */
  .dashboard-v2 .section-label {
    margin-bottom: 8px;
    letter-spacing: -0.01em;
  }
  /* APEXY inline : compact */
  .dashboard-v2 .apexy-inline-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
  }
  .dashboard-v2 .apexy-inline-msg { font-size: 11.5px; }
}
@media (max-width: 480px) {
  .dashboard-v2 .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .dashboard-v2 .quick-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-v2 #soinsTreemap { height: 220px !important; }
}

/* ============================================================
   DASHBOARD V2 — Finalisation v6.1 (12 mai 2026)
   Ajouts CSS pour :
     • Bandeau APEXY IA décalé (aligné topbar Nouveau RDV → Admin)
     • Sous-titres section colorés (Activité / Finance / Alertes)
     • Layout Charges vs CA (graph + 3 KPIs latéraux interactifs)
     • Hub IA Premium (header dégradé, badge, pill, tuiles modulaires)
     • Bouton refresh des cartes (Créances / Stock)
   ============================================================ */

/* ─── #6 Bandeau APEXY IA — alignement latéral topbar ─────────── */
.dashboard-v2 .apexy-inline-bar-aligned {
  display: flex;
  width: calc(100% - 240px);   /* ~ depuis le bouton Nouveau RDV jusqu'au bouton Admin */
  max-width: 760px;
  margin-left: auto;            /* Décalé vers la droite */
  margin-right: 0;
  margin-top: 4px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}
@media (max-width: 1280px) {
  .dashboard-v2 .apexy-inline-bar-aligned { width: calc(100% - 180px); max-width: 640px; }
}
@media (max-width: 900px) {
  .dashboard-v2 .apexy-inline-bar-aligned { width: 100%; margin-left: 0; max-width: 100%; }
  .dashboard-v2 .apexy-inline-bar-aligned .apexy-inline-msg { white-space: normal; }
}

/* ─── #7 Sous-titres de section différenciés (UX v7.2 — typographie) ───
   Refonte typographique : suppression de l'uppercase agressif + letter-spacing
   trop large qui rendaient les libellés "Activité du jour / Finance du mois /
   Alertes opérationnelles" peu lisibles. Police Inter en casse normale, taille
   confortable, hiérarchie visuelle préservée via la pastille colorée. */
/* ── Section labels : sans fond ni cadre, texte coloré rapproché des KPIs ── */
.dashboard-v2 .section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 4px;             /* pas de fond, pas de cadre */
  border-radius: 0;
  font-family: 'Inter', 'Roboto', 'Open Sans', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-bottom: 8px;             /* rapproché des KPIs */
  border: none;
  background: transparent;       /* pas de fond coloré */
  line-height: 1.3;
}
.dashboard-v2 .section-label .section-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  font-size: 11px;
  color: currentColor;           /* icône en couleur du texte, sans fond */
  background: transparent;       /* pas de fond carré coloré */
  flex-shrink: 0;
}
.dashboard-v2 .section-label .section-label-text {
  line-height: 1.3;
  font-weight: 700;
}
@media (max-width: 640px) {
  .dashboard-v2 .section-label {
    font-size: 13px;
    margin-bottom: 6px;
  }
}
/* Activité du jour — couleur ambre/orange uniquement */
.dashboard-v2 .section-label-activity {
  color: #B45309;
  background: transparent;
  border: none;
}
.dashboard-v2 .section-label-activity .section-label-icon {
  background: transparent;
  box-shadow: none;
}
/* Finance du mois — couleur verte uniquement */
.dashboard-v2 .section-label-finance {
  color: #047857;
  background: transparent;
  border: none;
}
.dashboard-v2 .section-label-finance .section-label-icon {
  background: transparent;
  box-shadow: none;
}
/* Alertes opérationnelles — couleur rouge uniquement */
.dashboard-v2 .section-label-alerts {
  color: #B91C1C;
  background: transparent;
  border: none;
}
.dashboard-v2 .section-label-alerts .section-label-icon {
  background: transparent;
  box-shadow: none;
}

/* ─── Légende custom premium pour le graphique Charges vs CA ─────── */
.charges-ca-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}
.charges-ca-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  background: #FFFFFF;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1;
}
.charges-ca-legend-item:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.charges-ca-legend-item:focus-visible {
  outline: 2px solid #0D7A6E;
  outline-offset: 1px;
}
.charges-ca-legend-item--off {
  opacity: 0.45;
  text-decoration: line-through;
}
.charges-ca-legend-item--off .charges-ca-legend-swatch {
  background: #CBD5E1 !important;
}
.charges-ca-legend-item--total {
  background: #F1F5F9;
  border-color: #E2E8F0;
  cursor: default;
  color: #475569;
  font-weight: 700;
}
.charges-ca-legend-item--total:hover {
  background: #F1F5F9;
  border-color: #E2E8F0;
}
.charges-ca-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20);
}
.charges-ca-legend-swatch--charges {
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
}
.charges-ca-legend-swatch--marge {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
}
.charges-ca-legend-swatch--total {
  background: linear-gradient(135deg, #DC2626 0%, #DC2626 49%, #059669 51%, #059669 100%);
  position: relative;
}
.charges-ca-legend-swatch--total::after {
  content: '';
  position: absolute;
  left: 1px; right: 1px;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 480px) {
  .charges-ca-legend {
    justify-content: flex-start;
    padding: 6px 8px;
  }
  .charges-ca-legend-item {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* ─── #1 Layout Charges vs CA — GRAPHIQUE PLEINE LARGEUR + KPIs EN BANDEAU HORIZONTAL ─────── */
/* Refonte v10 : les 3 KPIs sont désormais en ligne HORIZONTALE sous le graphique,
   compactes et élégantes. Le graphique occupe TOUTE la largeur pour gagner de l'espace. */
.dashboard-v2 .charges-ca-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dashboard-v2 .charges-ca-chart-wrap {
  min-width: 0;
  width: 100%;
}
/* Bandeau de KPIs : ligne horizontale élégante */
.dashboard-v2 .charges-ca-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 0 2px;
  border-top: 1px dashed #E2E8F0;
}
.dashboard-v2 .charges-ca-kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  min-width: 0;
}
.dashboard-v2 .charges-ca-kpi::before {
  /* Pastille colorée indicative */
  content: '';
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: #94A3B8;
  flex-shrink: 0;
}
.dashboard-v2 .charges-ca-kpi[data-kpi="avg-ca"]::before    { background: linear-gradient(180deg, #10B981, #059669); }
.dashboard-v2 .charges-ca-kpi[data-kpi="best-day"]::before  { background: linear-gradient(180deg, #34D399, #10B981); }
.dashboard-v2 .charges-ca-kpi[data-kpi="margin-avg"]::before { background: linear-gradient(180deg, #3B82F6, #2563EB); }
.dashboard-v2 .charges-ca-kpi:hover {
  border-color: #94A3B8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.dashboard-v2 .charges-ca-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.dashboard-v2 .charges-ca-kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94A3B8;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-v2 .charges-ca-kpi-value {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-v2 .charges-ca-kpi-sub {
  font-size: 10.5px;
  color: #64748B;
  font-weight: 500;
  margin-top: 1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile compact : KPIs en ligne mais plus compacts */
@media (max-width: 640px) {
  .dashboard-v2 .charges-ca-kpis {
    gap: 6px;
    padding: 8px 0 2px;
  }
  .dashboard-v2 .charges-ca-kpi {
    padding: 6px 8px;
    gap: 6px;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .dashboard-v2 .charges-ca-kpi::before {
    width: 100%;
    height: 3px;
    border-radius: 3px;
  }
  .dashboard-v2 .charges-ca-kpi-label {
    font-size: 9px;
    letter-spacing: 0.3px;
  }
  .dashboard-v2 .charges-ca-kpi-value {
    font-size: 13px;
  }
  .dashboard-v2 .charges-ca-kpi-sub {
    font-size: 9.5px;
  }
}

/* ─── #2 HUB IA — Design Premium ──────────────────────────────── */
.dashboard-v2 .ia-hub-premium {
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.10), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(11, 95, 255, 0.07), transparent 55%),
    linear-gradient(135deg, #FFFFFF, #F8FAFC);
  border: 1px solid rgba(124, 58, 237, 0.18);
  position: relative;
  overflow: hidden;
}
.dashboard-v2 .ia-hub-premium::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 60%);
  pointer-events: none;
}
.dashboard-v2 .ia-hub-premium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.dashboard-v2 .ia-hub-premium-titlewrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dashboard-v2 .ia-hub-premium-iconbox {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C3AED, #A855F7, #C084FC);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.30);
  flex-shrink: 0;
}
.dashboard-v2 .ia-hub-premium-title {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-v2 .ia-hub-premium-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #F59E0B, #D97706);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.30);
  text-transform: uppercase;
}
.dashboard-v2 .ia-hub-premium-sub {
  font-size: 12.5px;
  color: #475569;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
.dashboard-v2 .ia-hub-status-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: ia-hub-pulse 1.8s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes ia-hub-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.40); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}
.dashboard-v2 .ia-hub-premium-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.dashboard-v2 .ia-hub-premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  color: #6D28D9;
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 999px;
}
.dashboard-v2 .ia-hub-premium-link {
  font-size: 12px;
  font-weight: 700;
  color: #7C3AED;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.dashboard-v2 .ia-hub-premium-link:hover {
  text-decoration: underline;
}

/* Tuiles modulaires Premium — variable --ia-c par tuile */
.dashboard-v2 .ia-hub-premium .ia-hub-tile {
  --ia-c: var(--ia-color, #7C3AED);
  background: linear-gradient(180deg, #FFFFFF, color-mix(in srgb, var(--ia-c) 4%, #FFFFFF));
  border: 1px solid color-mix(in srgb, var(--ia-c) 14%, #E2E8F0);
  position: relative;
  z-index: 1;
}
.dashboard-v2 .ia-hub-premium .ia-hub-tile::before {
  background: linear-gradient(90deg, var(--ia-c), color-mix(in srgb, var(--ia-c) 60%, #FFFFFF));
  opacity: 1;
  height: 4px;
}
.dashboard-v2 .ia-hub-premium .ia-hub-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--ia-c) 10%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.dashboard-v2 .ia-hub-premium .ia-hub-tile:hover {
  border-color: var(--ia-c);
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--ia-c) 18%, rgba(15, 23, 42, 0.08)),
    0 4px 10px rgba(15, 23, 42, 0.04);
  transform: translateY(-4px);
}
.dashboard-v2 .ia-hub-premium .ia-hub-tile:hover::after {
  opacity: 1;
}
.dashboard-v2 .ia-hub-premium .ia-hub-icon {
  box-shadow:
    0 6px 16px color-mix(in srgb, var(--ia-c, #7C3AED) 35%, transparent),
    0 0 0 4px color-mix(in srgb, var(--ia-c, #7C3AED) 8%, transparent);
}

/* Insights premium */
.dashboard-v2 .ia-hub-premium .ia-hub-insights {
  position: relative;
  z-index: 1;
  border-top: 1px dashed rgba(124, 58, 237, 0.22);
}
.dashboard-v2 .ia-hub-premium .ia-hub-insight {
  background: #FFFFFF;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}
.dashboard-v2 .ia-hub-premium .ia-hub-insight > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
}
.dashboard-v2 .ia-hub-premium .ia-hub-insight > i.text-violet-500 {
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
}
.dashboard-v2 .ia-hub-premium .ia-hub-insight > i.text-amber-500 {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}
.dashboard-v2 .ia-hub-premium .ia-hub-insight > i.text-emerald-500 {
  background: linear-gradient(135deg, #10B981, #059669);
}

@media (max-width: 1280px) {
  .dashboard-v2 .ia-hub-premium-header { flex-direction: column; align-items: flex-start; }
  .dashboard-v2 .ia-hub-premium-meta { align-self: flex-start; }
}
@media (max-width: 900px) {
  .dashboard-v2 .ia-hub-premium { padding: 16px; }
  .dashboard-v2 .ia-hub-premium-iconbox { width: 44px; height: 44px; font-size: 18px; }
  .dashboard-v2 .ia-hub-premium-title { font-size: 15px; }
}
@media (max-width: 540px) {
  .dashboard-v2 .ia-hub-premium-titlewrap { gap: 10px; }
  .dashboard-v2 .ia-hub-premium-iconbox { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
  .dashboard-v2 .ia-hub-premium-title { font-size: 14px; }
  .dashboard-v2 .ia-hub-premium-sub { font-size: 11.5px; }
}

/* ─── #5 Bouton refresh sur les cartes ────────────────────────── */
.card-refresh-btn {
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.card-refresh-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #94A3B8;
  transform: rotate(15deg);
}
.card-refresh-btn:active {
  transform: rotate(180deg);
}

/* ============================================================
   DENTOS v6.0 — SOUS-RUBRIQUES (Sub-tabs)
   Charte UI/UX officielle : fond clair, titres lisibles,
   accent couleur par sous-rubrique. Aucun contraste noir/noir.
   ============================================================ */
.dentos-subtabs {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 6px;
  overflow: hidden;
}
.dentos-subtabs-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.3) transparent;
  -webkit-overflow-scrolling: touch;
}
.dentos-subtabs-bar::-webkit-scrollbar { height: 6px; }
.dentos-subtabs-bar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}
.dentos-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;            /* Texte foncé lisible */
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  position: relative;
}
.dentos-subtab i {
  font-size: 13px;
  color: var(--tab-color, #64748B);
  flex-shrink: 0;
  transition: transform .15s ease;
}
.dentos-subtab-label {
  font-size: 13px;
  color: inherit;
}
.dentos-subtab:hover {
  background: #F8FAFC;
  color: #0F172A;             /* Toujours lisible au hover */
  border-color: #E2E8F0;
}
.dentos-subtab:hover i { transform: scale(1.08); }

.dentos-subtab.is-active {
  background: color-mix(in srgb, var(--tab-color, #0D7A6E) 12%, #FFFFFF);
  color: var(--tab-color, #0D7A6E);
  border-color: color-mix(in srgb, var(--tab-color, #0D7A6E) 35%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.dentos-subtab.is-active i {
  color: var(--tab-color, #0D7A6E);
}
.dentos-subtab.is-active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--tab-color, #0D7A6E);
  opacity: .85;
}

/* Fallback si color-mix non supporté */
@supports not (background: color-mix(in srgb, red, blue)) {
  .dentos-subtab.is-active {
    background: rgba(13, 122, 110, 0.10);
    border-color: rgba(13, 122, 110, 0.30);
  }
}

.dentos-subtab-badge {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--tab-color, #64748B);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
}

/* Responsive : sur mobile, l'icône reste, le label peut être plus court */
@media (max-width: 640px) {
  .dentos-subtab { padding: 8px 10px; font-size: 12.5px; }
  .dentos-subtab-label { font-size: 12.5px; }
}

/* Dark mode (cohérence si appliqué) */
@media (prefers-color-scheme: dark) {
  .dentos-subtabs {
    background: #FFFFFF;        /* On force le fond clair même en dark */
    border-color: #E2E8F0;
  }
  .dentos-subtab { color: #334155; }
}

/* ============================================================
   DENTOS v6.0 — VUE D'ENSEMBLE (Overview Summary)
   Cartes synthétiques par sous-rubrique
   ============================================================ */
/* ── Conteneur global du résumé (base — détails dans le bloc v7.0 plus bas) ── */
.dentos-overview {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 20px;
  margin-bottom: 18px;
  overflow: hidden;          /* nécessaire pour le header vert qui déborde via margin négatif */
}
/* (Tous les autres styles .dentos-overview-* sont définis dans le bloc v7.0 plus bas) */

/* ============================================================
   DENTOS v7.0 — PageTabs RESET (purge des règles v6 noir/blanc)
   ============================================================ */
/* (purgé — remplacé par les règles v7.0 ci-dessous) */

/* ============================================================
   DENTOS v7.0 — PageTabs CHARTE VERTE OFFICIELLE
   ------------------------------------------------------------
   Barre de menu principal & sous-rubriques en VERT DENTOS.
   Titres en BLANC. Transitions fluides. Désélection propre.
   ============================================================ */

/* ── Conteneur global ─────────────────────────────────────── */
.page-tabs {
  margin-bottom: 18px;
}
.page-tabs.page-tabs-sticky .page-tabs-bar {
  position: sticky;
  top: 0;
  z-index: 30;
}
/* ── FIX mobile : la topbar est position:fixed (z-index:40, hauteur ~60px),
   la barre des sous-rubriques sticky doit donc se positionner SOUS la topbar
   au lieu d'être masquée. Sur tablette/mobile (<= 1024px), on offset top + on
   passe z-index à 39 pour rester sous la topbar.
   Sur écrans très petits (<= 640px), la topbar fait ~56px de haut. ── */
@media (max-width: 1024px) {
  .page-tabs.page-tabs-sticky {
    /* Marge haute pour aérer la barre une fois remontée sous la topbar */
    margin-top: 4px;
  }
  .page-tabs.page-tabs-sticky .page-tabs-bar {
    top: 64px; /* hauteur topbar mobile + petit padding */
    z-index: 39; /* sous la topbar (40) mais au-dessus du contenu */
  }
}
@media (max-width: 640px) {
  .page-tabs.page-tabs-sticky .page-tabs-bar {
    top: 60px; /* topbar plus petite */
  }
}

/* ── Barre verte DENTOS (charte officielle) ───────────────── */
.page-tabs-bar {
  position: relative;
  background: linear-gradient(135deg, #0D7A6E 0%, #0A5F56 55%, #0D7A6E 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 14px;
  box-shadow:
    0 6px 18px rgba(13, 122, 110, 0.18),
    0 2px 4px rgba(13, 122, 110, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
/* Décor subtil (motif de points) */
.page-tabs-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.06) 0, transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(0, 194, 168, 0.10) 0, transparent 40%);
  pointer-events: none;
}

/* ── Track horizontal (scroll mobile) ─────────────────────── */
.page-tabs-track {
  position: relative;
  display: flex;
  gap: 4px;
  align-items: stretch;
  padding: 8px 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.page-tabs-track::-webkit-scrollbar { display: none; }
.page-tabs-align-center { justify-content: center; }
.page-tabs-align-right  { justify-content: flex-end; }
.page-tabs-align-left   { justify-content: flex-start; }

/* ── Onglet : style par défaut (texte blanc translucide) ──── */
.page-tabs-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.78);       /* Titre BLANC translucide */
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    color .22s cubic-bezier(.4,0,.2,1),
    background-color .22s cubic-bezier(.4,0,.2,1),
    border-color .22s cubic-bezier(.4,0,.2,1),
    transform .15s ease,
    box-shadow .22s ease;
  flex-shrink: 0;
}
.page-tabs-item-icon {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  transition: color .22s ease, transform .22s ease;
}
.page-tabs-item-label {
  letter-spacing: 0.01em;
}
.page-tabs-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  transition: background-color .22s ease, color .22s ease;
}

/* Indicateur (souligné blanc) — caché par défaut */
.page-tabs-item-indicator {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -2px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #FFFFFF;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
  opacity: 0;
  pointer-events: none;
}

/* ── Effet de survol ──────────────────────────────────────── */
.page-tabs-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.12);
}
.page-tabs-item:hover .page-tabs-item-icon {
  color: #FFFFFF;
  transform: scale(1.05);
}
.page-tabs-item:hover .page-tabs-item-badge {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Onglet actif (titre blanc + fond pastille) ───────────── */
.page-tabs-item.is-active,
.page-tabs-item[aria-selected="true"] {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.page-tabs-item.is-active .page-tabs-item-icon,
.page-tabs-item[aria-selected="true"] .page-tabs-item-icon {
  color: #FFFFFF;
}
.page-tabs-item.is-active .page-tabs-item-badge,
.page-tabs-item[aria-selected="true"] .page-tabs-item-badge {
  background: #FFFFFF;
  color: var(--apex-primary, #0D7A6E);
}
.page-tabs-item.is-active .page-tabs-item-indicator,
.page-tabs-item[aria-selected="true"] .page-tabs-item-indicator {
  transform: scaleX(1);
  opacity: 1;
}

/* Variante pill (active = pastille blanche) */
.page-tabs-variant-pill .page-tabs-item.is-active {
  background: #FFFFFF;
  color: var(--apex-primary, #0D7A6E) !important;
}
.page-tabs-variant-pill .page-tabs-item.is-active .page-tabs-item-icon {
  color: var(--apex-primary, #0D7A6E);
}
.page-tabs-variant-pill .page-tabs-item.is-active .page-tabs-item-indicator {
  display: none;
}

/* ── Onglet désactivé ─────────────────────────────────────── */
.page-tabs-item.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Tailles ──────────────────────────────────────────────── */
.page-tabs-size-sm .page-tabs-item { padding: 7px 11px; font-size: 12.5px; }
.page-tabs-size-sm .page-tabs-item-icon { font-size: 11.5px; }
.page-tabs-size-lg .page-tabs-item { padding: 11px 18px; font-size: 14.5px; }
.page-tabs-size-lg .page-tabs-item-icon { font-size: 14.5px; }

/* ── Panneaux : animations fluides d'entrée / sortie ──────── */
.page-tabs-panels {
  margin-top: 16px;
  position: relative;
}
.page-tabs-panel {
  color: #1A1A1A;
  opacity: 1;
}
.page-tabs-panel[hidden] {
  display: none !important;
}
.page-tabs-panel.is-entering {
  animation: pageTabsFadeIn .28s cubic-bezier(.4, 0, .2, 1) both;
}
.page-tabs-panel.is-leaving {
  animation: pageTabsFadeOut .18s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes pageTabsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageTabsFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

/* ── Responsive mobile : scroll horizontal + ombrage bords ── */
@media (max-width: 640px) {
  .page-tabs-bar {
    border-radius: 12px;
  }
  .page-tabs-track {
    padding: 6px 8px;
    gap: 3px;
  }
  .page-tabs-item {
    padding: 8px 12px;
    font-size: 13px;
  }
  /* Indicateur de scroll : dégradé sur les bords */
  .page-tabs-bar::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    right: 0;
    width: 24px;
    background: linear-gradient(to right, transparent, rgba(13, 122, 110, 0.85));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
  }
}

/* ── Mode RTL (arabe) ─────────────────────────────────────── */
html[dir="rtl"] .page-tabs-track { direction: rtl; }
html[dir="rtl"] .page-tabs-bar::after { right: auto; left: 0; transform: scaleX(-1); }

/* ============================================================
   DENTOS v7.0 — OverviewSummary HEADER VERT DENTOS
   ------------------------------------------------------------
   Header en dégradé vert avec titre BLANC.
   ============================================================ */
.dentos-overview-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 22px 24px;
  margin: -20px -20px 18px -20px;   /* déborde sur le padding du conteneur */
  background: linear-gradient(135deg, #0D7A6E 0%, #0A5F56 50%, #1BAF9E 100%);
  border-radius: 16px 16px 0 0;
  color: #FFFFFF;
  overflow: hidden;
  min-height: 96px;
}
.dentos-overview-header-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.dentos-overview-header-decor {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 88% 25%, rgba(255, 255, 255, 0.12) 0, transparent 28%),
    radial-gradient(circle at 12% 85%, rgba(0, 194, 168, 0.20) 0, transparent 32%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 12px);
  pointer-events: none;
  z-index: 1;
}
.dentos-overview-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 4px 12px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(6px);
}
.dentos-overview-titles {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dentos-overview-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255, 255, 255, 0.80);
  margin-bottom: 2px;
}
.dentos-overview-eyebrow i { font-size: 10px; }
.dentos-overview-title {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.dentos-overview-subtitle {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
  margin: 4px 0 0;
  line-height: 1.5;
  max-width: 720px;
}

/* ── Stats rapides (en dessous du header) ─────────────────── */
.dentos-overview-quickstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 16px 0;
}
.dentos-overview-quickstat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dentos-overview-quickstat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  border-color: var(--stat-color, #0D7A6E);
}
.dentos-overview-quickstat-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  background: color-mix(in srgb, var(--stat-color, #0D7A6E) 12%, transparent);
  color: var(--stat-color, #0D7A6E);
}
.dentos-overview-quickstat-body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.dentos-overview-quickstat-value {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
}
.dentos-overview-quickstat-label {
  font-size: 11.5px;
  color: #64748B;
  font-weight: 500;
  margin-top: 2px;
}

/* ── Bandeau introduction (vert clair) ────────────────────── */
.dentos-overview-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #E6F4F2 0%, #F0FAF8 100%);
  border: 1px solid #B8E0D8;
  border-left: 4px solid #0D7A6E;
  border-radius: 10px;
  color: #1A3A36;
  font-size: 13px;
  line-height: 1.55;
}
.dentos-overview-intro p { margin: 0; flex: 1; }
.dentos-overview-intro-icon {
  color: #0D7A6E;
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Titre de section "Sous-rubriques disponibles" ────────── */
.dentos-overview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px 0;
  padding: 0 2px;
}
.dentos-overview-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.dentos-overview-section-title i {
  color: #0D7A6E;
  font-size: 12px;
}
.dentos-overview-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #E6F4F2;
  color: #0D7A6E;
  font-size: 12px;
  font-weight: 800;
}

/* ── Grille de cartes (sous-rubriques) ────────────────────── */
.dentos-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

/* ── Carte (refonte complète) ─────────────────────────────── */
.dentos-overview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 16px 18px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition:
    border-color .22s ease,
    box-shadow .25s ease,
    transform .18s cubic-bezier(.4, 0, .2, 1),
    background-color .22s ease;
  animation: dentosCardIn .35s cubic-bezier(.34, 1.2, .64, 1) both;
}
@keyframes dentosCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bandeau couleur d'accent à gauche */
.dentos-overview-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--card-color, #0D7A6E) 0%, color-mix(in srgb, var(--card-color, #0D7A6E) 65%, #FFFFFF) 100%);
  transition: width .22s ease;
}
.dentos-overview-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--card-color, #0D7A6E);
  opacity: 0.04;
  transition: opacity .22s ease, transform .35s ease;
  pointer-events: none;
}
.dentos-overview-card:hover {
  border-color: var(--card-color, #0D7A6E);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.10),
    0 4px 10px rgba(15, 23, 42, 0.04);
  transform: translateY(-3px);
  background: #FFFFFF;
}
.dentos-overview-card:hover .dentos-overview-card-accent {
  width: 6px;
}
.dentos-overview-card:hover::before {
  opacity: 0.10;
  transform: scale(1.1);
}

.dentos-overview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.dentos-overview-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--card-color, #0D7A6E) 12%, transparent);
  color: var(--card-color, #0D7A6E);
  border: 1px solid color-mix(in srgb, var(--card-color, #0D7A6E) 20%, transparent);
  transition: transform .22s ease, background-color .22s ease;
}
.dentos-overview-card:hover .dentos-overview-card-icon {
  transform: scale(1.06) rotate(-2deg);
  background: color-mix(in srgb, var(--card-color, #0D7A6E) 18%, transparent);
}
.dentos-overview-card-count {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  gap: 2px;
}
.dentos-overview-card-count-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--card-color, #0D7A6E);
}
.dentos-overview-card-count-label {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dentos-overview-card-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  margin-top: 2px;
}
.dentos-overview-card-trend.trend-up    { background: #ECFDF5; color: #059669; }
.dentos-overview-card-trend.trend-down  { background: #FEF2F2; color: #DC2626; }
.dentos-overview-card-trend.trend-neutral { background: #F1F5F9; color: #64748B; }

.dentos-overview-card-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 8px;
  background: color-mix(in srgb, var(--card-color, #0D7A6E) 10%, transparent);
  color: var(--card-color, #0D7A6E);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}

.dentos-overview-card-body {
  min-width: 0;
  position: relative;
  z-index: 2;
}
.dentos-overview-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 6px 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.dentos-overview-card-desc {
  font-size: 13px;
  color: #475569;
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dentos-overview-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  position: relative;
  z-index: 2;
}
.dentos-overview-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--card-color, #0D7A6E);
  transition: gap .22s ease, color .22s ease;
}
.dentos-overview-card-cta i {
  transition: transform .22s ease;
}
.dentos-overview-card:hover .dentos-overview-card-cta {
  gap: 12px;
}
.dentos-overview-card:hover .dentos-overview-card-cta i {
  transform: translateX(3px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .dentos-overview { padding: 18px; }
  .dentos-overview-header {
    margin: -18px -18px 14px -18px;
    padding: 18px 18px;
    min-height: auto;
  }
  .dentos-overview-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 12px;
  }
  .dentos-overview-title { font-size: 18px; }
  .dentos-overview-subtitle { font-size: 12.5px; }
  .dentos-overview-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dentos-overview-quickstats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 420px) {
  .dentos-overview-quickstats {
    grid-template-columns: 1fr;
  }
  .dentos-overview-header-content { gap: 12px; }
}

/* ============================================================
   DENTOS v7.1 — Conformité UI/UX (Phase Finalisation)
   ------------------------------------------------------------
   Ajustements ciblés sur le cahier des charges :
   ✔ Vert plus CLAIR & lumineux pour la barre de sous-rubriques
   ✔ Titres BLANC contrasté + poids typographique renforcé
   ✔ Indicateur ACTIF glissant (pastille + soulignement)
   ✔ Ombrages portés renforcés (effet de profondeur)
   ✔ Transitions fluides (cubic-bezier) sans blocage
   ✔ Fade-in du résumé au chargement (animation séquencée)
   ✔ Responsive mobile peaufiné (scrollbar horizontale)
   ============================================================ */

/* ── 0. INDICATEUR GLISSANT FLUIDE (suit la sous-rubrique active) ── */
.page-tabs-slider {
  position: absolute;
  top: 8px;
  left: 0;
  height: calc(100% - 16px);
  width: 0;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 10px;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    transform .42s cubic-bezier(.34, 1.36, .64, 1),
    width .35s cubic-bezier(.34, 1.36, .64, 1),
    opacity .25s ease;
  will-change: transform, width;
}
@media (max-width: 640px) {
  .page-tabs-slider {
    top: 6px;
    height: calc(100% - 12px);
  }
}
/* Les items doivent passer au-dessus du slider */
.page-tabs-item {
  position: relative;
  z-index: 2;
}
/* Quand le slider est actif, on désactive le fond de l'item actif (évite le doublon visuel) */
.page-tabs-bar:has(.page-tabs-slider[style*="opacity: 1"]) .page-tabs-item.is-active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* ── 1. BARRE DE SOUS-RUBRIQUES — Vert clair lumineux ───────── */
.page-tabs-bar {
  /* Dégradé vert plus lumineux : du vert DENTOS vers un vert sapin clair */
  background:
    linear-gradient(135deg, #11A294 0%, #0D7A6E 50%, #14B5A4 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 16px;
  box-shadow:
    0 8px 24px rgba(13, 122, 110, 0.22),
    0 3px 8px rgba(13, 122, 110, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}
/* Halo lumineux + décor de points raffiné */
.page-tabs-bar::before {
  background-image:
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.12) 0, transparent 38%),
    radial-gradient(circle at 85% 30%, rgba(0, 230, 200, 0.16) 0, transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.06) 0, transparent 55%);
}

/* Titre de sous-rubrique : BLANC parfaitement lisible */
.page-tabs-item {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.page-tabs-item-icon {
  color: rgba(255, 255, 255, 0.92);
}
.page-tabs-item-label {
  font-weight: 600;
}

/* Survol : effet lumineux subtil + élévation */
.page-tabs-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* ── 2. SOUS-RUBRIQUE ACTIVE — Pastille blanche éclatante ───── */
.page-tabs-item.is-active,
.page-tabs-item[aria-selected="true"] {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}
.page-tabs-item.is-active .page-tabs-item-icon,
.page-tabs-item[aria-selected="true"] .page-tabs-item-icon {
  color: #FFFFFF;
  transform: scale(1.08);
}

/* Indicateur glissant — barre blanche soulignée fluide */
.page-tabs-item-indicator {
  bottom: -4px;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.40) 0%, #FFFFFF 50%, rgba(255,255,255,0.40) 100%);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transition:
    transform .35s cubic-bezier(.34, 1.56, .64, 1),
    opacity .25s ease;
}

/* ── 3. TRANSITION FLUIDE entre sous-rubriques ──────────────── */
.page-tabs-item {
  transition:
    color .25s cubic-bezier(.4, 0, .2, 1),
    background-color .25s cubic-bezier(.4, 0, .2, 1),
    border-color .25s cubic-bezier(.4, 0, .2, 1),
    box-shadow .25s cubic-bezier(.4, 0, .2, 1),
    transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

/* Panneau actif : fade-in + slide plus marqué */
@keyframes pageTabsFadeIn {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes pageTabsFadeOut {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}
.page-tabs-panel.is-entering {
  animation: pageTabsFadeIn .32s cubic-bezier(.34, 1.2, .64, 1) both;
}

/* ── 4. RÉSUMÉ "VUE D'ENSEMBLE" — Fade-in à l'entrée ───────── */
@keyframes dentosOverviewFadeIn {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes dentosOverviewHeaderFadeIn {
  0%   { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
.dentos-overview {
  animation: dentosOverviewFadeIn .45s cubic-bezier(.34, 1.2, .64, 1) both;
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.06),
    0 1px 3px rgba(15, 23, 42, 0.04);
}
.dentos-overview-header {
  animation: dentosOverviewHeaderFadeIn .55s cubic-bezier(.34, 1.2, .64, 1) both;
  /* Vert plus lumineux harmonisé avec la barre */
  background: linear-gradient(135deg, #11A294 0%, #0D7A6E 45%, #14B5A4 100%);
  box-shadow:
    0 6px 20px rgba(13, 122, 110, 0.20),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

/* Titre du résumé : poids renforcé pour la hiérarchie */
.dentos-overview-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
}
.dentos-overview-subtitle {
  font-size: 14px;
  line-height: 1.55;
}
.dentos-overview-eyebrow {
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  width: fit-content;
  margin-bottom: 6px;
  backdrop-filter: blur(6px);
}

/* Stats rapides : animation séquencée */
.dentos-overview-quickstat {
  animation: dentosOverviewFadeIn .5s cubic-bezier(.34, 1.2, .64, 1) both;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.dentos-overview-quickstat:nth-child(1) { animation-delay: 0.10s; }
.dentos-overview-quickstat:nth-child(2) { animation-delay: 0.18s; }
.dentos-overview-quickstat:nth-child(3) { animation-delay: 0.26s; }
.dentos-overview-quickstat:nth-child(4) { animation-delay: 0.34s; }

/* Section "Sous-rubriques disponibles" : séparateur élégant */
.dentos-overview-section-head {
  margin: 8px 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed #E2E8F0;
}
.dentos-overview-section-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Cartes : ombrage renforcé + hiérarchie visuelle améliorée */
.dentos-overview-card {
  border-radius: 16px;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.05),
    0 1px 2px rgba(15, 23, 42, 0.03);
}
.dentos-overview-card:hover {
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.12),
    0 6px 12px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}
.dentos-overview-card-title {
  font-size: 16px;
  font-weight: 800;
}
.dentos-overview-card-desc {
  font-size: 13px;
  line-height: 1.6;
}

/* ── 5. RESPONSIVE MOBILE — Scrollbar horizontale + ombrages ── */
@media (max-width: 640px) {
  .page-tabs-bar {
    border-radius: 14px;
    box-shadow:
      0 4px 12px rgba(13, 122, 110, 0.18),
      0 2px 4px rgba(13, 122, 110, 0.10);
  }
  .page-tabs-item {
    font-size: 13.5px;
    padding: 9px 13px;
  }
  /* Indicateur de scroll discret sur les deux bords */
  .page-tabs-bar::after {
    width: 28px;
    background: linear-gradient(to right, transparent, rgba(13, 122, 110, 0.65));
    border-radius: 0 14px 14px 0;
  }
  .dentos-overview-title { font-size: 19px; }
  .dentos-overview-header {
    padding: 20px 18px;
  }
}

/* ── 6. ACCESSIBILITÉ — Respect du prefers-reduced-motion ───── */
@media (prefers-reduced-motion: reduce) {
  .page-tabs-item,
  .page-tabs-item-indicator,
  .page-tabs-panel.is-entering,
  .page-tabs-panel.is-leaving,
  .dentos-overview,
  .dentos-overview-header,
  .dentos-overview-quickstat,
  .dentos-overview-card {
    animation: none !important;
    transition: none !important;
  }
}

/* ── 7. FOCUS visible — Accessibilité clavier (WCAG) ────────── */
.page-tabs-item:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
  border-radius: 10px;
}
.dentos-overview-card:focus-visible {
  outline: 2px solid var(--card-color, #0D7A6E);
  outline-offset: 3px;
}


/* ============================================================
   🩹 FIX SUITE #1 — Sélecteur de langue toujours visible
   - z-index élevé + overflow visible garantis sur la topbar
   - dropdown lang en position absolute haute priorité
   ============================================================ */
.apex-topbar,
header.apex-topbar {
  overflow: visible !important;
  z-index: 100 !important;        /* au-dessus des cards dashboard */
}
.apex-topbar #lang-dropdown,
.apex-topbar #notif-dropdown,
.apex-topbar #user-profile-dropdown {
  position: relative;
  z-index: 1001;                  /* parents en z-index high */
}
.apex-topbar #lang-menu,
.apex-topbar #notif-menu,
.apex-topbar #user-profile-menu {
  z-index: 9999 !important;       /* dropdowns devant TOUT */
  position: absolute !important;
  right: 0;
  top: calc(100% + 6px);
}
.apex-topbar #lang-menu {
  min-width: 180px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18), 0 4px 8px rgba(15,23,42,.08);
  border: 1px solid #E2E8F0;
  background: #ffffff;
  overflow: hidden;
  padding: 6px 0;
}
.apex-topbar #lang-menu .dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  border: none; background: none;
  width: 100%; text-align: left;
}
.apex-topbar #lang-menu .dropdown-item:hover {
  background: #F1F5F9;
  color: #0D7A6E;
}
.apex-topbar #lang-menu .dropdown-item.active-lang {
  background: rgba(13,122,110,.08);
  color: #0D7A6E;
}
/* RTL : aligner le dropdown lang à gauche en mode arabe */
[dir="rtl"] .apex-topbar #lang-menu {
  right: auto;
  left: 0;
}

/* ============================================================
   🩹 FIX SUITE #3 — Légende graphique Charges vs CA
   Alignée HORIZONTALEMENT SOUS le graphique avec UI premium
   ============================================================ */
.dashboard-v2 #charges-ca-card .charges-ca-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;        /* centré horizontalement */
  gap: 10px;
  padding: 12px 14px;
  margin: 14px 0 0 0;              /* SOUS le graphique */
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
  order: 99;                        /* envoie en bas via flex parent */
}
/* On utilise le grid existant : déplacer la légende après le layout */
.dashboard-v2 #charges-ca-card {
  display: flex;
  flex-direction: column;
}
.dashboard-v2 #charges-ca-card > .charges-ca-legend {
  order: 3;                        /* après le header (0) et le layout (2) */
}
.dashboard-v2 #charges-ca-card > .charges-ca-layout {
  order: 2;
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 999px;            /* forme pilule premium */
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-item:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15,23,42,.08);
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-item--off {
  opacity: 0.45;
  text-decoration: line-through;
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-item--total {
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  border-color: #CBD5E1;
  color: #1E293B;
  font-weight: 700;
  cursor: default;
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-item--total:hover {
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  transform: none;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.dashboard-v2 #charges-ca-card .charges-ca-legend-swatch {
  width: 12px; height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20);
}
@media (max-width: 480px) {
  .dashboard-v2 #charges-ca-card .charges-ca-legend {
    justify-content: flex-start;
    padding: 10px;
    gap: 7px;
  }
  .dashboard-v2 #charges-ca-card .charges-ca-legend-item {
    font-size: 11px;
    padding: 6px 11px;
  }
}

/* ============================================================
   🩹 FIX SUITE #4 v2 — "Actions rapides" : Grille premium ROBUSTE
   ============================================================
   Spécificité forte (#id + !important) pour éviter toute surcharge
   par d'autres règles. Affichage GRILLE GARANTI à toutes les tailles
   avec dégradation progressive : 10 → 5 → 4 → 3 → 2 colonnes.
   ============================================================ */
#quick-actions-grid,
.dashboard-v2 #quick-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 14px !important;
  padding: 6px 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
#quick-actions-grid .quick-bottom-item,
.dashboard-v2 #quick-actions-grid .quick-bottom-item {
  /* Carte premium : fond blanc, ombre douce, transitions fluides */
  aspect-ratio: auto !important;
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  padding: 14px 8px 12px !important;
  gap: 8px !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-decoration: none !important;
  color: #475569 !important;
  text-align: center !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease !important;
  min-width: 0 !important;
  position: relative !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  overflow: hidden !important;
  cursor: pointer;
}
/* Halo coloré subtil au hover (animation top-bar light) */
#quick-actions-grid .quick-bottom-item::before,
.dashboard-v2 #quick-actions-grid .quick-bottom-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
              var(--color, #0D7A6E),
              color-mix(in srgb, var(--color, #0D7A6E) 60%, white));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
  z-index: 1;
}
#quick-actions-grid .quick-bottom-item:hover,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:hover {
  transform: translateY(-3px) !important;
  background: #FFFFFF !important;
  border-color: color-mix(in srgb, var(--color, #0D7A6E) 35%, #E5E7EB) !important;
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--color, #0D7A6E) 12%, transparent),
    0 2px 6px rgba(15, 23, 42, 0.05) !important;
}
#quick-actions-grid .quick-bottom-item:hover::before,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:hover::before {
  transform: scaleX(1);
}
#quick-actions-grid .quick-bottom-icon,
.dashboard-v2 #quick-actions-grid .quick-bottom-icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;     /* coins doux (squircle) */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg,
              var(--color, #0D7A6E),
              color-mix(in srgb, var(--color, #0D7A6E) 65%, white)) !important;
  color: #fff !important;
  font-size: 20px !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--color, #0D7A6E) 26%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
  border: none !important;
  flex-shrink: 0 !important;
}
#quick-actions-grid .quick-bottom-item:hover .quick-bottom-icon,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:hover .quick-bottom-icon {
  transform: scale(1.08) rotate(-3deg) !important;
  box-shadow:
    0 8px 22px color-mix(in srgb, var(--color, #0D7A6E) 38%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
#quick-actions-grid .quick-bottom-item:active .quick-bottom-icon,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:active .quick-bottom-icon {
  transform: scale(0.95) !important;
}
#quick-actions-grid .quick-bottom-label,
.dashboard-v2 #quick-actions-grid .quick-bottom-label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  line-height: 1.25 !important;
  position: relative !important;
  z-index: 1 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  max-width: 100% !important;
  transition: color .15s ease !important;
  word-break: break-word;
}
#quick-actions-grid .quick-bottom-item:hover .quick-bottom-label,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:hover .quick-bottom-label {
  color: var(--color, #0D7A6E) !important;
}

/* Focus accessibilité clavier */
#quick-actions-grid .quick-bottom-item:focus-visible,
.dashboard-v2 #quick-actions-grid .quick-bottom-item:focus-visible {
  outline: 2px solid var(--color, #0D7A6E);
  outline-offset: 2px;
  border-color: var(--color, #0D7A6E) !important;
}

/* ── Responsive : DÉGRADATION PROGRESSIVE 10 → 5 → 4 → 3 → 2 colonnes ── */
@media (max-width: 1400px) {
  #quick-actions-grid,
  .dashboard-v2 #quick-actions-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  #quick-actions-grid,
  .dashboard-v2 #quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  #quick-actions-grid .quick-bottom-icon,
  .dashboard-v2 #quick-actions-grid .quick-bottom-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 17px !important;
    border-radius: 12px !important;
  }
  #quick-actions-grid .quick-bottom-label,
  .dashboard-v2 #quick-actions-grid .quick-bottom-label {
    font-size: 10.5px !important;
  }
}
@media (max-width: 560px) {
  #quick-actions-grid,
  .dashboard-v2 #quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #quick-actions-grid .quick-bottom-item,
  .dashboard-v2 #quick-actions-grid .quick-bottom-item {
    padding: 12px 6px 10px !important;
  }
}
@media (max-width: 380px) {
  #quick-actions-grid,
  .dashboard-v2 #quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ============================================================
   🩹 FIX SUITE v11 — 3 MISSIONS UI/UX (mai 2026)
   ============================================================
   Mission #1 : Boutons "Actions rapides" — grille premium + design SaaS
   Mission #2 : Légende & KPIs du graphique "Charges vs CA" sur 1 ligne
   Mission #3 : Bandeau APEXY IA à droite du titre (et non en dessous)
   ============================================================ */

/* ─── MISSION #3 — Header row : titre + APEXY IA INLINE ─────────────
   Le titre passe sur la GAUCHE et le bandeau APEXY se loge à droite
   sur la même ligne. Économie d'espace vertical garantie. */
.dashboard-v2 .dashboard-header-row-v11 {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 18px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
}
.dashboard-v2 .dashboard-header-row-v11 .dashboard-header-title {
  flex-shrink: 0 !important;
  min-width: 0;
}
.dashboard-v2 .apexy-inline-bar-inheader {
  flex: 1 1 360px !important;
  min-width: 280px !important;
  max-width: 720px !important;
  margin: 0 !important;
  width: auto !important;
  align-self: center !important;
  padding: 10px 14px !important;
}
@media (max-width: 900px) {
  .dashboard-v2 .dashboard-header-row-v11 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .dashboard-v2 .apexy-inline-bar-inheader {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* ─── MISSION #2 — Légende graphique sur 1 SEULE ligne compacte ───
   3 KPIs (Moy. CA, Meilleur jour, Marge nette) en disposition
   HORIZONTALE row, libellé + valeur + sub-info inline. */
.dashboard-v2 #charges-ca-card .charges-ca-kpis {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 12px 0 4px !important;
  border-top: 1px dashed #E2E8F0 !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%) !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
  min-width: 0 !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-body {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;
  flex: 1 !important;
  min-width: 0 !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-label {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  color: #94A3B8 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-label::after {
  content: ':';
  margin-left: 2px;
  color: #CBD5E1;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-value {
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-sub {
  font-size: 10.5px !important;
  color: #64748B !important;
  font-weight: 500 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding-left: 6px;
  border-left: 1px solid #E2E8F0;
}

@media (max-width: 900px) {
  .dashboard-v2 #charges-ca-card .charges-ca-kpis {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .dashboard-v2 #charges-ca-card .charges-ca-kpi {
    padding: 6px 10px !important;
  }
}

/* ─── MISSION #1 — Actions rapides : GRILLE PREMIUM ULTRA-SOLIDE ───
   Renforcement avec spécificité maximale pour TOUJOURS afficher en grille.
   Design premium : icône en cercle gradient, label en dessous, hover lift. */
body .dashboard-v2 #quick-actions-grid,
.dashboard-v2 .card #quick-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 8px 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item,
.dashboard-v2 .card #quick-actions-grid > .quick-bottom-item {
  /* Carte premium SaaS : aspect carré préservé */
  aspect-ratio: 1 / 1 !important;
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  padding: 12px 6px !important;
  gap: 8px !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  color: #475569 !important;
  text-align: center !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease !important;
  min-width: 0 !important;
  min-height: 92px !important;
  position: relative !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  overflow: hidden !important;
  cursor: pointer !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--color, #0D7A6E) 6%, transparent),
              transparent 60%) !important;
  opacity: 0 !important;
  transition: opacity .25s ease !important;
  pointer-events: none !important;
  z-index: 0 !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item:hover {
  transform: translateY(-3px) !important;
  border-color: color-mix(in srgb, var(--color, #0D7A6E) 40%, #E5E7EB) !important;
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--color, #0D7A6E) 14%, transparent),
    0 2px 6px rgba(15, 23, 42, 0.06) !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item:hover::before {
  opacity: 1 !important;
}
body .dashboard-v2 #quick-actions-grid .quick-bottom-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg,
              var(--color, #0D7A6E),
              color-mix(in srgb, var(--color, #0D7A6E) 60%, white)) !important;
  color: #fff !important;
  font-size: 18px !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow:
    0 4px 10px color-mix(in srgb, var(--color, #0D7A6E) 30%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
  flex-shrink: 0 !important;
  border: none !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item:hover .quick-bottom-icon {
  transform: scale(1.08) rotate(-3deg) !important;
}
body .dashboard-v2 #quick-actions-grid .quick-bottom-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  line-height: 1.2 !important;
  position: relative !important;
  z-index: 1 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  max-width: 100% !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  transition: color .15s ease !important;
}
body .dashboard-v2 #quick-actions-grid > .quick-bottom-item:hover .quick-bottom-label {
  color: var(--color, #0D7A6E) !important;
}

/* Responsive dégradation : 10 → 5 → 4 → 3 → 2 */
@media (max-width: 1400px) {
  body .dashboard-v2 #quick-actions-grid,
  .dashboard-v2 .card #quick-actions-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  body .dashboard-v2 #quick-actions-grid,
  .dashboard-v2 .card #quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  body .dashboard-v2 #quick-actions-grid .quick-bottom-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
}
@media (max-width: 560px) {
  body .dashboard-v2 #quick-actions-grid,
  .dashboard-v2 .card #quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-width: 380px) {
  body .dashboard-v2 #quick-actions-grid,
  .dashboard-v2 .card #quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* Fin FIX v11 ============================================== */

/* ============================================================
   🩹 FIX SUITE v12 (mai 2026) — 4 CORRECTIONS UI/UX FINALES
   ============================================================
   Mission #1 : Légende graphique "Charges vs CA" — chips premium
                avec espaces VISIBLES (gap garanti, jamais collés)
   Mission #2 : Actions rapides — GRILLE ULTRA-ROBUSTE
                (spécificité maximale, dégradation responsive)
   Mission #3 : Bandeau APEXY IA — décalé COMPLÈTEMENT à droite
                (margin-left: auto, juste sous Nouveau RDV/admin)
   Mission #4 : Graphique Charges vs CA — barres rouges TOUJOURS
                visibles, légende lisible
   ============================================================ */

/* ─── MISSION #1 — Légende Charges vs CA : chips espacées ───
   Force gap entre les 3 items (Charges / Marge nette / = CA total)
   et style chip premium avec swatch coloré + padding généreux. */
.charges-ca-legend,
.dashboard-v2 #charges-ca-card .charges-ca-legend {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;                  /* ✅ ESPACE GARANTI entre chips */
  padding: 12px 16px !important;
  margin: 14px 0 6px 0 !important;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%) !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.03) !important;
  list-style: none !important;
}
.charges-ca-legend-item,
.dashboard-v2 #charges-ca-card .charges-ca-legend-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;                   /* ✅ ESPACE entre swatch et label */
  padding: 7px 14px !important;
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 999px !important;       /* forme pilule */
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all .15s ease !important;
  line-height: 1 !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
  white-space: nowrap !important;
  font-family: inherit !important;
}
.charges-ca-legend-item:hover,
.dashboard-v2 #charges-ca-card .charges-ca-legend-item:hover {
  border-color: #94A3B8 !important;
  background: #F8FAFC !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(15,23,42,.08) !important;
}
.charges-ca-legend-item--total,
.dashboard-v2 #charges-ca-card .charges-ca-legend-item--total {
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0) !important;
  border-color: #CBD5E1 !important;
  color: #1E293B !important;
  font-weight: 700 !important;
  cursor: default !important;
}
.charges-ca-legend-swatch {
  width: 14px !important;
  height: 14px !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20) !important;
  display: inline-block !important;
}
.charges-ca-legend-swatch--charges {
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%) !important;
}
.charges-ca-legend-swatch--marge {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%) !important;
}
.charges-ca-legend-swatch--total {
  background: linear-gradient(135deg, #DC2626 0%, #DC2626 49%, #059669 51%, #059669 100%) !important;
}
.charges-ca-legend-label {
  white-space: nowrap !important;
}

/* ─── MISSION #2 — Actions rapides : GRILLE FORCÉE (spécificité++) ─── */
html body .dashboard-v2 #quick-actions-grid,
html body .dashboard-v2 .card #quick-actions-grid,
html body #quick-actions-grid.quick-bottom-grid {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 8px 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item,
html body #quick-actions-grid.quick-bottom-grid > a.quick-bottom-item {
  /* Force display flex (au cas où Tailwind reset s'applique) */
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  aspect-ratio: 1 / 1 !important;
  min-height: 92px !important;
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 14px !important;
  padding: 12px 6px !important;
  gap: 8px !important;
  text-decoration: none !important;
  color: #475569 !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}

/* Responsive : 10 → 6 → 5 → 4 → 3 → 2 */
@media (max-width: 1500px) {
  html body .dashboard-v2 #quick-actions-grid,
  html body #quick-actions-grid.quick-bottom-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 1200px) {
  html body .dashboard-v2 #quick-actions-grid,
  html body #quick-actions-grid.quick-bottom-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  html body .dashboard-v2 #quick-actions-grid,
  html body #quick-actions-grid.quick-bottom-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}
@media (max-width: 600px) {
  html body .dashboard-v2 #quick-actions-grid,
  html body #quick-actions-grid.quick-bottom-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-width: 380px) {
  html body .dashboard-v2 #quick-actions-grid,
  html body #quick-actions-grid.quick-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ─── MISSION #3 — Bandeau APEXY IA : COMPLÈTEMENT À DROITE ───
   L'utilisateur souhaite que la barre bleue APEXY soit poussée
   à l'extrême droite de l'écran, juste sous "Nouveau RDV" et le
   nom de l'admin (qui sont dans la topbar). */
.dashboard-v2 .dashboard-header-row-v11 {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;  /* ✅ titre à gauche, barre à droite */
  gap: 18px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
  width: 100% !important;
}
.dashboard-v2 .dashboard-header-row-v11 .dashboard-header-title {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  margin-right: auto !important;             /* ✅ pousse la barre tout à droite */
}
.dashboard-v2 .apexy-inline-bar-inheader {
  flex: 0 1 480px !important;                /* largeur fixe max 480px */
  min-width: 320px !important;
  max-width: 520px !important;
  width: auto !important;
  margin: 0 0 0 auto !important;             /* ✅ ALIGNÉ À DROITE */
  padding: 10px 14px !important;
  align-self: center !important;
  justify-self: end !important;
}
@media (max-width: 900px) {
  .dashboard-v2 .dashboard-header-row-v11 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .dashboard-v2 .dashboard-header-row-v11 .dashboard-header-title {
    margin-right: 0 !important;
  }
  .dashboard-v2 .apexy-inline-bar-inheader {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}

/* ─── MISSION #4 — KPIs du graphique : sub correctement séparés ───
   Améliore la lisibilité du libellé KPI ("Moy. CA / jour", etc.)
   en garantissant l'espace entre value et sub. */
.dashboard-v2 #charges-ca-card .charges-ca-kpi-body {
  gap: 4px 12px !important;
}
.dashboard-v2 #charges-ca-card .charges-ca-kpi-sub {
  padding-left: 10px !important;
  margin-left: 4px !important;
}

/* Fin FIX v12 ============================================== */

/* ============================================================
   🩹 FIX v13 (mai 2026) — UI/UX corrections finales
   ============================================================
   Mission #1 : Actions rapides — design SaaS premium plus lisible
                (icône colorée centrée + label bold dessous +
                 grille toujours visible, fallback sans ::before lourd)
   Mission #2 : Charges vs CA — KPIs sur UNE SEULE LIGNE inline
                (label · valeur · sub côte à côte, gain d'espace)
   Mission #3 : Mobile-nav-bar — assurée visible <1024px
                (display flex, scroll horizontal, sticky sous topbar)
   ============================================================ */

/* ─── MISSION #1 v13 — Actions rapides : grille PREMIUM ULTIME ─── */
html body .dashboard-v2 #quick-actions-grid,
html body .dashboard-v2 .card #quick-actions-grid,
html body #quick-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 14px !important;
  padding: 10px 2px 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Carte d'action — design SaaS premium avec icône en haut, label dessous */
html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item,
html body #quick-actions-grid > a.quick-bottom-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  aspect-ratio: 1 / 1 !important;
  min-height: 100px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%) !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 16px !important;
  padding: 14px 8px 12px !important;
  gap: 10px !important;
  text-decoration: none !important;
  color: #334155 !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.04) !important;
  transition: transform .22s cubic-bezier(.4,0,.2,1),
              box-shadow .22s ease,
              border-color .22s ease,
              background .22s ease !important;
}

html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item:hover,
html body #quick-actions-grid > a.quick-bottom-item:hover {
  transform: translateY(-4px) !important;
  border-color: color-mix(in srgb, var(--color, #0D7A6E) 45%, #E5E7EB) !important;
  background: #FFFFFF !important;
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--color, #0D7A6E) 16%, transparent),
    0 4px 8px rgba(15, 23, 42, 0.06) !important;
}

/* Barre colorée discrète sur le bord supérieur (révélée au hover) */
html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item::after,
html body #quick-actions-grid > a.quick-bottom-item::after {
  content: '' !important;
  position: absolute !important;
  top: 0; left: 50%; right: 50%;
  height: 3px !important;
  background: linear-gradient(90deg,
              var(--color, #0D7A6E),
              color-mix(in srgb, var(--color, #0D7A6E) 60%, white)) !important;
  border-radius: 0 0 6px 6px !important;
  transition: left .25s ease, right .25s ease !important;
  z-index: 2 !important;
}
html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item:hover::after,
html body #quick-actions-grid > a.quick-bottom-item:hover::after {
  left: 18% !important;
  right: 18% !important;
}

/* Icône premium : carré arrondi avec gradient et ombre colorée */
html body .dashboard-v2 #quick-actions-grid .quick-bottom-icon,
html body #quick-actions-grid .quick-bottom-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg,
              var(--color, #0D7A6E) 0%,
              color-mix(in srgb, var(--color, #0D7A6E) 65%, #FFFFFF) 100%) !important;
  color: #FFFFFF !important;
  font-size: 19px !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--color, #0D7A6E) 32%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
  transition: transform .22s ease, box-shadow .22s ease !important;
  flex-shrink: 0 !important;
  border: none !important;
}

html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item:hover .quick-bottom-icon,
html body #quick-actions-grid > a.quick-bottom-item:hover .quick-bottom-icon {
  transform: scale(1.10) translateY(-1px) !important;
  box-shadow:
    0 8px 20px color-mix(in srgb, var(--color, #0D7A6E) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.30) !important;
}

/* Label : police premium, deux lignes max, transition couleur */
html body .dashboard-v2 #quick-actions-grid .quick-bottom-label,
html body #quick-actions-grid .quick-bottom-label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  line-height: 1.22 !important;
  letter-spacing: -0.01em !important;
  position: relative !important;
  z-index: 1 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  max-width: 100% !important;
  word-break: break-word !important;
  transition: color .15s ease !important;
}
html body .dashboard-v2 #quick-actions-grid > a.quick-bottom-item:hover .quick-bottom-label {
  color: var(--color, #0D7A6E) !important;
  font-weight: 700 !important;
}

/* Focus accessibilité */
html body #quick-actions-grid > a.quick-bottom-item:focus-visible {
  outline: 2px solid var(--color, #0D7A6E) !important;
  outline-offset: 3px !important;
}

/* Responsive : 10 → 6 → 5 → 4 → 3 → 2 colonnes */
@media (max-width: 1500px) {
  html body #quick-actions-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
}
@media (max-width: 1200px) {
  html body #quick-actions-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
@media (max-width: 900px) {
  html body #quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  html body #quick-actions-grid .quick-bottom-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
  html body #quick-actions-grid > a.quick-bottom-item { min-height: 88px !important; padding: 12px 6px 10px !important; }
}
@media (max-width: 600px) {
  html body #quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-width: 380px) {
  html body #quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ─── MISSION #2 v13 — Charges vs CA : KPIs sur 1 SEULE ligne ───
   Refonte pour aligner label · valeur · sub TOUS sur la même ligne
   à l'intérieur de chaque carte KPI (gain d'espace vertical massif). */
html body .dashboard-v2 #charges-ca-card .charges-ca-kpis {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 12px 0 4px !important;
  border-top: 1px dashed #E2E8F0 !important;
}

html body .dashboard-v2 #charges-ca-card .charges-ca-kpi {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%) !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  padding: 8px 14px !important;
  min-height: 44px !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

/* ✅ KEY: KPI body en ROW pour aligner libellé + valeur + sub sur 1 LIGNE */
html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-body {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-label {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  color: #94A3B8 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-label::after {
  content: ':' !important;
  margin-left: 2px !important;
  color: #CBD5E1 !important;
}

html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-value {
  font-size: 15.5px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-sub {
  font-size: 10.5px !important;
  color: #64748B !important;
  font-weight: 500 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding-left: 8px !important;
  border-left: 1px solid #E2E8F0 !important;
}

/* Mobile : KPIs empilés (1 par ligne, label · valeur · sub toujours inline) */
@media (max-width: 900px) {
  html body .dashboard-v2 #charges-ca-card .charges-ca-kpis {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  html body .dashboard-v2 #charges-ca-card .charges-ca-kpi {
    padding: 6px 12px !important;
    min-height: 38px !important;
  }
  html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-value {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  html body .dashboard-v2 #charges-ca-card .charges-ca-kpi-sub {
    display: none !important;  /* gain de place sur petits écrans */
  }
}

/* ─── MISSION #3 v13 — Mobile-nav-bar : visible et fonctionnelle ───
   Renforcement de la barre de navigation mobile pour s'assurer qu'elle
   apparaît bien sous la topbar sur tablette/mobile (<1024px). */
@media (max-width: 1023px) {
  .apex-topbar .mobile-nav-bar,
  header .mobile-nav-bar,
  nav.mobile-nav-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 39 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: linear-gradient(135deg, #0D7A6E 0%, #0A5F56 55%, #0D7A6E 100%) !important;
    padding: 6px 8px !important;
    gap: 4px !important;
    box-shadow: 0 2px 6px rgba(13, 122, 110, 0.20) !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Cacher la scrollbar mais garder le scroll fonctionnel */
  .mobile-nav-bar::-webkit-scrollbar { display: none !important; }

  /* Décaler le main pour faire place à la mobile-nav-bar */
  .apex-main,
  main.apex-main {
    padding-top: calc(60px + 56px + 8px) !important;
  }

  /* Page-tabs sticky décalée sous la mobile-nav-bar */
  .page-tabs.page-tabs-sticky .page-tabs-bar {
    top: calc(60px + 56px) !important;
  }
}

@media (max-width: 640px) {
  .apex-topbar .mobile-nav-bar,
  header .mobile-nav-bar,
  nav.mobile-nav-bar {
    top: 56px !important;
    padding: 5px 6px !important;
  }
  .apex-main,
  main.apex-main {
    padding-top: calc(56px + 52px + 6px) !important;
  }
  .page-tabs.page-tabs-sticky .page-tabs-bar {
    top: calc(56px + 52px) !important;
  }
}

/* Desktop : masquée explicitement */
@media (min-width: 1024px) {
  .apex-topbar .mobile-nav-bar,
  header .mobile-nav-bar,
  nav.mobile-nav-bar {
    display: none !important;
  }
}

/* Fin FIX v13 ============================================== */

/* ============================================================
   ✅ FIX v14 (mai 2026) — Titres KPI Dashboard mieux lisibles
   Charte UI DENTOS : Inter, casse normale (pas d'uppercase forcé),
   taille confortable, hiérarchie nette icône → libellé → valeur.
   ============================================================ */
.dashboard-v2 .kpi {
  padding: 13px 14px;
  grid-template-columns: 40px 1fr;
  column-gap: 12px;
  row-gap: 3px;
}
.dashboard-v2 .kpi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.dashboard-v2 .kpi-label {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;            /* fin de l'uppercase étiré */
  text-transform: none;         /* casse normale, premier mot capitalisé */
  color: #475569;               /* slate-600 — lisible mais discret */
  line-height: 1.25;
  white-space: normal;          /* autorise retour à la ligne si besoin */
  overflow: visible;
  text-overflow: clip;
}
.dashboard-v2 .kpi-value {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0F172A;
  line-height: 1.1;
  margin-top: 1px;
}
.dashboard-v2 .kpi-delta {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 5px;
  letter-spacing: 0;
}

/* Section labels v2 (surcharge globale) : sans fond, sans cadre, juste texte coloré */
.dashboard-v2 .section-label {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 0 0 0 4px;
  border-radius: 0;
  margin-bottom: 8px;
  gap: 8px;
  position: static;
  box-shadow: none;
  background: transparent !important;
  border: none !important;
}
/* Barre verticale décorative supprimée */
.dashboard-v2 .section-label::before {
  display: none !important;
}
.dashboard-v2 .section-label .section-label-icon {
  width: 18px; height: 18px;
  border-radius: 0;
  font-size: 13px;
  box-shadow: none;
  background: transparent !important;
  color: currentColor;
}
.dashboard-v2 .section-label .section-label-text {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================================
   ✅ FIX v17 (mai 2026) — KPI icons & cards PREMIUM
   Icônes plus présentes (relief, halo, padding) + cartes
   plus élégantes (border subtile colorée, hover lift).
   ============================================================ */
.dashboard-v2 .kpi {
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFDFE 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
              0 1px 0 rgba(255, 255, 255, 0.6) inset;
  grid-template-columns: 42px 1fr;            /* icône plus large */
  column-gap: 12px;
  row-gap: 2px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-v2 .kpi::after {
  height: 3px;                                /* barre supérieure légèrement plus marquée */
  border-radius: 14px 14px 0 0;
}
.dashboard-v2 .kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -8px rgba(15, 23, 42, 0.15),
              0 4px 10px rgba(15, 23, 42, 0.06);
  border-color: #CBD5E1;
}
.dashboard-v2 .kpi-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  font-size: 15.5px;
  color: #FFFFFF;
  box-shadow: 0 6px 14px -2px rgba(15, 23, 42, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.32),
              inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  position: relative;
}
/* Halo coloré subtil derrière l'icône */
.dashboard-v2 .kpi-icon::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  background: var(--kpi-color, currentColor);
  opacity: 0.10;
  z-index: -1;
  filter: blur(6px);
}
.dashboard-v2 .kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}
.dashboard-v2 .kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0F172A;
  margin-top: 2px;
}
.dashboard-v2 .kpi-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0;
}

/* Responsive : ajustements compacts mais lisibles */
@media (max-width: 768px) {
  .dashboard-v2 .kpi { padding: 12px 13px; grid-template-columns: 38px 1fr; column-gap: 10px; }
  .dashboard-v2 .kpi-icon { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
  .dashboard-v2 .kpi-label { font-size: 10px; }
  .dashboard-v2 .kpi-value { font-size: 18px; }
  .dashboard-v2 .section-label { font-size: 14px; padding: 8px 15px 8px 11px; }
  .dashboard-v2 .section-label .section-label-icon { width: 28px; height: 28px; font-size: 13px; }
}
/* Fin FIX v14 / v17 ========================================== */

/* ============================================================
   ✅ FIX v15 (mai 2026) — Modaux globaux DENTOS (charte premium)
   Utilisés pour remplacer les boîtes natives window.prompt/alert/confirm
   et toutes les UI modales de mauvaise qualité.
   ============================================================ */
.dentos-modal-overlay {
  position: fixed; inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  animation: dentosModalFadeIn .18s ease-out;
}
.dentos-modal-overlay.open { display: flex; }
@keyframes dentosModalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dentosModalSlideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.dentos-modal-dialog {
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 25px 60px -10px rgba(2, 6, 23, 0.35),
              0 0 0 1px rgba(15, 23, 42, 0.06);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dentosModalSlideUp .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.dentos-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #E2E8F0;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  flex-shrink: 0;
}
.dentos-modal-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dentos-modal-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08),
              inset 0 1px 0 rgba(255,255,255,0.18);
}
.dentos-modal-title {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.dentos-modal-subtitle {
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
  line-height: 1.3;
}
.dentos-modal-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
  flex-shrink: 0;
  font-size: 14px;
}
.dentos-modal-close:hover { background: #F1F5F9; color: #0F172A; border-color: #E2E8F0; }
.dentos-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.dentos-modal-footer {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  flex-shrink: 0;
}
/* Fin FIX v15 ============================================== */

/* ============================================================
   ✅ FIX v16 (mai 2026) — Dropdowns topbar TOUJOURS visibles
   Les menus admin (profil) et langue restaient cachés/clippés
   à cause d'overflow:hidden parents et z-index insuffisants.
   ============================================================ */
/* Garantit que les parents directs n'écrasent JAMAIS le dropdown */
.apex-topbar,
.apex-topbar > *,
.apex-topbar .flex,
.apex-topbar .flex-1 {
  overflow: visible !important;
}
/* Visibilité absolue des 3 dropdowns topbar (langue / notifs / profil) */
.apex-topbar #lang-menu:not(.hidden),
.apex-topbar #notif-menu:not(.hidden),
.apex-topbar #user-profile-menu:not(.hidden) {
  display: block !important;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  z-index: 10000 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18),
              0 4px 10px rgba(15, 23, 42, 0.06) !important;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 6px 0;
  animation: dropdownFadeIn .15s ease-out;
}
/* SAFEGUARD ABSOLU — force le masquage si .hidden est présent
   (au cas où une autre règle aurait surchargé display:none). */
.apex-topbar #lang-menu.hidden,
.apex-topbar #notif-menu.hidden,
.apex-topbar #user-profile-menu.hidden {
  display: none !important;
}
/* Les conteneurs dropdown DOIVENT permettre l'affichage du menu */
.apex-topbar #lang-dropdown,
.apex-topbar #notif-dropdown,
.apex-topbar #user-profile-dropdown {
  position: relative !important;
  overflow: visible !important;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.apex-topbar #user-profile-menu:not(.hidden) {
  min-width: 240px;
}
.apex-topbar #notif-menu:not(.hidden) {
  min-width: 320px;
  max-width: min(360px, calc(100vw - 24px));
}
/* Les <a>/<button> dans les dropdowns sont bien cliquables */
.apex-topbar #lang-menu .dropdown-item,
.apex-topbar #notif-menu .dropdown-item,
.apex-topbar #user-profile-menu .dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.apex-topbar #lang-menu .dropdown-item:hover,
.apex-topbar #notif-menu .dropdown-item:hover,
.apex-topbar #user-profile-menu .dropdown-item:hover {
  background: #F1F5F9 !important;
  color: #0D7A6E !important;
}
.apex-topbar #user-profile-menu .dropdown-item i { color: #64748B; width: 16px; }
.apex-topbar #user-profile-menu .dropdown-item:hover i { color: #0D7A6E; }
/* Boutons icône topbar : un peu plus visibles */
.apex-topbar .topbar-icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(241, 245, 249, 0.5);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}
.apex-topbar .topbar-icon-btn:hover {
  background: #F1F5F9;
  border-color: #E2E8F0;
}
/* Pour le bouton langue avec le label FR/EN */
.apex-topbar #lang-dropdown > .topbar-icon-btn {
  width: auto;
  padding: 0 10px;
  gap: 4px;
}
/* RTL : les dropdowns s'alignent à gauche */
[dir="rtl"] .apex-topbar #lang-menu:not(.hidden),
[dir="rtl"] .apex-topbar #notif-menu:not(.hidden),
[dir="rtl"] .apex-topbar #user-profile-menu:not(.hidden) {
  right: auto !important;
  left: 0 !important;
}
/* Fin FIX v16 ============================================== */

/* ============================================================
   ✅ FIX v17 GLOBAL (mai 2026) — UI KPI PREMIUM (CSS FORCÉ)
   ------------------------------------------------------------
   Règles APPLIQUÉES PARTOUT (non scopées à .dashboard-v2) :
   - .section-label : font-weight 800, letter-spacing -0.012em
     + barre verticale décorative ::before (visible).
   - .kpi / .kpi-card : padding 14px, border-radius 14px,
     gradient subtil, hover translateY(-2px).
   - .kpi-icon : taille 40px, triple shadow, halo coloré.
   Ces règles sont écrites en !important pour neutraliser
   tout reset Tailwind / surcharges page.
   ============================================================ */
.section-label {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.012em !important;
  position: relative !important;
  padding-left: 14px !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 8px !important;
  bottom: 8px !important;
  width: 3px !important;
  border-radius: 0 3px 3px 0 !important;
  background: currentColor !important;
  opacity: 0.55 !important;
  display: block !important;
}

.kpi-card,
.kpi {
  padding: 14px !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFDFE 100%) !important;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi-card:hover,
.kpi:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 26px -8px rgba(15, 23, 42, 0.15),
              0 4px 10px rgba(15, 23, 42, 0.06) !important;
  border-color: #CBD5E1;
}

.kpi-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
  font-size: 15.5px !important;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* TRIPLE SHADOW */
  box-shadow:
    0 6px 14px -2px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06) !important;
}
/* HALO coloré derrière l'icône */
.kpi-icon::before {
  content: '' !important;
  position: absolute !important;
  inset: -5px !important;
  border-radius: 14px !important;
  background: var(--kpi-color, currentColor) !important;
  opacity: 0.10 !important;
  z-index: -1 !important;
  filter: blur(6px) !important;
  display: block !important;
}
/* Fin FIX v17 GLOBAL ======================================== */

/* ============================================================
   ✅ FIX v17 DROPDOWNS TOPBAR (CSS FORCÉ GLOBAL)
   ------------------------------------------------------------
   Règles GLOBALES (non scopées) pour TOUT dropdown-menu :
   visible quand .hidden absent, caché sinon.
   Parents avec position:relative + overflow:visible forcés.
   ============================================================ */
.dropdown-menu:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}
.dropdown-menu.hidden {
  display: none !important;
}
/* Parents des dropdowns topbar : doivent autoriser l'affichage */
#lang-dropdown,
#notif-dropdown,
#user-profile-dropdown,
.apex-topbar .relative {
  position: relative !important;
  overflow: visible !important;
}
/* Fin FIX v17 DROPDOWNS ===================================== */


