/* =============================================================================
   MIC — MyClinicIA
   Design System — Thème clair — MyAlfred.ai
   ============================================================================= */

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  /* Fonds */
  --bg-primary:    #f8f8fc;
  --bg-secondary:  #ffffff;
  --bg-elevated:   #fcf8ff;
  --bg-card:       #ffffff;
  --bg-card-hover: #fdf7ff;

  /* Bordures */
  --border:        #e7dff6;
  --border-hover:  #d2c3ee;
  --border-focus:  rgba(76, 29, 149, 0.45);

  /* Couleurs principales */
  --primary:       #4c1d95;
  --primary-hover: #3b146f;
  --primary-light: rgba(76, 29, 149, 0.12);
  --confirm:       #3d0069;
  --confirm-hover: #2f0051;
  --accent:        #4c1d95;
  --accent-hover:  #3b146f;
  --accent-light:  rgba(76, 29, 149, 0.12);
  --warm:          #5b21b6;
  --warm-hover:    #4c1d95;
  --warm-light:    rgba(91, 33, 182, 0.12);

  /* Dégradés */
  --gradient:        linear-gradient(135deg, #6d28d9 0%, #4c1d95 55%, #3b146f 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(109,40,217,0.09) 0%, rgba(76,29,149,0.08) 55%, rgba(59,20,111,0.08) 100%);
  --gradient-text:   linear-gradient(135deg, #6d28d9 0%, #4c1d95 55%, #3b146f 100%);

  /* Texte */
  --text:         #0f172a;
  --text-2:       #334155;
  --text-muted:   #64748b;
  --text-inverse: #ffffff;

  /* Statuts */
  --success:       #059669;
  --success-light: rgba(5, 150, 105, 0.1);
  --warning:       #4c1d95;
  --warning-light: rgba(76, 29, 149, 0.12);
  --danger:        #dc2626;
  --danger-light:  rgba(220, 38, 38, 0.09);
  --danger-warm:   #f97316;
  --info:          #5b21b6;
  --info-light:    rgba(91, 33, 182, 0.12);

  /* Boutons */
  --btn-neutral-bg:        #e8edf3;
  --btn-neutral-bg-hover:  #dde4ec;
  --btn-neutral-border:    #cfd8e3;
  --btn-neutral-text:      #334155;
  --btn-cancel-bg:         #ffffff;
  --btn-cancel-bg-hover:   #f7f9fc;
  --btn-cancel-border:     #d7dfeb;
  --btn-cancel-text:       #475569;

  /* Statuts créneaux */
  --slot-available: #059669;
  --slot-booked:    #5b21b6;
  --slot-blocked:   #dc2626;
  --slot-done:      #94a3b8;
  --slot-cancelled: #5b21b6;

  /* Typographie */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;

  /* Rayons */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Ombres */
  --shadow-sm:   0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:   0 4px 16px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg:   0 20px 48px rgba(15,23,42,0.12), 0 8px 16px rgba(15,23,42,0.06);
  --shadow-glow: 0 0 30px rgba(76,29,149,0.18);

  /* Transitions */
  --t:      all 0.17s ease;
  --t-slow: all 0.3s ease;

  /* Layout */
  --sidebar-w:  260px;
  --header-h:   60px;
  --content-mw: 1200px;
  --footer-h:   72px;
  --footer-h-mobile: 122px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: var(--footer-h);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--t); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

/* ─── Typographie ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 2.125rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }

p { color: var(--text-2); line-height: 1.7; }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted    { color: var(--text-muted); }
.text-2        { color: var(--text-2); }
.text-sm       { font-size: 0.8125rem; }
.text-xs       { font-size: 0.75rem; }
.text-lg       { font-size: 1.125rem; }
.text-center   { text-align: center; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ─── Layout public ──────────────────────────────────────────────────────── */
.layout-public {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

/* ─── Layout Admin ───────────────────────────────────────────────────────── */
.layout-admin { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(15,23,42,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 1.25rem 1.125rem 0.875rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9375rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .logo-text { display: flex; flex-direction: column; }
.sidebar-logo .logo-text span:first-child {
  font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em;
}
.sidebar-logo .logo-text span:last-child {
  font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; letter-spacing: 0.02em;
}

/* Navigation sidebar */
.sidebar-nav {
  flex: 1;
  padding: 0.875rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.875rem 0.5rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--t);
  text-decoration: none;
}

.nav-link:hover { background: var(--bg-elevated); color: var(--text); }

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-link .nav-icon { width: 17px; height: 17px; opacity: 0.55; flex-shrink: 0; }
.nav-link:hover .nav-icon, .nav-link.active .nav-icon { opacity: 1; }

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--r-full);
}

/* Utilisateur sidebar */
.sidebar-user { padding: 0.75rem; border-top: 1px solid var(--border); flex-shrink: 0; }

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.company-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.company-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.company-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.company-hero-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--gradient);
  color: #fff;
  font-size: 1.375rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.company-address {
  white-space: pre-line;
}

