/* ══════════════════════════════════════════════
   SmileClub Flow — Design system
   ══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}
:root {
  /* ── Charte SmileClub : rose brand + neutres + 1 vert subtil ── */
  --brand:        #ed3a5f;
  --brand-dark:   #c81d44;
  --brand-soft:   #fde7ec;
  --brand-tint:   #fef5f7;

  --success:      #15a36b;
  --success-soft: #e6f5ee;
  --danger:       #dc2649;
  --danger-soft:  #fdebee;

  --neutral-50:   #fafafa;
  --neutral-100:  #f4f4f5;
  --neutral-200:  #e4e4e7;
  --neutral-300:  #d4d4d8;
  --neutral-400:  #a1a1aa;
  --neutral-500:  #71717a;
  --neutral-600:  #52525b;
  --neutral-700:  #3f3f46;
  --neutral-800:  #27272a;
  --neutral-900:  #18181b;

  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(24,24,27,.06), 0 1px 2px rgba(24,24,27,.04);
  --shadow:    0 4px 12px rgba(24,24,27,.07), 0 2px 4px rgba(24,24,27,.04);
  --shadow-lg: 0 20px 40px rgba(24,24,27,.10), 0 8px 16px rgba(24,24,27,.05);
}

/* ── Système d'icônes SVG ── */
.ic { width: 1.05em; height: 1.05em; flex-shrink: 0; vertical-align: -0.15em; }
.ic-lg { width: 1.4em; height: 1.4em; }
.ic-sm { width: 0.9em; height: 0.9em; }
html { font-size: 15px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--neutral-100);
  color: var(--neutral-800);
  min-height: 100vh;
}

.screen { min-height: 100vh; }

/* ══ LOGIN ══ */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, var(--brand-soft) 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, #fce7f3 0%, transparent 45%),
    var(--neutral-50);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 36px 36px 28px;
  width: 100%;
  max-width: 420px;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--neutral-100);
}
.login-logo img { height: 56px; width: auto; }
.sidebar-logo img { height: 32px; width: auto; }
.login-title { font-size: 1.5rem; font-weight: 700; color: var(--neutral-900); }
.login-sub { font-size: .9rem; color: var(--neutral-500); margin-bottom: 22px; }
.login-error {
  display: none;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .82rem;
  margin: 12px 0;
}
.login-error.show { display: block; }
.login-hint {
  margin-top: 22px;
  padding: 12px;
  background: var(--brand-soft);
  border-radius: 8px;
  font-size: .78rem;
  color: var(--brand-dark);
  line-height: 1.6;
}

/* ══ APP SHELL ══ */
#screen-app { display: flex; }

/* Sidebar */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--neutral-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--neutral-100);
}

.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section-label {
  color: var(--neutral-400);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--neutral-600);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--neutral-100); color: var(--neutral-900); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active .ic { stroke: var(--brand); }
.nav-item .ic { width: 18px; height: 18px; stroke: var(--neutral-500); }

.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--neutral-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { color: var(--neutral-900); font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--neutral-500); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

/* Main */
.main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--neutral-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--neutral-800); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page-content { padding: 28px; flex: 1; }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ══ COMPONENTS ══ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--neutral-600); border: 1px solid var(--neutral-200); }
.btn-ghost:hover { background: var(--neutral-50); color: var(--neutral-900); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--neutral-700); }
.input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--neutral-800);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--neutral-400);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 18px; opacity: .55; }
.empty-icon-svg {
  width: 56px; height: 56px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  margin: 0 auto 18px;
  display: block;
  opacity: .8;
}
.empty-title { font-size: 1.15rem; font-weight: 600; color: var(--neutral-600); margin-bottom: 8px; }
.empty-sub { font-size: .88rem; color: var(--neutral-500); }

/* ══ CARDS ══ */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--neutral-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.card-title { font-size: .95rem; font-weight: 700; color: var(--neutral-800); }

/* ══ FILTER BAR ══ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--neutral-100);
  flex-wrap: wrap;
  background: var(--neutral-50);
}
.search-input {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  padding: 7px 12px;
}
.search-input input {
  border: none; background: none; outline: none;
  font-size: .85rem; color: var(--neutral-800);
  width: 100%;
}
.filter-select {
  padding: 7px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: #fff;
  font-size: .85rem;
  color: var(--neutral-700);
  cursor: pointer;
  outline: none;
}

/* ══ TABLE ══ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--neutral-200); background: var(--neutral-50); }
th {
  padding: 11px 18px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--neutral-500);
  white-space: nowrap;
}
td {
  padding: 13px 18px;
  font-size: .85rem;
  color: var(--neutral-700);
  border-bottom: 1px solid var(--neutral-100);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--neutral-50); }
/* Patient avec RDV programmé : surlignage vert */
tbody tr.lead-row-rdv td { background: var(--success-soft); }
tbody tr.lead-row-rdv:hover td { background: #d6efe0; }
tbody tr.lead-row-rdv .td-name { color: var(--success); }
.rdv-cell { color: var(--success); font-weight: 600; }
.td-rdv { font-size: .72rem; color: var(--success); font-weight: 600; margin-top: 2px; }

/* ══ INSCRIPTIONS SÉMINAIRE ══ */
.inscr-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.inscr-card {
  background: #fff; border: 1px solid var(--neutral-200);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.inscr-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.06); border-color: var(--brand-light); }
.inscr-card-head { display: flex; align-items: center; gap: 10px; }
.inscr-card-id { flex: 1; min-width: 0; }
.inscr-card-name { font-weight: 700; color: var(--neutral-900); }
.inscr-card-profile { font-size: .82rem; color: var(--brand); font-weight: 600; }
.inscr-card-date { font-size: .72rem; color: var(--neutral-400); white-space: nowrap; }
.inscr-card-body { display: grid; gap: 6px; }
.inscr-field { display: flex; gap: 8px; font-size: .85rem; flex-wrap: wrap; }
.inscr-field-wide { flex-direction: column; gap: 2px; }
.inscr-label {
  color: var(--neutral-500); min-width: 130px;
  display: inline-flex; align-items: center; gap: 6px;
}
.inscr-label .ic { width: 14px; height: 14px; color: var(--neutral-400); }
.inscr-value { color: var(--neutral-900); flex: 1; word-break: break-word; }
.inscr-card { cursor: pointer; }
.inscr-card-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--neutral-100); }

/* Modale inscription (lecture seule) */
.insc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.insc-head .lead-avatar { width: 44px; height: 44px; font-size: 1rem; }
.insc-head-name { font-weight: 700; font-size: 1.05rem; color: var(--neutral-900); }
.insc-head-profile { color: var(--brand); font-weight: 600; font-size: .85rem; }
.insc-rows { display: flex; flex-direction: column; }
.insc-row {
  display: grid; grid-template-columns: 24px 130px 1fr; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--neutral-100);
  align-items: center;
}
.insc-row:first-child { border-top: none; }
.insc-row-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--neutral-400); }
.insc-row-icon .ic { width: 16px; height: 16px; }
.insc-row-label { color: var(--neutral-500); font-size: .85rem; }
.insc-row-value { color: var(--neutral-900); font-size: .92rem; word-break: break-word; }
.insc-row-block { grid-template-columns: 24px 1fr; }
.insc-row-block .insc-row-label { display: none; }
@media (max-width: 600px) {
  .inscr-cards { grid-template-columns: 1fr; }
}
.lead-rdv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  background: var(--success-soft); color: var(--success);
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  border: 1px solid #b6e2c9;
}
.td-name { font-weight: 600; color: var(--neutral-900); }
.td-sub  { font-size: .72rem; color: var(--neutral-400); margin-top: 2px; }

