/* ── CSS Custom Properties (Light theme) ──────────────────────────────────── */
:root {
  --bg-page: #f8fafc;
  --bg-card: #fff;
  --bg-card-alt: #f8fafc;
  --bg-green-light: #f0faf4;
  --bg-input: #fff;
  --bg-hover: #f1f5f9;
  --bg-auth: #f0faf4;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-input: #d1d5db;

  --text-primary: #1e293b;
  --text-heading: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-label: #374151;

  --accent: #4CAF7D;
  --accent-hover: #3D9168;
  --accent-ring: #dcf5e7;
  --accent-light: #a7d9b8;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18);
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,.12);

  --modal-overlay: rgba(15, 23, 42, .45);
}

/* ── Dark theme ──────────────────────────────────────────────────────────── */
body.dark-theme {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-card-alt: #1a2332;
  --bg-green-light: #132a1f;
  --bg-input: #1e293b;
  --bg-hover: #334155;
  --bg-auth: #0f172a;

  --border: #334155;
  --border-light: #283548;
  --border-input: #475569;

  --text-primary: #e2e8f0;
  --text-heading: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-label: #cbd5e1;

  --accent: #5cc98e;
  --accent-hover: #4CAF7D;
  --accent-ring: rgba(92, 201, 142, .2);
  --accent-light: #3D9168;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,.4);

  --modal-overlay: rgba(0, 0, 0, .6);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Auth page ────────────────────────────────────────────────────────────── */
.auth-bg {
  min-height: 100vh;
  background: var(--bg-auth);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-logo span {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.5px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-subtitle {
  color: #64748b;
  margin-bottom: 28px;
  font-size: 13px;
}

.mfa-hint {
  background: var(--bg-green-light);
  border: 1px solid var(--accent-light);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── App layout ───────────────────────────────────────────────────────────── */
.app-bg { min-height: 100vh; background: var(--bg-page); }

.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.5px;
}

.app-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
}

/* ── Panels ───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  align-self: start;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 20px;
}
.panel-header .panel-title { margin-bottom: 0; }

.badge {
  background: var(--bg-green-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.form-group legend {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  padding: 0 6px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row-2 > .field { margin-top: 0; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
}
.field:first-child { margin-top: 0; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-label);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
input[type="number"],
input[type="search"] {
  border: 1px solid var(--border-input);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder { color: var(--text-muted); }

.radio-group {
  display: flex;
  gap: 16px;
  padding-top: 4px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text-label);
}
input[type="radio"] { accent-color: var(--accent); }

.required { color: #ef4444; }

.field-hint {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text-label); }

.btn-full { width: 100%; margin-top: 20px; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
}
.success-msg {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
}
.hidden { display: none !important; }

/* ── Patient list ─────────────────────────────────────────────────────────── */
.search-bar { margin-bottom: 16px; }
.search-bar input { background: var(--bg-card-alt); }

.patient-list { display: flex; flex-direction: column; gap: 8px; }

.patient-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
  cursor: default;
  background: var(--bg-card);
}
.patient-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 2px 8px rgba(76,175,125,.08);
}

.patient-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-green-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patient-info { flex: 1; min-width: 0; }
.patient-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.patient-meta { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.patient-contact { color: var(--text-secondary); font-size: 12px; margin-top: 1px; }

.patient-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}
.patient-badge.active  { background: #f0fdf4; color: #16a34a; }
.patient-badge.inactive { background: #f8fafc; color: #94a3b8; }

.loading, .empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Fiche patient ────────────────────────────────────────────────────────── */
.fiche-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.fiche-topbar {
  margin-bottom: 0;
}

/* ── Sticky patient identity bar ─────────────────────────────────────────── */
.patient-sticky-bar {
  position: sticky;
  top: 93px;
  z-index: 8;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.patient-sticky-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-green-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.patient-sticky-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.patient-sticky-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-heading);
}
.patient-sticky-dob {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px 6px 8px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.btn-back:hover { background: var(--bg-hover); color: var(--text-label); }

.fiche-content { display: flex; flex-direction: column; gap: 16px; }

.fiche-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.fiche-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-green-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fiche-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}
.fiche-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.fiche-sections { display: flex; flex-direction: column; gap: 12px; }

/* ── Layout 3 colonnes desktop (25% | 25% | 50%) ─────────────────────────── */
.fiche-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 20px;
  align-items: start;
}
.fiche-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fiche-col2 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fiche-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fiche-sidebar .fiche-label { width: 130px; }

/* Header vertical dans la sidebar */
.fiche-sidebar .fiche-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  gap: 10px;
}
.fiche-sidebar .fiche-name {
  font-size: 16px;
  word-break: break-word;
}
.fiche-sidebar .fiche-subtitle {
  font-size: 12px;
}
.fiche-sidebar #editBtn {
  width: 100%;
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .fiche-3col { grid-template-columns: 1fr 1fr; }
  .fiche-main { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .fiche-3col { grid-template-columns: 1fr; }
  .fiche-main { grid-column: auto; }
  .fiche-sidebar .fiche-label { width: 160px; }
}

/* ── Activité unifiée (cartes uniformes, couleurs distinctes) ───────────────── */
.activity-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid transparent;
}
.activity-card:last-child { margin-bottom: 0; }

/* Consultation : fond bleu très clair, bordure bleue */
.activity-card--consult {
  background: #f0faf4;
  border-color: #a7d9b8;
}
/* Acte : fond orange très clair, bordure orange */
.activity-card--act {
  background: #fff7ed;
  border-color: #fed7aa;
}

.activity-card__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 88px;
  flex-shrink: 0;
}
.activity-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}
.activity-badge--consult {
  background: #4CAF7D;
  color: #fff;
}
.activity-badge--act {
  background: #d97706;
  color: #fff;
}
.activity-date {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.activity-card__body {
  flex: 1;
  min-width: 0;
}
.activity-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 3px;
}
.activity-doctor {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}
.activity-act-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.activity-amount {
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  white-space: nowrap;
}
.activity-sub {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin-top: 2px;
}
.activity-sub-label {
  font-weight: 600;
  color: #374151;
}
.activity-sub--notes {
  font-style: italic;
  color: #64748b;
}