.company-form-logo-preview {
  width: 96px;
  height: 96px;
  margin-top: 0.625rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
}

.company-form-logo-preview img,
.company-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-info { flex: 1; min-width: 0; }
.user-info .user-name  { font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .user-role  { font-size: 0.6875rem; color: var(--text-muted); }

.btn-logout-sm {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.25rem;
  border-radius: var(--r-sm);
  transition: var(--t);
  display: flex; align-items: center;
}
.btn-logout-sm:hover { color: var(--danger); background: var(--danger-light); }

/* Main admin */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}

.admin-header .page-title { font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.admin-header-right { display: flex; align-items: center; gap: 0.75rem; }

.admin-content {
  flex: 1;
  padding: 1.75rem;
  max-width: var(--content-mw);
  width: 100%;
}

/* ─── Layout Client ──────────────────────────────────────────────────────── */
.layout-client { min-height: 100vh; display: flex; flex-direction: column; }

.client-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}

.client-logo { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; }
.client-logo .logo-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 800; color: #fff;
}
.client-logo span { font-size: 1rem; font-weight: 800; color: var(--text); }

.client-nav { display: flex; align-items: center; gap: 0.125rem; }
.client-nav a {
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-2);
}
.client-nav a:hover { color: var(--text); background: var(--bg-elevated); }
.client-nav a.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

.client-header-right { display: flex; align-items: center; gap: 0.75rem; }
.client-main { flex: 1; padding: 1.75rem; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }

.card-glass {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}
.stat-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.25rem;
}

.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.pink   { background: var(--accent-light); color: var(--accent); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.blue   { background: var(--warm-light); color: var(--warm); }

.stat-body   { flex: 1; min-width: 0; }
.stat-value  { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label  { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-delta  { font-size: 0.75rem; margin-top: 0.375rem; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15,23,42,0.10); }
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-primary {
  background: var(--confirm);
  color: #fff;
  border-color: var(--confirm);
  box-shadow: 0 6px 16px rgba(61,0,105,0.28);
}
.btn-primary:hover {
  background: var(--confirm-hover);
  border-color: var(--confirm-hover);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47,0,81,0.32);
}

.btn-secondary {
  background: var(--btn-neutral-bg);
  color: var(--btn-neutral-text);
  border-color: var(--btn-neutral-border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--btn-neutral-bg-hover);
  border-color: #c2ccd9;
  color: #1f2937;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-warm) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(234,88,12,0.22);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #c81e1e 0%, #ea580c 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(234,88,12,0.28);
}

.btn-success {
  background: var(--confirm);
  color: #fff;
  border-color: var(--confirm);
  box-shadow: 0 6px 16px rgba(61,0,105,0.24);
}
.btn-success:hover {
  background: var(--confirm-hover);
  color: #fff;
  border-color: var(--confirm-hover);
  box-shadow: 0 8px 18px rgba(47,0,81,0.30);
}

.btn-ghost {
  background: var(--btn-cancel-bg);
  color: var(--btn-cancel-text);
  border-color: var(--btn-cancel-border);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--btn-cancel-bg-hover);
  color: #334155;
  border-color: #c7d0de;
  box-shadow: 0 4px 10px rgba(15,23,42,0.06);
}