/* ══ BADGES ══ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active   { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: var(--neutral-100); color: var(--neutral-500); }
.badge-admin    { background: var(--brand-soft); color: var(--brand); }
.badge-commercial { background: var(--neutral-100); color: var(--neutral-700); }
.badge-dentist  { background: var(--success-soft); color: var(--success); }
.badge-soft     { background: var(--neutral-100); color: var(--neutral-500); padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 500; }
.badge-soft::before { display:none; }
.badge-ok       { background: var(--success-soft); color: var(--success); }
.badge-ko       { background: var(--neutral-100); color: var(--neutral-400); }

/* ══ ROW ACTIONS ══ */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--neutral-200);
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--neutral-500);
  transition: all .15s;
}
.btn-icon:hover { background: var(--neutral-100); color: var(--neutral-800); }
.btn-icon.danger:hover { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-light { background: var(--neutral-100); color: var(--neutral-700); }
.btn-light:hover { background: var(--neutral-200); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ══ MODAL ══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  overflow-y: auto;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  transform: translateY(15px);
  transition: transform .2s;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 26px 16px;
  border-bottom: 1px solid var(--neutral-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--neutral-900); }
.modal-subtitle { font-size: .8rem; color: var(--neutral-500); margin-top: 2px; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none; background: var(--neutral-100);
  color: var(--neutral-500);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--neutral-200); }
.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 14px 26px;
  border-top: 1px solid var(--neutral-100);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ══ TABS (dans modale) ══ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 22px;
  margin-top: -8px;
}
.tab {
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neutral-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--neutral-800); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ FORM ══ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .field { margin-bottom: 0; }
.col-span-2 { grid-column: span 2; }
.form-hint {
  font-size: .8rem;
  color: var(--neutral-500);
  background: var(--neutral-50);
  padding: 9px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--brand);
  margin-bottom: 16px;
}
.required { color: var(--danger); }
.optional { color: var(--neutral-400); font-weight: 400; font-size: .72rem; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--neutral-700);
  cursor: pointer;
  font-weight: 500;
}
.checkbox-label input[type=checkbox] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}

/* ══ DENTIST GRID ══ */
.dentist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 18px 22px;
}
.dentist-card-item {
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .15s;
  position: relative;
}
.dentist-card-item:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.dentist-card-item.inactive { opacity: .55; }
.dentist-card-item .dent-head { display: flex; align-items: center; gap: 12px; }
.dentist-card-item .dent-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  border: 1.5px solid var(--brand-soft);
}
.dentist-card-item .dent-avatar.ortho {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.dentist-card-item .dent-info { flex: 1; min-width: 0; }
.dentist-card-item .dent-name {
  font-weight: 700; font-size: .92rem; color: var(--neutral-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dentist-card-item .dent-type {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-block;
}
.dentist-card-item .dent-type.dentist     { background: var(--neutral-100); color: var(--neutral-700); }
.dentist-card-item .dent-type.orthodontist { background: var(--brand-soft); color: var(--brand); }
.dentist-card-item .dent-meta {
  font-size: .8rem;
  color: var(--neutral-500);
  display: flex; align-items: center; gap: 5px;
}
.dentist-card-item .dent-zones {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 4px;
}
.dentist-card-item .dent-zone-tag {
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-size: .7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
}
.dentist-card-item .dent-stats {
  display: flex; gap: 12px; margin-top: 6px;
  border-top: 1px solid var(--neutral-100);
  padding-top: 10px;
}
.dent-stat {
  font-size: .76rem;
  color: var(--neutral-500);
  display: flex; align-items: center; gap: 4px;
}
.dent-stat strong { color: var(--neutral-900); }
.dent-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.dentist-card-item:hover .dent-actions { opacity: 1; }

/* ══ FORM SECTION TITLE ══ */
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand);
  margin: 18px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--brand-soft);
}

/* ══ ZONE GROUPS ══ */
.zone-group {
  display: flex; flex-direction: column; gap: 6px;
}
.zone-group-header {
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--brand-soft);
  margin-bottom: 4px;
}

.zone-group-cb {
  margin-bottom: 14px;
}
.zone-group-cb-head {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.zone-group-cb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px;
}
.btn-link {
  background: none; border: none;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.btn-link:hover { background: var(--brand-soft); }

/* ══ ZONES (admin) ══ */
.zone-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  padding: 8px 12px;
}
.zone-row .zone-name {
  flex: 1; font-size: .88rem; font-weight: 500; color: var(--neutral-800);
}
.zone-row input.zone-name-edit {
  flex: 1; padding: 4px 8px;
  font-size: .88rem; font-weight: 500;
  border: 1px solid var(--brand);
  border-radius: 6px;
  outline: none;
  background: #fff;
}
.zone-row .zone-count {
  font-size: .72rem; color: var(--neutral-400);
}

/* ══ ZONES SEARCH BAR (modale praticien) ══ */
.zones-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: 8px;
  padding: 7px 12px;
  margin-bottom: 8px;
}
.zones-search-bar input {
  border: none; background: none; outline: none;
  font-size: .85rem; color: var(--neutral-800);
  flex: 1; font-family: inherit;
}
.zones-counter {
  font-size: .72rem;
  font-weight: 600;
  color: var(--neutral-400);
  background: var(--neutral-100);
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.zones-counter.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ══ ZONES CHECKBOX GRID (dans modale praticien) ══ */
.zones-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.zone-check {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--neutral-700);
  background: #fff;
  border: 1px solid transparent;
  transition: all .12s;
}
.zone-check:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.zone-check input { accent-color: var(--brand); cursor: pointer; }
.zone-check input:checked + span { color: var(--brand-dark); font-weight: 600; }

/* ══ PROFIL ══ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--neutral-100);
}
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-name { font-size: 1.05rem; font-weight: 700; color: var(--neutral-900); }
.profile-role {
  font-size: .72rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

/* ══ TOGGLE SWITCHES (préférences notifs) ══ */
.notif-prefs {
  display: flex; flex-direction: column;
  gap: 4px;
}
.notif-pref-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  transition: background .12s;
}
.notif-pref-row:hover { background: var(--neutral-50); }
.notif-pref-info { flex: 1; min-width: 0; }
.notif-pref-label {
  font-size: .9rem; font-weight: 600; color: var(--neutral-900);
  margin-bottom: 2px;
}
.notif-pref-desc {
  font-size: .78rem; color: var(--neutral-500); line-height: 1.45;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0; height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--neutral-300);
  border-radius: 99px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--brand);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
  opacity: .5; cursor: not-allowed;
}

/* ══ DASHBOARD : Push notifications + QR ══ */
.push-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  padding: 20px 22px;
  align-items: center;
}
@media (max-width: 700px) {
  .push-grid { grid-template-columns: 1fr; }
  .push-qr { order: -1; }
}
.push-qr img {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
}
.push-qr {
  text-align: center;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 14px;
}
.push-qr img {
  display: block;
  width: 192px; height: 192px;
  margin: 0 auto;
  border-radius: 8px;
}
.push-qr-cap {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand);
  margin-top: 8px;
}

