/*
 * DentalPro Maroc — Feuille de styles principale
 * Thème premium : bleu pétrole / blanc / teal
 * Bootstrap 5.3 étendu
 */

/* === VARIABLES & DESIGN TOKENS === */
:root {
  --dp-primary:       #0ea5e9; /* Sky blue */
  --dp-primary-dark:  #0284c7;
  --dp-primary-light: #f0f9ff;
  --dp-accent:        #10b981; /* Emerald accent */
  --dp-accent-light:  #ecfdf5;
  --dp-success:       #10b981;
  --dp-warning:       #f59e0b;
  --dp-danger:        #ef4444;
  --dp-info:          #3b82f6;

  /* Sidebar */
  --dp-sidebar-bg:    #0f172a; /* Slate 900 */
  --dp-sidebar-width: 260px;
  --dp-sidebar-collapsed: 70px;

  /* Topbar */
  --dp-topbar-height: 65px;
  --dp-topbar-bg:     rgba(15, 23, 42, 0.92); /* Glassmorphic slate */

  /* Content */
  --dp-bg:            #f8fafc; /* Slate 50 */
  --dp-card-bg:       #ffffff;
  --dp-card-shadow:   0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --dp-border-radius: 16px; /* Smooth corners */
  --dp-border-color:  #e2e8f0; /* Slate 200 */

  /* Typography */
  --dp-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --dp-text:          #0f172a; /* Slate 900 */
  --dp-text-muted:    #64748b; /* Slate 500 */
  --dp-text-light:    #94a3b8; /* Slate 400 */

  /* Transitions */
  --dp-transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.dp-body {
  font-family: var(--dp-font);
  background: var(--dp-bg);
  color: var(--dp-text);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--dp-primary); text-decoration: none; }
a:hover { color: var(--dp-primary-dark); }

/* === TOPBAR === */
.dp-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--dp-topbar-height);
  background: var(--dp-topbar-bg);
  z-index: 1050;
  padding: 0 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dp-brand {
  text-decoration: none;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dp-brand-icon { font-size: 1.5rem; }
.dp-brand-name { font-size: 1.1rem; font-weight: 700; line-height: 1; color: #fff; display: block; }
.dp-brand-sub  { font-size: 0.65rem; font-weight: 400; color: rgba(255,255,255,0.7); letter-spacing: 0.1em; text-transform: uppercase; display: block; }

.dp-sidebar-toggle { color: rgba(255,255,255,0.85) !important; border: none !important; }
.dp-sidebar-toggle:hover { color: #fff !important; transform: scale(1.1); }

/* Bannière mot de passe */
.dp-pwd-warning {
  background: rgba(231, 76, 60, 0.85);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid rgba(255,255,255,0.2);
  animation: dp-pulse 2s infinite;
}
.dp-pwd-warning a { color: #fff; }

@keyframes dp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Notifications */
.dp-notif-btn { color: rgba(255,255,255,0.85) !important; border: none; font-size: 1.1rem; padding: 0.4rem !important; border-radius: 8px; transition: var(--dp-transition); }
.dp-notif-btn:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
.dp-badge-notif {
  position: absolute; top: 0; right: 0;
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  border: 2px solid var(--dp-primary-dark);
}
.dp-notif-menu { min-width: 300px; max-height: 400px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--dp-border-color); }

/* Avatar utilisateur */
.dp-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--dp-accent), var(--dp-primary));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.dp-user-btn { color: rgba(255,255,255,0.9) !important; border: none !important; padding: 0.3rem 0.6rem !important; border-radius: 8px; transition: var(--dp-transition); }
.dp-user-btn:hover { background: rgba(255,255,255,0.1) !important; }
.dp-user-name { font-size: 0.85rem; font-weight: 600; line-height: 1.2; color: #fff; }
.dp-user-role { font-size: 0.7rem; color: rgba(255,255,255,0.65); line-height: 1; }

/* Mobile Header & Topbar UX Optimizations */
@media (max-width: 768px) {
  :root {
    --dp-topbar-height: 54px;
  }
  .dp-topbar {
    height: 54px !important;
    padding: 0 0.5rem !important;
  }
  .dp-brand {
    max-width: 140px;
    overflow: hidden;
  }
  .dp-brand-name {
    font-size: 0.85rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }
  .dp-brand-sub {
    display: none !important;
  }
  .dp-sidebar-toggle {
    padding: 0.2rem !important;
    margin-right: 0.25rem !important;
  }
  .dp-user-btn {
    padding: 0.2rem !important;
  }
  .dp-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem !important;
  }
  .dp-notif-btn {
    padding: 0.25rem !important;
    font-size: 1rem !important;
  }
}

/* === LAYOUT === */
.dp-layout {
  display: flex;
  margin-top: var(--dp-topbar-height);
  min-height: calc(100vh - var(--dp-topbar-height));
}

/* === SIDEBAR === */
.dp-sidebar {
  width: var(--dp-sidebar-width);
  background: var(--dp-sidebar-bg);
  height: calc(100vh - var(--dp-topbar-height)) !important;
  max-height: calc(100vh - var(--dp-topbar-height)) !important;
  position: fixed !important;
  top: var(--dp-topbar-height) !important;
  bottom: 0 !important;
  left: 0;
  z-index: 1040;
  transition: width var(--dp-transition), transform var(--dp-transition);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.dp-sidebar::-webkit-scrollbar {
  width: 5px;
}
.dp-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
.dp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.dp-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.dp-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 3.5rem;
}

/* Nav items */
.dp-nav { flex: 1; padding: 1rem 0 2rem 0; }
.dp-nav-list { list-style: none; margin: 0; padding: 0 0 2rem 0; }
.dp-nav-item { margin: 0.1rem 0.75rem; }

.dp-nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  transition: var(--dp-transition);
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.dp-nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.95);
  transform: translateX(2px);
}