.btn-sm   { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg   { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.btn-icon.btn-sm { width: 30px; height: 30px; }

.btn-google {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  gap: 0.625rem;
  box-shadow: 0 2px 10px rgba(76,29,149,0.24);
}
.btn-google:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 1rem; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.5625rem 0.875rem;
  transition: var(--t);
  outline: none;
  appearance: none;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1), inset 0 1px 2px rgba(15,23,42,0.04);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.25rem; }
.form-control.error { border-color: rgba(220,38,38,0.5); background: rgba(220,38,38,0.03); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-available  { background: rgba(5,150,105,0.1);  color: var(--success); }
.badge-available::before  { background: var(--success); }

.badge-booked     { background: var(--info-light);  color: var(--info); }
.badge-booked::before     { background: var(--info); }

.badge-blocked    { background: rgba(220,38,38,0.09); color: var(--danger); }
.badge-blocked::before    { background: var(--danger); }

.badge-done       { background: rgba(100,116,139,0.12); color: var(--text-muted); }
.badge-done::before       { background: var(--text-muted); }

.badge-cancelled  { background: rgba(76,29,149,0.12);  color: var(--warning); }
.badge-cancelled::before  { background: var(--warning); }

.badge-confirmed  { background: rgba(5,150,105,0.1);  color: var(--success); }
.badge-confirmed::before  { background: var(--success); }

.badge-primary    { background: var(--primary-light); color: var(--primary); }
.badge-primary::before    { background: var(--primary); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead { background: var(--bg-elevated); }

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); transition: var(--t); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-elevated); }
[data-row-link] { cursor: pointer; }
[data-row-link]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-2); }
.td-sm    { font-size: 0.8125rem; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-success { background: var(--success-light); color: #065f46; border-color: rgba(5,150,105,0.25); }
.alert-error   { background: var(--danger-light);  color: #991b1b; border-color: rgba(220,38,38,0.25); }
.alert-warning { background: var(--warning-light); color: var(--primary-hover); border-color: rgba(76,29,149,0.3); }
.alert-info    { background: var(--info-light);    color: #6b21a8; border-color: rgba(168,85,247,0.3); }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  min-width: 280px;
  max-width: 380px;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.25s ease forwards;
  box-shadow: var(--shadow-lg);
  border: 1px solid;
  background: var(--bg-card);
}

.toast-success { background: #f0fdf4; color: #065f46; border-color: rgba(5,150,105,0.3); }
.toast-error   { background: #fef2f2; color: #991b1b; border-color: rgba(220,38,38,0.3); }
.toast-warning { background: #f5f3ff; color: var(--primary-hover); border-color: rgba(76,29,149,0.34); }
.toast-info    { background: #faf5ff; color: #6b21a8; border-color: rgba(168,85,247,0.34); }

.toast-dismiss {
  margin-left: auto;
  background: none; border: none;
  cursor: pointer; color: inherit; opacity: 0.5;
  padding: 0; transition: var(--t);
}
.toast-dismiss:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(12px); }
}

/* ─── Page sections ──────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.375rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.page-header p  { font-size: 0.875rem; color: var(--text-muted); }

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

/* ─── Slots ──────────────────────────────────────────────────────────────── */
.slot-list { display: flex; flex-direction: column; gap: 0.4375rem; }

.slot-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.6875rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--t);
  box-shadow: var(--shadow-sm);
}
.slot-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.slot-item-link {
  text-decoration: none;
  color: inherit;
}
.slot-item-link:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}

.slot-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}

.slot-subject { flex: 1; font-size: 0.875rem; color: var(--text-2); }

.slot-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.slot-dot.available { background: var(--slot-available); }
.slot-dot.booked    { background: var(--slot-booked); }
.slot-dot.blocked   { background: var(--slot-blocked); }
.slot-dot.done      { background: var(--slot-done); }
.slot-dot.cancelled { background: var(--slot-cancelled); }

.slot-item.available:hover { border-color: rgba(5,150,105,0.35); cursor: pointer; }

/* ─── Page d'accueil ─────────────────────────────────────────────────────── */
.home-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(124,58,237,0.12), transparent 48%),
    radial-gradient(circle at 90% 0%, rgba(76,29,149,0.08), transparent 42%),
    var(--bg-primary);
}