/* ══ DASHBOARD : Toolbar widgets ══ */
.widget-toolbar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  margin-bottom: 16px;
}
.widget-toolbar-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neutral-500);
  margin-right: 4px;
}
.widget-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid var(--neutral-200);
  background: #fff;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--neutral-600);
  cursor: pointer;
  user-select: none;
  transition: all .12s;
}
.widget-toggle:hover { border-color: var(--brand); color: var(--brand); }
.widget-toggle input { display: none; }
.widget-toggle:has(input:checked) {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.widget-toggle:has(input:not(:checked))::before {
  content: '○';
  font-weight: 900;
  color: var(--neutral-300);
}
.widget-toggle:has(input:checked)::before {
  content: '●';
  font-weight: 900;
  color: var(--brand);
}

/* ══ DASHBOARD : Layout 2 colonnes (commerciaux + donuts) ══ */
.dashboard-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: stretch;       /* étire la colonne droite à la hauteur de gauche */
}
@media (max-width: 1100px) {
  .dashboard-2col { grid-template-columns: 1fr; align-items: start; }
}
.dashboard-donut-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;  /* 2 donuts à hauteur égale */
  gap: 16px;
  height: 100%;
}
.dashboard-donut-stack .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dashboard-donut-stack .chart-donut-wrap {
  flex: 1;
  align-items: center;
}

/* ══ DASHBOARD : Activité par période (4 colonnes Total · Today · Week · Month) ══ */
.period-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 18px 22px;
}
@media (max-width: 1100px) {
  .period-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .period-grid { grid-template-columns: 1fr; }
}
.period-col.is-total {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
}
.period-col.is-total .period-title { color: var(--brand-dark); }
.period-col.is-total .period-title-big { color: var(--brand); }
.period-col {
  background: var(--neutral-50);
  border-radius: 10px;
  padding: 14px 16px;
}
.period-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neutral-500);
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.period-title-big {
  font-size: 2rem; font-weight: 800; color: var(--neutral-900); line-height: 1;
}
.period-stats { display: flex; flex-direction: column; gap: 4px; }
.period-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: .82rem;
  transition: background .12s;
}
.period-row:hover { background: var(--neutral-100); }
.period-row .lbl { display: flex; align-items: center; gap: 6px; color: var(--neutral-600); }
.period-row .lbl::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--neutral-300);
}
.period-row.s-new       .lbl::before { background: var(--brand); }
.period-row.s-assigned  .lbl::before { background: var(--neutral-500); }
.period-row.s-contact   .lbl::before { background: var(--brand-dark); }
.period-row.s-rdv       .lbl::before { background: var(--brand); }
.period-row.s-rdv_confirmed .lbl::before { background: var(--success); opacity: .6; }
.period-row.s-concretise .lbl::before { background: var(--success); }
.period-row.s-lost      .lbl::before { background: var(--neutral-300); }
.period-row .v {
  font-weight: 700;
  color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

/* ══ DASHBOARD : Charts ══ */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}

/* Bar chart 7 jours */
.chart-7days {
  padding: 18px 22px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 200px;
}
.chart-7days .bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.chart-7days .bar-fill {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: opacity .15s;
  position: relative;
}
.chart-7days .bar:hover .bar-fill { opacity: .8; }
.chart-7days .bar-fill .bar-value {
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  font-weight: 700;
  color: var(--neutral-900);
  white-space: nowrap;
}
.chart-7days .bar-label {
  font-size: .7rem;
  color: var(--neutral-500);
  font-weight: 600;
  text-align: center;
  text-transform: capitalize;
}

/* Donut chart */
.chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  flex-wrap: wrap;
}
.chart-donut svg { width: 160px; height: 160px; flex-shrink: 0; }
.chart-donut-legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px; }
.donut-row {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem;
  padding: 3px 0;
}
.donut-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.donut-row .lbl { flex: 1; color: var(--neutral-700); }
.donut-row .v { font-weight: 700; color: var(--neutral-900); font-variant-numeric: tabular-nums; }

/* ══ DASHBOARD : commerciaux ══ */
.commercials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px 22px;
}
.com-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .12s, transform .12s;
}
.com-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.com-card-head { display: flex; align-items: center; gap: 12px; }
.com-card-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.com-card-avatar .online-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--neutral-300);
  border: 2px solid #fff;
}
.com-card-avatar.online .online-dot { background: var(--success); }
.com-card-info { flex: 1; min-width: 0; }
.com-card-name {
  font-weight: 700; font-size: .9rem; color: var(--neutral-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.com-card-status {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neutral-400);
}
.com-card-status.online { color: var(--success); }
.com-card-total {
  font-size: 2rem;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1;
}
.com-card-total-lbl {
  font-size: .72rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.com-card-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--neutral-100);
}
.com-card-bar > div {
  transition: width .3s;
}
.com-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.com-stat {
  background: var(--neutral-50);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}
.com-stat-num {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}
.com-stat-lbl {
  font-size: .65rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-top: 2px;
}
.com-stat-num.success { color: var(--success); }
.com-stat-num.brand   { color: var(--brand); }
.com-stat-num.muted   { color: var(--neutral-400); }
.com-card-conv {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--neutral-100);
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem;
  color: var(--neutral-600);
}
.com-conv-rate {
  font-weight: 700;
  color: var(--success);
}

/* ══ MESSAGERIE INTERNE ══ */
.msg-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  height: calc(100vh - 60px - 56px); /* topbar + padding */
  min-height: 500px;
}
@media (max-width: 900px) {
  .msg-layout { grid-template-columns: 1fr; }
}
.msg-conversations {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.msg-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}
.msg-search input {
  border: none; outline: none; background: none;
  flex: 1; font-size: .85rem; color: var(--neutral-800);
  font-family: inherit;
}
.msg-conv-list { flex: 1; overflow-y: auto; padding: 4px; }
.conv-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.conv-item:hover { background: var(--neutral-50); }
.conv-item.active { background: var(--brand-soft); }
.conv-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.conv-avatar .online-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #fff;
}
.conv-avatar.offline .online-dot {
  background: var(--neutral-300);
}
.online-text {
  font-size: .7rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.online-text.online  { color: var(--success); }
.online-text.offline { color: var(--neutral-400); }
.online-text::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.conv-item.active .conv-avatar {
  background: var(--brand); color: #fff;
}
.conv-body { flex: 1; min-width: 0; }
.conv-name {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: .88rem;
  color: var(--neutral-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-role {
  font-size: .65rem; font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.conv-last {
  font-size: .76rem;
  color: var(--neutral-500);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-last.unread { color: var(--neutral-900); font-weight: 600; }
.conv-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px;
  flex-shrink: 0;
}
.conv-time {
  font-size: .68rem; color: var(--neutral-400);
}
.conv-badge {
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

/* Chat panel */
.msg-chat {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.msg-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  color: var(--neutral-400);
  padding: 40px 20px;
}
.msg-chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--neutral-100);
}
.msg-chat-header .btn-icon { margin-left: auto; }
.msg-chat-header .conv-avatar { width: 42px; height: 42px; }
.msg-chat-name { font-weight: 700; color: var(--neutral-900); }
.msg-chat-role { font-size: .72rem; color: var(--neutral-500); }

.msg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column;
  gap: 4px;
  background: var(--neutral-50);
}
.msg-day-sep {
  align-self: center;
  font-size: .68rem;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 14px 0 6px;
}
.msg-bubble {
  max-width: 70%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .88rem;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  margin-bottom: 2px;
}
.msg-bubble.received {
  background: #fff;
  color: var(--neutral-800);
  border: 1px solid var(--neutral-200);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-bubble.sent {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-time {
  font-size: .65rem;
  color: var(--neutral-400);
  margin: 1px 8px 8px;
}
.msg-time.sent { align-self: flex-end; }
.msg-time.received { align-self: flex-start; }
.msg-time .read { color: var(--brand); margin-left: 4px; }

.msg-compose {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--neutral-100);
  background: #fff;
  align-items: flex-end;
}
.msg-attach-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--neutral-200);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-500);
  transition: all .12s;
}
.msg-attach-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.msg-attach-btn .ic { width: 20px; height: 20px; }

