/* =====================================================================
   MEDICO-NURSE — Design System Principal
   ---------------------------------------------------------------------
   - Variables CSS (mode clair / sombre)
   - Base & typographie
   - Composants réutilisables (boutons, cartes, badges, formulaires…)
   - Dashboard, messagerie, notifications
   - Responsive (Desktop → Tablette → Mobile)
   - Animations CSS légères
   ===================================================================== */

/* ---------- Variables : mode clair (défaut) ---------- */
:root,
[data-theme="light"] {
  --brand: #0e7490;
  --brand-2: #1d4ed8;
  --brand-grad: linear-gradient(135deg, #0e7490, #1d4ed8);
  --brand-rgb: 14, 116, 144;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eff3f9;
  --border: #e2e8f0;
  --border-2: #cbd5e1;

  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .12);
  --ring: 0 0 0 3px rgba(var(--brand-rgb), .18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --topbar-h: 66px;
}

/* ---------- Mode sombre ---------- */
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2c;
  --surface-2: #0f1729;
  --surface-3: #16203a;
  --border: #22304a;
  --border-2: #2f3f5e;

  --text: #e7edf7;
  --muted: #94a3b8;
  --muted-2: #64748b;

  --success-bg: #052e16;
  --warning-bg: #331c06;
  --danger-bg: #33090a;
  --info-bg: #032b3f;

  --shadow: 0 4px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
svg.icon { width: 1.05em; height: 1.05em; flex: none; }
input, select, textarea, button { font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s ease;
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.07); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }

/* ---------- Icônes & boutons icônes ---------- */
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--text);
  transition: all .2s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--brand); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: inline; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }
.has-badge .badge-dot {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 50px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

/* ---------- Topbar / Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 900; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: var(--topbar-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-sm);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { color: var(--text); }
.brand-name .accent { color: var(--brand); }
.brand-logo { height: 36px; }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
/* Boutons d'auth du menu (anciennement en haut à droite) : une seule source,
   affichés en ligne sur desktop et en colonne dans le menu mobile. */
.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 8px; }
.nav-link {
  padding: 9px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: all .2s ease;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { color: var(--brand); background: rgba(var(--brand-rgb), .1); }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 50px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600;
  transition: all .2s ease;
}
.user-chip:hover { border-color: var(--brand); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .18s ease; z-index: 950;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a, .dropdown .menu-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px;
  color: var(--text); font-size: 14px; font-weight: 500; background: transparent; border: 0; text-decoration: none;
  transition: all .15s ease;
}
.dropdown a:hover, .dropdown .menu-btn:hover { background: var(--surface-3); color: var(--brand); }
.dropdown a .icon, .dropdown .menu-btn .icon { width: 17px; height: 17px; }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-form { margin: 0; }
.menu-btn.danger:hover { color: var(--danger); }