.home-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1.5rem 2.25rem;
  background:
    linear-gradient(160deg, #faf8ff 0%, #f5f2ff 46%, #f9f6ff 100%);
}

.home-main::before,
.home-main::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.home-main::before {
  width: 560px;
  height: 560px;
  left: -140px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.14) 0%, rgba(124,58,237,0) 72%);
}

.home-main::after {
  width: 460px;
  height: 460px;
  right: -110px;
  bottom: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,33,182,0.13) 0%, rgba(91,33,182,0) 74%);
}

.home-hero,
.home-proof,
.home-section {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.home-hero {
  margin-bottom: 1.4rem;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(320px, 0.93fr);
  gap: 1.45rem;
  align-items: stretch;
}

.home-hero-copy {
  padding: 1.75rem 0.2rem 1rem;
  animation: homeFadeUp 0.7s ease both;
}

.home-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.home-brand-logo {
  width: 54px;
  height: 54px;
  border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(76,29,149,0.2);
  flex-shrink: 0;
}

.home-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-brand-name {
  font-size: 1.72rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.home-brand-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(76,29,149,0.2);
  background: rgba(255,255,255,0.84);
  box-shadow: 0 5px 16px rgba(76,29,149,0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.84rem;
  margin-bottom: 0.9rem;
}

.home-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(76,29,149,0.15);
}

.home-hero-title {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 0.95rem;
}

.home-hero-title .text-gradient {
  display: block;
}

.home-hero-subtitle {
  font-size: 1.02rem;
  max-width: 590px;
  color: var(--text-2);
  margin-bottom: 1.6rem;
  line-height: 1.75;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.home-signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.home-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.82);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
}

.home-signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.home-signal-dot.available { background: var(--success); }
.home-signal-dot.info { background: var(--info); }
.home-signal-dot.success { background: var(--primary); }

.home-preview {
  position: relative;
  padding: 1.2rem;
  border-radius: var(--r-xl);
  border: 1px solid rgba(76,29,149,0.2);
  background: rgba(255,255,255,0.82);
  box-shadow: 0 28px 55px rgba(76,29,149,0.17), 0 4px 12px rgba(15,23,42,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: homeFloat 7.5s ease-in-out infinite, homeFadeUp 0.85s ease both;
}

.home-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(109,40,217,0.52), rgba(76,29,149,0.2));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.home-preview-head h2 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.home-preview-kicker {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.home-preview-day {
  margin-top: 0.9rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(248,248,252,0.9);
}

.home-preview-date {
  font-size: 0.91rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}

.home-preview-place {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.home-preview-slots {
  list-style: none;
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.home-preview-slots li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.58rem 0.7rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  font-size: 0.8rem;
  color: var(--text-2);
}

.home-preview-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text);
}

.home-preview-note {
  margin-top: 0.82rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.home-proof {
  margin-bottom: 2.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.home-proof-item {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem 1rem;
  animation: homeFadeUp 0.72s ease both;
}

.home-proof-item:nth-child(2) { animation-delay: 0.07s; }
.home-proof-item:nth-child(3) { animation-delay: 0.14s; }
.home-proof-item:nth-child(4) { animation-delay: 0.21s; }

.home-proof-value {
  font-size: 1.16rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.home-proof-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.home-section {
  margin-bottom: 2.25rem;
}

.home-section-heading {
  margin-bottom: 1rem;
}

.home-section-kicker {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.28rem;
}

.home-section-title {
  font-size: clamp(1.28rem, 2.3vw, 1.8rem);
  letter-spacing: -0.02em;
  max-width: 760px;
}

.home-how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.home-how-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  animation: homeFadeUp 0.72s ease both;
}

.home-how-card:nth-child(2) { animation-delay: 0.1s; }
.home-how-card:nth-child(3) { animation-delay: 0.2s; }

.home-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(76,29,149,0.22);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 0.62rem;
}

.home-how-card h3,
.home-benefit-card h3 {
  font-size: 1rem;
  margin-bottom: 0.32rem;
  letter-spacing: -0.01em;
}

.home-how-card p,
.home-benefit-card p {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.65;
}

.home-section-benefits {
  margin-bottom: 0.7rem;
}

.home-benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.home-benefit-card {
  border-radius: var(--r-lg);
  border: 1px solid rgba(76,29,149,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(247,243,255,0.85));
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  animation: homeFadeUp 0.72s ease both;
}

.home-benefit-card:nth-child(2) { animation-delay: 0.1s; }
.home-benefit-card:nth-child(3) { animation-delay: 0.2s; }

.home-quote {
  margin-top: 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(255,255,255,0.7);
  border-radius: var(--r-md);
  padding: 0.72rem 0.85rem;
  font-size: 0.84rem;
  color: var(--text-2);
  font-style: italic;
}

@keyframes homeFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* ─── Home minimal (version épurée) ─────────────────────────────────────── */
.home-page {
  background: var(--bg-primary);
}

.home-minimal {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 1.6rem;
}

.home-minimal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 1.25rem;
  align-items: stretch;
}