.dp-nav-link.active {
  background: linear-gradient(135deg, var(--dp-primary), var(--dp-accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 107, 138, 0.4);
  font-weight: 600;
}

.dp-nav-icon { font-size: 1.05rem; flex-shrink: 0; }
.dp-nav-label { flex: 1; text-align: left; }
.dp-nav-chevron { font-size: 0.75rem; transition: transform var(--dp-transition); }
.dp-has-submenu.dp-open .dp-nav-chevron { transform: rotate(180deg); }
.dp-nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 1rem 1.65rem 0.25rem;
  font-weight: 600;
}

/* Submenu */
.dp-submenu {
  list-style: none; margin: 0; padding: 0;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.dp-submenu.dp-submenu-open { max-height: 500px; }
.dp-submenu-link {
  display: flex; align-items: center;
  padding: 0.5rem 0.9rem 0.5rem 2.5rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 8px;
  margin: 0.1rem 0.75rem;
  transition: var(--dp-transition);
}
.dp-submenu-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); }
.dp-submenu-link.active { color: var(--dp-accent); font-weight: 600; }

/* Sidebar footer */
.dp-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.dp-version { font-size: 0.7rem; color: rgba(255,255,255,0.25); }
.dp-version-sub { font-size: 0.65rem; color: rgba(255,255,255,0.15); }

/* Collapsed sidebar */
.dp-sidebar-collapsed .dp-sidebar {
  width: var(--dp-sidebar-collapsed);
}
.dp-sidebar-collapsed .dp-nav-label,
.dp-sidebar-collapsed .dp-nav-chevron,
.dp-sidebar-collapsed .dp-nav-section-title,
.dp-sidebar-collapsed .dp-version { display: none !important; }
.dp-sidebar-collapsed .dp-nav-link { justify-content: center; padding: 0.7rem; }
.dp-sidebar-collapsed .dp-main { margin-left: var(--dp-sidebar-collapsed); }

/* Expansion au survol de la sidebar lorsqu'elle est réduite (Desktop) */
@media (min-width: 992px) {
  .dp-sidebar-collapsed .dp-sidebar:hover {
    width: var(--dp-sidebar-width) !important;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.25);
    z-index: 1050;
  }
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-nav-label,
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-nav-chevron,
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-nav-section-title,
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-version {
    display: block !important;
  }
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-nav-link {
    justify-content: flex-start !important;
    padding: 0.7rem 0.9rem !important;
  }
  .dp-sidebar-collapsed .dp-sidebar:hover .dp-submenu.dp-submenu-open {
    display: block !important;
    max-height: 500px !important;
  }
}

/* === MAIN CONTENT === */
.dp-main {
  flex: 1;
  margin-left: var(--dp-sidebar-width);
  transition: margin-left var(--dp-transition);
  min-width: 0;
  background-color: var(--dp-bg);
}

.dp-content {
  padding: 2rem 2.5rem 3rem 2.5rem;
}

@media (min-width: 1200px) {
  .dp-content {
    padding: 2.5rem 3.5rem 3.5rem 3.5rem;
  }
}

/* === PAGE HEADER === */
.dp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.dp-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dp-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dp-page-title i { color: var(--dp-primary); }
.dp-breadcrumb {
  font-size: 0.8rem;
  color: var(--dp-text-muted);
  margin: 0.25rem 0 0;
}
.dp-breadcrumb a { color: var(--dp-primary); }