/* Preview avant envoi */
.msg-preview {
  display: none;
  border-top: 1px solid var(--neutral-100);
  background: var(--neutral-50);
  padding: 10px 14px;
  align-items: center; gap: 10px;
}
.msg-preview.visible { display: flex; }
.msg-preview-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  background: var(--neutral-200);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-500);
}
.msg-preview-info { flex: 1; min-width: 0; }
.msg-preview-name {
  font-size: .85rem; font-weight: 600; color: var(--neutral-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-preview-size { font-size: .72rem; color: var(--neutral-500); margin-top: 2px; }
.msg-preview-cancel {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none; background: var(--neutral-200);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-700);
}
.msg-preview-cancel:hover { background: var(--danger); color: #fff; }

/* Pièces jointes dans les bulles */
.msg-bubble.with-image {
  padding: 4px;
  background: transparent !important;
  border: none !important;
}
.msg-bubble-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  cursor: pointer;
  background: var(--neutral-100);
}
.msg-bubble.with-image.sent .msg-img-caption {
  background: var(--brand); color: #fff;
  padding: 7px 12px;
  border-radius: 0 0 10px 10px;
  margin-top: -4px;
}
.msg-bubble.with-image.received .msg-img-caption {
  background: #fff; color: var(--neutral-800);
  padding: 7px 12px;
  border-radius: 0 0 10px 10px;
  border: 1px solid var(--neutral-200); border-top: 0;
  margin-top: -4px;
}

/* Document attaché (non-image) */
.msg-attachment-doc {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.18);
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  margin-top: 4px;
}
.msg-bubble.received .msg-attachment-doc {
  background: var(--neutral-100);
}
.msg-attachment-doc:hover { filter: brightness(.95); }
.msg-attachment-doc .doc-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-bubble.received .msg-attachment-doc .doc-icon { background: #fff; color: var(--brand); }
.msg-doc-name {
  font-size: .82rem; font-weight: 600; line-height: 1.2;
  word-break: break-word;
}
.msg-doc-size { font-size: .7rem; opacity: .8; margin-top: 2px; }

/* Lightbox pour les images */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.msg-compose textarea {
  flex: 1;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  max-height: 120px;
}
.msg-compose textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237,58,95,.12);
}
.msg-compose button {
  align-self: flex-end;
}

/* Badge non-lu sur le nav-item Messagerie */
.nav-item .nav-unread {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

/* ══ DASHBOARD : layout calendrier + sidebar ══ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Calendrier */
.cal-wrap { padding: 14px 18px 18px; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.cal-weekdays > div {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--neutral-400);
  text-align: center;
  padding: 6px 0;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1 / 1;
  background: var(--neutral-50);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color .12s, background .12s;
}
.cal-day:hover { border-color: var(--neutral-200); background: #fff; }
.cal-day.other-month { opacity: .35; }
.cal-day.today {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
}
.cal-day.today .cal-day-num { color: var(--brand); font-weight: 800; }
.cal-day.selected {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237,58,95,.15);
}
.cal-day-num {
  font-size: .85rem;
  font-weight: 600;
  color: var(--neutral-700);
}
.cal-day-dots {
  display: flex; flex-wrap: wrap; gap: 3px;
  margin-top: auto;
}
.cal-day-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.cal-day-dot.completed { background: var(--neutral-300); }
.cal-day-count {
  font-size: .65rem;
  color: var(--neutral-400);
  font-weight: 600;
}

/* Sidebar rappels */
.reminder-item {
  display: flex; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--neutral-200);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.reminder-item:hover { border-color: var(--brand); background: var(--brand-tint); }
.reminder-item.completed { opacity: .55; }
.reminder-item.completed .rem-title { text-decoration: line-through; }
.reminder-item.due-soon { border-color: var(--brand); }
.reminder-item.overdue { border-color: var(--danger); background: var(--danger-soft); }

.rem-check {
  width: 20px; height: 20px;
  border: 2px solid var(--neutral-300);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: all .12s;
}
.rem-check:hover { border-color: var(--brand); }
.rem-check.checked {
  background: var(--brand);
  border-color: var(--brand);
}
.rem-check.checked::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.rem-body { flex: 1; min-width: 0; }
.rem-time {
  font-size: .72rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rem-time.overdue { color: var(--danger); }
.rem-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--neutral-900);
  margin-top: 2px;
}
.rem-patient {
  font-size: .76rem;
  color: var(--neutral-500);
  margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.rem-assignee {
  font-size: .68rem;
  color: var(--neutral-400);
  margin-top: 2px;
}

/* Notification permission banner */
.notif-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--brand-dark);
}
.notif-banner button {
  margin-left: auto;
}

/* ══ COMBOBOX FILTRE (compacte, dans la filter-bar) ══ */
.combobox-filter { min-width: 200px; max-width: 240px; }
.combobox-filter .combobox-field {
  padding: 6px 10px;
  border-width: 1px;
  background: #fff;
  border-radius: 8px;
}
.combobox-filter .combobox-field input {
  font-size: .85rem;
  color: var(--neutral-700);
}

/* ══ COMBOBOX (zone avec recherche) ══ */
.combobox { position: relative; }
.combobox-field {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.combobox-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237,58,95,.12);
}
.combobox-field input {
  flex: 1; border: none; outline: none;
  font-size: .9rem; color: var(--neutral-800);
  background: none; font-family: inherit;
}
.combobox-clear {
  background: var(--neutral-100); border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-500);
}
.combobox-clear:hover { background: var(--brand-soft); color: var(--brand); }
.combobox-popup {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}
.combobox-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand);
  padding: 8px 14px 4px;
}
.combobox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--neutral-700);
  transition: background .12s;
}
.combobox-item:hover, .combobox-item.highlight { background: var(--brand-soft); color: var(--brand-dark); }
.combobox-item.selected { background: var(--brand); color: #fff; font-weight: 600; }
.combobox-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: .85rem;
  color: var(--neutral-400);
}