/* Boutons d'ajout colorés */
.btn-add--consult {
  background: #4CAF7D;
  color: #fff;
  border: none;
}
.btn-add--consult:hover { background: #3D9168; }
.btn-add--act {
  background: #d97706;
  color: #fff;
  border: none;
}
.btn-add--act:hover { background: #b45309; }

/* ── Notes cliniques par date ───────────────────────────────────────────────── */
.note-block {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.note-block:last-child { margin-bottom: 0; }
.note-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
}
.note-block-date {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.note-add-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #4CAF7D;
  background: #fff;
  color: #4CAF7D;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.note-add-btn:hover { background: #4CAF7D; color: #fff; }
.note-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.note-entry:last-child { border-bottom: none; }
.note-entry-textarea {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  line-height: 1.6;
  resize: vertical;
  background: #fff;
  transition: border-color .15s;
  min-height: 60px;
}
.note-entry-textarea:focus { outline: none; border-color: #93c5fd; }
.note-entry-del {
  flex-shrink: 0;
  margin-top: 4px;
}

/* ── Actes réalisés ────────────────────────────────────────────────────────── */
.act-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.act-card:last-child { border-bottom: none; }
.act-code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #4CAF7D;
  background: #f0faf4;
  border: 1px solid #a7d9b8;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.act-official {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
}
.act-label {
  font-size: 13px;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.act-date {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.act-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

/* ── Combobox CCAM ─────────────────────────────────────────────────────────── */
.ccam-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
}
.ccam-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f8fafc;
}
.ccam-option:last-child { border-bottom: none; }
.ccam-option:hover, .ccam-option.active { background: #f0faf4; }
.ccam-option-code {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  color: #4CAF7D;
  margin-right: 8px;
}
.ccam-option-label { font-size: 12px; color: #374151; }
.ccam-option-spec {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}
.ccam-option-meta {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

/* ── CCAM Favoris ─────────────────────────────────────────────────────────── */
.ccam-section-header {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
}
.ccam-option--fav {
  background: #fffbeb;
}
.ccam-option--fav:hover { background: #fef3c7; }

.fiche-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.fiche-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.fiche-grid { display: flex; flex-direction: column; gap: 0; }

.fiche-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
  min-width: 0;
}
.fiche-row:last-child { border-bottom: none; }

.fiche-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 160px;
  flex-shrink: 0;
}
.fiche-value {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.fiche-value.empty { color: var(--text-muted); }
.fiche-value a { color: var(--accent); text-decoration: none; }
.fiche-value a:hover { text-decoration: underline; }

.fiche-section-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  font-size: 12px;
}
.fiche-id { font-family: monospace; font-size: 11px; }

/* Carte cliquable */
.patient-card { cursor: pointer; }
.patient-card:hover .patient-name { color: #4CAF7D; }

/* ── Combobox ─────────────────────────────────────────────────────────────── */
.combobox { position: relative; }

.combobox-input {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.combobox-input:focus {
  outline: none;
  border-color: #4CAF7D;
  box-shadow: 0 0 0 3px #dcf5e7;
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
}

.combobox-option {
  padding: 9px 12px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  transition: background .1s;
}
.combobox-option:hover { background: #f0faf4; color: #4CAF7D; }
.combobox-clear { color: #94a3b8; }
.combobox-clear:hover { background: #f8fafc; color: #64748b; }

/* ── Notes administratives ────────────────────────────────────────────────── */
.fiche-notes {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

/* ── Édition fiche ────────────────────────────────────────────────────────── */
.edit-textarea {
  border: 1px solid var(--border-input);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  width: 100%;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.edit-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 8px;
}

/* ── select dans les formulaires ──────────────────────────────────────────── */
select, .modal-select {
  border: 1px solid var(--border-input);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
select:focus, .modal-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ── Bannière allergies critiques ─────────────────────────────────────────── */
.allergy-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 12px 18px;
  color: #b91c1c;
  font-size: 13px;
}

/* ── Section header row (titre + bouton ajouter) ─────────────────────────── */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header-row .fiche-section-title { margin-bottom: 0; }

/* ── Bouton ajouter ───────────────────────────────────────────────────────── */
.btn-add {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-add:hover { background: var(--bg-green-light); border-color: #93c5fd; }

/* ── Item card (allergies, antécédents, traitements) ──────────────────────── */
.item-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.item-card:last-child { border-bottom: none; }
.item-card.item-inactive { opacity: .6; }

.item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
}
.item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  width: 100%;
}
.item-sub-muted { color: var(--text-muted); font-style: italic; }

.item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background .1s, color .1s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-label); }
.btn-icon-danger:hover { background: #fef2f2; color: #dc2626; }

/* ── Badges de couleur ────────────────────────────────────────────────────── */
.badge-danger  { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-success { background: #f0fdf4; color: #16a34a; }
.badge-neutral { background: #f8fafc; color: #64748b; }
.badge-blue    { background: #f0faf4; color: #4CAF7D; }
.badge-purple  { background: #f5f3ff; color: #7c3aed; }
.badge-pink    { background: #fdf2f8; color: #be185d; }
.badge-green   { background: #f0fdf4; color: #16a34a; }

/* ── Antécédents groupés ──────────────────────────────────────────────────── */
.history-group { margin-bottom: 8px; }
.history-group:last-child { margin-bottom: 0; }

/* ── Checkbox group ───────────────────────────────────────────────────────── */
.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ── Timeline consultations ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -17px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4CAF7D;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #a7d9b8;
  flex-shrink: 0;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.timeline-date {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
}
.timeline-doctor { font-size: 12px; color: #64748b; }
.timeline-reason { font-size: 14px; color: #1e293b; margin-bottom: 3px; }
.timeline-diag   { font-size: 13px; color: #374151; margin-bottom: 3px; }
.timeline-notes  { font-size: 12px; color: #64748b; font-style: italic; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-box {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-heading); }
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-label); }
.modal-body {
  padding: 20px 24px 4px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-light);
}

/* ── Tab Navigation ──────────────────────────────────────────────────────── */
.tab-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  position: sticky;
  top: 56px;
  z-index: 9;
}
.tab-btn {
  display: inline-block;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Sub-tab bar (pill toggle) ───────────────────────────────────────────── */
.sub-tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-hover);
  border-radius: 10px;
}
.sub-tab-btn {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.sub-tab-btn:hover { color: var(--text-label); }
.sub-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}
/* ── Dashboard filters ────────────────────────────────────────────────── */
.dash-filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  flex: 1;
}
.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.filter-group select,
.filter-group input[type="date"] {
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: #1e293b;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
}
.stat-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .dash-charts { grid-template-columns: 1fr; }
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.chart-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
}
.chart-card canvas {
  width: 100% !important;
  max-height: 280px;
}

/* ── Tab btn right (Réglages) ─────────────────────────────────────────── */
.tab-btn--right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tab-btn--right svg {
  width: 14px;
  height: 14px;
  opacity: .6;
}
.tab-btn--right.active svg,
.tab-btn--right:hover svg { opacity: 1; }

/* ── Admin / Réglages ────────────────────────────────────────────────────── */
.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Settings layout (sidebar + content) */
.settings-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  min-height: calc(100vh - 150px);
}
.settings-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
}
.settings-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
  border-bottom: 1px solid var(--border-light);
}
.settings-nav-item:last-child { border-bottom: none; }
.settings-nav-item:hover { background: var(--bg-card-alt); color: var(--text-primary); }
.settings-nav-item.active {
  background: var(--bg-green-light);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}
.settings-nav-item svg,
.settings-nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.settings-nav-item.active svg,
.settings-nav-item.active .nav-icon { opacity: 1; }

.settings-content {
  min-width: 0;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.admin-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
}

/* Settings cards grid (for display section) */
.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.settings-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
}
.settings-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}
.settings-field {
  margin-bottom: 14px;
}
.settings-field:last-child { margin-bottom: 0; }
.settings-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.settings-field input,
.settings-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: #1e293b;
}

/* Favorite acts list in settings */
.fav-list { display: flex; flex-direction: column; gap: 6px; }
.fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.fav-item-code {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #4CAF7D;
  background: #f0faf4;
  border: 1px solid #a7d9b8;
  border-radius: 4px;
  padding: 1px 6px;
}
.fav-item-label { flex: 1; font-size: 13px; color: #1e293b; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-item-del { flex-shrink: 0; }

/* Template items in settings */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.tpl-card-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.tpl-card-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.tpl-card-actions { display: flex; gap: 4px; }

@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav-item { white-space: nowrap; border-bottom: none; border-right: 1px solid #f1f5f9; }
  .settings-nav-item.active { border-left: none; border-bottom: 3px solid #4CAF7D; }
}

/* Table générique */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  background: var(--bg-card-alt);
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tbody td.cell-wrap {
  white-space: normal;
  word-break: break-word;
  max-width: none;
}
.data-table tbody tr:hover { background: var(--bg-card-alt); }

/* Badge statut */
.badge-active   { background: #f0fdf4; color: #16a34a; }
.badge-inactive-user { background: #fef2f2; color: #dc2626; }

/* ── Prescription section ────────────────────────────────────────────────── */
.rx-list { display: flex; flex-direction: column; gap: 8px; }
.rx-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s;
  background: var(--bg-card);
}
.rx-card:hover { border-color: var(--accent-light); }
.rx-info { flex: 1; min-width: 0; }
.rx-date { font-weight: 600; font-size: 13px; }
.rx-doctor { font-size: 12px; color: #64748b; }
.rx-count { font-size: 12px; color: #94a3b8; }
.rx-actions { display: flex; gap: 4px; }

/* ── Invoice section ─────────────────────────────────────────────────────── */
.invoice-list { display: flex; flex-direction: column; gap: 8px; }
.invoice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.invoice-card:hover { border-color: var(--accent-light); }
.invoice-info { flex: 1; min-width: 0; }
.invoice-number { font-weight: 700; font-size: 13px; font-family: monospace; color: #0f172a; }
.invoice-amount { font-size: 15px; font-weight: 700; color: #0f172a; }

.badge-pending  { background: #fffbeb; color: #d97706; }
.badge-paid     { background: #f0fdf4; color: #16a34a; }
.badge-cancelled { background: #f8fafc; color: #64748b; }

/* ── Lab Results / Biologie ────────────────────────────────────────────── */
.lab-result-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: border-color .15s;
}
.lab-result-card:hover { border-color: var(--accent-light); }
.lab-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.lab-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.lab-results-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.lab-results-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.lab-results-table tr:last-child td { border-bottom: none; }
.lab-abnormal { background: rgba(239, 68, 68, .05); }
.lab-value-abnormal {
  color: #dc2626;
  font-weight: 700;
}
.tiers-payant-section .row-2 {
  display: flex;
  gap: 10px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.btn-link:hover { opacity: .8; }

/* ── PWA Offline Banner ──────────────────────────────────────────────────── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .3s;
}
.offline-banner.hidden {
  transform: translateY(-100%);
  display: flex;
}
.offline-icon { font-size: 16px; }
body.is-offline .navbar { margin-top: 40px; }
body.is-offline.auth-bg .welcome-container { margin-top: 56px; }

/* ── Carte Vitale (mock) ─────────────────────────────────────────────────── */
.cv-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 10px;
}
.cv-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cv-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-secondary);
}
.cv-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading, #0f172a);
}
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 600px) {
  .cv-data-grid { grid-template-columns: 1fr; }
}

/* ── Ségur du Numérique ────────────────────────────────────────────────── */
.segur-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--bg-card); }
.segur-actions {
  display: flex; flex-direction: column; gap: 6px;
}
.btn-segur {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card-alt); color: var(--text-primary);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.btn-segur:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn-segur svg { flex-shrink: 0; stroke: var(--accent); }
.btn-segur-teleconsult svg { stroke: #8b5cf6; }
.btn-segur-teleconsult:hover { border-color: #8b5cf6; }

.segur-status {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 8px; margin-top: 10px;
  font-size: 12px; line-height: 1.5;
}
.segur-status strong { display: block; font-size: 13px; margin-bottom: 2px; }
.segur-loading { background: var(--bg-card-alt); color: var(--text-secondary); align-items: center; }
.segur-success { background: #f0fdf4; border: 1px solid #bbf7d0; }
.segur-warning { background: #fffbeb; border: 1px solid #fde68a; }
.segur-error   { background: #fef2f2; border: 1px solid #fecaca; }
.segur-detail { font-size: 11px; color: var(--text-secondary); }
.segur-timestamp { font-style: italic; margin-top: 4px; }
.badge-success {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #dcfce7; color: #16a34a; font-size: 11px; font-weight: 600;
}
.badge-warning {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #fef3c7; color: #d97706; font-size: 11px; font-weight: 600;
}

/* DMP modal */
.segur-dmp-placeholder { text-align: center; padding: 10px 0; }
.segur-dmp-icon { margin-bottom: 4px; }
.segur-dmp-info {
  background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin: 12px auto; max-width: 320px;
  text-align: left;
}
.segur-dmp-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px;
}
.segur-dmp-row + .segur-dmp-row { border-top: 1px solid var(--border-light); }
.segur-dmp-label { color: var(--text-secondary); font-size: 12px; }
.segur-dmp-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 10px 14px; margin-top: 16px; font-size: 12px; color: #1d4ed8;
  text-align: left; line-height: 1.5;
}
.segur-dmp-note svg { flex-shrink: 0; margin-top: 1px; stroke: #3b82f6; }

/* MSSanté */
.btn-mssante { color: #2563eb !important; }
.btn-mssante:hover { background: #eff6ff !important; }
.segur-info-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-green-light); border: 1px solid var(--accent-ring);
  border-radius: 8px; padding: 8px 12px;
}
.segur-mssante-preview {
  background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; flex-wrap: wrap;
}
.segur-mssante-options {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 0;
}

/* Dark mode overrides for Ségur */
body.dark-theme .segur-success { background: rgba(22, 163, 98, .1); border-color: rgba(22, 163, 98, .3); }
body.dark-theme .segur-warning { background: rgba(217, 119, 6, .1); border-color: rgba(217, 119, 6, .3); }
body.dark-theme .segur-error   { background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .3); }
body.dark-theme .badge-success { background: rgba(22, 163, 98, .2); }
body.dark-theme .badge-warning { background: rgba(217, 119, 6, .2); }
body.dark-theme .segur-dmp-note { background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .3); color: #93c5fd; }
body.dark-theme .segur-dmp-note svg { stroke: #60a5fa; }
body.dark-theme .btn-mssante { color: #60a5fa !important; }
body.dark-theme .btn-mssante:hover { background: rgba(59, 130, 246, .1) !important; }

/* ── Stock section ───────────────────────────────────────────────────────── */
.stock-alert-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 18px;
  color: #92400e;
  font-size: 13px;
  margin-bottom: 16px;
}
.stock-scanner {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.stock-scanner input {
  flex: 1;
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 1px;
}

/* ── BDPM combobox (prescription search) ─────────────────────────────────── */
.bdpm-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
}
.bdpm-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f8fafc;
  font-size: 12px;
}
.bdpm-option:last-child { border-bottom: none; }
.bdpm-option:hover { background: #f0faf4; }
.bdpm-option-name { color: #374151; font-weight: 500; }
.bdpm-option-meta { color: #94a3b8; font-size: 11px; margin-top: 1px; }

/* ── Prescription line items ─────────────────────────────────────────────── */
.rx-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}
.rx-line:last-child { border-bottom: none; }
.rx-line-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rx-line-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* ── Empty module placeholder ────────────────────────────────────────────── */
.module-placeholder {
  text-align: center;
  padding: 60px 24px;
  color: #94a3b8;
}
.module-placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .5;
}

/* ── Sub-tab badge (factures impayées) ──────────────────────────────────── */
.sub-tab-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Speech-to-text mic button ──────────────────────────────────────────── */
.textarea-with-mic {
  position: relative;
}
.textarea-with-mic textarea {
  width: 100%;
  padding-right: 44px;
}
/* .btn-mic inside textarea: positioned absolutely */
.textarea-with-mic .btn-mic {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  z-index: 2;
}
.textarea-with-mic .btn-mic:hover { background: var(--accent-hover); transform: scale(1.05); }
.btn-mic-unsupported {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Agenda ────────────────────────────────────────────────────────── */
.agenda-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
}
.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
}
.agenda-toolbar-left,
.agenda-toolbar-right { display: flex; align-items: center; gap: 10px; }
.agenda-toolbar-center { display: flex; align-items: center; gap: 8px; }
.agenda-week-label { font-weight: 600; font-size: 15px; min-width: 220px; text-align: center; }

.agenda-grid-wrapper { overflow-x: auto; }
.agenda-grid {
  display: flex;
  min-width: 700px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.agenda-hours { width: 56px; flex-shrink: 0; border-right: 1px solid #e2e8f0; }
.agenda-hour-header {
  height: 36px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.agenda-hour-label {
  font-size: 11px;
  color: #64748b;
  text-align: right;
  padding-right: 8px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}
.agenda-col {
  flex: 1;
  min-width: 120px;
  border-right: 1px solid #e2e8f0;
}
.agenda-col:last-child { border-right: none; }
.agenda-col--today { background: #f0fdf4; }
.agenda-day-header {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  text-transform: capitalize;
}
.agenda-day-body { position: relative; }
.agenda-slot-line {
  position: absolute;
  left: 0; right: 0;
  height: 40px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.agenda-slot-line:hover { background: rgba(76, 175, 125, 0.05); }
.agenda-slot-half { border-bottom: 1px dashed #f1f5f9; }

.agenda-event {
  position: absolute;
  left: 3px; right: 3px;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  overflow: hidden;
  font-size: 11px;
  z-index: 2;
  transition: box-shadow .15s;
}
.agenda-event:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); z-index: 3; }
.agenda-event.completed { opacity: 0.6; }
.agenda-event.noshow { opacity: 0.4; text-decoration: line-through; }
.agenda-event-time { font-weight: 600; font-size: 10px; }
.agenda-event-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1e293b; }
.agenda-event-patient { font-size: 10px; color: inherit; opacity: 0.75; text-decoration: none; font-weight: 500; }
.agenda-event-patient:hover { text-decoration: underline; opacity: 1; }
.agenda-event-type-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1;
  opacity: 0.85;
}

.agenda-color-opt {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .1s;
}
.agenda-color-opt:hover { transform: scale(1.15); }
.agenda-color-opt.active { border-color: #1e293b; }

@media (max-width: 700px) {
  .agenda-toolbar { flex-direction: column; align-items: stretch; }
  .agenda-toolbar-center { justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════
   RÉSERVATION EN LIGNE (rdv.html) — style Doctolib
   ═══════════════════════════════════════════════════════════════════════ */
.booking-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0faf4 0%, #f8fafc 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1e293b;
}

/* Header cabinet */
.booking-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 0;
}
.booking-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.booking-logo {
  width: 44px; height: 44px; border-radius: 10px; background: #4CAF7D;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.booking-logo svg { display: block; }
.booking-cabinet-name { font-size: 18px; font-weight: 700; color: #1e293b; }
.booking-cabinet-info { font-size: 13px; color: #64748b; margin-top: 2px; }

/* Container principal */
.booking-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* Stepper */
.booking-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.booking-stepper-item {
  display: flex; align-items: center; gap: 8px;
}
.booking-stepper-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: #e2e8f0; color: #94a3b8;
  transition: all .2s;
}
.booking-stepper-item.active .booking-stepper-circle {
  background: #4CAF7D; color: #fff;
}
.booking-stepper-item.done .booking-stepper-circle {
  background: #4CAF7D; color: #fff;
}
.booking-stepper-label {
  font-size: 13px; color: #94a3b8; font-weight: 500;
}
.booking-stepper-item.active .booking-stepper-label { color: #1e293b; }
.booking-stepper-item.done .booking-stepper-label { color: #4CAF7D; }
.booking-stepper-line {
  width: 40px; height: 2px; background: #e2e8f0; margin: 0 8px;
}
.booking-stepper-item.done + .booking-stepper-line { background: #4CAF7D; }

/* Steps */
.booking-step { display: none; }
.booking-step.active { display: block; }

/* Step 1 — Praticien */
.booking-step h2 {
  font-size: 22px; font-weight: 700; margin-bottom: 8px; text-align: center;
}
.booking-step .step-subtitle {
  font-size: 14px; color: #64748b; text-align: center; margin-bottom: 28px;
}
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.doctor-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.doctor-card:hover { border-color: #4CAF7D; box-shadow: 0 2px 12px rgba(76,175,125,.12); }
.doctor-card.selected { border-color: #4CAF7D; background: #f0faf4; }
.doctor-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: #4CAF7D; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  margin: 0 auto 12px;
}
.doctor-card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.doctor-card-speciality { font-size: 13px; color: #64748b; }

/* Step 2 — Créneaux */
.slot-date-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 24px;
}
.slot-date-nav button {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px 16px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.slot-date-nav button:hover { border-color: #4CAF7D; color: #4CAF7D; }
.slot-date-label {
  font-size: 16px; font-weight: 600; min-width: 200px; text-align: center;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.slot-btn {
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  color: #1e293b;
}
.slot-btn:hover { border-color: #4CAF7D; color: #4CAF7D; }
.slot-btn.selected { background: #4CAF7D; color: #fff; border-color: #4CAF7D; }
.slot-empty {
  text-align: center; color: #94a3b8; padding: 40px 20px;
  font-size: 15px;
}

/* Step 3 — Formulaire patient */
.booking-form {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 28px 24px;
}
.booking-form .field { margin-bottom: 16px; }
.booking-form label {
  display: block; font-size: 13px; font-weight: 600; color: #475569;
  margin-bottom: 5px;
}
.booking-form input,
.booking-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color .15s;
  box-sizing: border-box;
}
.booking-form input:focus,
.booking-form textarea:focus {
  outline: none; border-color: #4CAF7D; box-shadow: 0 0 0 3px rgba(76,175,125,.1);
}
.booking-form .btn-book {
  width: 100%; padding: 14px; background: #4CAF7D; color: #fff;
  border: none; border-radius: 8px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .15s; margin-top: 8px;
}
.booking-form .btn-book:hover { background: #3D9168; }
.booking-form .btn-book:disabled { opacity: .6; cursor: not-allowed; }

/* Step 4 — Confirmation */
.booking-confirmation {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 40px 28px;
}
.booking-confirmation .check-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #f0faf4; color: #4CAF7D;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 20px;
}
.booking-confirmation h2 { color: #4CAF7D; margin-bottom: 16px; }
.booking-confirmation .summary-table {
  text-align: left; width: 100%; max-width: 360px; margin: 20px auto;
  font-size: 14px;
}
.booking-confirmation .summary-table td { padding: 6px 0; }
.booking-confirmation .summary-table td:first-child { color: #64748b; padding-right: 16px; }
.booking-confirmation .summary-table td:last-child { font-weight: 600; }
.booking-btn-back {
  display: inline-block; margin-top: 24px; padding: 10px 24px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; color: #64748b; text-decoration: none;
  transition: all .15s; background: #fff; cursor: pointer;
}
.booking-btn-back:hover { border-color: #4CAF7D; color: #4CAF7D; }

/* Responsive */
@media (max-width: 600px) {
  .booking-container { padding: 20px 16px 40px; }
  .doctor-grid { grid-template-columns: 1fr; }
  .slot-grid { grid-template-columns: repeat(3, 1fr); }
  .booking-stepper-label { display: none; }
  .booking-stepper-line { width: 24px; }
}

/* ── Booking : recherche médecin ──────────────────────────────────── */
.search-bar-booking {
  margin-bottom: 1.5rem;
}
.search-bar-booking input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.search-bar-booking input:focus {
  border-color: #4CAF7D;
}
.no-results {
  color: #94a3b8;
  text-align: center;
  padding: 2rem 0;
}
.step-subtitle {
  color: #64748b;
  margin-bottom: 1.5rem;
}
.doctor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doctor-spec {
  color: #4CAF7D;
  font-size: .88rem;
  font-weight: 500;
}
.doctor-city {
  font-size: .82rem;
  color: #64748b;
}
.doctor-fee {
  font-size: .82rem;
  color: #94a3b8;
  font-weight: 600;
}
.booking-badge-success {
  display: inline-block;
  background: #dcfce7;
  color: #16a34a;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  margin-top: 2px;
  width: fit-content;
}
.motif-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.motif-tag {
  font-size: .72rem;
  padding: 1px 7px;
  border: 1px solid;
  border-radius: 10px;
  font-weight: 500;
}

/* ── Booking : sélection motif ────────────────────────────────────── */
.motif-select-wrapper {
  margin-bottom: 1.5rem;
}
.motif-select-wrapper label {
  display: block;
  font-weight: 600;
  margin-bottom: .5rem;
  color: #1e293b;
}
.motif-select-wrapper select {
  width: 100%;
  padding: 12px 14px;
  font-size: .95rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  background: white;
  cursor: pointer;
  transition: border-color .2s;
}
.motif-select-wrapper select:focus {
  border-color: #4CAF7D;
}

/* ── Booking : header patient ─────────────────────────────────────── */
.booking-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.booking-user span {
  font-weight: 500;
  color: #1e293b;
  font-size: .9rem;
}
.booking-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
}
.booking-summary-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

/* ── Page profil médecin ──────────────────────────────────────────── */
.profil-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.profil-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.profil-section h2 {
  font-size: 1.25rem;
  color: #1e293b;
  margin-bottom: 1rem;
}
.profil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.profil-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
  box-sizing: border-box;
}
.text-muted {
  color: #94a3b8;
  font-size: .88rem;
}
.success-msg {
  background: #dcfce7;
  color: #16a34a;
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}

/* ── Motifs list (profil page) ────────────────────────────────────── */
.motifs-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1rem;
}
.motif-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.motif-item.inactive {
  opacity: .5;
}
.motif-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.motif-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.motif-details span {
  font-size: .82rem;
  color: #94a3b8;
}
.motif-actions {
  display: flex;
  gap: .5rem;
}
.btn-danger {
  color: #dc2626 !important;
}

/* ── Responsive profil ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .profil-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Page d'accueil (welcome) ────────────────────────────────────── */
.welcome-container {
  text-align: center;
  max-width: 600px;
  width: 100%;
}
.welcome-subtitle {
  color: #64748b;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.welcome-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.welcome-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  border: 2px solid transparent;
}
.welcome-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  border-color: #4CAF7D;
}
.welcome-icon {
  margin-bottom: .25rem;
}
.welcome-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}
.welcome-card p {
  font-size: .85rem;
  color: #64748b;
  line-height: 1.4;
}
@media (max-width: 500px) {
  .welcome-choices {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Page d'accueil médecin (home.html)
   ══════════════════════════════════════════════════════════════════════ */
.home-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Greeting */
.home-greeting {
  margin-bottom: 24px;
}
.home-greeting-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.home-greeting-date {
  font-size: 14px;
  color: #64748b;
}

/* Quick stats row */
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.home-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}
.home-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Main content row */
.home-main-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
.home-main-left { display: flex; flex-direction: column; gap: 20px; }
.home-main-right { display: flex; flex-direction: column; gap: 20px; }

/* Sections */
.home-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.home-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-section-count {
  background: #f0faf4;
  color: #4CAF7D;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}
.home-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px 0;
}

/* Appointment list */
.home-appt-list { display: flex; flex-direction: column; gap: 0; }
.home-appt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.home-appt-item:last-child { border-bottom: none; }
.home-appt-item:hover { background: #f8fafc; border-radius: 8px; margin: 0 -8px; padding: 12px 8px; }
.home-appt-time {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  min-width: 80px;
}
.home-appt-end { font-weight: 400; color: #94a3b8; font-size: 12px; }
.home-appt-info { flex: 1; min-width: 0; }
.home-appt-patient { font-size: 14px; font-weight: 600; color: #1e293b; }
.home-appt-title { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reminder list */
.home-reminder-list { display: flex; flex-direction: column; gap: 0; }
.home-reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.home-reminder-item:last-child { border-bottom: none; }
.home-reminder-info { flex: 1; min-width: 0; }
.home-reminder-patient { font-size: 13px; font-weight: 600; color: #1e293b; }
.home-reminder-type { font-size: 12px; color: #64748b; }
.home-reminder-date { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Quick access widgets */
.home-widgets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-widget-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.home-widget-card:hover {
  border-color: #4CAF7D;
  box-shadow: 0 2px 8px rgba(76,175,125,.1);
  transform: translateX(4px);
}
.home-widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-widget-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.home-widget-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Responsive */
@media (max-width: 900px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-main-row { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .home-stats { grid-template-columns: 1fr; }
}

/* ── Constantes vitales ──────────────────────────────────────────────── */
.vitals-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.vitals-banner-date {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}
.vital-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.vital-chip--bp       { background: #fef3c7; color: #92400e; }
.vital-chip--hr       { background: #fce7f3; color: #9d174d; }
.vital-chip--temp     { background: #fee2e2; color: #991b1b; }
.vital-chip--spo2     { background: #dbeafe; color: #1e40af; }
.vital-chip--weight   { background: #e0e7ff; color: #3730a3; }
.vital-chip--bmi      { background: #d1fae5; color: #065f46; }
.vital-chip--glucose  { background: #fef9c3; color: #854d0e; }

.vitals-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.vitals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.vitals-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}
.vitals-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.vitals-table tbody tr:hover {
  background: #f8fafc;
}
.vitals-table tbody tr:last-child td {
  border-bottom: none;
}
.vitals-table td .item-actions {
  display: flex;
  gap: 2px;
}
@media (max-width: 700px) {
  .vitals-banner { padding: 8px 10px; gap: 4px; }
  .vital-chip { font-size: 11px; padding: 2px 8px; }
}

/* ── Notifications (cloche) ──────────────────────────────────────────── */
.notif-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}
.notif-bell {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
  line-height: 1;
}
.notif-bell:hover {
  background: rgba(0,0,0,0.06);
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: 0;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  animation: notif-pulse 2s ease-in-out infinite;
}
@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  border: 1px solid #e2e8f0;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}
.notif-mark-all {
  background: none;
  border: none;
  font-size: 12px;
  color: #4CAF7D;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.notif-mark-all:hover {
  background: #f0fdf4;
}
.notif-dropdown-body {
  overflow-y: auto;
  max-height: 360px;
  padding: 8px;
}
.notif-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px 16px;
}
.notif-item {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.notif-item:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.notif-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.notif-item-type {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.notif-item-date {
  font-size: 11px;
  color: #94a3b8;
}
.notif-item-patient {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}
.notif-item-message {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 6px;
}
.notif-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.notif-ack-btn {
  background: #4CAF7D;
  color: #fff;
  border: none;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.notif-ack-btn:hover { background: #3D9168; }
.notif-view-btn {
  font-size: 11px;
  color: #4CAF7D;
  text-decoration: none;
  font-weight: 600;
}
.notif-view-btn:hover { text-decoration: underline; }
@media (max-width: 500px) {
  .notif-dropdown { width: 300px; right: -40px; }
}

/* ── Global Search Bar ──────────────────────────────────────────────────── */
.global-search-container {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 20px;
}
.global-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.global-search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}
.global-search-input {
  width: 100%;
  padding: 7px 60px 7px 32px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  background: var(--bg-card-alt) !important;
  color: var(--text-primary) !important;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.global-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
  background: var(--bg-card) !important;
}
.global-search-kbd {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
  font-family: inherit;
}

/* Search dropdown */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}
.gs-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.gs-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
  border-top: 1px solid var(--border-light);
}
.gs-category:first-child { border-top: none; }
.gs-category-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.gs-category-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-card-alt);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 1px 7px;
}
.gs-item {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  transition: background .1s;
  cursor: pointer;
}
.gs-item:hover { background: var(--bg-green-light); }
.gs-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}
.gs-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.gs-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

@media (max-width: 700px) {
  .global-search-container { max-width: none; margin: 0 8px; }
  .global-search-kbd { display: none; }
}
@media (max-width: 500px) {
  .global-search-container { display: none; }
}

/* ── Dark Mode Toggle ───────────────────────────────────────────────────── */
.dark-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-right: 8px;
  flex-shrink: 0;
}
.dark-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* ── Dark theme: additional overrides for elements not using CSS vars ───── */
body.dark-theme .note-block-header { background: var(--bg-card-alt); border-color: var(--border); }
body.dark-theme .note-block { border-color: var(--border); }
body.dark-theme .note-block-date { color: var(--text-primary); }
body.dark-theme .note-entry { border-color: var(--border-light); }
body.dark-theme .note-entry-textarea { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-input); }

body.dark-theme .agenda-toolbar { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .agenda-grid { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .agenda-hours { border-color: var(--border); }
body.dark-theme .agenda-col { border-color: var(--border); }
body.dark-theme .agenda-day-header { background: var(--bg-card-alt); border-color: var(--border); color: var(--text-primary); }
body.dark-theme .agenda-hour-header { background: var(--bg-card-alt); border-color: var(--border); }
body.dark-theme .agenda-hour-label { color: var(--text-secondary); border-color: var(--border-light); }
body.dark-theme .agenda-col--today { background: var(--bg-green-light); }

body.dark-theme .ccam-dropdown,
body.dark-theme .bdpm-dropdown,
body.dark-theme .combobox-dropdown { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .ccam-option:hover,
body.dark-theme .combobox-option:hover,
body.dark-theme .bdpm-option:hover { background: var(--bg-green-light); }
body.dark-theme .ccam-option { border-color: var(--border-light); }
body.dark-theme .ccam-section-header { background: var(--bg-card-alt); border-color: var(--border); color: var(--text-muted); }

body.dark-theme .combobox-input { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-input); }

body.dark-theme .fiche-notes { color: var(--text-primary); }
body.dark-theme .fiche-section-meta { background: var(--bg-card-alt); border-color: var(--border); color: var(--text-muted); }

body.dark-theme .patient-card:hover .patient-name { color: var(--accent); }

body.dark-theme .activity-card--consult { background: var(--bg-green-light); border-color: var(--accent-light); }
body.dark-theme .activity-title { color: var(--text-heading); }
body.dark-theme .activity-doctor { color: var(--text-secondary); }
body.dark-theme .activity-sub { color: var(--text-secondary); }

body.dark-theme .notif-dropdown { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .notif-dropdown-header { background: var(--bg-card-alt); border-color: var(--border); color: var(--text-primary); }
body.dark-theme .notif-item { border-color: var(--border-light); }
body.dark-theme .notif-item-patient { color: var(--text-primary); }
body.dark-theme .notif-item-message { color: var(--text-secondary); }

body.dark-theme .settings-card { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .settings-card-title { color: var(--text-primary); }
body.dark-theme .settings-field input,
body.dark-theme .settings-field select { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-input); }
body.dark-theme .filter-group select,
body.dark-theme .filter-group input[type="date"] { background: var(--bg-input); color: var(--text-primary); border-color: var(--border); }

body.dark-theme .fav-item { background: var(--bg-card-alt); border-color: var(--border); }
body.dark-theme .tpl-card { background: var(--bg-card-alt); border-color: var(--border); }
body.dark-theme .tpl-card-name { color: var(--text-primary); }

body.dark-theme .rx-date { color: var(--text-primary); }
body.dark-theme .rx-doctor { color: var(--text-secondary); }
body.dark-theme .rx-count { color: var(--text-muted); }
body.dark-theme .invoice-number { color: var(--text-heading); }
body.dark-theme .invoice-amount { color: var(--text-heading); }

body.dark-theme .lab-abnormal { background: rgba(239, 68, 68, .12); }
body.dark-theme .lab-value-abnormal { color: #f87171; }
body.dark-theme .lab-results-table th { color: var(--text-secondary); border-color: var(--border); }
body.dark-theme .lab-results-table td { border-color: var(--border-light); }

body.dark-theme .offline-banner { background: linear-gradient(135deg, #b45309, #92400e); }
body.dark-theme .cv-value { color: var(--text-primary); }
body.dark-theme .cv-info-banner { background: var(--bg-card-alt); border-color: var(--border); color: var(--accent); }

body.dark-theme .stock-alert-banner { background: #3d2800; border-color: #5a3f00; color: #fde68a; }

body.dark-theme .home-layout .panel { background: var(--bg-card); border-color: var(--border); }

body.dark-theme .vitals-banner { background: var(--bg-card-alt); border-color: var(--border); }
body.dark-theme .vitals-table thead th { background: var(--bg-card-alt); border-color: var(--border); color: var(--text-secondary); }
body.dark-theme .vitals-table tbody td { border-color: var(--border-light); color: var(--text-primary); }

/* Home page dark overrides */
body.dark-theme .home-greeting-title { color: var(--text-heading); }
body.dark-theme .home-greeting-date { color: var(--text-secondary); }
body.dark-theme .home-stat-card { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .home-stat-value { color: var(--text-heading); }
body.dark-theme .home-stat-label { color: var(--text-secondary); }
body.dark-theme .home-section { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .home-section-title { color: var(--text-heading); }
body.dark-theme .home-section-count { background: var(--bg-green-light); color: var(--accent); }
body.dark-theme .home-empty { color: var(--text-muted); }
body.dark-theme .home-appt-item { border-color: var(--border-light); }
body.dark-theme .home-appt-item:hover { background: var(--bg-hover); }
body.dark-theme .home-appt-time { color: var(--text-heading); }
body.dark-theme .home-appt-end { color: var(--text-muted); }
body.dark-theme .home-appt-patient { color: var(--text-primary); }
body.dark-theme .home-appt-title { color: var(--text-secondary); }
body.dark-theme .home-reminder-item { border-color: var(--border-light); }
body.dark-theme .home-reminder-patient { color: var(--text-primary); }
body.dark-theme .home-reminder-type { color: var(--text-secondary); }
body.dark-theme .home-reminder-date { color: var(--text-muted); }
body.dark-theme .home-widget-card { border-color: var(--border); color: var(--text-primary); }
body.dark-theme .home-widget-card:hover { border-color: var(--accent); }
body.dark-theme .home-widget-title { color: var(--text-primary); }
body.dark-theme .home-widget-desc { color: var(--text-muted); }

/* Auth title dark override */
body.dark-theme .auth-title { color: var(--text-heading); }
body.dark-theme .auth-subtitle { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 6A — RESPONSIVE MOBILE                                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ─────────────────────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
}
.hamburger-btn:hover { background: var(--bg-hover); }
.hamburger-btn.active { color: var(--accent); }

/* ── Mobile breakpoint ≤768px ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn { display: block; }

  /* Navbar: compact */
  .navbar {
    padding: 0 12px;
    height: 50px;
  }
  .navbar-brand span { font-size: 15px; }

  /* Tab bar: slide-down mobile menu */
  .tab-bar {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    padding: 8px 0;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
  }
  .tab-bar.mobile-open { display: flex; }

  .tab-btn {
    padding: 14px 24px;
    font-size: 15px;
    border-bottom: none;
    border-left: 3px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .tab-btn.active {
    border-bottom: none;
    border-left-color: var(--accent);
    background: var(--bg-green-light);
  }
  .tab-btn--right {
    margin-left: 0 !important;
    border-top: 1px solid var(--border);
  }

  /* Sub-tab bar (patient tabs) — horizontal scroll */
  .sub-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    flex-wrap: nowrap;
    max-width: 100%;
    gap: 0;
  }
  .sub-tab-bar::-webkit-scrollbar { display: none; }
  .sub-tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: fit-content;
    flex-shrink: 0;
  }

  /* App layout: single column with less padding */
  .app-layout { padding: 12px; gap: 12px; }

  /* Dashboard layout */
  .dashboard-layout { padding: 12px; }
  .dash-filters {
    flex-direction: column;
    gap: 8px;
  }
  .dash-filters .filter-group { min-width: 100%; }
  .dash-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-charts {
    grid-template-columns: 1fr;
  }
  .stat-card { padding: 14px; }

  /* Patient layout: stack */
  .patient-layout { padding: 12px; }

  /* Home layout */
  .home-layout { padding: 12px; }
  .home-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .home-columns { grid-template-columns: 1fr; }

  /* Settings layout */
  .settings-layout {
    grid-template-columns: 1fr !important;
    padding: 12px;
  }
  .settings-nav {
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding: 8px !important;
    white-space: nowrap;
  }
  .settings-nav-item {
    padding: 8px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
    min-width: fit-content;
  }

  /* Forms: stack fields */
  .row-2 { grid-template-columns: 1fr !important; }
  .row-3 { grid-template-columns: 1fr !important; }
  .row-4 { grid-template-columns: 1fr 1fr !important; }

  /* Modal full-width on mobile */
  .modal-box {
    width: 95% !important;
    max-width: 100% !important;
    margin: 10px;
    max-height: 90vh;
  }

  /* Buttons: touch-friendly min size */
  button, .btn-primary, .btn-ghost, .btn-danger {
    min-height: 44px;
  }

  /* Global search in navbar */
  .global-search-container {
    max-width: 160px;
  }
  .global-search-input {
    font-size: 13px;
    padding: 6px 10px 6px 30px;
  }

  /* Dark toggle compact */
  .dark-toggle-btn {
    padding: 6px !important;
    font-size: 16px !important;
  }

  /* Data tables: horizontal scroll */
  .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }

  /* Cards: compact */
  .panel { padding: 14px; border-radius: 12px; }

  /* Agenda: force day view on mobile */
  .agenda-week-header { font-size: 13px; }
}

/* ── Extra small ≤480px ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .navbar { padding: 0 8px; }
  .navbar-brand svg { width: 22px; height: 22px; }
  .navbar-brand span { font-size: 14px; }

  .global-search-container { max-width: 120px; }
  .global-search-input { font-size: 12px; }

  .dash-stats { grid-template-columns: 1fr; }
  .home-stats-grid { grid-template-columns: 1fr; }

  .stat-card-value { font-size: 24px; }

  .sub-tab-btn { padding: 6px 10px; font-size: 11px; }
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/* 6B — DICTÉE VOCALE                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.btn-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.btn-mic:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-mic.mic-active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

/* Recording indicator */
.speech-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
  padding: 4px 0;
}
.speech-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