/* ---------- Sélecteur de langue ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border-radius: 50px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 700; transition: all .2s ease;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-btn .icon { width: 16px; height: 16px; }
.lang-switch .dropdown { min-width: 150px; }
.lang-switch.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown { right: 0; }
html[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-option { justify-content: center; font-weight: 600; }

.burger { display: none; flex-direction: column; gap: 4px; width: 40px; height: 40px; border: 0; background: transparent; align-items: center; justify-content: center; }
.burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s ease; }

/* ---------- Messages flash ---------- */
.flash-stack { position: fixed; top: calc(var(--topbar-h) + 16px); right: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 12px; max-width: 400px; }
.alert {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px 14px; border-radius: var(--radius-lg, 14px);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border);
  box-shadow: 0 18px 50px -12px rgba(15, 23, 42, .28), 0 4px 12px rgba(15, 23, 42, .08);
  font-size: 14px; font-weight: 500; letter-spacing: .01em;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  animation: slideIn .35s cubic-bezier(.21, 1.02, .73, 1);
}
.alert::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: currentColor; opacity: .85;
}
.alert .icon { width: 22px; height: 22px; margin: 1px 0 0 2px; flex: none; }
.alert-success { color: #166534; background: linear-gradient(135deg, color-mix(in srgb, var(--success-bg) 96%, #fff), var(--success-bg)); border-color: color-mix(in srgb, #86efac 70%, var(--border)); }
.alert-warning { color: #92400e; background: linear-gradient(135deg, color-mix(in srgb, var(--warning-bg) 96%, #fff), var(--warning-bg)); border-color: color-mix(in srgb, #fcd34d 70%, var(--border)); }
.alert-error, .alert-danger { color: #991b1b; background: linear-gradient(135deg, color-mix(in srgb, var(--danger-bg) 96%, #fff), var(--danger-bg)); border-color: color-mix(in srgb, #fca5a5 70%, var(--border)); }
.alert-info { color: #075985; background: linear-gradient(135deg, color-mix(in srgb, var(--info-bg) 96%, #fff), var(--info-bg)); border-color: color-mix(in srgb, #bae6fd 70%, var(--border)); }
.alert-close { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; color: inherit; opacity: .55; padding: 0 0 0 8px; cursor: pointer; transition: opacity .15s ease, transform .15s ease; }
.alert-close:hover { opacity: 1; transform: scale(1.15); }
.alert-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: currentColor; opacity: .65; }
.alert.alert-leave { animation: alertOut .3s ease forwards; }
@keyframes alertOut { to { opacity: 0; transform: translateX(24px) scale(.96); } }

/* ---------- Badges, avatars, étoiles ---------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .03em;
  background-size: cover; background-position: center; overflow: hidden;
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 88px; height: 88px; font-size: 30px; border-radius: 22px; }
.avatar-xl { width: 120px; height: 120px; font-size: 42px; border-radius: 28px; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 50px; font-size: 12px; font-weight: 700; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--success-bg); color: var(--success); }
.status-pending, .status-warning { background: var(--warning-bg); color: var(--warning); }
.status-suspended, .status-danger, .status-expired, .status-cancelled { background: var(--danger-bg); color: var(--danger); }
.status-deleted { background: var(--surface-3); color: var(--muted); }

.plan-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px;
  background: linear-gradient(135deg, #f5b31b, #d97706); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.plan-badge.plan-standard { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.plan-badge.plan-professionnel { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.plan-badge.plan-entreprise { background: linear-gradient(135deg, #fb7185, #e11d48); }
.plan-badge.plan-gratuit { background: var(--muted-2); }

.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.stars .star { width: 15px; height: 15px; color: var(--border-2); }
.stars .star.filled { color: #f59e0b; }
.stars .stars-val { font-weight: 700; color: var(--text); margin-left: 4px; font-size: 13px; }
.stars .stars-count { color: var(--muted); font-size: 13px; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; transition: all .18s ease; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.textarea { min-height: 110px; resize: vertical; }
.input.invalid, .textarea.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.input.invalid ~ .field-error, .field.invalid .input ~ .field-error { display: block; }
.input-group { display: flex; align-items: stretch; border-radius: var(--radius-sm); border: 1px solid var(--border-2); overflow: hidden; background: var(--surface); }
.input-group .icon-wrap { display: grid; place-items: center; padding: 0 12px; color: var(--muted); border-right: 1px solid var(--border); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none; }
.input-group .btn { border-radius: 0; }

.check, .radio { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text); }
.check input[type="checkbox"], .radio input[type="radio"] { width: 17px; height: 17px; accent-color: var(--brand); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-2); border-radius: 30px; transition: .25s; }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); animation: fadeUp .4s ease;
}
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-header h3, .card-header h2 { margin: 0; font-size: 17px; }
.card-body > *:last-child, .card > *:last-child { margin-bottom: 0; }
.card-footer { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }

/* ---------- Cards de profil (résultats de recherche) ---------- */
.profile-card { display: flex; gap: 18px; padding: 20px; }
.profile-card .avatar { width: 84px; height: 84px; border-radius: 20px; font-size: 28px; }
.profile-card .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-card .pc-body { flex: 1; min-width: 0; }
.profile-card .pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.profile-card .pc-name { font-size: 18px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-card .pc-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.profile-card .pc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-card .pc-meta .icon { width: 14px; height: 14px; }
.profile-card .pc-bio { color: var(--muted); font-size: 14px; margin: 8px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-card .pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 50px;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600;
}
.tag .icon { width: 12px; height: 12px; color: var(--brand); }
.profile-card .pc-actions { display: flex; gap: 8px; align-items: center; flex: none; }

/* ---------- Hero (accueil) ---------- */
.hero {
  position: relative; overflow: hidden; padding: 64px 0 72px; text-align: center;
  background: var(--brand-grad);
}
.hero.has-image {
  position: relative;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero.has-image::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,47,73,.55), rgba(8,47,73,.25) 40%, rgba(8,47,73,.6) 100%);
}
.hero.has-image .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 16px;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -40% -10%; height: 180%; border-radius: 50%;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 40%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: #16a34a; color: #fff;
  padding: 9px 20px; border-radius: 50px; font-size: 14px; font-weight: 600; margin-bottom: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  animation: fadeUp .5s ease both; position: relative; z-index: 1;
}
.hero h1 { color: #fff; font-size: clamp(30px, 5vw, 52px); margin: 0 0 6px; max-width: 780px; line-height: 1.15; position: relative; z-index: 1; text-shadow: 0 2px 18px rgba(0,0,0,.35); animation: fadeUp .5s .05s ease both; }
.hero .sub { color: rgba(255,255,255,.96); font-size: 18px; max-width: 600px; margin: 0 0 18px; line-height: 1.5; position: relative; z-index: 1; text-shadow: 0 2px 14px rgba(0,0,0,.3); animation: fadeUp .5s .1s ease both; }

.search-hero {
  position: relative; z-index: 2; width: 100%; max-width: 820px; margin: 0 auto; background: var(--surface);
  border-radius: 999px; padding: 8px; box-shadow: 0 20px 45px rgba(13, 38, 61, .28), 0 4px 14px rgba(13,38,61,.15);
  animation: fadeUp .5s .15s ease both;
}
.search-hero .search-form { display: flex; align-items: center; gap: 8px; }
.search-hero .input-group { flex: 1; display: flex; align-items: center; background: var(--surface-3); border: 0; border-radius: 999px; overflow: hidden; }
.search-hero .input-group .icon-wrap { display: grid; place-items: center; padding: 0 6px 0 20px; color: var(--muted); border: 0; flex: none; }
.search-hero .input-group .icon-wrap svg { width: 20px; height: 20px; }
.search-hero .input-group .input { flex: 1; border: 0; box-shadow: none; padding: 18px 10px; font-size: 17px; height: 58px; min-width: 0; background: transparent; }
.search-hero .input-group .input::placeholder { color: var(--muted); }
.search-hero .btn { padding: 18px 32px; font-size: 17px; height: 58px; border-radius: 999px; white-space: nowrap; flex: none; }
.search-helper { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 2; }
.search-helper button, .search-helper a.btn { background: #2563eb; color: #fff; border: 1px solid rgba(255,255,255,.3); padding: 11px 20px; border-radius: 50px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: all .2s ease; }
.search-helper button:hover, .search-helper a.btn:hover { background: #1d4ed8; color: #fff; }

/* ---------- Sections générales ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(22px, 3.4vw, 32px); margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 16px; }
.eyebrow { display: inline-block; color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }

/* ---------- Grille ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-wall { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---------- Feature / bénéfice ---------- */
.feature { text-align: center; padding: 26px 20px; }
.feature .f-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: rgba(var(--brand-rgb), .12);
  display: grid; place-items: center; color: var(--brand);
}
.feature .f-icon .icon { width: 26px; height: 26px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

/* Icones colorées de la section « Comment ça marche » — chaque étape a sa couleur médicale. */
.how-steps .f-icon { background: rgba(14, 116, 144, .1); color: #0e7490; border: 1px solid rgba(14, 116, 144, .25); box-shadow: 0 6px 16px rgba(14, 116, 144, .18); }
.how-steps .f-icon-step1 { background: rgba(22, 163, 74, .12); color: #16a34a; border-color: rgba(22, 163, 74, .3); box-shadow: 0 6px 16px rgba(22, 163, 74, .2); }
.how-steps .f-icon-step2 { background: rgba(37, 99, 235, .12); color: #2563eb; border-color: rgba(37, 99, 235, .3); box-shadow: 0 6px 16px rgba(37, 99, 235, .22); }
.how-steps .f-icon-step3 { background: rgba(8, 145, 178, .12); color: #0891b2; border-color: rgba(8, 145, 178, .3); box-shadow: 0 6px 16px rgba(8, 145, 178, .2); }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: start; }
.price-card { position: relative; padding: 28px 24px; text-align: center; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.price-pop { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--brand-grad); color: #fff; padding: 5px 16px; border-radius: 50px; font-size: 12px; font-weight: 700; }
.price-name { font-size: 16px; font-weight: 700; color: var(--muted); }
.price-amount { font-size: 40px; font-weight: 800; margin: 10px 0 2px; }
.price-amount small { font-size: 16px; font-weight: 500; color: var(--muted); }
.price-duration { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.price-features { text-align: left; margin: 18px 0; display: grid; gap: 10px; }
.price-features li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--text); }
.price-features li .icon { width: 16px; height: 16px; color: var(--success); margin-top: 3px; }
.price-features li.off { color: var(--muted-2); text-decoration: line-through; }
.price-features li.off .icon { color: var(--muted-2); }

/* ---------- Statistiques (hero secondaire) ---------- */
.stat-band { background: var(--surface); border-block: 1px solid var(--border); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { text-align: center; padding: 22px 10px; }
.stat .stat-num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .stat-label { color: var(--muted); font-size: 14px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th {
  text-align: left; padding: 13px 16px; background: var(--surface-3); color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap;
}
.table td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table .avatar { display: inline-flex; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }

/* ---------- Dashboard layout ---------- */
.dash { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 28px 0; align-items: start; }
.dash-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.dash-side .side-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.5; cursor: default; text-align: left; }
.side-acc-caret { display: none; }
.side-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 12px 16px; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--border); transition: all .15s ease; }
.side-nav a:last-child { border-bottom: 0; }
.side-nav a .icon { width: 18px; height: 18px; }
.side-nav a:hover { background: var(--surface-2); color: var(--brand); }
.side-nav a.active { background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 700; border-left: 3px solid var(--brand); }
.dash-main { min-width: 0; }
.dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-toolbar h1 { font-size: 22px; margin: 0; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.kpi .kpi-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-label .icon { width: 15px; height: 15px; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted-2); margin-top: 4px; }

/* ---------- Dashboard grid 2 colonnes ---------- */
.dash-main .grid-main-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- Messagerie ---------- */
.msgs-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; min-height: 600px; }
.msg-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 600px; }
.msg-thread { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s ease; }
.msg-thread:hover { background: var(--surface-2); }
.msg-thread.active { background: rgba(var(--brand-rgb), .08); }
.msg-thread .mt-body { min-width: 0; flex: 1; }
.msg-thread .mt-name { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.msg-thread .mt-preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread .mt-time { font-size: 11px; color: var(--muted-2); flex: none; }
.msg-thread .unread-badge { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: auto; flex: none; }
.msg-group-label { padding: 12px 16px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.msg-group-label .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.mt-unread-name { font-weight: 800; }
.msg-convo { display: flex; flex-direction: column; max-height: 600px; }
.msg-convo-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.msg-body { flex: 1; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.bubble { max-width: 72%; padding: 10px 15px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.bubble.mine { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.theirs { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble .b-time { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.msg-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.msg-input .input { flex: 1; }
.msg-empty { display: grid; place-items: center; flex: 1; color: var(--muted); }
.chat-loading { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Notifications ---------- */
.notif-list { display: grid; gap: 10px; }
.notif { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: all .15s ease; }
.notif.unread { border-color: var(--brand); background: rgba(var(--brand-rgb), .05); }
.notif .n-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 18px; }
.notif-unread .n-icon { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-title { font-weight: 700; margin-bottom: 2px; }
.notif .n-msg { color: var(--muted); font-size: 14px; }
.notif .n-time { color: var(--muted-2); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 5px; }

/* ---------- Fiche infirmière ---------- */
.nurse-hero { display: grid; grid-template-columns: 200px 1fr; gap: 28px; padding: 32px; align-items: start; }
.nurse-hero .avatar { width: 190px; height: 190px; border-radius: 28px; font-size: 64px; }
.nurse-hero .nh-name { font-size: 30px; font-weight: 800; margin: 8px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nurse-hero .nh-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.nurse-hero .nh-meta span { display: inline-flex; align-items: center; gap: 6px; }
.nurse-hero .nh-meta .icon { width: 15px; height: 15px; color: var(--brand); }
.nurse-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.contact-cards-stack { grid-template-columns: 1fr; }
.contact-coords { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.contact-coords-title { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.contact-coords-title .icon { width: 18px; height: 18px; color: var(--brand); }
.contact-message-form { display: block; }
.contact-message-form .card-header { margin-top: 0; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: all .2s ease; }
.contact-card:hover { border-color: var(--brand); color: var(--brand); }
.contact-card .cc-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--brand); flex: none; }
.contact-card .cc-icon .icon { width: 19px; height: 19px; }

/* Schedule table */
.sched { display: grid; gap: 8px; }
.sched .s-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface-2); border-radius: 9px; font-size: 14px; }
.sched .s-day { font-weight: 600; }
.sched .s-hours { color: var(--muted); }
.sched .s-closed { color: var(--danger); font-style: italic; }

/* ---------- Avis ---------- */
.review-list { display: grid; gap: 16px; }
.review { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.review .r-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review .r-name { font-weight: 700; }
.review .r-date { color: var(--muted-2); font-size: 12px; }
.review .r-text { color: var(--text); font-size: 14px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab-btn { padding: 11px 18px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s ease; white-space: nowrap; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-btn:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .3s ease; }

/* ---------- Accordéon filtres (mobile) ---------- */
.acc-filter { display: none; margin-bottom: 16px; }
.acc-filter-head { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.acc-filter-head .icon { color: var(--brand); }
.acc-filter[data-acc].open .side-acc-caret { transform: rotate(180deg); }
.acc-filter-panel { display: none; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.acc-filter[data-acc].open .acc-filter-panel { display: flex; }
.acc-filter-panel a { padding: 11px 14px; border-radius: calc(var(--radius) - 4px); color: var(--muted); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.acc-filter-panel a:hover { background: var(--surface-2); color: var(--brand); }
.acc-filter-panel a.active { background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 700; }


/* ---------- Fil d'Ariane / page header ---------- */
.page-head { padding: 34px 0 10px; }
.page-head h1 { font-size: 28px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { color: var(--muted-2); }

/* ---------- Utilitaires ---------- */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.text-center { text-align: center; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.hidden { display: none !important; }
.avatar-bg {
  background-image: linear-gradient(135deg, #0e7490, #1d4ed8);
}
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-size: 14px; font-weight: 600;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .empty-icon { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 20px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted-2); }
.empty .empty-icon .icon { width: 32px; height: 32px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Filtres de recherche latéraux ---------- */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; height: fit-content; position: sticky; top: calc(var(--topbar-h) + 16px); }
.filters h4 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rating-opts { display: grid; gap: 8px; }
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; padding-top: 0; }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.results-count { color: var(--muted); font-size: 14px; }
.sort-select { min-width: 180px; }

/* ---------- Form login ---------- */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-header { justify-content: center; }
.auth-sep { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 13px; margin: 20px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }
.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.role-tab { padding: 13px; border: 2px solid var(--border); border-radius: var(--radius-sm); text-align: center; cursor: pointer; transition: all .2s ease; color: var(--text); }
.role-tab .rt-title { font-weight: 700; display: block; }
.role-tab .rt-sub { font-size: 12px; color: var(--muted); }
.role-tab.active { border-color: var(--brand); background: rgba(var(--brand-rgb), .06); }
.role-tab input { display: none; }

.captcha-wrap { display: flex; gap: 12px; align-items: center; }
.captcha-box { flex: none; padding: 9px 16px; font-size: 20px; font-weight: 800; letter-spacing: 6px; background: var(--surface-3); border: 1px dashed var(--border-2); border-radius: var(--radius-sm); color: var(--brand); font-family: ui-monospace, monospace; user-select: none; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }
.loader { width: 22px; height: 22px; border: 3px solid var(--border-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.loader-wrap { display: grid; place-items: center; padding: 40px; }
.loader-inline { display: inline-block; width: 16px; height: 16px; border-width: 2px; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer-brand p { color: var(--muted); font-size: 14px; margin: 12px 0; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.footer-col { display: grid; gap: 8px; align-content: start; }
.footer-link { color: var(--muted); font-size: 14px; transition: color .15s ease; }
.footer-link:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; color: var(--muted-2); font-size: 13px; border-top: 1px solid var(--border); margin-top: 36px; padding-top: 18px; flex-wrap: wrap; }
.footer-bottom .heart { color: #e11d48; }

/* ---------- Modals ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); z-index: 1100; display: grid; place-items: center; padding: 20px; animation: fadeUp .2s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: fadeUp .25s ease; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { margin: 0; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 1300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--text); color: var(--surface); padding: 13px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: slideIn .3s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- Button loader ---------- */
.btn .loader-inline { border-color: rgba(255,255,255,.4); border-top-color: #fff; }

/* ---------- Liste inline horizontale (langues etc.) ---------- */

/* ---------- API docs / misc ---------- */
code, .code { background: var(--surface-3); padding: 2px 6px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: 13px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .nurse-hero { grid-template-columns: 1fr; text-align: center; }
  .nurse-hero .avatar { margin: 0 auto; }
  .nurse-hero .nh-meta, .nurse-actions { justify-content: center; }
  .msgs-layout { grid-template-columns: 1fr; }
  .msg-list, .msg-convo { max-height: none; }
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; }

  .hero.has-image { min-height: 540px; }
  .hero.has-image .container { max-width: 720px; }

  /* Back-office : les grilles à 2 colonnes se replient sur tablette. */
  .dash .dash-main .grid-main-2,
  .dash-main .grid-main-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .main-nav {
    position: fixed; inset: var(--topbar-h) 0 auto 0; background: var(--surface); flex-direction: column;
    padding: 12px; border-bottom: 1px solid var(--border); gap: 4px; box-shadow: var(--shadow);
    transform: translateY(-140%); transition: transform .3s ease; z-index: 880;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-link { padding: 13px 16px; font-size: 15px; }
  .burger { display: flex; }

  /* Boutons Connexion / Créer un compte dans le menu mobile (déconnecté). */
  .nav-auth {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 10px; margin-left: 0; margin-right: 0;
    padding: 12px 4px 4px;
    border-top: 1px solid var(--border);
  }
  .nav-auth .btn { width: 100%; justify-content: center; }

  .dash { grid-template-columns: 1fr; }
  .dash-side {
    position: static; width: 100%; max-width: none; margin-bottom: 2px;
  }
  .dash-side .side-head {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); cursor: pointer; text-align: left; justify-content: space-between;
  }
  .dash-side .side-head .avatar { flex: none; }
  .side-acc-caret { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: transform .2s ease; }
  .dash-side[data-acc].open .side-acc-caret { transform: rotate(180deg); }
  .side-nav {
    display: none; flex-direction: column; gap: 2px; padding: 6px;
  }
  .dash-side[data-acc].open .side-nav { display: flex; }
  .side-nav a {
    border: 0; white-space: normal; padding: 12px 14px; flex: none; border-radius: calc(var(--radius) - 4px);
  }
  .side-nav a.active { border-left: 3px solid var(--brand); border-bottom: 0; }
  .side-nav a .icon { width: 16px; height: 16px; }

  /* Toutes les grilles admin à 2 colonnes passent en 1 colonne, même avec styles inline. */
  .dash-main .grid-main-2 { grid-template-columns: 1fr !important; }
  .grid-main-2 { grid-template-columns: 1fr !important; }

  .search-hero { padding: 8px; border-radius: 20px; }
  .search-hero .search-form { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-hero .input-group { width: 100%; flex: none; border-radius: 999px; }
  .search-hero .input-group .icon-wrap { padding-left: 16px; }
  .search-hero .input-group .icon-wrap svg { width: 20px; height: 20px; }
  .search-hero .input-group .input { padding: 14px 10px; font-size: 16px; height: 54px; min-width: 0; }
  .search-hero .btn { width: 100%; padding: 16px; font-size: 16px; height: 54px; }

  .hero.has-image { min-height: 520px; }
  .hero.has-image .container {
    position: relative;
    inset: 0;
    justify-content: center;
    padding: 48px 16px;
    gap: 14px;
  }
  .hero-badge { font-size: 13px; padding: 8px 16px; }
  .hero h1 { font-size: clamp(26px, 7.5vw, 34px); }
  .hero .sub { font-size: 16px; }
  .search-helper { gap: 10px; margin-top: 10px; }
  .search-helper button, .search-helper a.btn { padding: 10px 18px; font-size: 13px; }
  .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr !important; grid-template-areas: 'coords' 'assist' 'form' !important; gap: 20px !important; }
  .nurse-hero .avatar { width: 140px; height: 140px; font-size: 46px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 0 52px; }
  .hero.has-image { padding: 0; }

  /* Adaptations du back-office admin sur mobile. */
  .dash-toolbar { align-items: stretch; }
  .dash-toolbar form, .dash-toolbar .ash-actions { flex-wrap: wrap; }
  .dash-toolbar .btn { white-space: nowrap; }
  .card { padding: 16px; }
  .tabs { margin-bottom: 16px; }
  .tabs:has(+ .acc-filter) { display: none; }
  .acc-filter { display: block; }
  .admin-appt-filters { display: none; }
  .kpi { padding: 14px; }
  .kpi .kpi-value { font-size: 22px; }
}

@media (max-width: 520px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .topbar-actions .btn { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .hero.has-image { min-height: 560px; }
  .hero.has-image .container { padding: 40px 14px; gap: 12px; }
  .hero .sub { font-size: 15px; }
  .search-helper button, .search-helper a.btn { font-size: 12.5px; padding: 9px 14px; }
  .profile-card { flex-direction: column; }
  .profile-card .avatar { width: 90px; height: 90px; }
  .profile-card .pc-actions { width: 100%; }
  .profile-card .pc-actions .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 10px 12px; }

  /* Back-office admin : compact sur très petits écrans. */
  .dash { padding: 20px 0; }
  .dash + .dash, .dash-main { min-width: 0; }
  .side-nav a { padding: 10px 12px; }
  .dash-toolbar h1 { font-size: 19px; }
  .side-nav a .icon { display: none; }
  .card-header { flex-wrap: wrap; }
  .batch-actions, .flex.gap-2 { flex-wrap: wrap; }
  .btn { white-space: normal; }
}

/* =====================================================================
   LANGUE ARABE (RTL) — Polices et ajustements directionnels
   ===================================================================== */
html[lang="ar"] {
  --font: "Segoe UI", "Cairo", "Tahoma", "Noto Kufi Arabic", "Amiri", sans-serif;
  font-size: 15px;
}
html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] button {
  text-align: right;
}
html[dir="rtl"] .input-group .input { text-align: right; }
html[dir="rtl"] .main-nav { margin-right: 8px; margin-left: 0; }
html[dir="rtl"] .topbar-actions { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .dropdown { right: auto; left: 0; }
html[dir="rtl"] .flash-stack { right: auto; left: 16px; }
html[dir="rtl"] .alert::before { left: auto; right: 0; }
html[dir="rtl"] .alert-bar { transform-origin: right !important; }

html[dir="rtl"] .hero, 
html[dir="rtl"] .search-hero,
html[dir="rtl"] .card,
html[dir="rtl"] .dash { }

/* =====================================================================
   BANDEAU D'INSTALLATION PWA
   ---------------------------------------------------------------------
   Sur mobile : bandeau horizontal pleine largeur (X à gauche, icône,
   texte, bouton). Sur écrans plus larges : carte centrée en bas.
   ===================================================================== */
.pwa-banner {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 14px;
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  border-bottom: 1px solid rgba(var(--brand-rgb), .28);
  box-shadow: 0 6px 24px rgba(var(--brand-rgb), .18);
  transform: translateY(-110%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
.pwa-banner.show {
  transform: translateY(0);
  opacity: 1;
}
[hidden] { display: none !important; }
.pwa-banner-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  margin-inline-end: -4px;
}
.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #fff;
  padding: 2px;
  border: 1px solid rgba(var(--brand-rgb), .15);
}
.pwa-banner-body { flex: 1; min-width: 0; }
.pwa-banner-body strong { display: block; font-size: 14px; margin-bottom: 1px; line-height: 1.25; }
.pwa-banner-body p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}
.pwa-banner .btn { flex: 0 0 auto; white-space: nowrap; }

/* Sur écran plus large : carte arrondie flottante centrée en haut, pas pleine largeur. */
@media (min-width: 640px) {
  .pwa-banner {
    left: 50%;
    right: auto;
    top: 16px;
    transform: translate(-50%, -140%);
    max-width: 440px;
    border: 1px solid rgba(var(--brand-rgb), .25);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(var(--brand-rgb), .22);
  }
  .pwa-banner.show {
    transform: translate(-50%, 0);
  }
}

/* Très petits écrans : on garde un bandeau horizontal compact. */
@media (max-width: 360px) {
  .pwa-banner { gap: 8px; padding: 10px 10px 10px 6px; }
  .pwa-banner-icon { width: 36px; height: 36px; }
  .pwa-banner-body p { display: none; }
  .hero.has-image { min-height: 600px; }
}

/* =====================================================================
   BANDEAU CONSENTEMENT COOKIES (RGPD)
   ===================================================================== */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid rgba(var(--brand-rgb), .28);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .22);
  transform: translateY(130%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  max-width: 460px;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner-body { flex: 1; min-width: 0; }
.cookie-banner-title { display: block; font-size: 14px; margin-bottom: 4px; line-height: 1.25; }
.cookie-banner-text { margin: 0 0 6px; font-size: 12px; color: var(--text-muted, #64748b); line-height: 1.4; }
.cookie-banner-link { font-size: 12px; text-decoration: underline; }
.cookie-banner-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.cookie-banner-actions .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 10px; }
  .cookie-banner-actions { flex-direction: row; justify-content: flex-end; }
}

/* =====================================================================
   AUTOCOMPLÉTION DES VILLES (recherche)
   ===================================================================== */
.ac-wrap { position: relative; }
/* Le conteneur a overflow:hidden par défaut : on le restaure pour
   laisser le menu de suggestions dépasser sous le champ. */
.ac-wrap.input-group { overflow: visible; }
.ac-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid rgba(var(--brand-rgb), .2);
  border-radius: var(--radius-sm, 10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.ac-list.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text, #0f172a);
  font-size: 14px;
}
.ac-item:hover, .ac-item.selected { background: rgba(var(--brand-rgb), .1); color: var(--brand); }
.ac-pin { display: grid; place-items: center; color: var(--brand); }
.ac-pin .icon { width: 16px; height: 16px; }
.ac-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


