/* Odysium Care — noir profond + blanc + cyan signature, premium minimaliste */

:root {
  /* Cyan signature Odysium */
  --cyan: #1FC8D9;
  --cyan-bright: #2ADAEC;
  --cyan-dark: #0F9AAB;
  --cyan-glow: rgba(31, 200, 217, 0.45);
  --cyan-soft: rgba(31, 200, 217, 0.10);

  /* Noirs profonds (premium) */
  --black: #07090D;
  --black-2: #0C0F14;
  --black-3: #141821;
  --black-elev: #1A1F2A;

  /* Blancs & gris clairs */
  --white: #FFFFFF;
  --off-white: #F7F8FA;
  --surface-soft: #EEF0F4;
  --border: #E3E6EB;
  --border-soft: #EFF1F5;

  /* Textes */
  --text: #2B3240;
  --text-muted: #6A7280;
  --text-faint: #A0A7B4;
  --text-on-dark: #E8EBF0;
  --text-on-dark-muted: rgba(232, 235, 240, 0.62);
  --text-on-dark-faint: rgba(232, 235, 240, 0.42);

  /* Géométrie */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  /* Ombres */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-cyan: 0 10px 28px rgba(31, 200, 217, 0.35);

  /* Layout */
  --max-w: 460px;

  /* Typographie */
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Oswald', var(--font-body);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Fond noir profond premium + halo cyan discret ===== */
body {
  background-color: var(--black);
  background-image:
    radial-gradient(1100px 800px at 50% -200px, rgba(31, 200, 217, 0.15), transparent 60%),
    radial-gradient(600px 500px at 90% 110%, rgba(31, 200, 217, 0.08), transparent 65%),
    linear-gradient(180deg, var(--black) 0%, var(--black-2) 100%);
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
}

/* Ligne de lumière cyan en haut (signature premium) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(31, 200, 217, 0) 15%,
    rgba(31, 200, 217, 0.6) 50%,
    rgba(31, 200, 217, 0) 85%,
    transparent 100%);
  pointer-events: none;
  z-index: 10;
}

/* Motif de lignes diagonales très subtiles (texture premium) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    120deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ===== Mise en page ===== */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 48px;
}

.view {
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hidden { display: none !important; }

/* ===== Brand Hero ===== */
.brand {
  text-align: center;
  margin: 12px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
/* Logo affiché dans la carte noire (fond noir JPG ↔ fond noir carte = pas de bord visible) */
.form-logo {
  display: block;
  width: 200px;
  max-width: 70%;
  height: auto;
  margin: -4px auto 12px;
  /* mix-blend-mode: screen efface les pixels noirs du JPG sur fond noir */
  mix-blend-mode: screen;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--white);
  line-height: 1.05;
}
.brand h1 span { color: var(--cyan-bright); }

/* Accroche baseline */
.brand .headline {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--white);
  line-height: 1.1;
  margin: 0;
}
.brand .headline em {
  font-style: normal;
  color: var(--cyan-bright);
  display: block;
  font-weight: 700;
}

.brand .tagline {
  color: var(--text-on-dark-muted);
  font-size: 14.5px;
  letter-spacing: 0.01em;
  margin: 0;
  max-width: 360px;
}
.brand .tagline strong {
  color: var(--white);
  font-weight: 600;
}

/* Trait cyan décoratif */
.brand-accent {
  width: 56px;
  height: 2px;
  background: var(--cyan-bright);
  border-radius: 2px;
  box-shadow: 0 0 16px var(--cyan-glow);
}

/* ===== Carte formulaire : noire premium ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--black-elev);
  padding: 32px 28px;
  border-radius: var(--radius);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}
/* Trait cyan fin en haut de la carte */
.form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--cyan-glow);
}

.form-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 4px 0 8px;
  text-align: center;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-on-dark);
}
.form label > span {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11.5px;
  color: var(--text-on-dark-muted);
}

.form input[type="email"],
.form input[type="password"],
.form input[type="text"],
.form input[type="tel"],
.form input[type="number"],
.form textarea,
.form select {
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  outline: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  width: 100%;
  box-sizing: border-box;
}
.form textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.45;
  font-size: 14px;
}
.form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E8EBF0' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  color-scheme: dark;
}
.form select option { background: var(--black-2); color: var(--white); }
.form input::placeholder,
.form textarea::placeholder { color: var(--text-on-dark-faint); }
.form input:hover,
.form textarea:hover,
.form select:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.14); }
.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.05);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}
/* Correction autofill Chrome/Edge : évite le fond jaune/bleu par défaut */
.form input:-webkit-autofill,
.form input:-webkit-autofill:hover,
.form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px var(--black-elev) inset;
  caret-color: var(--white);
}

/* ===== Toggle œil pour les champs mot de passe ===== */
.password-wrap {
  position: relative;
  display: flex;
}
.password-wrap input {
  width: 100%;
  padding-right: 48px !important;
}
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: color .18s ease, background .18s ease;
}
.password-toggle:hover {
  color: var(--cyan-bright);
  background: rgba(31, 200, 217, 0.08);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}
.password-toggle svg { display: block; }
/* Par défaut : œil ouvert visible, œil barré caché (état = mot de passe masqué) */
.password-toggle .icon-eye-off { display: none; }
/* Quand visible=true (mot de passe affiché) : on montre l'œil barré */
.password-toggle[data-visible="true"] .icon-eye { display: none; }
.password-toggle[data-visible="true"] .icon-eye-off { display: block; }

.form label.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-on-dark-muted);
  line-height: 1.55;
  text-transform: none;
  letter-spacing: normal;
}
.form label.checkbox input {
  margin-top: 3px;
  accent-color: var(--cyan);
  transform: scale(1.1);
}
.form label.checkbox span {
  text-transform: none;
  font-size: 12.5px;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--text-on-dark-muted);
}

.form small.muted {
  text-align: left;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-on-dark-faint);
}

/* ===== Boutons premium ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease, color .22s ease;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.995); }

.btn-primary {
  background: var(--cyan);
  color: var(--black);
  box-shadow: var(--shadow-cyan);
}
.btn-primary:hover {
  background: var(--cyan-bright);
  box-shadow: 0 14px 36px rgba(31, 200, 217, 0.5);
  transform: translateY(-1px);
}
/* Reflet lumineux au survol */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn-primary:hover::before { left: 120%; }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn-ghost:hover {
  background: rgba(31, 200, 217, 0.08);
  border-color: var(--cyan);
  color: var(--cyan-bright);
}

/* ===== Séparateur ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-on-dark-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin: 6px 0;
  font-weight: 600;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

/* ===== Error state ===== */
.error {
  background: rgba(254, 226, 226, 0.98);
  color: #8B0000;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  margin: 0;
  font-weight: 500;
}

/* Bannière preview */
.preview-banner {
  background: rgba(31, 200, 217, 0.1);
  border: 1px solid rgba(31, 200, 217, 0.3);
  color: #9FE3EB;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 auto;
  text-align: center;
  width: fit-content;
  font-weight: 500;
}

/* Petit texte de pied */
.foot-note {
  text-align: center;
  color: var(--text-on-dark-muted);
  font-size: 12.5px;
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}
.foot-note a {
  color: var(--cyan-bright);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(42, 218, 236, 0.35);
  padding-bottom: 1px;
  transition: border-color .18s ease;
}
.foot-note a:hover { border-color: var(--cyan-bright); }