.home-minimal-copy {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.45rem;
  height: 100%;
}

.home-minimal .home-brand-row {
  margin-bottom: 0.95rem;
  gap: 0.65rem;
}

.home-minimal .home-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  box-shadow: 0 4px 14px rgba(76,29,149,0.15);
}

.home-minimal .home-brand-name {
  font-size: 1.35rem;
}

.home-minimal .home-brand-tagline {
  font-size: 0.68rem;
}

.home-minimal .home-eyebrow {
  margin-bottom: 0.8rem;
  font-size: 0.74rem;
  padding: 0.28rem 0.7rem;
}

.home-minimal-title {
  font-size: clamp(1.8rem, 3.3vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.home-minimal-title .text-gradient {
  display: block;
}

.home-minimal-subtitle {
  font-size: 0.95rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  max-width: 580px;
}

.home-minimal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.home-minimal-media {
  display: flex;
  height: 100%;
}

.home-main-icon-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 0.7rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  text-align: center;
}

.home-main-icon-card img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--r-md);
}

.home-minimal .home-media-eyebrow {
  margin-bottom: 0;
  justify-content: center;
}

.home-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.home-icon-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 0.42rem;
  text-align: center;
}

.home-icon-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-md);
}

.home-icon-card span {
  display: block;
  margin-top: 0.26rem;
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 600;
}

.home-minimal-points {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.home-minimal-points article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.home-minimal-points h2 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.home-minimal-points p {
  font-size: 0.82rem;
}

/* ─── Authentification ───────────────────────────────────────────────────── */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 52%, #f3e8ff 100%);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 500px;
  background:
    radial-gradient(ellipse, rgba(124,58,237,0.08) 0%, transparent 70%),
    radial-gradient(ellipse, rgba(76,29,149,0.09) 30%, transparent 75%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.auth-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.auth-logo .logo-name { font-size: 1.25rem; font-weight: 800; color: var(--text); }

.auth-card h2         { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.375rem; }
.auth-card .auth-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.75rem; }

.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.25rem 0;
}
.auth-divider span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-footer { margin-top: 1.25rem; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }

/* ─── Footer public ──────────────────────────────────────────────────────── */
.public-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  font-size: 0.8125rem;
  color: var(--text-muted);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
}

.admin-main .public-footer {
  left: var(--sidebar-w);
}

.public-footer-origin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.public-footer-logo {
  height: 22px;
  width: auto;
}

.footer-about-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--primary);
  border-radius: var(--r-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--t);
}

.footer-about-btn:hover {
  border-color: var(--border-hover);
  background: var(--primary-light);
  color: var(--primary-hover);
}

.footer-about-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 29, 149, 0.2);
}

/* ─── Section title icons ────────────────────────────────────────────────── */
.section-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.section-title-icon {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* ─── Dashboard widgets ──────────────────────────────────────────────────── */
.client-dashboard-left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.client-dashboard-doctor-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0.25rem;
}

.client-dashboard-doctor-image {
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
}

.upcoming-list { display: flex; flex-direction: column; gap: 0.5rem; }