/* ══ DENTIST PICKER (cartes cliquables dans modale patient) ══ */
.dentist-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 12px;
  max-height: 380px;
  overflow-y: auto;
}
.dent-pick-card {
  background: #fff;
  border: 2px solid var(--neutral-200);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
}
.dent-pick-card:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.dent-pick-card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(237,58,95,.15);
}
.dent-pick-card.selected::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px;
}
.dent-pick-head { display: flex; align-items: center; gap: 10px; }
.dent-pick-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: .76rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dent-pick-avatar.ortho { background: var(--brand); color: #fff; }
.dent-pick-name {
  font-weight: 700; font-size: .85rem; color: var(--neutral-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dent-pick-type {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neutral-500);
}
.dent-pick-info {
  font-size: .75rem;
  color: var(--neutral-600);
  display: flex; align-items: center; gap: 5px;
  font-family: monospace;
}
.dent-pick-info svg { color: var(--neutral-400); }
.dent-pick-zones {
  display: flex; flex-wrap: wrap; gap: 3px;
  margin-top: 4px;
}
.dent-pick-zones .tag {
  font-size: .68rem;
  background: var(--neutral-100);
  color: var(--neutral-600);
  padding: 1px 7px;
  border-radius: 99px;
}
.dent-pick-empty {
  background: var(--neutral-50);
  border: 1px dashed var(--neutral-300);
  border-radius: 10px;
  padding: 26px 16px;
  text-align: center;
  color: var(--neutral-500);
  font-size: .88rem;
}

/* ══ BANNIÈRE PRATICIEN (actions sur patient) ══ */
.dent-banner {
  background: var(--brand-tint);
  border: 1.5px solid var(--brand-soft);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.dent-banner.success {
  background: var(--success-soft);
  border-color: #b9ebd1;
}
.dent-banner.success .dent-banner-title {
  color: var(--success);
}
.dent-banner.info {
  background: var(--neutral-50);
  border-color: var(--neutral-200);
}
.dent-banner.info .dent-banner-title { color: var(--neutral-700); }
.dent-banner-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-dark);
  margin-bottom: 4px;
}
.dent-banner-sub {
  font-size: .82rem;
  color: var(--neutral-600);
  margin-bottom: 14px;
}
.dent-banner-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.dent-action {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--neutral-200);
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neutral-700);
  transition: all .12s;
  font-family: inherit;
}
.dent-action:hover { border-color: var(--brand); color: var(--brand); }
.dent-action.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dent-action.success { background: var(--success); border-color: var(--success); color: #fff; }
.dent-action.success:hover { filter: brightness(.95); }
.dent-action.warn    { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.dent-action.warn:hover { filter: brightness(.95); }
.dent-banner-meta {
  font-size: .78rem;
  color: var(--neutral-500);
  margin-top: 10px;
}
.dent-rdv-form {
  margin-top: 12px;
}
.dent-rdv-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.dent-rdv-inline .input {
  max-width: 280px;
  flex: 1 1 220px;
  background: #fff;
}
.dent-rdv-ok {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .dent-rdv-inline { flex-direction: column; }
  .dent-rdv-inline .input { max-width: 100%; }
  .dent-rdv-ok { width: 100%; justify-content: center; }
}

/* ══ PATIENTS — stats top + statuts ══ */
.status-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.status-stat-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.status-stat-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.status-stat-card.active { border-color: var(--brand); background: var(--brand-tint); }
.status-stat-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--neutral-500);
  margin-bottom: 4px;
}
.status-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--neutral-900); line-height: 1; }
.status-stat-value.is-success { color: var(--success); }
.status-stat-value.is-brand { color: var(--brand); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s;
}
.status-pill:hover { filter: brightness(.96); }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new        { background: var(--brand-soft);    color: var(--brand); }
.status-assigned   { background: var(--neutral-100);   color: var(--neutral-700); }
.status-contact    { background: #eef2ff;              color: #4f46e5; }
.status-rdv        { background: var(--brand);         color: #fff; }
.status-rdv::before{ background: #fff; }
.status-rdv-confirmed { background: var(--success-soft); color: var(--success); }
.status-concretise { background: var(--success);  color: #fff; }
.status-concretise::before { background: #fff; }
.status-lost       { background: var(--neutral-100);   color: var(--neutral-400); text-decoration: line-through; }
.status-no-show    { background: #fef3c7; color: #b45309; }
.status-no-show::before { background: #f59e0b; }
.status-received   { background: #d1fae5; color: #065f46; }
.status-received::before { background: #34d399; }

/* ══ BOT MESSENGER ══ */
.bs-page-row { display:flex; justify-content:space-between; align-items:center; padding:8px 10px; background:#fff; border-radius:8px; margin-bottom:6px; border:1px solid var(--neutral-200); }
.bot-phone-cell { color:var(--success); font-weight:700; font-family:monospace; text-decoration:none; }
.bot-phone-cell:hover { text-decoration:underline; }
tbody tr.bot-row-has-phone td { background: var(--success-soft); }
tbody tr.bot-row-has-phone:hover td { background: #d6efe0; }

/* Bulles de chat (modale détail lead) */
.chat-row { display:flex; margin:8px 0; }
.chat-row-user { justify-content:flex-start; }
.chat-row-bot  { justify-content:flex-end; }
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .9rem;
  line-height: 1.45;
  position: relative;
}
.chat-row-user .chat-bubble { background:var(--neutral-100); color:var(--neutral-900); border-bottom-left-radius:4px; }
.chat-row-bot  .chat-bubble { background:var(--brand); color:#fff; border-bottom-right-radius:4px; }
.chat-from { font-size:.7rem; font-weight:600; opacity:.7; margin-bottom:3px; }
.chat-txt  { white-space:pre-wrap; word-break:break-word; }
.chat-time { font-size:.65rem; opacity:.6; margin-top:4px; text-align:right; }
.bot-kpis { display:grid; gap:10px; grid-template-columns:repeat(3,1fr); padding:16px 18px; }
.bot-kpi { background:var(--neutral-50); border-radius:10px; padding:12px 14px; }
.bot-kpi-success { background:var(--success-soft); }
.bot-kpi-label { font-size:.74rem; color:var(--neutral-500); text-transform:uppercase; letter-spacing:.04em; font-weight:600; }
.bot-kpi-val { font-size:1.5rem; font-weight:800; color:var(--neutral-900); margin-top:4px; }
.bot-card { background:#fff; border:1px solid var(--neutral-200); border-radius:12px; padding:14px 16px; margin-bottom:12px; }
.bot-card:hover { box-shadow:0 4px 14px rgba(0,0,0,.05); border-color:var(--brand-light); }
.bot-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.bot-card-name { font-weight:700; color:var(--neutral-900); }
.bot-card-meta { font-size:.72rem; color:var(--neutral-400); margin-top:2px; }
.bot-phone { background:var(--success-soft); color:var(--success); padding:4px 10px; border-radius:6px; font-family:monospace; font-weight:700; font-size:.85rem; }
.bot-no-phone { color:var(--neutral-400); font-size:.78rem; }
.bot-conv { background:var(--neutral-50); border-radius:8px; padding:10px; display:flex; flex-direction:column; gap:6px; margin-bottom:10px; max-height:240px; overflow-y:auto; }
.bot-msg { font-size:.84rem; }
.bot-msg-from { font-weight:600; color:var(--neutral-700); margin-right:6px; }
.bot-msg-bot .bot-msg-from { color:var(--brand); }
.bot-msg-txt { color:var(--neutral-900); }
.bot-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width: 600px) { .bot-kpis { grid-template-columns: 1fr; } .bot-card-head { flex-direction:column; } }

/* ══ FINANCE ══ */
.fin-kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.fin-kpi-card { padding: 22px; border-left: 4px solid var(--neutral-200); }
.fin-spent { border-left-color: var(--brand); }
.fin-paid  { border-left-color: var(--success); }
.fin-balance.pos { border-left-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 50%); }
.fin-balance.neg { border-left-color: var(--success); background: linear-gradient(180deg, var(--success-soft) 0%, #fff 50%); }
.fin-kpi-label { font-size: .8rem; color: var(--neutral-500); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.fin-kpi-value { font-size: 2rem; font-weight: 800; color: var(--neutral-900); margin-top: 6px; }
.fin-kpi-value .fin-cur { font-size: .85rem; color: var(--neutral-500); font-weight: 600; margin-left: 4px; }
.fin-kpi-sub { font-size: .78rem; color: var(--neutral-400); margin-top: 6px; }
.fin-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

/* ══ ANALYSE ══ */
.metric-grid { display:grid; gap:12px; grid-template-columns:repeat(5, 1fr); margin-bottom:18px; }
.metric-card {
  background:#fff; padding:14px 16px; border-radius:12px;
  border:1px solid var(--neutral-200); display:flex; gap:12px; align-items:flex-start;
  transition:.15s;
}
.metric-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.05); border-color: color-mix(in srgb, var(--accent,#ed3a5f) 40%, var(--neutral-200)); }
.metric-icon {
  flex:none; width:36px; height:36px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
}
.metric-main { flex:1; min-width:0; }
.metric-label { font-size:.74rem; color:var(--neutral-500); text-transform:uppercase; letter-spacing:.04em; font-weight:600; }
.metric-val { font-size:1.25rem; font-weight:800; color:var(--neutral-900); margin-top:2px; }
.metric-sub { font-size:.72rem; color:var(--neutral-400); margin-top:2px; }
.ana-sec { font-size:.95rem; font-weight:700; color:var(--neutral-900); margin:22px 0 10px; display:flex; align-items:center; gap:8px; }
.ana-sec svg { color:var(--brand); }

/* Blocs et charts */
.ana-grid-2 { display:grid; gap:14px; grid-template-columns:2fr 1.2fr; margin-bottom:8px; }
.ana-block { background:#fff; border:1px solid var(--neutral-100); border-radius:12px; padding:16px; }
.ana-block-title { font-size:.85rem; font-weight:700; color:var(--neutral-700); margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.ana-block-title svg { color:var(--brand); }
.ana-chart { width:100%; }
.chart-toolbar { display:inline-flex; gap:4px; background:var(--neutral-100); border-radius:8px; padding:3px; margin-bottom:8px; }
.chart-tab {
  border:none; background:transparent; cursor:pointer;
  padding:5px 12px; font-size:.78rem; font-weight:600;
  color:var(--neutral-500); border-radius:6px; transition:.15s;
}
.chart-tab:hover { color:var(--neutral-900); }
.chart-tab.active { background:#fff; color:var(--brand); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.ana-chart-axis { display:flex; justify-content:space-between; font-size:.7rem; color:var(--neutral-500); margin-top:6px; }
.ana-donut { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.ana-donut svg { width:140px; height:140px; flex:none; }

/* Funnel */
.funnel { display:flex; flex-direction:column; gap:8px; }
.funnel-row { display:grid; grid-template-columns:200px 1fr; gap:14px; align-items:center; padding:6px 0; }
.funnel-row-final { background:linear-gradient(90deg, #d1fae5, transparent); border-radius:10px; padding:10px 8px; margin-top:6px; }
.funnel-row-final .funnel-bar { background:linear-gradient(90deg, var(--success), #34d399); }
.funnel-label { display:flex; align-items:center; gap:10px; }
.funnel-label-icon { width:32px; height:32px; border-radius:8px; background:var(--brand-soft); color:var(--brand); display:inline-flex; align-items:center; justify-content:center; flex:none; }
.funnel-row-final .funnel-label-icon { background:var(--success-soft); color:var(--success); }
.funnel-label-text { font-size:.88rem; color:var(--neutral-900); font-weight:700; }
.funnel-conv { font-size:.7rem; font-weight:700; margin-top:1px; }
.funnel-bar-wrap { position:relative; height:34px; background:var(--neutral-100); border-radius:8px; overflow:hidden; }
.funnel-bar { height:100%; background:linear-gradient(90deg, var(--brand), #fdb1c0); border-radius:8px; transition:width .3s; }
.funnel-val { position:absolute; top:50%; left:14px; transform:translateY(-50%); font-size:.82rem; color:var(--neutral-900); white-space:nowrap; }

/* Projections */
.proj-grid { display:grid; gap:12px; grid-template-columns:repeat(4, 1fr); }
.proj-card { background:#fff; border:1px dashed var(--neutral-300); border-radius:12px; padding:16px; text-align:center; }
.proj-icon { width:40px; height:40px; border-radius:50%; background:var(--brand-soft); color:var(--brand); display:inline-flex; align-items:center; justify-content:center; margin-bottom:8px; }
.proj-card-final { border:2px solid var(--success); background:linear-gradient(180deg, var(--success-soft), #fff); }
.proj-card-final .proj-icon { background:var(--success-soft); color:var(--success); }
.proj-label { font-size:.74rem; color:var(--neutral-500); text-transform:uppercase; letter-spacing:.04em; font-weight:600; }
.proj-val { font-size:1.6rem; font-weight:800; color:var(--neutral-900); margin:4px 0; }
.proj-sub { font-size:.72rem; color:var(--neutral-400); }
@media (max-width: 960px) {
  .funnel-row { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ana-grid-2 { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 1fr; }
}
.sug-list { display:flex; flex-direction:column; gap:10px; }
.sug { display:flex; gap:12px; padding:12px 14px; border-radius:10px; border:1px solid var(--neutral-200); }
.sug-ok   { background:#ecfdf5; border-color:#a7f3d0; }
.sug-warn { background:#fefce8; border-color:#fde68a; }
.sug-bad  { background:#fef2f2; border-color:#fecaca; }
.sug-info { background:#eff6ff; border-color:#bfdbfe; }
.sug-icon { font-size:1.3rem; flex:none; }
.sug-title { font-weight:700; color:var(--neutral-900); font-size:.92rem; }
.sug-text { font-size:.85rem; color:var(--neutral-700); margin-top:3px; line-height:1.45; }
.cmp-table { width:100%; border-collapse:collapse; font-size:.86rem; }
.cmp-table th { background:var(--neutral-50); text-align:left; padding:10px 12px; font-weight:600; color:var(--neutral-500); }
.cmp-table td { padding:10px 12px; border-top:1px solid var(--neutral-100); vertical-align: top; }
.post-rank-grid { display:grid; gap:12px; grid-template-columns:repeat(3,1fr); margin-top:14px; }
.post-rank { background:var(--neutral-50); border-radius:10px; padding:12px 14px; }
.post-rank-title { font-size:.85rem; font-weight:700; color:var(--neutral-900); margin-bottom:8px; }
.post-rank-row { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:.82rem; border-top:1px solid var(--neutral-100); }
.post-rank-row:first-of-type { border-top:none; }
.post-rank-pos { width:22px; height:22px; border-radius:50%; background:var(--brand); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:700; flex:none; }
.post-rank-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--neutral-700); }
.post-rank-val { font-weight:700; color:var(--neutral-900); white-space:nowrap; }
@media (max-width: 960px) { .post-rank-grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .fin-kpis { grid-template-columns: 1fr; }
  .fin-grid { grid-template-columns: 1fr; }
}

/* ══ PAGINATION (liste patients) ══ */
.leads-pagination { padding: 12px 18px; }
.lp-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.lp-info { font-size: .85rem; color: var(--neutral-500); }
.lp-info strong { color: var(--neutral-900); }
.lp-pages { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.lp-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--neutral-200); background: #fff; color: var(--neutral-700);
  border-radius: 8px; font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.lp-btn:hover:not(:disabled):not(.active) { border-color: var(--brand); color: var(--brand); }
.lp-btn.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700;
}
.lp-btn:disabled { opacity: .4; cursor: not-allowed; }
.lp-ellipsis { color: var(--neutral-400); padding: 0 4px; align-self: center; }
@media (max-width: 600px) {
  .lp-bar { justify-content: center; }
  .lp-info { width: 100%; text-align: center; }
}

/* Color override for the indigo dot — keep <=3 colors total : on retire l'indigo */
.status-contact    { background: var(--brand-tint);    color: var(--brand-dark); }

.problem-tag {
  background: var(--brand-tint);
  color: var(--brand);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 500;
  display: inline-block;
  margin: 1px 2px 1px 0;
}

/* Multi-select à puces (problèmes dentaires) */
.chip-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
}
.chip-multiselect .chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1.5px solid var(--neutral-200);
  background: #fff;
  border-radius: 99px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--neutral-700);
  transition: all .12s;
  user-select: none;
}
.chip-multiselect .chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.chip-multiselect .chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip-multiselect .chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.chip-multiselect .chip:has(input:checked):hover {
  background: var(--brand-dark);
}

.lead-name-cell { display: flex; align-items: center; gap: 10px; }
.lead-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ══ CUSTOM FIELDS BUILDER ══ */
.cf-tabs {
  display: flex;
  gap: 4px;
  padding: 0 22px;
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}
.cf-tab {
  background: none; border: none;
  padding: 12px 18px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neutral-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: color .15s;
}
.cf-tab:hover { color: var(--neutral-800); }
.cf-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.cf-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.cf-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--neutral-400);
  font-size: .88rem;
  background: var(--neutral-50);
  border-radius: 12px;
  border: 1px dashed var(--neutral-200);
}
.cf-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s;
}
.cf-row:hover { border-color: var(--brand); }
.cf-handle {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--neutral-400);
}
.cf-handle button {
  background: none; border: none; cursor: pointer;
  width: 22px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-400);
  border-radius: 4px;
}
.cf-handle button:hover { background: var(--neutral-100); color: var(--brand); }
.cf-handle button:disabled { opacity: .3; cursor: not-allowed; }
.cf-info { flex: 1; min-width: 0; }
.cf-label {
  font-size: .9rem; font-weight: 600; color: var(--neutral-900);
  display: flex; align-items: center; gap: 8px;
}
.cf-meta {
  font-size: .75rem; color: var(--neutral-500);
  margin-top: 2px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.cf-type-chip {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cf-required-chip {
  background: var(--neutral-100);
  color: var(--neutral-700);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 600;
}
.cf-actions { display: flex; gap: 4px; }

/* Section "Informations complémentaires" dans le formulaire dentiste */
.cf-form-section {
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 6px;
}
.cf-form-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.cf-form-section .form-grid { gap: 12px; }
.cf-help {
  font-size: .72rem;
  color: var(--neutral-500);
  margin-top: 4px;
}

/* ══ ASSISTANT IA — Mode VOCAL plein écran ══ */
.ai-fab-group {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 800;
  display: flex; flex-direction: column;
  gap: 10px;
}
.ai-fab-text {
  width: 44px !important; height: 44px !important;
  font-size: 1.2rem !important;
  background: #fff !important;
  color: var(--brand) !important;
  border: 2px solid var(--brand) !important;
  box-shadow: 0 4px 14px rgba(237,58,95,.25) !important;
}
.ai-fab-text:hover { background: var(--brand-tint) !important; }

/* Mode vocal plein écran */
.voice-mode {
  position: fixed;
  inset: 0;
  z-index: 950;
  background:
    radial-gradient(circle at 30% 20%, rgba(237,58,95,.4), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(21,163,107,.25), transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e1b2e 50%, #2d1b3a 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: voiceFadeIn .4s ease;
}
.voice-mode.open { display: flex; }
@keyframes voiceFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.voice-close {
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  transition: background .15s;
}
.voice-close:hover { background: rgba(255,255,255,.2); }

/* Orb central animé */
.voice-orb-wrap {
  position: relative;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 40px;
}
.voice-orb {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.voice-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(237,58,95,.5);
  animation: orbRing 3s ease-out infinite;
  opacity: 0;
}
.voice-orb-ring.r2 { animation-delay: 1s; }
.voice-orb-ring.r3 { animation-delay: 2s; }
@keyframes orbRing {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(1.3); opacity: 0; }
}
.voice-orb-core {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ed3a5f 0%, #c81d44 50%, #8b1538 100%);
  box-shadow:
    0 0 60px rgba(237,58,95,.6),
    0 0 120px rgba(237,58,95,.3),
    inset 0 0 40px rgba(255,255,255,.15);
  animation: orbBreathe 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.voice-orb-core::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4), transparent 50%);
}
@keyframes orbBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* États : écoute (vert), parle (rose intense), réflexion (jaune) */
.voice-orb.listening .voice-orb-core {
  background: linear-gradient(135deg, #15a36b 0%, #0f7d52 50%, #074a32 100%);
  box-shadow:
    0 0 60px rgba(21,163,107,.6),
    0 0 120px rgba(21,163,107,.3),
    inset 0 0 40px rgba(255,255,255,.15);
  animation: orbListen .8s ease-in-out infinite;
}
.voice-orb.listening .voice-orb-ring { border-color: rgba(21,163,107,.5); }
@keyframes orbListen {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.voice-orb.speaking .voice-orb-core {
  animation: orbSpeak .25s ease-in-out infinite;
}
@keyframes orbSpeak {
  0%, 100% { transform: scale(1.05); }
  50%      { transform: scale(1.18); }
}
.voice-orb.thinking .voice-orb-core {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #92400e 100%);
  box-shadow: 0 0 60px rgba(245,158,11,.5);
  animation: orbThink 1.5s linear infinite;
}
.voice-orb.thinking .voice-orb-ring { border-color: rgba(245,158,11,.4); }
@keyframes orbThink {
  0%   { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

.voice-status {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: .2px;
  min-height: 1.5em;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.voice-transcript {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  text-align: center;
  max-width: 600px;
  min-height: 2.5em;
  font-style: italic;
  padding: 0 20px;
  margin-bottom: 30px;
  line-height: 1.5;
  text-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.voice-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.voice-action {
  padding: 12px 24px;
  border-radius: 99px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all .15s;
  font-family: inherit;
}
.voice-action:hover { background: rgba(255,255,255,.2); }
.voice-action.muted { opacity: .5; text-decoration: line-through; }
.voice-select {
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.voice-select option { background: #1e1b2e; color: #fff; }

@media (max-width: 600px) {
  .voice-orb-wrap { width: 200px; height: 200px; margin-bottom: 24px; }
  .voice-orb-core { width: 130px; height: 130px; }
  .voice-status { font-size: 1.05rem; }
  .voice-transcript { font-size: .9rem; }
}

/* ══ ASSISTANT IA — bouton flottant + panel ══ */
.ai-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(237,58,95,.45), 0 2px 8px rgba(0,0,0,.1);
  z-index: 800;
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
.ai-fab:hover {
  transform: scale(1.08) rotate(8deg);
  box-shadow: 0 12px 32px rgba(237,58,95,.55), 0 2px 8px rgba(0,0,0,.12);
}
.ai-fab.open {
  transform: scale(0);
  pointer-events: none;
}

.ai-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(24,24,27,.18), 0 8px 16px rgba(0,0,0,.06);
  z-index: 850;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: aiPanelIn .25s ease-out;
}
.ai-panel.open { display: flex; }
@keyframes aiPanelIn {
  from { opacity: 0; transform: scale(.85) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-panel-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700;
  font-size: .95rem;
}
.ai-close {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.ai-close:hover { background: rgba(255,255,255,.35); }

.ai-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--neutral-100);
  background: var(--brand-tint);
}
.ai-chip {
  background: #fff;
  border: 1px solid var(--brand-soft);
  color: var(--brand);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.ai-chip:hover { background: var(--brand); color: #fff; }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  background: var(--neutral-50);
}
.ai-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .88rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.ai-bubble.user {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ai-bubble.bot {
  background: #fff;
  color: var(--neutral-800);
  border: 1px solid var(--neutral-200);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.ai-bubble.bot strong { color: var(--brand); }
.ai-bubble.typing {
  font-style: italic;
  color: var(--neutral-400);
}

.ai-input-form {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--neutral-100);
  background: #fff;
}
.ai-input-form input {
  flex: 1;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .88rem;
  outline: none;
  font-family: inherit;
}
.ai-input-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237,58,95,.12);
}
.ai-input-form button {
  width: 42px; height: 42px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-mic-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-600);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
}
.ai-mic-btn::before { content: '🎤'; }
.ai-mic-btn:hover { border-color: var(--brand); }
.ai-mic-btn.recording {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: micPulse 1s infinite;
}
.ai-mic-btn.recording::before { content: '🔴'; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(237,58,95,.5); }
  50%      { box-shadow: 0 0 0 10px rgba(237,58,95,0); }
}

.ai-mini-btn {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background .12s;
}
.ai-mini-btn:hover { background: rgba(255,255,255,.35); }
.ai-mini-btn.off { opacity: .4; text-decoration: line-through; }
.ai-mini-btn.on {
  background: #fff;
  color: var(--brand);
}

/* Indicateur conversation continue active */
.ai-panel.continuous .ai-panel-header {
  background: linear-gradient(135deg, var(--success) 0%, var(--brand) 100%);
}
.ai-panel.continuous .ai-mic-btn {
  background: var(--brand-soft);
  border-color: var(--brand);
}

@media (max-width: 480px) {
  .ai-panel {
    bottom: 70px; right: 8px; left: 8px;
    width: auto;
    height: 70vh;
  }
  .ai-fab { bottom: 70px; right: 12px; }
}

/* ══ Toast ══ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--neutral-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  animation: slideUp .25s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 99px; }

/* ════════════════════════════════════════════
   RESPONSIVE — tablette + mobile
   ════════════════════════════════════════════ */

/* Tablette : sidebar collapsée à 60px */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .sidebar-logo img { height: 28px; }
  .sidebar .nav-item span:not(.icon),
  .sidebar .nav-section-label,
  .sidebar .user-meta,
  .sidebar-footer .btn { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-unread {
    position: absolute; top: 4px; right: 4px;
    margin: 0;
    font-size: .58rem;
    padding: 0 4px; min-width: 14px;
  }
  .main { margin-left: 60px; }
  .page-content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .topbar-title { font-size: .9rem; }

  /* Modale plus large et avec un peu moins de padding */
  .modal { max-width: 95% !important; }
  .modal-body { padding: 18px 20px; }
  .form-grid { grid-template-columns: 1fr 1fr; }

  /* Dashboard grid en colonne */
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Mobile : ≤ 640px */
@media (max-width: 640px) {
  /* Sidebar mode bottom-bar (icônes en bas, comme appli mobile) */
  .sidebar {
    width: 100%;
    height: 56px;
    min-height: 0;
    bottom: 0; top: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--neutral-200);
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  }
  .sidebar-logo, .sidebar-footer { display: none; }
  .sidebar-nav {
    flex: 1; flex-direction: row;
    padding: 6px 4px;
    gap: 0;
    overflow-x: auto;
    align-items: stretch;
  }
  .nav-section-label { display: none; }
  .nav-item {
    flex: 1; min-width: 56px;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    font-size: .65rem;
    border-radius: 6px;
    text-align: center;
  }
  .nav-item span:not(.icon) {
    display: block;
    font-size: .6rem;
    line-height: 1;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
  }
  .nav-item .ic { width: 18px; height: 18px; }

  /* Layout principal */
  .main { margin-left: 0; padding-bottom: 56px; }
  .page-content { padding: 12px; }
  .topbar {
    height: 50px;
    padding: 0 12px;
    position: sticky;
  }
  .topbar-title { font-size: .85rem; font-weight: 700; }
  .topbar-actions { gap: 6px; }

  /* Boutons un peu plus compacts */
  .btn { padding: 8px 12px; font-size: .8rem; }
  .btn-sm { padding: 6px 10px; font-size: .75rem; }

  /* Cards / headers qui s'adaptent */
  .card-header { padding: 14px 16px; gap: 8px; }
  .card-header > * { flex-shrink: 0; }
  .card-title { font-size: .85rem; }
  .filter-bar { padding: 10px 12px; gap: 8px; }
  .filter-bar .search-input { flex: 0 0 100%; min-width: 100%; }
  .filter-select { font-size: .8rem; padding: 6px 10px; min-width: 120px; flex: 1; }
  .combobox-filter { min-width: 100%; max-width: 100%; }

  /* Stats cards */
  .status-stats { gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .status-stat-card { padding: 10px 12px; }
  .status-stat-value { font-size: 1.4rem; }
  .status-stat-label { font-size: .65rem; }

  /* Tableaux : police plus petite + colonnes secondaires masquées */
  table { font-size: .82rem; }
  th, td { padding: 9px 12px; }
  .hide-sm { display: none !important; }

  /* Modales : full screen */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal {
    max-width: 100% !important;
    min-height: 100vh;
    border-radius: 0;
    transform: translateY(0);
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal-header { padding: 16px 18px 12px; }
  .modal-body { padding: 18px; }
  .modal-footer {
    padding: 12px 18px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn { flex: 1; min-width: 0; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .col-span-2 { grid-column: span 1; }
  .tabs, .cf-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .tab, .cf-tab { white-space: nowrap; padding: 10px 14px; flex-shrink: 0; }

  /* Calendrier */
  .cal-wrap { padding: 10px 12px; }
  .cal-day { padding: 4px 5px; border-radius: 6px; }
  .cal-day-num { font-size: .72rem; }
  .cal-day-dot { width: 5px; height: 5px; }
  .cal-day-dots { gap: 2px; }
  .cal-weekdays > div { font-size: .58rem; padding: 4px 0; }

  /* Cartes commerciaux */
  .commercials-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  .com-card-total { font-size: 1.6rem; }

  /* Cartes praticiens : 1 colonne */
  .dentist-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; }

  /* Zones config */
  .zones-checkbox-grid { padding: 10px; max-height: 280px; }
  .zone-group-cb-grid { grid-template-columns: 1fr 1fr; }

  /* Cartes dentistes (modale patient) */
  .dentist-pick-grid {
    grid-template-columns: 1fr;
    max-height: 320px;
    padding: 8px;
  }

  /* Empty states */
  .empty-state { padding: 40px 16px; }
  .empty-icon-svg { width: 44px; height: 44px; }

  /* Messagerie : passage à 1 colonne avec toggle (géré en JS via classe show-chat) */
  .msg-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 50px - 56px - 24px);
  }
  .msg-layout .msg-chat { display: none; }
  .msg-layout.show-chat .msg-conversations { display: none; }
  .msg-layout.show-chat .msg-chat { display: flex; }
  .msg-chat-back {
    background: none; border: none;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--neutral-700);
    cursor: pointer;
    border-radius: 50%;
    margin-right: 4px;
  }
  .msg-chat-back:hover { background: var(--neutral-100); }
  .msg-chat-back .ic { width: 22px; height: 22px; transform: rotate(90deg); }
  .msg-bubble { max-width: 85%; }
  .msg-compose textarea { padding: 8px 12px; font-size: .85rem; }
  .msg-compose button .ic { display: none; }
  .conv-name { font-size: .82rem; }
  .conv-last { font-size: .72rem; }

  /* Login */
  .login-card { padding: 28px 22px 22px; }
  .login-logo img { height: 44px; }
  .login-title { font-size: 1.25rem; }

  /* Reminders sidebar */
  .reminder-item { padding: 8px 10px; }
  .rem-title { font-size: .82rem; }

  /* Toast un peu plus haut (pour ne pas masquer la bottom-bar) */
  .toast-container { bottom: 70px; right: 12px; left: 12px; }
  .toast { min-width: 0; width: 100%; }

  /* Hide bottom bar nav on login screen */
  #screen-login ~ .toast-container { bottom: 24px; }
}

/* Très petits écrans */
@media (max-width: 380px) {
  .nav-item span:not(.icon) { font-size: .55rem; }
  .status-stats { grid-template-columns: 1fr 1fr; }
  .com-card-stats { grid-template-columns: 1fr; }
  .com-stat { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 10px; }
}