/* ===== Dashboards (placeholders Module 1) ===== */
.dashboard {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dashboard header strong {
  font-weight: 600;
  color: var(--black-2);
  font-size: 15px;
}
.dashboard header small {
  color: var(--text-muted);
  font-size: 13px;
}
.dashboard .role-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: var(--black);
  color: var(--cyan-bright);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.dashboard .card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.dashboard .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  width: 56px;
  height: 3px;
  background: var(--cyan);
  border-radius: 0 0 3px 3px;
}
.dashboard .card h2 {
  font-family: var(--font-display);
  margin: 10px 0 14px;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black-2);
}
.dashboard .card p {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ===== Dashboard admin (Module 2a) ===== */

/* Le rôle-view peut être plus large que le formulaire de login */
#role-view { max-width: 100%; width: 100%; }

/* Reset du padding global #app quand on est en mode shell (sidebar) */
.app:has(.app-shell) {
  padding: 0 !important;
  align-items: stretch;
}

/* ===== Shell avec sidebar latérale (style Odynutri) ===== */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar gauche */
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--black-2);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  z-index: 5;
}
.sidebar-brand {
  padding: 4px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-logo {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  mix-blend-mode: screen;
}
html[data-theme="light"] .sidebar-logo.logo-light {
  mix-blend-mode: multiply;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-on-dark-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: all .15s ease;
  width: 100%;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
}
.sidebar-nav-item.is-active {
  background: rgba(31, 200, 217, 0.12);
  color: var(--cyan-bright);
  border-color: rgba(31, 200, 217, 0.35);
  box-shadow: 0 2px 12px rgba(31, 200, 217, 0.15);
}
.sidebar-nav-item .nav-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-user-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan-darker));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
  flex: 1;
}
.sidebar-user-info strong {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-info small {
  color: var(--text-on-dark-muted);
  font-size: 11.5px;
}
.sidebar-logout,
.sidebar-theme,
.sidebar-notif {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-on-dark-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s ease;
  position: relative;
}
.sidebar-notif:hover {
  background: rgba(31, 200, 217, 0.08);
  color: var(--cyan-bright);
  border-color: rgba(31, 200, 217, 0.4);
}
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: auto;
  background: #EF4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
}
html[data-theme="light"] .sidebar-notif { color: #6B7280; border-color: rgba(15, 20, 25, 0.12); }
html[data-theme="light"] .sidebar-notif:hover { color: #0E8A96; border-color: rgba(31, 200, 217, 0.4); }
.sidebar-theme:hover {
  background: rgba(31, 200, 217, 0.08);
  color: var(--cyan-bright);
  border-color: rgba(31, 200, 217, 0.4);
}
.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.4);
}
html[data-theme="light"] .sidebar-theme {
  border-color: rgba(15, 20, 25, 0.12);
  color: #6B7280;
}
html[data-theme="light"] .sidebar-theme:hover {
  background: rgba(31, 200, 217, 0.08);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.5);
}

/* Main content à droite */
.app-main {
  padding: 28px 32px 40px;
  min-height: 100vh;
  overflow-x: hidden;
}
.main-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.space-header {
  margin-bottom: 8px;
}
.space-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 0;
}
.space-sub {
  font-size: 14px;
  margin: 6px 0 0;
}

/* Mode clair — sidebar et header */
html[data-theme="light"] .app-sidebar {
  background: #FFFFFF;
  border-right-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .sidebar-brand {
  border-bottom-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .sidebar-nav-item { color: #6B7280; }
html[data-theme="light"] .sidebar-nav-item:hover {
  background: rgba(15, 20, 25, 0.04);
  color: #0F1419;
}
html[data-theme="light"] .sidebar-nav-item.is-active {
  background: rgba(31, 200, 217, 0.1);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.5);
}
html[data-theme="light"] .sidebar-footer { border-top-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .sidebar-user {
  background: rgba(15, 20, 25, 0.03);
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .sidebar-user-info strong { color: #0F1419; }
html[data-theme="light"] .sidebar-user-info small { color: #6B7280; }
html[data-theme="light"] .sidebar-logout {
  border-color: rgba(15, 20, 25, 0.12);
  color: #6B7280;
}
html[data-theme="light"] .space-title { color: #0F1419; }

/* Responsive : sidebar en haut sur mobile */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .app-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 16px;
    gap: 12px;
  }
  .sidebar-brand { padding: 0; border-bottom: none; }
  .sidebar-logo { width: 140px; }
  .sidebar-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
  }
  .sidebar-nav-item {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12.5px;
  }
  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    border-top: none;
  }
  .sidebar-user { flex: 1; }
  .sidebar-logout { padding: 10px 14px; }
  .app-main { padding: 20px 16px 40px; }
  .space-title { font-size: 24px; }
  html[data-theme="light"] .app-sidebar {
    border-bottom-color: rgba(15, 20, 25, 0.08);
  }
}

/* Legacy : on garde admin-shell pour les vues sans sidebar (login etc.) */
.admin-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Header admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--black-elev);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}
.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-brand {
  height: 44px;
  width: auto;
  mix-blend-mode: screen;
}
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-user-meta {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.25;
}
.admin-user-meta strong {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}
.admin-user-meta small {
  color: var(--text-on-dark-muted);
  font-size: 11.5px;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--black-elev);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  margin: 0 auto;
}
.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color .18s ease, background .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-tab:hover:not(:disabled) { color: var(--white); }
.admin-tab.is-active {
  background: var(--cyan);
  color: var(--black);
  box-shadow: var(--shadow-cyan);
}
.admin-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tab-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Pastille numérique rouge à côté du label d'un onglet (items à traiter) */
.tab-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  background: #EF4444;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

/* Panneau de contenu */
.admin-tabpanel {
  background: var(--black-elev);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

/* Users tab */
.users-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.users-stats {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  text-align: left;
}
.users-stats strong { color: var(--white); }

.users-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-pills {
  display: flex;
  gap: 8px;
  width: 100%;
}
.filter-pills > .filter-pill {
  flex: 1;
  min-width: 0;
  text-align: center;
  justify-content: center;
}
/* Sur écrans très étroits, wrap possible pour éviter d'être illisible */
@media (max-width: 520px) {
  .filter-pills { flex-wrap: wrap; }
  .filter-pills > .filter-pill { flex: 1 1 calc(50% - 4px); }
}
.filter-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all .15s ease;
  white-space: nowrap;
}
.filter-pill:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
.filter-pill.is-active {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--cyan);
  box-shadow: 0 2px 10px rgba(31, 200, 217, 0.3);
}
html[data-theme="light"] .filter-pill {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.12);
  color: #6B7280;
}
html[data-theme="light"] .filter-pill:hover {
  background: #F9FAFB;
  color: #0F1419;
  border-color: rgba(15, 20, 25, 0.25);
}
html[data-theme="light"] .filter-pill.is-active {
  background: var(--cyan);
  color: #FFFFFF;
  border-color: var(--cyan);
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--white);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.search-input::placeholder { color: var(--text-on-dark-faint); }
.search-input:focus {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.05);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}

/* Liste */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.users-empty, .users-loading {
  padding: 32px;
  text-align: center;
  color: var(--text-on-dark-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: background .18s ease, border-color .18s ease;
}
.user-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(31, 200, 217, 0.25);
}
.user-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.user-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan-darker, #0B7782));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.user-main { min-width: 0; flex: 1; }
.user-name {
  color: var(--white);
  font-weight: 600;
  font-size: 14.5px;
}
.user-sub {
  color: var(--text-on-dark-muted);
  font-size: 12.5px;
  margin-top: 2px;
}
.user-spec { color: var(--cyan-bright); }
.user-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.user-date {
  color: var(--text-on-dark-faint);
  font-size: 11.5px;
}

/* Badges de rôle colorés */
.role-badge.role-client     { background: var(--black); color: var(--cyan-bright); border: 1px solid rgba(31, 200, 217, 0.4); }
.role-badge.role-practitioner { background: var(--black); color: #FACC15; border: 1px solid rgba(250, 204, 21, 0.4); }
.role-badge.role-admin      { background: var(--cyan); color: var(--black); border: 1px solid var(--cyan); }

/* Badges de statut d'activation */
.activation-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
  white-space: nowrap;
}
.activation-pending  { background: rgba(251, 146, 60, 0.12); color: #FDBA74; border-color: rgba(251, 146, 60, 0.5); }
.activation-active   { background: rgba(34, 197, 94, 0.10); color: #86EFAC; border-color: rgba(34, 197, 94, 0.4); }
.activation-archived { background: rgba(148, 163, 184, 0.08); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.35); }

.stat-pending {
  color: #FDBA74;
  font-size: 13px;
}
.stat-pending strong { color: #FDBA74; }

/* Boutons mini (inline actions sur user row) */
.user-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-mini {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-mini-success {
  background: rgba(34, 197, 94, 0.1);
  color: #86EFAC;
  border-color: rgba(34, 197, 94, 0.5);
}
.btn-mini-success:hover { background: rgba(34, 197, 94, 0.2); }
.btn-mini-ghost {
  background: transparent;
  color: var(--text-on-dark-muted);
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-mini-ghost:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.03);
}
.btn-mini-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.45);
}
.btn-mini-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.7);
}
html[data-theme="light"] .btn-mini-danger {
  background: #FEF2F2;
  color: #991B1B;
  border-color: rgba(239, 68, 68, 0.5);
}
html[data-theme="light"] .btn-mini-danger:hover {
  background: #FEE2E2;
}
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }

/* Combiné indicatif + numéro */
.phone-input {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 6px;
  align-items: stretch;
}
.phone-dialcode {
  padding: 14px 10px !important;
  font-family: inherit;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--white) !important;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E8EBF0' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 28px !important;
}
.phone-dialcode option { background: var(--black-2); color: var(--white); font-size: 14px; }
.phone-dialcode:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.phone-number {
  /* hérite des styles input[type="tel"] */
  width: 100%;
}
html[data-theme="light"] .phone-dialcode {
  background: #FFFFFF !important;
  border-color: rgba(15, 20, 25, 0.12) !important;
  color: #0F1419 !important;
  color-scheme: light !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230F1419' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  /* no-repeat + position obligatoires : le shorthand background:#FFFFFF
     ci-dessus reset toutes les sous-propriétés. Sans ces 2 lignes, le
     chevron apparaît en mosaïque sur tout le select. */
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
}
html[data-theme="light"] .phone-dialcode option { background: #FFFFFF; color: #0F1419; }

@media (max-width: 480px) {
  .phone-input { grid-template-columns: 1fr; gap: 6px; }
}

/* Suggestion de correction d'email (typo du domaine) */
.email-suggestion {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: -6px 0 4px;
  font-size: 13px;
  color: #FDE68A;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.email-suggestion strong { color: #FACC15; }
.email-suggestion-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
html[data-theme="light"] .email-suggestion {
  background: #FEFCE8;
  border-color: rgba(250, 204, 21, 0.5);
  color: #713F12;
}
html[data-theme="light"] .email-suggestion strong { color: #854D0E; }

/* Erreur de doublon avec bouton supprimer */
.dup-error-body { display: flex; flex-direction: column; gap: 8px; }
.dup-error-body p { margin: 0; line-height: 1.45; }
.dup-error-hint { font-size: 12.5px; opacity: 0.85; }
.dup-error-body .btn-mini-danger { align-self: flex-start; margin-top: 4px; }

/* Message de succès (après suppression doublon) */
.success-msg {
  background: rgba(34, 197, 94, 0.08);
  color: #86EFAC;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  margin: 8px 0 0;
  font-weight: 500;
}
html[data-theme="light"] .success-msg {
  background: #F0FDF4;
  color: #166534;
  border-color: rgba(34, 197, 94, 0.5);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 13, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  animation: fadeIn .18s ease;
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--black-elev);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg, 0 32px 80px rgba(0, 0, 0, 0.6));
  animation: slideDown .22s ease;
  position: relative;
}
@keyframes slideDown { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  border-radius: 2px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--white); background: rgba(255, 255, 255, 0.05); }
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 26px 22px;
}
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-on-dark);
}
.modal-body label > span {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="text"],
.modal-body input[type="tel"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body input[type="time"],
.modal-body select {
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.modal-body select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E8EBF0' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.modal-body select option { background: var(--black-2); color: var(--white); }
.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.05);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}
.modal-body .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-body .hint {
  font-size: 12px;
  line-height: 1.55;
  margin: 2px 0;
  padding: 10px 12px;
  background: rgba(31, 200, 217, 0.06);
  border: 1px solid rgba(31, 200, 217, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Credentials (après création praticien) */
.credentials {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin: 6px 0;
}
.cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}
.cred-row + .cred-row { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.cred-row span {
  font-size: 11.5px;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.cred-row code {
  font-family: 'Courier New', monospace;
  background: rgba(31, 200, 217, 0.08);
  color: var(--cyan-bright);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  user-select: all;
}

/* Responsive admin mobile */
@media (max-width: 640px) {
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .admin-header-right {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-user-chip { justify-content: space-between; }
  .admin-tabpanel { padding: 18px; }
  .users-head { flex-direction: column; align-items: stretch; }
  .users-filters { flex-direction: column; align-items: stretch; }
  .search-input { min-width: 0; }
  .user-row { flex-direction: column; align-items: stretch; }
  .user-right { flex-direction: row; justify-content: space-between; align-items: center; }
  .modal-body .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Onglet Rendez-vous (Module 2b) ===== */

.appts-tab { display: flex; flex-direction: column; gap: 16px; }

.appts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.appts-filters {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
/* Variante 3-col pour la vue admin (status + urgence + recherche) */
.appts-filters--admin {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) 2fr;
  gap: 10px;
}
.appts-filters select { cursor: pointer; }

.appts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Ligne de demande */
.appt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .05s ease;
}
.appt-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(31, 200, 217, 0.3);
}
.appt-row:active { transform: translateY(1px); }
.appt-col-main { flex: 1; min-width: 0; }
.appt-patient {
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.appt-motive {
  color: var(--text-on-dark);
  font-size: 13.5px;
  line-height: 1.45;
}
.appt-practitioner {
  color: var(--cyan-bright);
  font-size: 12.5px;
  margin-top: 4px;
}
.appt-date {
  color: var(--text-on-dark-muted);
  font-size: 12px;
  margin-top: 4px;
  font-style: italic;
}
.appt-col-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.appt-created { font-size: 11px; }

/* Badges de statut — couleurs distinctes */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
  white-space: nowrap;
}
.status-new-client  { background: rgba(168, 85, 247, 0.12); color: #D8B4FE; border-color: rgba(168, 85, 247, 0.5); }
.status-draft       { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.4); }
.status-sent        { background: rgba(59, 130, 246, 0.12); color: #93C5FD; border-color: rgba(59, 130, 246, 0.5); }
.status-proposed    { background: rgba(250, 204, 21, 0.12); color: #FDE68A; border-color: rgba(250, 204, 21, 0.5); }
.status-validated   { background: rgba(34, 197, 94, 0.12); color: #86EFAC; border-color: rgba(34, 197, 94, 0.5); }
.status-confirmed   { background: rgba(31, 200, 217, 0.15); color: var(--cyan-bright); border-color: rgba(31, 200, 217, 0.6); }
.status-declined    { background: rgba(251, 146, 60, 0.12); color: #FDBA74; border-color: rgba(251, 146, 60, 0.5); }
.status-cancelled   { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.5); }
.status-expired     { background: rgba(115, 115, 115, 0.12); color: #A3A3A3; border-color: rgba(115, 115, 115, 0.4); }

/* Badges d'urgence */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid;
  white-space: nowrap;
}
.urgency-normal   { background: rgba(148, 163, 184, 0.08); color: #94A3B8; border-color: rgba(148, 163, 184, 0.3); }
.urgency-priority { background: rgba(251, 146, 60, 0.12); color: #FDBA74; border-color: rgba(251, 146, 60, 0.5); }
.urgency-urgent   { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }

/* Modal wide (pour création RDV) */
.modal-wide { max-width: 640px; }

/* Onglets dans la modal (mode workflow vs manuel) */
.mode-tabs {
  display: flex;
  gap: 6px;
  padding: 0 26px;
  margin-bottom: 4px;
}
.mode-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s ease;
  text-align: left;
}
.mode-tab small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-on-dark-faint);
  margin-top: 2px;
}
.mode-tab:hover { border-color: rgba(255, 255, 255, 0.15); color: var(--white); }
.mode-tab.is-active {
  background: rgba(31, 200, 217, 0.08);
  border-color: var(--cyan);
  color: var(--cyan-bright);
}
.mode-tab.is-active small { color: var(--cyan-bright); opacity: 0.8; }

/* Liste de créneaux précis (type Calendly) — ponctuels + récurrents */
.slots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.slot-row {
  display: grid;
  grid-template-columns: 1.3fr 1.6fr 36px;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}
.slot-row > .slot-type-toggle { grid-column: 1 / -1; grid-row: 1; }
.slot-row > .slot-when  { grid-column: 1; grid-row: 2; }
.slot-row > .slot-times { grid-column: 2; grid-row: 2; }
.slot-row > .slot-remove { grid-column: 3; grid-row: 2; }

/* Toggle Ponctuel / Récurrent par ligne */
.slot-type-toggle {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  padding: 2px;
  width: fit-content;
}
.slot-type-toggle button {
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all .15s ease;
}
.slot-type-toggle button:hover { color: var(--white); }
.slot-type-toggle button.is-active {
  background: var(--cyan);
  color: var(--black);
}

/* Chips multi-sélection pour les jours (créneau récurrent) */
.slot-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.weekday-chip {
  padding: 7px 10px;
  min-width: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: all .15s ease;
}
.weekday-chip:hover {
  border-color: rgba(31, 200, 217, 0.3);
  color: var(--white);
}
.weekday-chip.is-active {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--cyan);
  box-shadow: 0 2px 8px rgba(31, 200, 217, 0.3);
}

/* Date (ponctuel) */
.slot-when input[type="date"] {
  width: 100%;
  padding: 10px 12px !important;
  font-family: inherit;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--white) !important;
  outline: none;
  color-scheme: dark;
  transition: border-color .18s ease, background .18s ease;
}

.slot-row input[type="date"],
.slot-row input[type="time"] {
  padding: 10px 12px !important;
  font-family: inherit;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--white);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
  color-scheme: dark;
}
.slot-row input:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
.slot-row input:focus {
  border-color: var(--cyan) !important;
  background: rgba(31, 200, 217, 0.05) !important;
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.slot-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}
.slot-sep {
  color: var(--text-on-dark-muted);
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}
.slot-remove {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all .15s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-remove:hover {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}
.slot-add-btn {
  margin-top: 10px;
  align-self: flex-start;
}

/* Lecture seule (détail d'une demande) */
.slots-readonly {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slots-readonly li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.slots-readonly li strong {
  color: var(--white);
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.slots-readonly li > span:last-child {
  color: var(--cyan-bright);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.slot-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.slot-badge-weekly { background: rgba(168, 85, 247, 0.12); color: #D8B4FE; border: 1px solid rgba(168, 85, 247, 0.4); }
.slot-badge-once   { background: rgba(59, 130, 246, 0.12); color: #93C5FD; border: 1px solid rgba(59, 130, 246, 0.4); }

/* Textarea de la modale */
.modal-body textarea {
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color .18s ease, background .18s ease;
}
.modal-body textarea:focus {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.05);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}
.modal-body input[type="date"],
.modal-body input[type="time"] {
  color-scheme: dark;
}

/* Détail d'une demande — sections et timeline */
.detail-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.detail-section:last-child { border-bottom: none; }
.detail-section h3 {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin: 0 0 8px;
}
.detail-section p {
  margin: 0 0 6px;
  color: var(--text-on-dark);
  font-size: 14px;
  line-height: 1.5;
}
.detail-section p strong { color: var(--white); }

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  padding: 8px 0 8px 20px;
  border-left: 2px solid rgba(31, 200, 217, 0.25);
  position: relative;
  font-size: 13px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px; top: 12px;
  width: 10px; height: 10px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(31, 200, 217, 0.18);
}
.tl-date {
  color: var(--text-on-dark-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
}
.tl-status {
  color: var(--cyan-bright);
  font-weight: 600;
}
.tl-by {
  color: var(--text-on-dark-muted);
  font-size: 12px;
  margin-left: 8px;
}
.tl-note {
  display: block;
  color: var(--text-on-dark-muted);
  font-size: 12.5px;
  font-style: italic;
  margin-top: 2px;
}

.detail-actions { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 16px; }

@media (max-width: 640px) {
  .appts-filters { grid-template-columns: 1fr; }
  .appt-row { flex-direction: column; }
  .appt-col-meta { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .slot-row {
    grid-template-columns: 1fr 36px;
    grid-template-rows: auto auto auto;
    gap: 8px;
  }
  .slot-row > .slot-type-toggle { grid-column: 1 / -1; grid-row: 1; }
  .slot-row > .slot-when  { grid-column: 1; grid-row: 2; }
  .slot-row > .slot-remove { grid-column: 2; grid-row: 2; }
  .slot-row > .slot-times { grid-column: 1 / -1; grid-row: 3; }
}

/* ===== Page auth-action (reset password custom) ===== */
.auth-state {
  min-height: 280px;
  justify-content: center;
}
.auth-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.auth-email {
  text-align: center;
  font-size: 12.5px;
  color: var(--cyan-bright);
  background: rgba(31, 200, 217, 0.06);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(31, 200, 217, 0.2);
  width: fit-content;
  margin: 0 auto 8px;
  letter-spacing: 0.02em;
}
.success-icon,
.error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.success-icon {
  color: var(--cyan);
  background: rgba(31, 200, 217, 0.1);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 32px var(--cyan-glow);
}
.error-icon {
  color: #FCA5A5;
  background: rgba(252, 165, 165, 0.08);
  border: 2px solid rgba(252, 165, 165, 0.4);
}
.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(31, 200, 217, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== View switcher (admin-only : bascule entre vues) ===== */
.view-switcher {
  position: relative;
  display: inline-block;
}
.view-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(31, 200, 217, 0.08);
  border: 1.5px solid rgba(31, 200, 217, 0.35);
  color: var(--cyan-bright);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all .15s ease;
}
.view-switcher-btn:hover {
  background: rgba(31, 200, 217, 0.14);
  border-color: var(--cyan);
}
.view-switcher-btn[aria-expanded="true"] {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--cyan);
}
.view-switcher-btn .vs-icon { font-size: 14px; }
.view-switcher-btn .vs-caret { font-size: 10px; opacity: 0.7; }

.view-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--black-elev);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn .14s ease;
}
.view-switcher-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-on-dark);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .12s ease;
}
.view-switcher-option:hover {
  background: rgba(31, 200, 217, 0.08);
  color: var(--cyan-bright);
}
.view-switcher-option.is-active {
  background: rgba(31, 200, 217, 0.1);
  color: var(--cyan-bright);
  font-weight: 600;
}
.view-switcher-option .vs-icon { font-size: 15px; }
.view-switcher-option .vs-check { margin-left: auto; color: var(--cyan); }

html[data-theme="light"] .view-switcher-btn {
  background: rgba(31, 200, 217, 0.08);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.45);
}
html[data-theme="light"] .view-switcher-btn:hover {
  background: rgba(31, 200, 217, 0.15);
}
html[data-theme="light"] .view-switcher-btn[aria-expanded="true"] {
  background: var(--cyan);
  color: #FFFFFF;
}
html[data-theme="light"] .view-switcher-menu {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.1);
}
html[data-theme="light"] .view-switcher-option { color: #0F1419; }
html[data-theme="light"] .view-switcher-option:hover {
  background: rgba(31, 200, 217, 0.08);
  color: #0F766E;
}
html[data-theme="light"] .view-switcher-option.is-active {
  background: rgba(31, 200, 217, 0.12);
  color: #0F766E;
}

@media (max-width: 640px) {
  .view-switcher-menu { right: auto; left: 0; min-width: 180px; }
}

/* ===== Dashboard praticien — hero ===== */
.prac-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.prac-hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white);
  margin: 0 0 6px;
}
.prac-hero-sub {
  font-size: 14px;
}
.prac-hero-sub strong {
  color: var(--cyan-bright);
  font-variant-numeric: tabular-nums;
}
.prac-hero-sub strong.text-urgent {
  color: #FCA5A5;
  font-weight: 700;
}
html[data-theme="light"] .prac-hero-title { color: #0F1419; }
html[data-theme="light"] .prac-hero-sub strong { color: #0F766E; }
html[data-theme="light"] .prac-hero-sub strong.text-urgent { color: #991B1B; }

/* ===== Profil praticien ===== */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.profile-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 20px 22px;
}
html[data-theme="light"] .profile-section {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.08);
  box-shadow: 0 2px 8px rgba(15, 20, 25, 0.04);
}
.profile-section .settings-title { margin-bottom: 14px; }

.profile-section label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-on-dark);
  margin-top: 10px;
}
.profile-section label > span {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11.5px;
  color: var(--text-on-dark-muted);
}
.profile-section input[type="text"],
.profile-section input[type="tel"],
.profile-section input[type="email"],
.profile-section select,
.profile-section textarea {
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.profile-section input:focus,
.profile-section select:focus,
.profile-section textarea:focus {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.05);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
html[data-theme="light"] .profile-section input,
html[data-theme="light"] .profile-section select,
html[data-theme="light"] .profile-section textarea {
  background: #FFFFFF !important;
  border-color: rgba(15, 20, 25, 0.12) !important;
  color: #0F1419 !important;
}

.readonly-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}
.readonly-field span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-muted);
  font-weight: 600;
}
.readonly-field strong {
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}
html[data-theme="light"] .readonly-field {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .readonly-field span { color: #6B7280; }
html[data-theme="light"] .readonly-field strong { color: #0F1419; }

/* Liste d'adresses */
.addresses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}
.address-row {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.address-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.address-header .addr-label { flex: 1; min-width: 180px; }
.addr-primary {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(31, 200, 217, 0.08);
  border: 1px solid rgba(31, 200, 217, 0.3);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12px;
  color: var(--cyan-bright);
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.addr-primary input { accent-color: var(--cyan); }
.addr-primary span { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px; color: inherit !important; font-weight: 600 !important; }
.addr-remove {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: all .15s ease;
}
.addr-remove:hover {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}
.address-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html[data-theme="light"] .address-row {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .addr-primary {
  background: rgba(31, 200, 217, 0.08);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.4);
}

/* Checkbox grid (paiements, langues) */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.checkbox-pill {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 9px 12px !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px !important;
  color: var(--text-on-dark) !important;
  transition: all .15s ease;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
}
.checkbox-pill:hover {
  border-color: rgba(31, 200, 217, 0.3);
}
.checkbox-pill input { accent-color: var(--cyan); margin: 0; }
.checkbox-pill span {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  color: inherit !important;
  font-size: 13px !important;
}
.checkbox-pill:has(input:checked) {
  background: rgba(31, 200, 217, 0.1);
  border-color: var(--cyan);
  color: var(--cyan-bright) !important;
}
html[data-theme="light"] .checkbox-pill {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.12);
  color: #0F1419 !important;
}
html[data-theme="light"] .checkbox-pill:has(input:checked) {
  background: rgba(31, 200, 217, 0.1);
  border-color: var(--cyan);
  color: #0F766E !important;
}

.profile-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

/* Toggle switch (iOS-style) pour carte vitale etc. */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}
.toggle-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.toggle-row-left strong {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
}
.toggle-row-left small {
  font-size: 12.5px;
  color: var(--text-on-dark-muted);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  transition: .2s ease;
}
.toggle-slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: .2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--cyan);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
html[data-theme="light"] .toggle-row {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .toggle-row-left strong { color: #0F1419; }
html[data-theme="light"] .toggle-row-left small { color: #6B7280; }
html[data-theme="light"] .toggle-slider {
  background: rgba(15, 20, 25, 0.15);
}

/* Alerte / warning box */
.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid;
}
.alert-warning {
  background: rgba(251, 146, 60, 0.08);
  color: #FDBA74;
  border-color: rgba(251, 146, 60, 0.4);
}
.alert-info {
  background: rgba(31, 200, 217, 0.08);
  color: var(--cyan-bright);
  border-color: rgba(31, 200, 217, 0.35);
}
html[data-theme="light"] .alert-warning {
  background: #FFF7ED;
  color: #9A3412;
  border-color: rgba(251, 146, 60, 0.5);
}
html[data-theme="light"] .alert-info {
  background: rgba(31, 200, 217, 0.08);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.4);
}

/* Conteneur désactivé (ex: secteur sans carte vitale) */
.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* Carte praticien dans le détail RDV (côté patient) */
.practitioner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.practitioner-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(31, 200, 217, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}
.practitioner-photo-placeholder {
  font-size: 26px;
  opacity: 0.6;
}
.practitioner-info { flex: 1; min-width: 0; }
.practitioner-info p { margin: 0 0 2px; }
.practitioner-bio {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-on-dark);
  font-style: italic;
}
html[data-theme="light"] .practitioner-bio {
  background: rgba(31, 200, 217, 0.04);
  color: #374151;
}

/* Photo uploader (profil praticien) */
.photo-uploader {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.photo-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(31, 200, 217, 0.3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-placeholder {
  font-size: 34px;
  opacity: 0.4;
}
.photo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}
html[data-theme="light"] .photo-preview {
  background: #F3F4F6;
  border-color: rgba(31, 200, 217, 0.5);
}

/* Adresse enrichie : checkboxes compactes + toggle PMR */
.checkbox-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 6px !important;
}
.checkbox-grid-compact .checkbox-pill {
  padding: 7px 10px !important;
  font-size: 12px !important;
}
.checkbox-grid-compact .checkbox-pill span {
  font-size: 12px !important;
}
.address-pmr {
  margin-top: 4px;
}
.addr-pmr-toggle {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(31, 200, 217, 0.06);
  border: 1px solid rgba(31, 200, 217, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px !important;
  color: var(--text-on-dark) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
.addr-pmr-toggle:has(input:checked) {
  background: rgba(31, 200, 217, 0.14);
  border-color: var(--cyan);
}
.addr-pmr-toggle input { accent-color: var(--cyan); }
.addr-pmr-toggle span {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  color: inherit !important;
  font-size: 13px !important;
}
html[data-theme="light"] .addr-pmr-toggle {
  background: rgba(31, 200, 217, 0.06);
  color: #0F1419 !important;
  border-color: rgba(31, 200, 217, 0.4);
}
.address-practical label[class^='addr']:not(.checkbox-pill) {
  margin-top: 0 !important;
}

/* Bloc "En savoir plus" sur le tiers payant */
.tp-details {
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 8px;
}
.tp-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  opacity: 0.85;
  list-style: none;
  user-select: none;
}
.tp-details summary::-webkit-details-marker { display: none; }
.tp-details summary:hover { opacity: 1; }
.tp-details[open] summary { opacity: 1; }
.tp-details p {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.5;
}
html[data-theme="light"] .tp-details {
  border-top-color: rgba(15, 20, 25, 0.15);
}

/* ===== Logos conditionnels selon thème ===== */
.logo-light { display: none; }
html[data-theme="light"] .logo-dark { display: none; }
html[data-theme="light"] .logo-light { display: block; }
html[data-theme="light"] .form-logo.logo-light {
  mix-blend-mode: multiply;
}

/* ===== Bouton WhatsApp (Niveau 1 : lien wa.me) ===== */
.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
  border: 1.5px solid #25D366;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover {
  background: #1EB755;
  border-color: #1EB755;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

/* ===== Onglet Paramètres ===== */
.settings-tab { display: flex; flex-direction: column; gap: 28px; }
.settings-section {
  padding: 4px 0 8px;
}
.settings-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin: 0 0 4px;
  position: relative;
  padding-left: 12px;
}
.settings-title::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--cyan);
  border-radius: 2px;
}
.settings-sub { margin: 0 0 14px; font-size: 13px; }
.settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
}
.settings-list li {
  padding: 4px 0;
}