.visit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}
.visit-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }

.visit-anchor-target {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.visit-anchor-targeted {
  border-color: var(--primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-md);
}

.visit-date-block {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--primary-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(124,58,237,0.15);
}
.visit-date-block .day   { font-size: 1.25rem; font-weight: 800; color: var(--primary); line-height: 1; }
.visit-date-block .month { font-size: 0.5625rem; font-weight: 700; color: var(--primary); text-transform: uppercase; }

.visit-info { flex: 1; min-width: 0; }
.visit-info .company { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.visit-info .session { font-size: 0.8125rem; color: var(--text-muted); }

.visit-slots { text-align: right; flex-shrink: 0; }
.visit-slots .count { font-size: 1rem; font-weight: 700; color: var(--text); }
.visit-slots .label { font-size: 0.6875rem; color: var(--text-muted); }

/* ─── Empty states ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state .empty-icon-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.empty-state h4 { font-size: 1rem; color: var(--text-2); margin-bottom: 0.375rem; }
.empty-state p  { font-size: 0.875rem; max-width: 300px; }

/* ─── Filtres ─────────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.search-input-wrapper { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-input-wrapper .search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-input-wrapper .form-control { padding-left: 2.25rem; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.25rem;
}
.pagination a, .pagination span {
  padding: 0.375rem 0.625rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--bg-card);
}
.pagination a:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-elevated); }
.pagination .active { background: var(--primary-light); border-color: rgba(124,58,237,0.2); color: var(--primary); font-weight: 600; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h3 { font-size: 1.125rem; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-muted);
  transition: var(--t);
}
.modal-close:hover { color: var(--text); background: var(--bg-card); border-color: var(--border-hover); }

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.about-modal-brand {
  margin-bottom: 1rem;
}

.about-modal-logo {
  height: 40px;
  width: auto;
}

.about-modal-content p {
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.about-modal-signature {
  margin-top: 1rem;
  font-weight: 600;
}

.about-modal-contact {
  margin-bottom: 0;
}

.about-contact-link {
  color: var(--primary);
  font-weight: 700;
}

.about-contact-link:hover {
  color: var(--primary-hover);
}

/* ─── FullCalendar ───────────────────────────────────────────────────────── */
.fc {
  --fc-border-color:                var(--border);
  --fc-button-bg-color:             var(--bg-card);
  --fc-button-border-color:         var(--border);
  --fc-button-hover-bg-color:       var(--bg-elevated);
  --fc-button-hover-border-color:   var(--border-hover);
  --fc-button-active-bg-color:      var(--primary-light);
  --fc-button-active-border-color:  transparent;
  --fc-button-text-color:           var(--text);
  --fc-today-bg-color:              rgba(124,58,237,0.05);
  --fc-page-bg-color:               transparent;
  --fc-neutral-bg-color:            var(--bg-elevated);
  --fc-list-event-hover-bg-color:   var(--bg-elevated);
  --fc-small-font-size: 0.8125rem;
  font-family: var(--font);
  font-size: 0.875rem;
}

.fc .fc-toolbar-title { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.fc .fc-col-header-cell-cushion { color: var(--text-2); font-weight: 600; font-size: 0.8125rem; text-decoration: none; }
.fc .fc-daygrid-day-number { color: var(--text-2); font-size: 0.875rem; text-decoration: none; }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: var(--primary); font-weight: 700; }
.fc .fc-button { font-family: var(--font); font-size: 0.8125rem; font-weight: 600; border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.fc .fc-event { border-radius: var(--r-sm); border: none; font-size: 0.8125rem; cursor: pointer; }
.fc .fc-event-available { background: var(--success); }
.fc .fc-event-booked    { background: var(--info); }
.fc .fc-event-blocked   { background: var(--danger); }
.fc .fc-event-done      { background: var(--text-muted); }
.fc .fc-event-cancelled { background: var(--warning); }

#admin-calendar .fc-daygrid-day.day-past-gray-admin .fc-daygrid-day-frame,
#admin-calendar .fc-timegrid-col.day-past-gray-admin {
  background: #e5e7eb !important;
}

#admin-calendar .fc-daygrid-day.day-past-gray-admin .fc-daygrid-day-number,
#admin-calendar .fc-daygrid-day.day-past-gray-admin .fc-daygrid-day-events {
  color: #64748b;
}

#admin-calendar .fc-daygrid-day.day-today-blue-admin .fc-daygrid-day-frame,
#admin-calendar .fc-timegrid-col.day-today-blue-admin {
  background: #dbeafe !important;
}