/* === CARDS === */
.dp-card {
  background: var(--dp-card-bg);
  border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.7);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
}
.dp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}
.dp-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--dp-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
}
.dp-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dp-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dp-card-title i { color: var(--dp-primary); }
.dp-card-body { padding: 1.5rem; }

/* === KPI CARDS (Dashboard) === */
.dp-kpi-card {
  background: var(--dp-card-bg);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}

.dp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.08);
}

.dp-kpi-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.kpi-blue   .dp-kpi-icon { background: var(--dp-primary-light); color: var(--dp-primary); }
.kpi-teal   .dp-kpi-icon { background: #ecfdf5; color: var(--dp-accent); }
.kpi-green  .dp-kpi-icon { background: #ecfdf5; color: var(--dp-success); }
.kpi-orange .dp-kpi-icon { background: #fffbeb; color: var(--dp-warning); }
.kpi-red    .dp-kpi-icon { background: #fef2f2; color: var(--dp-danger); }

.dp-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dp-text);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.dp-kpi-label {
  font-size: 0.78rem;
  color: var(--dp-text-muted);
  font-weight: 600;
}
.dp-kpi-trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.dp-kpi-trend.up    { color: var(--dp-success); }
.dp-kpi-trend.down  { color: var(--dp-danger); }
.dp-kpi-trend.flat  { color: var(--dp-text-muted); }

/* === FUNCTIONAL & CLEAN KPI / TELEMETRY TILES (NO BORDER STRIPES) === */
.dp-stat-tile {
  --tile-color: #0284c7;
  --tile-bg-soft: rgba(2, 132, 199, 0.09);
  --tile-border-soft: rgba(2, 132, 199, 0.18);
  background: var(--dp-card-bg, #ffffff);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 1rem 1.15rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  height: 100%;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dp-stat-tile.tile-primary { --tile-color: #0284c7; --tile-bg-soft: rgba(2, 132, 199, 0.09);  --tile-border-soft: rgba(2, 132, 199, 0.20); }
.dp-stat-tile.tile-success { --tile-color: #059669; --tile-bg-soft: rgba(16, 185, 129, 0.10); --tile-border-soft: rgba(16, 185, 129, 0.22); }
.dp-stat-tile.tile-warning { --tile-color: #d97706; --tile-bg-soft: rgba(245, 158, 11, 0.11); --tile-border-soft: rgba(245, 158, 11, 0.24); }
.dp-stat-tile.tile-danger  { --tile-color: #dc2626; --tile-bg-soft: rgba(239, 68, 68, 0.10);  --tile-border-soft: rgba(239, 68, 68, 0.22); }
.dp-stat-tile.tile-info    { --tile-color: #0891b2; --tile-bg-soft: rgba(6, 182, 212, 0.10);  --tile-border-soft: rgba(6, 182, 212, 0.22); }
.dp-stat-tile.tile-purple  { --tile-color: #7c3aed; --tile-bg-soft: rgba(124, 58, 237, 0.10); --tile-border-soft: rgba(124, 58, 237, 0.22); }
.dp-stat-tile.tile-slate   { --tile-color: #334155; --tile-bg-soft: rgba(51, 65, 85, 0.09);   --tile-border-soft: rgba(51, 65, 85, 0.20); }

.dp-stat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--tile-border-soft);
  box-shadow: 0 10px 22px -8px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}

a.dp-stat-tile,
.dp-stat-tile[role="button"],
.dp-stat-tile.is-clickable {
  cursor: pointer;
}

.dp-stat-tile.is-active-filter {
  border-color: var(--tile-color);
  box-shadow: 0 0 0 2px var(--tile-bg-soft), 0 8px 18px -6px rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, var(--tile-bg-soft) 0%, var(--dp-card-bg, #ffffff) 48%);
}

/* Header row: icon + label + functional context pill */
.dp-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
}

.dp-stat-head-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.dp-stat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  background: var(--tile-bg-soft);
  color: var(--tile-color);
  border: 1px solid var(--tile-border-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dp-stat-tile:hover .dp-stat-icon {
  transform: scale(1.05);
}

.dp-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: #64748b;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--tile-bg-soft);
  color: var(--tile-color);
  border: 1px solid var(--tile-border-soft);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.dp-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tile-color);
  display: inline-block;
  flex-shrink: 0;
}

/* Main value row */
.dp-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dp-text, #0f172a);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0.1rem 0 0.05rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.dp-stat-action-arrow {
  font-size: 0.85rem;
  color: #94a3b8;
  transition: transform 0.2s ease, color 0.2s ease;
}
.dp-stat-tile:hover .dp-stat-action-arrow {
  transform: translate(2px, -2px);
  color: var(--tile-color);
}

/* Functional footer: micro-progress bar + contextual subtext */
.dp-stat-foot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  margin-top: auto;
}

.dp-stat-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.dp-stat-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--tile-color);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dp-stat-sub {
  font-size: 0.73rem;
  color: #64748b;
  margin: 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.dp-stat-content {
  min-width: 0;
  flex: 1;
  width: 100%;
}

/* Neutralize any legacy Bootstrap border-start/border-top thick bars on cards */
.dp-card.border-start.border-4,
.card.border-start.border-4,
.dp-card.border-top.border-4,
.card.border-top.border-4 {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* ===================================================
   UNIFIED MODERN TABS & PILLS (ALL APPLICATION MODULES)
   =================================================== */
.nav-tabs,
.nav-pills {
  gap: 0.35rem;
}

.nav-tabs {
  border-bottom: 1px solid var(--dp-border-color);
  padding-bottom: 0.35rem;
}

.nav-tabs.border-0,
.nav-tabs.border-bottom-0 {
  border-bottom: none !important;
  padding-bottom: 0;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-radius: 9px !important;
  border: 1px solid transparent !important;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  background-color: transparent;
  transition: all 0.18s ease;
  box-shadow: none;
  margin-bottom: 0 !important;
}

.nav-tabs .nav-link:hover:not(.active),
.nav-pills .nav-link:hover:not(.active) {
  background-color: #f1f5f9 !important;
  color: var(--dp-primary-dark) !important;
  border-color: #e2e8f0 !important;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--dp-primary), var(--dp-primary-dark)) !important;
  color: #ffffff !important;
  border-color: var(--dp-primary) !important;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.24) !important;
}

.nav-tabs .nav-link.active i,
.nav-tabs .nav-link.active .bi,
.nav-pills .nav-link.active i,
.nav-pills .nav-link.active .bi {
  color: #ffffff !important;
}

/* === TABLES === */
.dp-table-card {
  background: var(--dp-card-bg);
  border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow);
  border: 1px solid var(--dp-border-color);
  overflow: hidden;
}

.table.dp-table {
  margin: 0;
  font-size: 0.875rem;
}
.dp-table thead th {
  background: #f8fafc;
  color: var(--dp-text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--dp-border-color);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.dp-table tbody tr {
  transition: background var(--dp-transition);
}
.dp-table tbody tr:hover { background: #f8fafc; }
.dp-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f4f8;
}

/* === BUTTONS === */
.btn-dp-primary {
  background: linear-gradient(135deg, var(--dp-primary) 0%, var(--dp-primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  transition: all var(--dp-transition);
  font-size: 0.875rem;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
}
.btn-dp-primary:hover {
  color: #fff;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.38);
  filter: brightness(1.05);
}

.btn-dp-outline {
  background: transparent;
  color: var(--dp-primary-dark);
  border: 1.5px solid var(--dp-primary-dark);
  border-radius: 10px;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  transition: all var(--dp-transition);
  font-size: 0.875rem;
}
.btn-dp-outline:hover {
  background: linear-gradient(135deg, var(--dp-primary) 0%, var(--dp-primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* Action buttons in tables */
.btn-action {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: none;
  transition: all var(--dp-transition);
  cursor: pointer;
}
.btn-action-view   { background: #f0f9ff; color: var(--dp-primary-dark); }
.btn-action-edit   { background: #fffbeb; color: #d97706; }
.btn-action-delete { background: #fef2f2; color: var(--dp-danger); }
.btn-action:hover  { filter: brightness(0.95); transform: translateY(-2px) scale(1.05); }

/* === FORMS === */
.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.875rem;
  transition: all var(--dp-transition);
  padding: 0.55rem 0.95rem;
  background-color: #fff;
  color: var(--dp-text);
}
.form-select {
  padding-right: 2.25rem !important;
  background-position: right 0.75rem center;
}
.form-control-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 8px;
}
.form-select-sm {
  padding: 0.35rem 2rem 0.35rem 0.75rem !important;
  font-size: 0.8125rem;
  border-radius: 8px;
  background-position: right 0.6rem center;
}
.form-control:focus, .form-select:focus {
  border-color: var(--dp-primary);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
  outline: none;
}
.form-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--dp-text);
  margin-bottom: 0.4rem;
}
.form-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dp-primary);
  font-weight: 700;
  border-bottom: 2px solid var(--dp-primary-light);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

/* === BADGES === */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.7em;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.badge-status-confirme    { background: #d4edda; color: #155724; }
.badge-status-en_attente  { background: #fff3cd; color: #856404; }
.badge-status-en_salle    { background: #cce5ff; color: #004085; }
.badge-status-termine     { background: #d1e7dd; color: #0f5132; }
.badge-status-absent      { background: #f8d7da; color: #721c24; }
.badge-status-annule      { background: #e2e3e5; color: #41464b; }

.badge-status-payee              { background: #d1e7dd; color: #0f5132; }
.badge-status-emise              { background: #cce5ff; color: #004085; }
.badge-status-partiellement_payee{ background: #fff3cd; color: #856404; }
.badge-status-brouillon          { background: #e2e3e5; color: #41464b; }
.badge-status-annulee            { background: #f8d7da; color: #721c24; }

/* === ALERTES MÉDICALES === */
.dp-medical-alert {
  background: linear-gradient(135deg, #fff5f5, #fde8e8);
  border: 2px solid #fc8181;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  animation: dp-alert-pulse 3s infinite;
}
.dp-medical-alert h6 {
  color: var(--dp-danger);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dp-medical-alert-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #742a2a;
  margin: 0.2rem 0;
}
@keyframes dp-alert-pulse {
  0%, 100% { border-color: #fc8181; }
  50% { border-color: #e53e3e; }
}

/* === ODONTOGRAMME === */
.dp-odontogram {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--dp-card-shadow);
}
.dp-odontogram-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 8px 0;
}
.dp-tooth {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #666;
  transition: all 0.15s;
  position: relative;
}
.dp-tooth:hover {
  border-color: var(--dp-primary);
  transform: scale(1.15);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(26,107,138,0.3);
}
.dp-tooth.saine      { background: #fff; border-color: #ddd; color: #999; }
.dp-tooth.carie      { background: #fff8e1; border-color: #ffc107; color: #856404; }
.dp-tooth.soignee    { background: #e8f5e9; border-color: #4caf50; color: #1b5e20; }
.dp-tooth.couronne   { background: #e3f2fd; border-color: #2196f3; color: #0d47a1; }
.dp-tooth.extraite   { background: #fde8e8; border-color: #f44336; color: #b71c1c; }
.dp-tooth.implant    { background: #f3e5f5; border-color: #9c27b0; color: #4a148c; }
.dp-tooth.bridge     { background: #e8eaf6; border-color: #3f51b5; color: #1a237e; }
.dp-tooth.prothese   { background: #fffde7; border-color: #ffeb3b; color: #f57f17; }
.dp-tooth.fracture   { background: #fce4ec; border-color: #e91e63; color: #880e4f; }
.dp-tooth-separator { width: 20px; }
.dp-odontogram-label {
  font-size: 0.7rem;
  color: var(--dp-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0.5rem 0;
}
.dp-odontogram-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dp-border-color);
}
.dp-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--dp-text-muted);
}
.dp-legend-dot {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 2px solid;
}

/* === AGENDA === */
.dp-agenda-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background: var(--dp-border-color);
  border-radius: 8px;
  overflow: hidden;
}
.dp-agenda-slot {
  background: #fff;
  padding: 0.25rem;
  min-height: 50px;
  position: relative;
}
.dp-agenda-hour {
  background: #f8fafc;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--dp-text-muted);
  font-weight: 600;
  text-align: right;
  border-right: 2px solid var(--dp-border-color);
}
.dp-appointment-chip {
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  transition: filter 0.15s;
}
.dp-appointment-chip:hover { filter: brightness(0.9); }
.dp-appt-confirme  { background: #d4edda; color: #155724; }
.dp-appt-en_attente{ background: #fff3cd; color: #856404; }
.dp-appt-termine   { background: #d1e7dd; color: #0f5132; }
.dp-appt-absent    { background: #f8d7da; color: #721c24; }

/* === LOGIN PAGE === */
.dp-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dp-primary-dark) 0%, var(--dp-primary) 40%, var(--dp-accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dp-login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  animation: dp-fadeInUp 0.6s ease;
}
.dp-login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.dp-login-logo .tooth { font-size: 3.5rem; }
.dp-login-logo h1 { font-size: 1.6rem; font-weight: 800; color: var(--dp-primary-dark); margin: 0.5rem 0 0.2rem; }
.dp-login-logo p { color: var(--dp-text-muted); font-size: 0.85rem; margin: 0; }

@keyframes dp-fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === PDF PREVIEW === */
.dp-pdf-preview {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Inter', serif;
}
.dp-pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid var(--dp-primary);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* === SEARCH BOX === */
.dp-search-box {
  position: relative;
}
.dp-search-box input {
  padding-left: 2.5rem;
  border-radius: 20px !important;
  background: #f8fafc;
}
.dp-search-box .dp-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dp-text-muted);
  pointer-events: none;
}

/* === STATS CHART === */
.dp-chart-card {
  background: var(--dp-card-bg);
  border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow);
  border: 1px solid var(--dp-border-color);
  padding: 1.25rem;
}
.dp-chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dp-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 991px) {
  .dp-sidebar {
    transform: translateX(-100%);
    width: var(--dp-sidebar-width) !important;
  }
  .dp-sidebar.dp-mobile-open { transform: translateX(0); }
  .dp-main { margin-left: 0 !important; }
  .dp-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
    display: none;
  }
  .dp-overlay.active { display: block; }
}

@media (max-width: 576px) {
  .dp-content { padding: 1rem; }
  .dp-kpi-value { font-size: 1.4rem; }
}

/* === UTILITIES === */
.text-dp-primary { color: var(--dp-primary) !important; }
.bg-dp-primary   { background-color: var(--dp-primary) !important; }
.border-dp       { border-color: var(--dp-border-color) !important; }
.fw-500          { font-weight: 500; }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }
.rounded-dp      { border-radius: var(--dp-border-radius) !important; }

/* Animaions */
.dp-fade-in { animation: dp-fadeIn 0.4s ease; }
@keyframes dp-fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.dp-slide-up { animation: dp-slideUp 0.4s ease; }
@keyframes dp-slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar globale */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f4f8; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dp-primary); }

/* DataTables customization */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--dp-border-color);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--dp-border-color);
  border-radius: 8px;
}
.paginate_button.current {
  background: var(--dp-primary) !important;
  border-color: var(--dp-primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
}
.paginate_button:hover {
  background: var(--dp-primary-light) !important;
  color: var(--dp-primary) !important;
  border-color: var(--dp-primary) !important;
  border-radius: 6px !important;
}

/* ===================================================
   PAGE HEADER
   =================================================== */
.dp-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}
.dp-page-title {
  font-size: 1.45rem; font-weight: 800; color: var(--dp-text);
  margin: 0; display: flex; align-items: center; gap: 0.5rem;
}
.dp-page-title .bi { color: var(--dp-primary); font-size: 1.3rem; }
.dp-breadcrumb { font-size: 0.8rem; color: var(--dp-text-muted); margin: 0.15rem 0 0; }
.dp-breadcrumb a { color: var(--dp-primary); text-decoration: none; }
.dp-breadcrumb a:hover { text-decoration: underline; }

/* ===================================================
   DP CARD (Unified)
   =================================================== */
.dp-card {
  background: var(--dp-card-bg);
  border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.7);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.dp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

/* TABLE CARD */
.dp-table-card {
  background: var(--dp-card-bg);
  border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.7);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.dp-table-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

/* DP TABLE */
.dp-table { margin: 0; font-size: 0.875rem; }
.dp-table thead th {
  background: #f8fafc;
  color: var(--dp-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--dp-border-color);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.dp-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  color: var(--dp-text);
}
.dp-table tbody tr:hover { background: rgba(14, 165, 233, 0.03); }
.dp-table tbody tr:last-child td { border-bottom: none; }

/* PRIMARY BUTTON */
.btn-dp-primary {
  background: linear-gradient(135deg, var(--dp-primary), var(--dp-primary-dark));
  color: #fff; border: none; border-radius: 8px; padding: 0.5rem 1.1rem;
  font-weight: 600; font-size: 0.875rem; transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(26,107,138,0.3);
}
.btn-dp-primary:hover {
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,107,138,0.4); color: #fff;
}
.btn-dp-primary:active { transform: none; }

/* GLOBAL BUTTON & ICON ALIGNMENT (ALL MODULES) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.25;
}
.btn > i,
.btn > .bi,
.btn-action > i,
.btn-action > .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.btn > i.me-1,
.btn > .bi.me-1 {
  margin-right: 0.1rem !important;
}
.btn-sm,
.btn-group-sm > .btn,
.btn-group-sm > form > .btn {
  padding: 0.32rem 0.62rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  border-radius: 7px;
  min-height: 31px;
}
.btn-xs,
.btn-group-xs > .btn,
.btn-group-xs > form > .btn {
  padding: 0.22rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border-radius: 6px;
  min-height: 26px;
  gap: 0.22rem;
}

/* Fix <form> inside .btn-group / .d-inline-flex / .d-flex */
.btn-group {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: nowrap;
  vertical-align: middle;
}
.btn-group > form {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
}
.btn-group > .btn,
.btn-group > form > .btn {
  position: relative;
  flex: 0 1 auto;
  height: auto;
}
.btn-group > :not(:first-child),
.btn-group > form:not(:first-child) > .btn {
  margin-left: -1px;
}
.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > form:not(:last-child) > .btn {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.btn-group > .btn:nth-child(n+3),
.btn-group > :not(.btn-check) + .btn,
.btn-group > form:not(:first-child) > .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Table action containers: prevent vertical stretching & multi-line wrapping */
.table td.text-end,
.table td.text-center,
.dp-table td.text-end,
.dp-table td.text-center {
  white-space: nowrap;
}
.table td .d-inline-flex,
.table td .d-flex:not(.flex-column),
.dp-table td .d-inline-flex,
.dp-table td .d-flex:not(.flex-column) {
  align-items: center;
  flex-wrap: nowrap;
}
.table td form.d-inline,
.dp-table td form.d-inline,
.table td form[style*="display:inline"],
.dp-table td form[style*="display:inline"] {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
  margin: 0;
}

/* ACTION BUTTONS */
.btn-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px; min-height: 32px;
  border-radius: 8px; border: none; cursor: pointer;
  font-size: 0.85rem; transition: all 0.18s; text-decoration: none; padding: 0;
  background: #f1f5f9; color: #475569; vertical-align: middle; flex-shrink: 0;
}
.btn-action:hover { transform: scale(1.12); }
.btn-action-view   { background: #e8f4f8; color: var(--dp-primary); }
.btn-action-edit   { background: #fef9ec; color: #e67e22; }
.btn-action-delete { background: #fef2f2; color: #c0392b; }
.btn-action-view:hover   { background: var(--dp-primary); color: #fff; }
.btn-action-edit:hover   { background: #e67e22; color: #fff; }
.btn-action-delete:hover { background: #c0392b; color: #fff; }

/* SEARCH BOX */
.dp-search-box { position: relative; }
.dp-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--dp-text-muted); pointer-events: none;
}
.dp-search-box .form-control { padding-left: 2.2rem; }

/* AGENDA */
.dp-agenda-container {
  background: var(--dp-card-bg); border-radius: var(--dp-border-radius);
  box-shadow: var(--dp-card-shadow); overflow: visible;
}
.dp-agenda-row { position: relative; z-index: 1; }
.dp-agenda-row:focus-within,
.dp-agenda-row:has(.dropdown-menu.show),
.dp-agenda-row.dp-dropdown-open { z-index: 1050 !important; }
.dp-agenda-slot:focus-within,
.dp-agenda-slot:has(.dropdown-menu.show),
.dp-agenda-slot.dp-dropdown-open { z-index: 1052 !important; }
.dp-agenda-event { position: relative; z-index: 2; transition: transform 0.15s, box-shadow 0.15s; }
.dp-agenda-event:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.10); z-index: 10; }
.dp-agenda-event:focus-within,
.dp-agenda-event:has(.dropdown-menu.show),
.dp-agenda-event.dp-dropdown-open { transform: none !important; z-index: 1055 !important; }
.dp-agenda-event .dropdown-menu { z-index: 1065 !important; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18); }
.dp-agenda-event .btn-action {
  width: 26px; height: 26px; min-width: 26px; min-height: 26px;
  border-radius: 6px; font-size: 0.78rem;
}

/* ODONTOGRAM */
.dp-tooth { transition: transform 0.15s, box-shadow 0.15s; }
.dp-tooth:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* FORM SECTION TITLE */
.form-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--dp-text-muted);
  border-bottom: 1px solid var(--dp-border-color);
  padding-bottom: 0.4rem; margin-bottom: 0.75rem;
}

/* UTILITIES */
.fw-800 { font-weight: 800; }

/* ===================================================
   ACCESSIBILITY & LISIBILITÉ (A11Y)
   =================================================== */
/* High Contrast Mode (Noir et Jaune - WCAG Compliant) */
body.a11y-contrast {
  --dp-bg:            #000000 !important;
  --dp-card-bg:       #121212 !important;
  --dp-text:          #ffff00 !important;
  --dp-text-muted:    #ffffff !important;
  --dp-text-light:    #ffffff !important;
  --dp-border-color:  #ffff00 !important;
  --dp-primary:       #ffff00 !important;
  --dp-primary-dark:  #ffea00 !important;
  --dp-primary-light: #333300 !important;
  color: #ffff00 !important;
  background-color: #000000 !important;
}
body.a11y-contrast .dp-card,
body.a11y-contrast .dp-table-card,
body.a11y-contrast .card,
body.a11y-contrast .modal-content,
body.a11y-contrast .dropdown-menu {
  background: #121212 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}
body.a11y-contrast td, 
body.a11y-contrast th, 
body.a11y-contrast label, 
body.a11y-contrast h1, 
body.a11y-contrast h2, 
body.a11y-contrast h3, 
body.a11y-contrast h4, 
body.a11y-contrast h5, 
body.a11y-contrast h6,
body.a11y-contrast p,
body.a11y-contrast span,
body.a11y-contrast i,
body.a11y-contrast a {
  color: #ffff00 !important;
}
body.a11y-contrast a:hover {
  text-decoration: underline !important;
  color: #ffea00 !important;
}
body.a11y-contrast .btn {
  background: #000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}
body.a11y-contrast .btn:hover {
  background: #ffff00 !important;
  color: #000000 !important;
}
body.a11y-contrast input, 
body.a11y-contrast select, 
body.a11y-contrast textarea {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 1px solid #ffff00 !important;
}
body.a11y-contrast .badge {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 1px solid #ffff00 !important;
}

/* Dyslexic Friendly Font (Lexend) */
body.a11y-dyslexic {
  --dp-font: 'Lexend', sans-serif !important;
  font-family: var(--dp-font) !important;
}
body.a11y-dyslexic *,
body.a11y-dyslexic p,
body.a11y-dyslexic span,
body.a11y-dyslexic a,
body.a11y-dyslexic td,
body.a11y-dyslexic th,
body.a11y-dyslexic input,
body.a11y-dyslexic button,
body.a11y-dyslexic select,
body.a11y-dyslexic textarea {
  font-family: 'Lexend', sans-serif !important;
}

/* Spacing Boost */
body.a11y-spacing {
  line-height: 1.95 !important;
  letter-spacing: 0.08em !important;
  word-spacing: 0.18em !important;
}
body.a11y-spacing p,
body.a11y-spacing td,
body.a11y-spacing li,
body.a11y-spacing span {
  line-height: 1.95 !important;
  letter-spacing: 0.08em !important;
}

/* Font Size Boost */
body.a11y-size-large {
  font-size: 1.05rem !important;
}
body.a11y-size-large .form-control,
body.a11y-size-large .form-select,
body.a11y-size-large .btn,
body.a11y-size-large td,
body.a11y-size-large th {
  font-size: 1.0rem !important;
}
body.a11y-size-large h1,
body.a11y-size-large .dp-page-title {
  font-size: 1.65rem !important;
}

body.a11y-size-xlarge {
  font-size: 1.22rem !important;
}
body.a11y-size-xlarge .form-control,
body.a11y-size-xlarge .form-select,
body.a11y-size-xlarge .btn,
body.a11y-size-xlarge td,
body.a11y-size-xlarge th {
  font-size: 1.15rem !important;
}
body.a11y-size-xlarge h1,
body.a11y-size-xlarge .dp-page-title {
  font-size: 1.9rem !important;
}

/* ===================================================
   INTERACTIVE CALENDAR SLOTS
   =================================================== */
.dp-agenda-slot {
  position: relative;
  transition: background-color var(--dp-transition);
}
.dp-agenda-slot:hover {
  background-color: rgba(14, 165, 233, 0.04) !important;
}
.dp-agenda-slot::after {
  content: '+ Planifier RDV';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dp-primary-dark);
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dp-transition);
}
.dp-agenda-slot:hover::after {
  opacity: 0.8;
}

/* Global Print Rules: Hide browser-generated header/footer (URL, date, title, page numbers) & enforce A4 paper margins */
@media print {
  @page {
    size: A4 portrait;
    margin: 0 !important;
  }
  body {
    margin: 0 !important;
    padding: 12mm 15mm !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .no-print, .dp-topbar, #topbar, .dp-sidebar, .dp-page-header, .dp-pwd-warning, .col-lg-4, .btn, form button, .modal, .modal-backdrop {
    display: none !important;
  }
  .dp-layout, .dp-main, .dp-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===================================================
   MODERN UI / UX ENHANCEMENTS
   =================================================== */

/* Card hover animation */
.dp-card, .card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dp-card:hover, .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.06);
}

/* Command Palette (Ctrl + K) */
.dp-command-dialog {
  max-width: 640px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.dp-command-input-group {
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dp-command-input {
  border: none;
  outline: none;
  font-size: 1.1rem;
  width: 100%;
  background: transparent;
  color: #0f172a;
}
.dp-command-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px 0;
  background: #ffffff;
}
.dp-command-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #334155;
  transition: background 0.15s ease;
  cursor: pointer;
}
.dp-command-item:hover, .dp-command-item.selected {
  background: #f0f9ff;
  color: #0284c7;
}

/* Toast Notifications System */
.dp-toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.dp-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #0f172a;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: dpToastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(14, 165, 233, 0.35);
}
.dp-toast.dp-toast-success { border-color: rgba(16, 185, 129, 0.45); }
.dp-toast.dp-toast-danger  { border-color: rgba(239, 68, 68, 0.45); }
.dp-toast.dp-toast-warning { border-color: rgba(245, 158, 11, 0.45); }

@keyframes dpToastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}