/* Choix du thème - cartes cliquables */
.theme-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 520px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.theme-card:hover {
  border-color: rgba(31, 200, 217, 0.4);
  transform: translateY(-2px);
}
.theme-card.is-active {
  border-color: var(--cyan);
  background: rgba(31, 200, 217, 0.08);
  box-shadow: 0 8px 24px rgba(31, 200, 217, 0.15);
}
.theme-preview {
  height: 80px;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.theme-preview-dark {
  background: linear-gradient(160deg, #061B2A 0%, #0C2A3F 100%);
  border: 1px solid rgba(31, 200, 217, 0.15);
}
.theme-preview-light {
  background: linear-gradient(160deg, #FFFFFF 0%, #F1F3F6 100%);
  border: 1px solid rgba(15, 20, 25, 0.08);
}
.theme-dot {
  width: 12px; height: 12px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(31, 200, 217, 0.6);
}
.theme-bar {
  height: 6px;
  border-radius: 3px;
  width: 70%;
}
.theme-preview-dark .theme-bar { background: rgba(255, 255, 255, 0.25); }
.theme-preview-light .theme-bar { background: rgba(15, 20, 25, 0.2); }
.theme-bar-short { width: 45%; }
.theme-info strong {
  display: block;
  color: var(--white);
  font-size: 14px;
  margin-bottom: 2px;
}
.theme-info small {
  display: block;
  color: var(--text-on-dark-muted);
  font-size: 12px;
}

/* ================================================================== */
/* =====         THÈME CLAIR — overrides complets            ======= */
/* ================================================================== */

html[data-theme="light"] {
  /* Réassigne les variables principales */
  --text: #374151;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --text-on-dark: #0F1419;
  --text-on-dark-muted: #64748B;
  --text-on-dark-faint: #94A3B8;
  --border: #E5E7EB;
  --border-soft: #EEF2F5;
  --shadow-sm: 0 2px 8px rgba(15, 20, 25, 0.05);
  --shadow: 0 12px 32px rgba(15, 20, 25, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 20, 25, 0.15);
}

html[data-theme="light"] body {
  background-color: #F7F8FA;
  background-image:
    radial-gradient(1000px 700px at 50% -200px, rgba(31, 200, 217, 0.14), transparent 60%),
    radial-gradient(600px 500px at 90% 110%, rgba(31, 200, 217, 0.06), transparent 65%),
    linear-gradient(180deg, #F7F8FA 0%, #EEF2F5 100%);
}
html[data-theme="light"] body::before {
  /* Ligne de lumière cyan en haut — garde-la, elle passe sur fond clair */
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(31, 200, 217, 0) 15%,
    rgba(31, 200, 217, 0.5) 50%,
    rgba(31, 200, 217, 0) 85%,
    transparent 100%);
}
html[data-theme="light"] body::after {
  /* Motif de lignes très subtiles, foncées sur clair */
  background-image: repeating-linear-gradient(
    120deg,
    transparent 0,
    transparent 3px,
    rgba(15, 20, 25, 0.015) 3px,
    rgba(15, 20, 25, 0.015) 4px
  );
}

/* Brand / textes principaux */
html[data-theme="light"] .brand h1,
html[data-theme="light"] .headline {
  color: #0F1419;
  text-shadow: none;
}
html[data-theme="light"] .tagline { color: #6B7280; }
html[data-theme="light"] .tagline strong { color: #0F1419; }

/* Surfaces élevées (cards, modals, rows) */
html[data-theme="light"] .form,
html[data-theme="light"] .admin-header,
html[data-theme="light"] .admin-tabpanel,
html[data-theme="light"] .modal,
html[data-theme="light"] .dashboard header,
html[data-theme="light"] .dashboard .card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 20, 25, 0.06);
  box-shadow: 0 12px 32px rgba(15, 20, 25, 0.08);
}

html[data-theme="light"] .admin-user-chip {
  background: rgba(15, 20, 25, 0.03);
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .admin-user-meta strong { color: #0F1419; }
html[data-theme="light"] .admin-user-meta small { color: #6B7280; }

/* Tabs */
html[data-theme="light"] .admin-tabs {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .admin-tab { color: #6B7280; }
html[data-theme="light"] .admin-tab:hover:not(:disabled) { color: #0F1419; }
html[data-theme="light"] .admin-tab.is-active { color: #0F1419; }
html[data-theme="light"] .tab-badge {
  background: rgba(15, 20, 25, 0.06);
  color: #6B7280;
}

/* Filter pills + search */
/* Les overrides .filter-pills en light sont maintenant inutiles
   (les pills sont individuelles, gérées dans leur propre bloc) */

html[data-theme="light"] .search-input,
html[data-theme="light"] .modal-body input[type="email"],
html[data-theme="light"] .modal-body input[type="password"],
html[data-theme="light"] .modal-body input[type="text"],
html[data-theme="light"] .modal-body input[type="tel"],
html[data-theme="light"] .modal-body input[type="number"],
html[data-theme="light"] .modal-body input[type="date"],
html[data-theme="light"] .modal-body input[type="time"],
html[data-theme="light"] .modal-body select,
html[data-theme="light"] .modal-body textarea,
html[data-theme="light"] .form input[type="email"],
html[data-theme="light"] .form input[type="password"],
html[data-theme="light"] .form input[type="text"],
html[data-theme="light"] .form input[type="tel"],
html[data-theme="light"] .form input[type="number"],
html[data-theme="light"] .form textarea,
html[data-theme="light"] .form select,
html[data-theme="light"] .slot-row input,
html[data-theme="light"] .slot-when input[type="date"] {
  background: #FFFFFF !important;
  border-color: rgba(15, 20, 25, 0.12) !important;
  color: #0F1419 !important;
  color-scheme: light !important;
}
html[data-theme="light"] .form select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230F1419' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  /* Restaure no-repeat + position : le shorthand background:#FFFFFF ci-dessus
     les avait reset, ce qui faisait apparaître le chevron en mosaïque. */
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
}
/* Modal admin : même fix de chevron + no-repeat en mode light */
html[data-theme="light"] .modal-body select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230F1419' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
}
/* Au focus, le shorthand background réécrit aussi les sub-props : on les force */
html[data-theme="light"] .form select:focus,
html[data-theme="light"] .modal-body select:focus,
html[data-theme="light"] .phone-dialcode:focus {
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
}
html[data-theme="light"] .form select option { background: #FFFFFF; color: #0F1419; }
html[data-theme="light"] .form textarea::placeholder { color: #9CA3AF; }
html[data-theme="light"] .search-input::placeholder,
html[data-theme="light"] .modal-body input::placeholder,
html[data-theme="light"] .form input::placeholder {
  color: #9CA3AF;
}
html[data-theme="light"] .form input:focus,
html[data-theme="light"] .modal-body input:focus,
html[data-theme="light"] .modal-body select:focus,
html[data-theme="light"] .modal-body textarea:focus,
html[data-theme="light"] .search-input:focus {
  border-color: var(--cyan) !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(31, 200, 217, 0.15) !important;
}
html[data-theme="light"] .form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
  -webkit-text-fill-color: #0F1419 !important;
}

/* User / Appt rows */
html[data-theme="light"] .user-row,
html[data-theme="light"] .appt-row,
html[data-theme="light"] .slot-row,
html[data-theme="light"] .users-empty,
html[data-theme="light"] .users-loading {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .user-row:hover,
html[data-theme="light"] .appt-row:hover {
  background: #F9FAFB;
  border-color: rgba(31, 200, 217, 0.3);
}
html[data-theme="light"] .user-name,
html[data-theme="light"] .appt-patient,
html[data-theme="light"] .form-title,
html[data-theme="light"] .modal-head h2,
html[data-theme="light"] .settings-title {
  color: #0F1419;
}
html[data-theme="light"] .user-sub,
html[data-theme="light"] .appt-motive,
html[data-theme="light"] .user-date,
html[data-theme="light"] .appt-created,
html[data-theme="light"] .muted,
html[data-theme="light"] .users-stats {
  color: #6B7280;
}
html[data-theme="light"] .users-stats strong { color: #0F1419; }
html[data-theme="light"] .form label,
html[data-theme="light"] .modal-body label {
  color: #0F1419;
}
html[data-theme="light"] .form label > span,
html[data-theme="light"] .modal-body label > span {
  color: #6B7280;
}
html[data-theme="light"] .divider {
  color: #9CA3AF;
}
html[data-theme="light"] .divider::before,
html[data-theme="light"] .divider::after {
  background: linear-gradient(90deg, transparent, rgba(15, 20, 25, 0.15), transparent);
}
html[data-theme="light"] .foot-note { color: #6B7280; }

/* Boutons */
html[data-theme="light"] .btn-ghost {
  background: #FFFFFF;
  color: #0F9AAB;
  border-color: rgba(15, 20, 25, 0.15);
}
html[data-theme="light"] .btn-ghost:hover {
  background: rgba(31, 200, 217, 0.08);
  border-color: var(--cyan);
}
html[data-theme="light"] .btn-primary { color: #FFFFFF; }

/* Timeline */
html[data-theme="light"] .tl-date { color: #9CA3AF; }
html[data-theme="light"] .tl-status { color: #0F9AAB; }
html[data-theme="light"] .tl-by,
html[data-theme="light"] .tl-note { color: #6B7280; }
html[data-theme="light"] .timeline li {
  border-left-color: rgba(31, 200, 217, 0.35);
}

/* Detail sections */
html[data-theme="light"] .detail-section h3 { color: #6B7280; }
html[data-theme="light"] .detail-section p { color: #0F1419; }
html[data-theme="light"] .detail-section p strong { color: #0F1419; }
html[data-theme="light"] .detail-section { border-bottom-color: rgba(15, 20, 25, 0.06); }

/* Credentials */
html[data-theme="light"] .credentials {
  background: rgba(15, 20, 25, 0.02);
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .cred-row span { color: #6B7280; }
html[data-theme="light"] .cred-row code {
  background: rgba(31, 200, 217, 0.1);
  color: #0F9AAB;
}
html[data-theme="light"] .cred-row + .cred-row { border-top-color: rgba(15, 20, 25, 0.05); }
html[data-theme="light"] .hint {
  background: rgba(31, 200, 217, 0.06);
  border-color: rgba(31, 200, 217, 0.2);
  color: #6B7280;
}

/* Badges textes — ajuster lisibilité sur fond clair */
html[data-theme="light"] .role-badge.role-client     { background: #FFFFFF; color: #0F9AAB; border-color: rgba(31, 200, 217, 0.5); }
html[data-theme="light"] .role-badge.role-practitioner { background: #FFFFFF; color: #A16207; border-color: rgba(250, 204, 21, 0.6); }
html[data-theme="light"] .role-badge.role-admin      { background: var(--cyan); color: #FFFFFF; }

html[data-theme="light"] .activation-pending  { background: #FFF7ED; color: #C2410C; border-color: rgba(251, 146, 60, 0.5); }
html[data-theme="light"] .activation-active   { background: #F0FDF4; color: #166534; border-color: rgba(34, 197, 94, 0.5); }
html[data-theme="light"] .activation-archived { background: #F3F4F6; color: #4B5563; border-color: rgba(148, 163, 184, 0.5); }
html[data-theme="light"] .stat-pending { color: #C2410C; }
html[data-theme="light"] .stat-pending strong { color: #C2410C; }

html[data-theme="light"] .status-new-client  { background: #FAF5FF; color: #6B21A8; border-color: rgba(168, 85, 247, 0.4); }
html[data-theme="light"] .status-draft       { background: #F3F4F6; color: #4B5563; border-color: rgba(148, 163, 184, 0.4); }
html[data-theme="light"] .status-sent        { background: #EFF6FF; color: #1E40AF; border-color: rgba(59, 130, 246, 0.4); }
html[data-theme="light"] .status-proposed    { background: #FEFCE8; color: #854D0E; border-color: rgba(250, 204, 21, 0.5); }
html[data-theme="light"] .status-validated   { background: #F0FDF4; color: #166534; border-color: rgba(34, 197, 94, 0.5); }
html[data-theme="light"] .status-confirmed   { background: rgba(31, 200, 217, 0.1); color: #0F766E; border-color: var(--cyan); }
html[data-theme="light"] .status-declined    { background: #FFF7ED; color: #9A3412; border-color: rgba(251, 146, 60, 0.5); }
html[data-theme="light"] .status-cancelled   { background: #FEF2F2; color: #991B1B; border-color: rgba(239, 68, 68, 0.5); }
html[data-theme="light"] .status-expired     { background: #F3F4F6; color: #6B7280; border-color: rgba(115, 115, 115, 0.4); }

html[data-theme="light"] .urgency-normal   { background: #F3F4F6; color: #4B5563; border-color: rgba(148, 163, 184, 0.4); }
html[data-theme="light"] .urgency-priority { background: #FFF7ED; color: #9A3412; border-color: rgba(251, 146, 60, 0.5); }
html[data-theme="light"] .urgency-urgent   { background: #FEF2F2; color: #991B1B; border-color: rgba(239, 68, 68, 0.5); }

html[data-theme="light"] .slot-badge-weekly { background: #FAF5FF; color: #6B21A8; border-color: rgba(168, 85, 247, 0.4); }
html[data-theme="light"] .slot-badge-once   { background: #EFF6FF; color: #1E40AF; border-color: rgba(59, 130, 246, 0.4); }

/* Mode tabs (dans la modal création RDV) */
html[data-theme="light"] .mode-tab {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.08);
  color: #6B7280;
}
html[data-theme="light"] .mode-tab:hover { color: #0F1419; border-color: rgba(15, 20, 25, 0.2); }
html[data-theme="light"] .mode-tab.is-active {
  background: rgba(31, 200, 217, 0.08);
  border-color: var(--cyan);
  color: #0F766E;
}
html[data-theme="light"] .mode-tab small { color: #9CA3AF; }
html[data-theme="light"] .mode-tab.is-active small { color: #0F766E; }

/* Slot rows */
html[data-theme="light"] .slots-readonly li {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.06);
}
html[data-theme="light"] .slots-readonly li strong { color: #0F1419; }
html[data-theme="light"] .weekday-chip {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.12);
  color: #6B7280;
}
html[data-theme="light"] .weekday-chip:hover { color: #0F1419; border-color: rgba(31, 200, 217, 0.4); }
html[data-theme="light"] .weekday-chip.is-active { color: #FFFFFF; background: var(--cyan); border-color: var(--cyan); }

html[data-theme="light"] .slot-type-toggle {
  background: rgba(15, 20, 25, 0.04);
  border-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .slot-type-toggle button { color: #6B7280; }
html[data-theme="light"] .slot-type-toggle button:hover { color: #0F1419; }
html[data-theme="light"] .slot-type-toggle button.is-active { background: var(--cyan); color: #FFFFFF; }

/* Settings */
html[data-theme="light"] .theme-card {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.1);
}
html[data-theme="light"] .theme-card:hover { border-color: rgba(31, 200, 217, 0.5); }
html[data-theme="light"] .theme-card.is-active {
  background: rgba(31, 200, 217, 0.06);
  border-color: var(--cyan);
}
html[data-theme="light"] .theme-info strong { color: #0F1419; }
html[data-theme="light"] .theme-info small { color: #6B7280; }

/* Preview banner */
html[data-theme="light"] .preview-banner {
  background: rgba(31, 200, 217, 0.12);
  color: #0F766E;
  border-color: rgba(31, 200, 217, 0.4);
}

/* Error */
html[data-theme="light"] .error {
  background: #FEF2F2;
  color: #991B1B;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Mini buttons (activation) */
html[data-theme="light"] .btn-mini-success {
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.5);
}
html[data-theme="light"] .btn-mini-ghost {
  background: #FFFFFF;
  color: #6B7280;
  border-color: rgba(15, 20, 25, 0.15);
}
html[data-theme="light"] .btn-mini-ghost:hover {
  color: #0F1419;
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.3);
}

/* Divider in mode-tabs area */
html[data-theme="light"] .modal::before {
  /* trait cyan en haut de la modal — reste visible */
}
html[data-theme="light"] .modal-head { border-bottom-color: rgba(15, 20, 25, 0.06); }
html[data-theme="light"] .modal-close { color: #6B7280; }
html[data-theme="light"] .modal-close:hover { color: #0F1419; background: rgba(15, 20, 25, 0.05); }
html[data-theme="light"] .detail-actions { border-top-color: rgba(15, 20, 25, 0.08); }

/* ===== Responsive mobile ===== */
@media (max-width: 480px) {
  .app { padding: 28px 16px 40px; }
  .brand h1 { font-size: 30px; }
  .brand-logo { width: 180px; }
  .brand .headline { font-size: 26px; }
  .form { padding: 26px 22px; }
  .form::before { left: 24px; right: 24px; }
  .dashboard header { padding: 16px 18px; }
  .dashboard .card { padding: 26px 22px; }
}

/* ===== Batch 2 : Listes dynamiques (motifs / diplômes / expérience) ===== */
.dyn-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.dyn-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dyn-row-main {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dyn-row input[type="text"],
.dyn-row input[type="number"],
.dyn-row select {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 13.5px;
}
.dyn-row input[type="text"]:focus,
.dyn-row input[type="number"]:focus,
.dyn-row select:focus {
  outline: none;
  border-color: #1FC8D9;
  background: rgba(31, 200, 217, 0.05);
}
.dyn-remove {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9CA3AF;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dyn-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

/* Motif row : label grand / durée medium / prix petit */
.motif-row .motif-label { flex: 1 1 220px; }
.motif-row .motif-duration { flex: 0 0 110px; }
.motif-row .motif-price-wrap {
  position: relative;
  flex: 0 0 100px;
}
.motif-row .motif-price {
  width: 100%;
  padding-right: 28px !important;
  text-align: right;
}
.motif-row .motif-price-sfx {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  font-size: 13px;
  pointer-events: none;
}
.motif-row .motif-description {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font-size: 13px;
}

/* Diploma row */
.diploma-row .dip-title { flex: 1 1 240px; }
.diploma-row .dip-school { flex: 1 1 180px; }
.diploma-row .dip-year { flex: 0 0 90px; }

/* Experience row */
.experience-row .exp-role { flex: 1 1 200px; }
.experience-row .exp-employer { flex: 1 1 180px; }
.experience-row .exp-years {
  display: flex; gap: 6px; align-items: center;
  flex: 0 0 auto;
}
.experience-row .exp-years input { width: 90px; }
.experience-row .exp-years span { color: #9CA3AF; font-size: 13px; }

/* Light theme */
html[data-theme="light"] .dyn-row {
  background: #FAFAFA;
  border-color: rgba(15, 20, 25, 0.1);
}
html[data-theme="light"] .dyn-row input[type="text"],
html[data-theme="light"] .dyn-row input[type="number"],
html[data-theme="light"] .dyn-row select {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.15);
}
html[data-theme="light"] .motif-row .motif-description {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.1);
}
html[data-theme="light"] .dyn-remove { color: #6B7280; }

/* ===== Batch 2 : Blocs fiche praticien (côté client) ===== */
.prac-sub-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.prac-sub-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9CA3AF;
  margin: 0 0 8px;
}
.motifs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.motif-item {
  padding: 8px 10px;
  background: rgba(31, 200, 217, 0.04);
  border-left: 3px solid rgba(31, 200, 217, 0.4);
  border-radius: 6px;
}
.motif-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(31, 200, 217, 0.08);
  color: #1FC8D9;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.simple-list {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: inherit;
}
.simple-list li { margin: 3px 0; }

/* Light theme */
html[data-theme="light"] .prac-sub-block { border-top-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .prac-sub-title { color: #6B7280; }
html[data-theme="light"] .motif-item {
  background: rgba(31, 200, 217, 0.06);
  border-left-color: rgba(31, 200, 217, 0.6);
}
html[data-theme="light"] .tag-chip {
  background: rgba(31, 200, 217, 0.1);
  color: #0E8A96;
}

/* ===== Batch 3 : Tag editor (expertises, mutuelles) ===== */
.tag-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: border-color 120ms ease;
}
.tag-editor:focus-within {
  border-color: #1FC8D9;
}
.tag-editor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.tag-editor-list:empty::before {
  content: 'Aucun tag pour le moment.';
  color: #9CA3AF;
  font-size: 12.5px;
  font-style: italic;
}
.tag-editor-input {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13.5px;
  outline: none;
}
.tag-chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(31, 200, 217, 0.12);
  color: #1FC8D9;
  padding: 4px 6px 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}
.tag-chip-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 50%;
  opacity: 0.7;
}
.tag-chip-x:hover {
  opacity: 1;
  background: rgba(31, 200, 217, 0.25);
}

/* Neutral variant (mutuelles) */
.tag-chip-neutral {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #D1D5DB !important;
}

/* Light theme */
html[data-theme="light"] .tag-editor {
  background: #FAFAFA;
  border-color: rgba(15, 20, 25, 0.12);
}
html[data-theme="light"] .tag-chip-removable {
  background: rgba(31, 200, 217, 0.1);
  color: #0E8A96;
}
html[data-theme="light"] .tag-chip-neutral {
  background: rgba(15, 20, 25, 0.06) !important;
  color: #374151 !important;
}

/* ===== Notifications — popup ===== */
.notif-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 80px 240px; /* aligné avec la fin de la sidebar (240px) */
  z-index: 1000;
  animation: fadeIn .15s ease-out;
}
.notif-popup {
  background: #14161A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-left: 20px;
}
.notif-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.notif-popup-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.notif-popup-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.notif-popup-list {
  overflow-y: auto;
  padding: 6px 0;
}
.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9CA3AF;
}
.notif-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background .1s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255, 255, 255, 0.03); }
.notif-item.is-unread { background: rgba(31, 200, 217, 0.04); }
.notif-item.is-unread:hover { background: rgba(31, 200, 217, 0.07); }
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-title {
  display: block;
  font-size: 13.5px;
  line-height: 1.3;
}
.notif-item-text {
  margin: 2px 0 4px;
  font-size: 12.5px;
  color: #9CA3AF;
  line-height: 1.35;
}
.notif-item-date {
  font-size: 11.5px;
  color: #6B7280;
}
.notif-item-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1FC8D9;
  margin-top: 6px;
}

/* Light theme */
html[data-theme="light"] .notif-popup {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.1);
  box-shadow: 0 10px 30px rgba(15, 20, 25, 0.15);
}
html[data-theme="light"] .notif-popup-head { border-bottom-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .notif-item { border-bottom-color: rgba(15, 20, 25, 0.05); }
html[data-theme="light"] .notif-item:hover { background: rgba(15, 20, 25, 0.03); }
html[data-theme="light"] .notif-item.is-unread { background: rgba(31, 200, 217, 0.06); }
html[data-theme="light"] .notif-item.is-unread:hover { background: rgba(31, 200, 217, 0.1); }
html[data-theme="light"] .notif-item-text { color: #6B7280; }
html[data-theme="light"] .notif-item-date { color: #9CA3AF; }

/* Mobile : popup en plein écran */
@media (max-width: 720px) {
  .notif-popup-overlay {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }
  .notif-popup {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Chat ===== */
.chat-wrap {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 480px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
}
.chat-wrap-single { flex-direction: column; }
.chat-wrap-split { flex-direction: row; }

/* Sidebar conversations (admin only) */
.chat-sidebar {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}
.chat-sidebar-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-sidebar-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #9CA3AF;
}
.chat-conv-list {
  flex: 1;
  overflow-y: auto;
}
.chat-empty-mini {
  padding: 24px 16px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.chat-conv-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: background .1s;
}
.chat-conv-item:hover { background: rgba(255, 255, 255, 0.03); }
.chat-conv-item.is-active {
  background: rgba(31, 200, 217, 0.08);
  border-left: 3px solid #1FC8D9;
  padding-left: 13px;
}
.chat-conv-avatar {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(31, 200, 217, 0.2);
  color: #1FC8D9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}
.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.chat-conv-top strong {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-conv-top small { font-size: 11px; }
.chat-conv-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.chat-conv-preview {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.chat-conv-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: #EF4444;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.chat-conv-role {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Panel conversation (right side admin, or full on single) */
.chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  padding: 40px 20px;
  text-align: center;
}
.chat-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.chat-empty-thread {
  padding: 40px 20px;
  text-align: center;
  font-size: 13.5px;
}

.chat-wrap-single > .chat-header,
.chat-panel > .chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-header-avatar {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(31, 200, 217, 0.15);
  color: #1FC8D9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.chat-header-info { display: flex; flex-direction: column; gap: 2px; }
.chat-header-info strong { font-size: 14px; }
.chat-header-info small { font-size: 12px; }

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
}
.chat-msg.is-chained { margin-top: 2px; }
.chat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.is-theirs { align-self: flex-start; align-items: flex-start; }
.chat-msg-sender {
  font-size: 11.5px;
  padding-left: 2px;
  margin-bottom: 2px;
}
.chat-msg-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg.is-mine .chat-msg-bubble {
  background: #1FC8D9;
  color: #0F1419;
  border-bottom-right-radius: 5px;
}
.chat-msg.is-theirs .chat-msg-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-bottom-left-radius: 5px;
}
.chat-msg.is-chained.is-mine .chat-msg-bubble { border-top-right-radius: 5px; }
.chat-msg.is-chained.is-theirs .chat-msg-bubble { border-top-left-radius: 5px; }
.chat-msg-time {
  font-size: 10.5px;
  padding: 0 4px;
}

.chat-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-family: inherit;
  font-size: 13.5px;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
}
.chat-input:focus {
  outline: none;
  border-color: #1FC8D9;
  background: rgba(31, 200, 217, 0.05);
}
.chat-send {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 20px;
}

/* Light theme */
html[data-theme="light"] .chat-wrap {
  background: #FFFFFF;
  border-color: rgba(15, 20, 25, 0.1);
}
html[data-theme="light"] .chat-sidebar {
  background: #F9FAFB;
  border-right-color: rgba(15, 20, 25, 0.08);
}
html[data-theme="light"] .chat-sidebar-head { border-bottom-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .chat-sidebar-head h3 { color: #6B7280; }
html[data-theme="light"] .chat-conv-item { border-bottom-color: rgba(15, 20, 25, 0.05); }
html[data-theme="light"] .chat-conv-item:hover { background: #F3F4F6; }
html[data-theme="light"] .chat-conv-item.is-active { background: rgba(31, 200, 217, 0.08); }
html[data-theme="light"] .chat-wrap-single > .chat-header,
html[data-theme="light"] .chat-panel > .chat-header { border-bottom-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .chat-composer { border-top-color: rgba(15, 20, 25, 0.08); }
html[data-theme="light"] .chat-input {
  background: #F9FAFB;
  border-color: rgba(15, 20, 25, 0.12);
}
html[data-theme="light"] .chat-msg.is-theirs .chat-msg-bubble {
  background: #F3F4F6;
  color: #0F1419;
}

/* Mobile */
@media (max-width: 720px) {
  .chat-wrap { height: calc(100vh - 160px); }
  .chat-wrap-split { flex-direction: column; }
  .chat-sidebar { flex: 0 0 auto; max-height: 40%; }
  .chat-msg { max-width: 85%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