#admin-calendar .fc-daygrid-day.day-today-blue-admin .fc-daygrid-day-number {
  color: #1d4ed8;
  font-weight: 700;
}

#client-dashboard-calendar {
  min-height: 380px;
}

#client-dashboard-calendar .fc-toolbar-title {
  font-size: 1rem;
}

#client-dashboard-calendar .fc-event {
  font-weight: 600;
}

#client-dashboard-calendar .fc-daygrid-day.day-past-gray .fc-daygrid-day-frame,
#client-dashboard-calendar .fc-timegrid-col.day-past-gray {
  background: #e5e7eb !important;
}

#client-dashboard-calendar .fc-daygrid-day.day-past-gray .fc-daygrid-day-number,
#client-dashboard-calendar .fc-daygrid-day.day-past-gray .fc-daygrid-day-events {
  color: #64748b;
}

#client-dashboard-calendar .fc-daygrid-day.day-today-blue .fc-daygrid-day-frame,
#client-dashboard-calendar .fc-timegrid-col.day-today-blue {
  background: #dbeafe !important;
}

#client-dashboard-calendar .fc-daygrid-day.day-today-blue .fc-daygrid-day-number {
  color: #1d4ed8;
  font-weight: 700;
}

#client-dashboard-calendar .fc-daygrid-day.day-available-light .fc-daygrid-day-frame,
#client-dashboard-calendar .fc-timegrid-col.day-available-light {
  background: #dcfce7 !important;
}

#client-dashboard-calendar .fc-daygrid-day.day-other-light .fc-daygrid-day-frame,
#client-dashboard-calendar .fc-timegrid-col.day-other-light {
  background: #f1f5f9 !important;
}

#client-dashboard-calendar .fc-daygrid-event {
  white-space: normal;
}

#client-dashboard-calendar .fc-daygrid-event .fc-event-main {
  padding: 0.125rem 0.25rem;
}

#client-dashboard-calendar .fc-daygrid-event .fc-event-title {
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
  font-size: 0.75rem;
}

#client-dashboard-calendar .fc-event.event-reservable {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

#client-dashboard-calendar .fc-event.event-unavailable {
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
  color: #334155 !important;
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; }
.gap-6  { gap: 1.5rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }

.w-full  { width: 100%; }
.hidden  { display: none; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Sidebar toggle ─────────────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3     { grid-template-columns: 1fr 1fr; }
  .home-minimal-hero { grid-template-columns: 1fr; }
  .home-icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-minimal-points { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body {
    padding-bottom: var(--footer-h-mobile);
  }

  .sidebar { transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .admin-header {
    height: auto;
    min-height: var(--header-h);
    padding: 0.625rem 0.875rem;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .admin-header > .flex.items-center.gap-3 { min-width: 0; flex: 1 1 auto; }
  .admin-header .page-title { white-space: normal; line-height: 1.3; }
  .admin-header-right { width: 100%; justify-content: flex-end; }
  .admin-header-right .text-sm { display: none; }
  .admin-content { padding: 1rem; }

  #client-dashboard-calendar .fc-header-toolbar {
    gap: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
  }
  #client-dashboard-calendar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
  }
  #client-dashboard-calendar .fc .fc-button {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  .client-header {
    height: auto;
    min-height: var(--header-h);
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.625rem;
  }
  .client-logo { order: 1; }
  .client-header-right { order: 2; margin-left: auto; }
  .client-header-right .text-sm { display: none; }
  .client-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.125rem;
    -webkit-overflow-scrolling: touch;
  }
  .client-nav a { flex: 0 0 auto; }
  .client-main { padding: 1rem; }

  .filters-bar form { width: 100%; }
  .filters-bar .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .filters-bar .btn,
  .filters-bar .ml-auto {
    width: 100%;
    margin-left: 0;
  }

  .page-header-row > .flex.gap-2.items-center.flex-wrap,
  .page-header-row > .flex.gap-3.items-center.flex-wrap,
  .page-header-row > .flex.gap-4.items-center.flex-wrap,
  .page-header-row > form.flex.gap-2.items-center.flex-wrap,
  .page-header-row > form.flex.gap-3.items-center.flex-wrap {
    width: 100%;
  }
  .page-header-row .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .page-header-row > .flex.gap-2 > .btn,
  .page-header-row > .flex.gap-3 > .btn,
  .page-header-row > .flex.gap-4 > .btn,
  .page-header-row > .flex.gap-2 > form,
  .page-header-row > .flex.gap-3 > form,
  .page-header-row > .flex.gap-4 > form {
    width: 100%;
  }
  .page-header-row > .flex.gap-2 > form .btn,
  .page-header-row > .flex.gap-3 > form .btn,
  .page-header-row > .flex.gap-4 > form .btn {
    width: 100%;
  }

  .admin-content form.flex.gap-2.items-center.flex-wrap,
  .admin-content form.flex.gap-3.items-center.flex-wrap {
    width: 100%;
  }
  .admin-content form.flex.gap-2.items-center.flex-wrap .form-control,
  .admin-content form.flex.gap-3.items-center.flex-wrap .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }

  .slot-item,
  .visit-item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.625rem;
  }
  .slot-time { min-width: 0; }
  .slot-subject,
  .visit-info {
    min-width: 0;
    flex: 1 1 180px;
  }
  .visit-slots { text-align: left; }
  .client-dashboard-doctor-image { width: min(100%, 300px); }
  .slot-item > form { width: 100%; }
  .slot-item > form .btn { width: 100%; }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem;
  }
  .fc .fc-toolbar-title { font-size: 1rem; text-align: center; }
  .fc .fc-button { padding: 0.3125rem 0.5rem; font-size: 0.75rem; }

  .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .card-header .card-title {
    min-width: 0;
    max-width: 100%;
  }
  .section-title-icon {
    width: 36px;
    height: 36px;
  }

  .tab-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.125rem !important;
  }

  .public-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .admin-main .public-footer {
    left: 0;
  }

  .footer-about-btn {
    margin-left: 0;
  }

  .public-footer-logo {
    height: 20px;
  }

  #toast-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .client-main .flex.gap-3,
  .client-main .flex.gap-4,
  .admin-content .flex.gap-3,
  .admin-content .flex.gap-4 {
    flex-wrap: wrap;
  }
  .client-main .flex.gap-3 > .btn,
  .client-main .flex.gap-4 > .btn,
  .admin-content .flex.gap-3 > .btn,
  .admin-content .flex.gap-4 > .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .home-minimal { padding: 1.3rem 0.9rem 0.8rem; }
  .home-minimal-copy { padding: 1rem; }
  .home-minimal-title { font-size: 1.95rem; }
  .home-minimal-subtitle { font-size: 0.9rem; }
  .home-minimal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .home-minimal-actions .btn {
    width: 100%;
  }
  .home-main-icon-card img { max-height: 200px; }
  .home-icon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header-row { flex-direction: column; }
}

@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
  .client-main { padding: 0.875rem; }
  .auth-card { padding: 1.5rem; }
  .home-minimal-title { font-size: 1.62rem; }
  .home-minimal .home-brand-name { font-size: 1.18rem; }
  .home-icon-grid { grid-template-columns: 1fr; }
  .section-title-icon {
    width: 32px;
    height: 32px;
  }
  .client-header-right .btn { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
  .client-nav a { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; }
  .fc .fc-toolbar-title { font-size: 0.9375rem; }
  .fc .fc-button { font-size: 0.6875rem; padding: 0.25rem 0.4375rem; }
  .tab-nav .tab-link { padding: 0.4375rem 0.625rem; font-size: 0.8125rem; }
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: #c7d2e4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Sidebar overlay mobile ─────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }
