:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #DBEAFE;
  --primary-text: #1E40AF;
  --accent: #F97316;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --worker-soft: #dbeafe;
  --worker-text: #1e40af;
  --estab-soft: #fce7f3;
  --estab-text: #9d174d;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --skeleton: #e5e7eb;
  --skeleton-shine: #f3f4f6;
}

html[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-hover: #1f2937;
  --border: #1f2937;
  --border-strong: #374151;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: #60A5FA;
  --primary-hover: #93C5FD;
  --primary-soft: #1E3A8A;
  --primary-text: #BFDBFE;
  --accent: #FB923C;
  --success: #34d399;
  --success-soft: #064e3b;
  --warning: #fbbf24;
  --warning-soft: #78350f;
  --danger: #f87171;
  --danger-soft: #7f1d1d;
  --worker-soft: #1e3a8a;
  --worker-text: #bfdbfe;
  --estab-soft: #831843;
  --estab-text: #fbcfe8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --skeleton: #1f2937;
  --skeleton-shine: #374151;
  --bg-soft: #1f2937;
  --card-bg: #111827;
}

:root {
  --bg-soft: #f3f4f6;
  --card-bg: #ffffff;
}

html { transition: background-color .3s ease; }
body { transition: background-color .3s ease, color .3s ease; }
body { background: var(--bg); color: var(--text); }

/* =====================================================
   DARK MODE - OVERRIDES COMPLETS
   ===================================================== */
html[data-theme="dark"] {
  /* Tous les fonds blancs/clairs deviennent sombres */
}

/* Backgrounds blancs hardcodés → utilisent les vars */
html[data-theme="dark"] body,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .dropdown,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--text-subtle);
}

/* Cartes et sections */
html[data-theme="dark"] .card,
html[data-theme="dark"] .section,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .auth-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Sidebar */
html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .admin-topbar {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .nav-item {
  color: var(--text-muted);
}

html[data-theme="dark"] .nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

html[data-theme="dark"] .nav-item.active {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary);
}

/* Boutons ghosts/secondary */
html[data-theme="dark"] .btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .btn.ghost:hover {
  background: var(--surface-hover);
}

/* Calendrier desktop */
html[data-theme="dark"] .cal-grid {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .cal-cell {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .cal-cell.free {
  background: var(--surface);
}

html[data-theme="dark"] .cal-cell.available {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

html[data-theme="dark"] .cal-cell.pending {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

html[data-theme="dark"] .cal-cell.accepted {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

html[data-theme="dark"] .cal-cell.uncovered {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

html[data-theme="dark"] .cal-mission.ACCEPTED {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

html[data-theme="dark"] .cal-mission.PENDING {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

html[data-theme="dark"] .cal-mission.REJECTED {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

html[data-theme="dark"] .cal-legend {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Calendrier mobile - mois */
html[data-theme="dark"] .cal-month-cell {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .cal-month-cell-num {
  color: var(--text);
}

html[data-theme="dark"] .cal-week-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
}

/* Page headers et textes */
html[data-theme="dark"] .page-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
  color: var(--text);
}

html[data-theme="dark"] .page-sub {
  color: var(--text-muted);
}

/* Tableaux et listes */
html[data-theme="dark"] table,
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .conv-item {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] tr:hover,
html[data-theme="dark"] .list-item:hover,
html[data-theme="dark"] .conv-item:hover {
  background: var(--surface-hover);
}

/* Form inputs */
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] label {
  color: var(--text);
}

/* Modals */
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* Badges et tags */
html[data-theme="dark"] .badge,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .support-pill {
  /* Garder les couleurs des variantes mais pas de fond blanc */
}

html[data-theme="dark"] .support-pill-blue   { background: rgba(59,130,246,0.18); color: #93c5fd; }
html[data-theme="dark"] .support-pill-purple { background: rgba(139,92,246,0.18); color: #c4b5fd; }
html[data-theme="dark"] .support-pill-orange { background: rgba(245,158,11,0.18); color: #fcd34d; }
html[data-theme="dark"] .support-pill-green  { background: rgba(16,185,129,0.18); color: #6ee7b7; }
html[data-theme="dark"] .support-pill-red    { background: rgba(239,68,68,0.18);  color: #fca5a5; }
html[data-theme="dark"] .support-pill-gray   { background: rgba(156,163,175,0.18); color: #d1d5db; }

/* Catégories support */
html[data-theme="dark"] .support-cat-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .support-cat-card:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .support-cat-card:has(input:checked) {
  background: rgba(129, 140, 248, 0.12);
  border-color: var(--primary);
}

html[data-theme="dark"] .support-cat-icon {
  background: rgba(129, 140, 248, 0.15);
}

/* Tickets */
html[data-theme="dark"] .ticket-msg {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .support-row {
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .support-row:hover {
  background: var(--surface-hover);
}

/* Liens */
html[data-theme="dark"] a:not(.btn):not(.nav-item) {
  color: var(--primary);
}

/* Exception : tous les liens dans la checklist restent blancs (fond coloré) */
html[data-theme="dark"] .checklist-card a,
html[data-theme="dark"] .checklist-card .cl-text a,
html[data-theme="dark"] .checklist-card .cl-stretched-link {
  color: #fff !important;
}

/* Borders forcées */
html[data-theme="dark"] hr,
html[data-theme="dark"] .divider {
  border-color: var(--border);
}

/* Focus states */
html[data-theme="dark"] *:focus-visible {
  outline-color: var(--primary);
}

/* Zone de texte légère/info */
html[data-theme="dark"] .hint,
html[data-theme="dark"] .info,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .text-muted {
  color: var(--text-muted);
}

/* Global smooth animations */
.card, .section, .stat-card, .plan-card {
  transition: transform .18s ease, box-shadow .18s ease, background-color .25s ease;
}
.btn { transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.cards > .card, .list-item, .conv-item { animation: fadeInUp .35s ease both; }
.cards > .card:nth-child(1) { animation-delay: .02s; }
.cards > .card:nth-child(2) { animation-delay: .06s; }
.cards > .card:nth-child(3) { animation-delay: .10s; }
.cards > .card:nth-child(4) { animation-delay: .14s; }
.cards > .card:nth-child(5) { animation-delay: .18s; }
.cards > .card:nth-child(n+6) { animation-delay: .22s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page { animation: fadeIn .25s ease both; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 8px;
  display: inline-block;
}
.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}
.skel-line { height: 14px; margin: 6px 0; border-radius: 6px; display: block;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}
.skel-line.w-40 { width: 40%; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-80 { width: 80%; }
.skel-line.w-100 { width: 100%; }
.skel-line.tall { height: 20px; }
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Theme toggle button */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
}
.theme-toggle:hover { background: var(--surface-hover); transform: translateY(-1px); }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* =====================================================
   LANDING PAGE
   ===================================================== */

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 70, 229, 0.08), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(124, 58, 237, 0.08), transparent 50%),
    var(--bg);
}

.landing-nav {
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 80px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-soft);
  color: var(--primary-text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 20px;
  max-width: 840px;
}

.hero-title .gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 48px;
  line-height: 1.55;
}

.role-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  gap: 20px;
  justify-content: center;
  width: 100%;
  max-width: 760px;
}
/* Sur mobile : on garantit que la carte SOIGNANT (rôle WORKER) apparaît en premier
   pour qu'elle capte l'œil tout de suite (la majorité du trafic mobile vient des soignants). */
@media (max-width: 720px) {
  .role-choice { grid-template-columns: 1fr; max-width: 100%; }
  .role-card[href*="role=WORKER"] { order: -1; }
  .role-card[href*="role=ESTABLISHMENT"] { order: 1; }
}

.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(79, 70, 229, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s;
}

.role-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.role-card:hover::before { opacity: 1; }

.role-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 24px;
}

.role-icon.worker {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: white;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.role-icon.estab {
  background: linear-gradient(135deg, #ec4899, #9d174d);
  color: white;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.role-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.role-card p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  min-height: 44px;
}

.role-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  transition: gap 0.2s;
}

.role-card:hover .role-cta { gap: 10px; }

.landing-footer {
  padding: 24px 48px;
  color: var(--text-subtle);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* =====================================================
   AUTH PAGES
   ===================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 70, 229, 0.05), transparent 50%),
    var(--bg);
}

.auth-nav {
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}

.back-link:hover { color: var(--text); text-decoration: none; }

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.auth-role-tag.WORKER { background: var(--worker-soft); color: var(--worker-text); }
.auth-role-tag.ESTABLISHMENT { background: var(--estab-soft); color: var(--estab-text); }

.auth-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.auth-form input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.auth-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   APP LAYOUT (logged in)
   ===================================================== */

.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.sidebar-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 15px;
  opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-user {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info .role { font-size: 11px; color: var(--text-subtle); }

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
  font-size: 14px;
}

.logout-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* =====================================================
   PAGE CONTENT
   ===================================================== */

.page {
  padding: 32px 48px 48px;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.page-sub {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}

/* === STAT CARDS (dashboard) === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-hint {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 6px;
}

/* === SECTION CARDS === */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* === FORMS === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-grid label.full { grid-column: 1 / -1; }

.form-grid input,
.form-grid select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-grid input::placeholder { color: var(--text-subtle); }

/* === BUTTONS === */
.btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn.primary.block { width: 100%; }

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn.ghost:hover { background: var(--surface-hover); }

.btn.success {
  background: var(--success);
  color: white;
  padding: 7px 12px;
  font-size: 13px;
}
.btn.success:hover { background: #047857; }

.btn.danger {
  background: white;
  color: var(--danger);
  border-color: var(--danger-soft);
  padding: 7px 12px;
  font-size: 13px;
}
.btn.danger:hover { background: var(--danger-soft); }

/* === LISTS & CARDS === */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}

.list-item:hover { background: var(--surface-hover); }

.id {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-subtle);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.list-item .name { font-weight: 600; }
.list-item .meta { color: var(--text-muted); font-size: 13px; }
.list-item .spacer { flex: 1; }

.cards { display: grid; gap: 14px; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-strong); }

.card-head {
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.card-head h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.card-meta .dot { color: var(--text-subtle); }

.card-body {
  padding: 14px 20px;
  color: var(--text);
  font-size: 14px;
}

.card-footer {
  padding: 12px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.applications {
  padding: 0;
  margin: 0;
  list-style: none;
}

.applications li {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.applications .spacer { flex: 1; }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.WORKER { background: var(--worker-soft); color: var(--worker-text); }
.badge.ESTABLISHMENT { background: var(--estab-soft); color: var(--estab-text); }
.badge.PENDING { background: var(--warning-soft); color: var(--warning); }
.badge.ACCEPTED { background: var(--success-soft); color: var(--success); }
.badge.REJECTED { background: var(--danger-soft); color: var(--danger); }
.badge.rating { background: #fef3c7; color: #92400e; }

/* === EMPTY STATES === */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* === TOAST === */
#toast {
  position: fixed;
  bottom: 120px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: 300px;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

#toast.error { background: var(--danger); }

/* === ICÔNES (Lucide inline SVG) === */
.icon {
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
  pointer-events: none;
  color: #94a3b8;
  stroke: #94a3b8;
}
/* Variantes utilitaires pour aligner sans casser */
.icon-inline { vertical-align: -4px; margin-right: 6px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; vertical-align: -8px; }
.icon-pop { width: 44px; height: 44px; vertical-align: middle; }
/* Couleurs sémantiques pour les badges/cards */
.icon-primary { color: white; stroke: white; }
.icon-success { color: white; stroke: white; }
.icon-warn { color: white; stroke: white; }
.icon-danger { color: white; stroke: white; }
.icon-muted { color: #94a3b8; stroke: #94a3b8; }

/* === LOGO === */
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-image: url('/logo.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* =====================================================
   PLANS / SUBSCRIPTIONS
   ===================================================== */

.plan-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #eef2ff, #fce7f3);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.plan-banner .plan-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.plan-banner .plan-banner-text { flex: 1; }
.plan-banner .plan-banner-title { font-weight: 700; margin-bottom: 2px; }
.plan-banner .plan-banner-sub { font-size: 13px; color: var(--text-muted); }

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-pill.NONE { background: #f1f5f9; color: #64748b; }
.plan-pill.CLASSIC { background: #dbeafe; color: #1e40af; }
.plan-pill.PREMIUM { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all 0.2s;
}

.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.15);
}

.plan-card.current {
  border-color: var(--success);
  background: linear-gradient(180deg, #f0fdf4, white);
}

.plan-ribbon {
  position: absolute;
  top: -10px;
  right: 20px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.current-plan {
  position: absolute;
  top: -10px;
  right: 20px;
  padding: 4px 10px;
  background: var(--success);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
}

.plan-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-price .per {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.plan-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.plan-features li.muted { color: var(--text-subtle); }
.plan-features li.muted::before { content: "—"; color: var(--text-subtle); }

/* =====================================================
   PROFESSION TAGS
   ===================================================== */

.profession-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--primary-soft);
  color: var(--primary-text);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* =====================================================
   INFO / LOCKED BOXES
   ===================================================== */

.info-banner {
  padding: 14px 18px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  color: var(--primary-text);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.locked-box {
  padding: 32px 24px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
}

.locked-box .locked-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.locked-box .locked-title { font-weight: 700; margin-bottom: 4px; }
.locked-box .locked-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* =====================================================
   WORKER PROFILE (viewed by establishment)
   ===================================================== */

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-info { flex: 1; }
.profile-info .name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.profile-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.profile-rating {
  text-align: center;
  padding: 12px 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  min-width: 120px;
}

.profile-rating-stars { color: #f59e0b; font-size: 18px; letter-spacing: 2px; }
.profile-rating-score {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.profile-rating .sub { font-size: 12px; color: var(--text-muted); }

.profile-rating.locked {
  color: var(--text-subtle);
  filter: blur(0);
  opacity: 0.7;
}

.worker-link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.worker-link:hover { text-decoration: underline; }

/* =====================================================
   AVATAR IMAGES + VERIFIED BADGE
   ===================================================== */

.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}

.profile-media {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.profile-media-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.profile-media-avatar .avatar-img,
.profile-media-avatar .avatar {
  width: 96px;
  height: 96px;
  font-size: 40px;
}

.profile-media-diploma { flex: 1; min-width: 240px; }

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  margin-left: 6px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.verified-dot {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

/* =====================================================
   RATINGS LIST
   ===================================================== */

.rating-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rating-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rating-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.rating-stars { color: #f59e0b; font-size: 14px; letter-spacing: 1px; }
.rating-score { font-weight: 700; font-size: 14px; }
.rating-mission {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: auto;
}

.rating-comment {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  margin: 4px 0 0;
}

/* =====================================================
   MESSAGERIE
   ===================================================== */

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

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

.conv-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.12s;
}

.conv-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  text-decoration: none;
}

.conv-item.unread {
  border-color: var(--primary-soft);
  background: #fbfbff;
}

.conv-unread {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.msg-thread {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 400px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg.mine .msg-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.theirs .msg-bubble {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 3px;
  padding: 0 6px;
}

.msg-form {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.msg-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  color: var(--text);
}

.msg-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* =====================================================
   CALENDAR
   ===================================================== */

.cal-view-mobile {
  display: none;
}

.cal-view-desktop {
  display: block;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cal-nav {
  display: flex;
  gap: 8px;
}

.cal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: capitalize;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: 6px 0;
}

.cal-cell {
  min-height: 84px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.cal-cell.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.cal-cell:hover:not(.empty):not([data-locked]) {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.cal-cell[data-locked] { cursor: not-allowed; }

.cal-cell.free { background: var(--surface); }
.cal-cell.available {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.cal-cell.pending {
  background: #fffbeb;
  border-color: #fde68a;
}
.cal-cell.accepted {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.cal-cell.uncovered {
  background: #fef2f2;
  border-color: #fecaca;
}

.cal-day {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}


.cal-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  margin-top: auto;
}

.cal-mission {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-mission.ACCEPTED { background: #c7d2fe; color: #3730a3; }
.cal-mission.PENDING { background: #fde68a; color: #92400e; }
.cal-mission.REJECTED { background: #fecaca; color: #991b1b; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  align-items: center;
}

.cal-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 4px;
}
.cal-swatch.free { background: var(--surface); }
.cal-swatch.available { background: #ecfdf5; border-color: #a7f3d0; }
.cal-swatch.pending { background: #fffbeb; border-color: #fde68a; }
.cal-swatch.accepted { background: #eef2ff; border-color: #c7d2fe; }
.cal-swatch.uncovered { background: #fef2f2; border-color: #fecaca; }

/* =====================================================
   CALENDRIER MOBILE - Vue Semaine (style natif)
   ===================================================== */

/* Onglets Jour/Semaine/Mois en haut */
.cal-mobile-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px 16px;
  background: transparent;
}

.cal-tab {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.cal-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cal-tab.active {
  background: rgba(99, 102, 241, 0.25);
  color: var(--text);
  font-weight: 600;
}

/* Header avec la plage de dates */
.cal-week-range-header {
  padding: 8px 20px 16px;
  background: transparent;
}

.cal-week-range {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

/* Liste des jours en vertical */
.cal-week-list {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-top: 1px solid var(--border);
}

.cal-week-row {
  display: flex;
  align-items: stretch;
  min-height: 90px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-week-row-today::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: #10b981;
  border-radius: 0 4px 4px 0;
}

.cal-week-row:hover:not(.cal-week-row-muted) {
  background: rgba(255, 255, 255, 0.03);
}

.cal-week-row-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 60px;
  flex-shrink: 0;
}

.cal-week-row-name {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  text-transform: capitalize;
}

.cal-week-row-num {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
}

.cal-week-row-muted .cal-week-row-name,
.cal-week-row-muted .cal-week-row-num {
  color: var(--text-subtle);
  opacity: 0.5;
}

.cal-week-row-weekend .cal-week-row-name,
.cal-week-row-weekend .cal-week-row-num {
  color: #4f8eff;
}

.cal-week-row-today .cal-week-row-name,
.cal-week-row-today .cal-week-row-num {
  color: #10b981;
  font-weight: 700;
}

.cal-week-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 16px;
  overflow: hidden;
}

.cal-week-row-content .cal-mission {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid;
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
}

.cal-week-row-content .cal-mission.ACCEPTED {
  background: rgba(99, 102, 241, 0.15);
  border-left-color: #6366f1;
  color: #c7d2fe;
}

.cal-week-row-content .cal-mission.PENDING {
  background: rgba(245, 158, 11, 0.15);
  border-left-color: #f59e0b;
  color: #fde68a;
}

.cal-week-row-content .cal-mission.REJECTED {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
  color: #fecaca;
}

.cal-week-row-content .cal-tag {
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
  margin-top: 0;
}

/* Sélecteur de semaines en bas */
.cal-week-selector {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 6px;
  padding: 16px 8px;
  background: transparent;
  border-top: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.cal-week-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  color: var(--text-muted);
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-week-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
}

.cal-week-pill.active {
  background: #4f46e5;
  color: white;
}

.cal-week-pill-month {
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cal-week-pill-range {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cal-week-pill.active .cal-week-pill-month,
.cal-week-pill.active .cal-week-pill-range {
  color: white;
}

.cal-week-pill.today:not(.active) .cal-week-pill-range {
  color: #10b981;
  font-weight: 700;
}

/* =====================================================
   CALENDRIER MOBILE - Vue Jour (heures)
   ===================================================== */

.cal-day-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.cal-day-hour {
  display: flex;
  align-items: stretch;
  min-height: 50px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-day-hour-label {
  min-width: 50px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 2px;
  flex-shrink: 0;
}

.cal-day-hour-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 16px;
  overflow: hidden;
}

.cal-day-hour-content .cal-mission {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid;
  white-space: normal;
}

.cal-day-hour-content .cal-mission.ACCEPTED {
  background: rgba(99, 102, 241, 0.15);
  border-left-color: #6366f1;
  color: #c7d2fe;
}

.cal-day-hour-content .cal-mission.PENDING {
  background: rgba(245, 158, 11, 0.15);
  border-left-color: #f59e0b;
  color: #fde68a;
}

.cal-day-hour-content .cal-mission.REJECTED {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
  color: #fecaca;
}

.cal-day-hour-content .cal-tag {
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
}

/* =====================================================
   CALENDRIER MOBILE - Vue Mois (grille compacte)
   ===================================================== */

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-month-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
  background: transparent;
}

.cal-month-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 4px;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
  position: relative;
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.3);
  user-select: none;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-month-cell:hover:not(.empty),
.cal-month-cell:active:not(.empty) {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.cal-month-cell.empty {
  background: transparent;
  cursor: default;
  opacity: 0.3;
  border-color: transparent;
}

.cal-month-cell-num {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  pointer-events: none;
}

.cal-month-cell.weekend .cal-month-cell-num {
  color: #4f8eff;
}

.cal-month-cell.today {
  background: #10b981;
  border-color: #10b981;
}

.cal-month-cell.today .cal-month-cell-num {
  color: white;
  font-weight: 700;
}

.cal-month-cell.today:hover,
.cal-month-cell.today:active {
  background: #059669;
  border-color: #059669;
}

.cal-month-cell-dots {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  pointer-events: none;
}

.cal-month-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
}

.cal-month-cell.accepted .cal-month-dot { background: #6366f1; }
.cal-month-cell.pending .cal-month-dot { background: #f59e0b; }
.cal-month-cell.uncovered .cal-month-dot { background: #ef4444; }
.cal-month-cell.available .cal-month-dot { background: #10b981; }
.cal-month-cell.free .cal-month-dot { background: #94a3b8; }

/* Indicateur subtil pour les jours avec dispo */
.cal-month-cell.available {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}
.cal-month-cell.pending {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.cal-month-cell.accepted {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}
.cal-month-cell.uncovered {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

/* Animation tap pour feedback mobile */
.cal-month-cell:not(.empty):not(.today):active {
  background: rgba(16, 185, 129, 0.25) !important;
  transform: scale(0.95);
  transition: transform 0.1s, background 0.1s;
}

.cal-month-cell.today .cal-month-dot {
  background: white;
}

@media (max-width: 860px) {
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-mission { font-size: 9px; padding: 1px 3px; }
  .landing-hero { padding: 24px 16px 60px; }
  .auth-card { padding: 28px; }
}

/* =====================================================
   MOBILE NAVIGATION (burger + drawer)
   ===================================================== */
.burger-btn {
  display: none;
  background: transparent; border: 0; padding: 8px; cursor: pointer;
  flex-direction: column; gap: 5px;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 8px;
}
.burger-btn:hover { background: var(--bg-soft, #f3f4f6); }
.burger-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text, #111827);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.burger-close {
  display: none;
  background: transparent; border: 0; cursor: pointer;
  font-size: 32px; line-height: 1; padding: 0;
  color: var(--text, #111827);
  width: 40px; height: 40px;
  border-radius: 8px;
}
.burger-close:hover { background: var(--bg-soft, #f3f4f6); }

/* Topbar app (visible uniquement sur mobile) */
.app-topbar, .admin-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  z-index: 30;
  height: 56px;
}
.app-topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.app-topbar-brand .logo { width: 30px; height: 30px; font-size: 14px; }

/* Backdrop drawer */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 45;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
body.nav-open-lock { overflow: hidden; }

/* === MOBILE BREAKPOINT (≤860px) : drawer pour app + admin === */
@media (max-width: 860px) {
  .app-topbar, .admin-topbar { display: flex; }
  .burger-btn { display: flex; }

  .app-layout { grid-template-columns: 1fr; }

  .sidebar, .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    height: 100vh;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 50;
    overflow-y: auto;
    box-shadow: 0 0 32px rgba(0,0,0,0.18);
    padding: 20px 16px;
    gap: 16px;
    border-right: 1px solid var(--border, #e5e7eb);
  }
  .app-layout.sidebar-open .sidebar,
  .admin-layout.sidebar-open .admin-sidebar { transform: translateX(0); }
  .app-layout.sidebar-open .sidebar-backdrop,
  .admin-layout.sidebar-open .sidebar-backdrop { display: block; }

  .sidebar-brand, .admin-brand { position: relative; padding-right: 40px; }
  .sidebar-close { display: flex; position: absolute; right: -8px; top: -4px; }

  .sidebar-nav, .admin-nav { flex-direction: column; flex: 1; gap: 2px; }
  .nav-section { display: block; }
  .sidebar-user .info { display: block; }
  .sidebar-user {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border, #e5e7eb);
    border-left: none;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .page, .admin-main { padding-top: 72px !important; padding-left: 16px; padding-right: 16px; }
}

/* === MOBILE BURGER : landing-nav + mk-header === */
@media (max-width: 768px) {
  .landing-nav, .mk-header { position: relative; padding: 14px 16px; flex-wrap: nowrap; }
  .landing-nav .burger-btn, .mk-header .burger-btn { display: flex; }
  .landing-nav .landing-nav-links,
  .mk-header .mk-nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(360px, 88vw);
    flex-direction: column;
    align-items: stretch;
    background: var(--card-bg, #fff);
    padding: 80px 24px 24px;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 60;
    box-shadow: -8px 0 32px rgba(0,0,0,0.18);
    overflow-y: auto;
    gap: 4px;
  }
  .landing-nav.nav-open .landing-nav-links,
  .mk-header.nav-open .mk-nav { transform: translateX(0); }
  .landing-nav.nav-open::after, .mk-header.nav-open::after {
    content: ""; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 55;
  }
  .landing-nav .burger-close, .mk-header .burger-close {
    display: flex !important;
    position: absolute; top: 16px; right: 16px;
    z-index: 1;
  }
  .landing-nav-links a, .mk-nav-link {
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 10px;
    width: 100%;
  }
  .landing-nav-links a:hover, .mk-nav-link:hover { background: var(--bg-soft, #f3f4f6); }
  .mk-cta { margin-left: auto; }
  .mk-cta .back-link { display: none; } /* on garde juste le bouton primary */
}

/* =====================================================
   POLISH RESPONSIVE GLOBAL
   ===================================================== */
@media (max-width: 768px) {
  /* Page generic — padding réduit */
  .page-header { padding: 0; }
  .page-title { font-size: 22px !important; }
  .page-sub { font-size: 14px; }

  /* Forms : labels en colonne, inputs full width */
  .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .form-grid .full { grid-column: auto; }
  input, select, textarea { font-size: 16px !important; } /* évite le zoom iOS */

  /* Cards & sections — padding réduit */
  .section { padding: 16px; }
  .auth-card { padding: 20px; }
  .legal-content { padding: 20px 18px; }

  /* Plans grid — colonne unique */
  .plans-grid, .mk-plans-grid { grid-template-columns: 1fr !important; }

  /* Stats cards en grille adaptable */
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-grid, .stats-row { grid-template-columns: 1fr 1fr !important; }

  /* Tableaux qui débordent : scroll horizontal */
  .table-wrap, .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Profil hero — compact */
  .profile-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .profile-avatar { width: 72px !important; height: 72px !important; font-size: 28px !important; }

  /* Messages thread */
  .msg { max-width: 90%; }
  .msg-form { padding: 8px; }

  /* Modal / overlay */
  .modal-card { padding: 20px; max-width: 100%; }

  /* Marketing hero */
  .mk-hero h1 { font-size: 28px; }
  .mk-section { padding: 24px 0; }
  .mk-section.alt { margin: 24px -16px; padding: 24px 16px; }
  .mk-steps { gap: 12px; }

  /* Footer marketing */
  .mk-footer-cols { grid-template-columns: 1fr; gap: 24px; text-align: left; }

  /* Ticket support : header + actions */
  .admin-ticket-actions { flex-direction: column; align-items: stretch; }
  .admin-ticket-actions label { width: 100%; }
  .admin-ticket-actions select { width: 100%; }
  .ticket-msg { max-width: 100%; }

  /* Map / calendar */
  .map-container, .leaflet-container { height: 380px !important; }
  .cal-cell { font-size: 11px; }

  /* Sidebar legal links — un peu plus aérés */
  .sidebar-legal { font-size: 12px; padding: 12px 0 0; }

  /* Boutons : full-width par défaut sur mobile dans les pages */
  .btn-row .btn, .form-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .admin-kpi-grid { grid-template-columns: 1fr !important; }
  .stat-grid, .stats-row { grid-template-columns: 1fr !important; }
  .mk-cta-row { flex-direction: column; }
  .mk-cta-row .btn { width: 100%; }
  .profile-rating { width: 100%; }
}

/* Rating chip (inline avg on name/card) */
.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin-left: 4px;
}
.rating-chip.none { background: #f3f4f6; color: #9ca3af; font-weight: 500; }
.rating-chip-count { opacity: 0.7; font-weight: 500; }

/* Modal (used for rating form) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.modal select, .modal textarea, .modal input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Map */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: stretch;
}
.map-root {
  height: calc(100vh - 220px);
  min-height: 480px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}
.map-info {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
}
.map-info-empty { color: var(--text-muted); font-size: 14px; }
.map-info-card h3 { margin: 0 0 8px; font-size: 18px; }
.map-info-meta { font-size: 13px; color: var(--text-muted); margin: 4px 0; display: flex; align-items: center; gap: 6px; }
.map-info-body { margin: 12px 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.map-info-actions { margin-top: 12px; }
.map-route-status {
  margin-top: 10px; padding: 8px 12px; background: #eff6ff; color: #1e40af; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.map-route-status.muted { background: #f3f4f6; color: var(--text-muted); font-weight: 500; }
.map-popup { font-family: inherit; }
.map-popup-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.map-popup-meta { font-size: 12px; color: #374151; margin: 2px 0; }

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-root { height: 52vh; min-height: 320px; }
}

/* Guide */
.guide-wrap {
  max-width: 980px;
  margin: 40px auto;
  padding: 0 24px 60px;
}
.guide-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  font-size: 13px;
}
.guide-toc h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.guide-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.guide-toc a { color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 6px; display: block; line-height: 1.3; }
.guide-toc a:hover { background: var(--bg); color: var(--accent); }
.guide-body {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
}
.guide-body section { padding: 16px 0; border-top: 1px solid var(--border); }
.guide-body section:first-child { border-top: none; padding-top: 0; }
.guide-body h2 { margin: 0 0 14px; font-size: 22px; }
.guide-body h3 { margin: 18px 0 8px; font-size: 15px; color: var(--text); }
.guide-body p { margin: 8px 0; line-height: 1.6; color: #374151; }
.guide-body ul { margin: 8px 0 12px; padding-left: 22px; }
.guide-body li { margin: 4px 0; line-height: 1.6; color: #374151; }
.guide-body code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 12px; }
.guide-table {
  width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px;
}
.guide-table th, .guide-table td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.guide-table th { background: var(--bg); font-weight: 700; }

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; }
}

/* Dark mode pour la page Guide */
html[data-theme="dark"] .guide-toc {
  background: #1a2235;  /* un peu plus clair que --bg (#0b1120) pour ressortir */
  border-color: var(--border);
}

html[data-theme="dark"] .guide-toc h3 {
  color: var(--text-muted);
}

html[data-theme="dark"] .guide-toc a {
  color: var(--text);
}

html[data-theme="dark"] .guide-toc a:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

html[data-theme="dark"] .guide-body {
  background: #1a2235;  /* un peu plus clair que --bg */
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .guide-body h2,
html[data-theme="dark"] .guide-body h3 {
  color: var(--text);
}

html[data-theme="dark"] .guide-body p,
html[data-theme="dark"] .guide-body li {
  color: #cbd5e1;  /* gris clair lisible */
}

html[data-theme="dark"] .guide-body section {
  border-top-color: var(--border);
}

html[data-theme="dark"] .guide-body code {
  background: var(--surface-hover);
  color: var(--text);
}

html[data-theme="dark"] .guide-table th,
html[data-theme="dark"] .guide-table td {
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .guide-table th {
  background: var(--surface-hover);
}

/* Modals & cartes additionnelles en dark mode */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .map-info {
  background: #1a2235;
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .modal label,
html[data-theme="dark"] .modal h3 {
  color: var(--text);
}

/* Pages marketing/landing avec sections blanches */
html[data-theme="dark"] .mk-section,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .step-card,
html[data-theme="dark"] .testimonial-card {
  background: #1a2235;
  border-color: var(--border);
  color: var(--text);
}

/* Match score (IA candidate ranking) */
.match-card {
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.match-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.match-score {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 14px; border-radius: 12px; min-width: 92px;
  font-weight: 800; line-height: 1;
}
.match-score .match-num { font-size: 26px; }
.match-score .match-num span { font-size: 14px; opacity: .7; margin-left: 2px; }
.match-score .match-verdict { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; opacity: .9; font-weight: 700; }

.match-green { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.match-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.match-orange { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.match-red { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

.match-details {
  margin: 10px 0 6px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}
.match-details summary { cursor: pointer; font-weight: 600; color: var(--text); padding: 4px 0; user-select: none; }
.match-details summary:hover { color: var(--accent); }
.match-breakdown { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.match-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.match-icon { font-size: 16px; }
.match-label { flex: 1; color: #374151; }
.match-points { font-weight: 700; color: #059669; font-size: 12px; background: #d1fae5; padding: 2px 8px; border-radius: 999px; }

/* Form hints */
.hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.4;
}

/* ===== Analytics Dashboard ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.45s ease both;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
}
.kpi-card.kpi-success::before { background: linear-gradient(180deg, #10b981, #059669); }
.kpi-card.kpi-info::before    { background: linear-gradient(180deg, #06b6d4, #0891b2); }
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text, #111827);
  line-height: 1.1;
}
.kpi-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-left: 2px;
}
.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.chart-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 18px 20px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  animation: fadeInUp 0.5s ease both;
}
.chart-card.chart-wide { grid-column: 1 / -1; }
.chart-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #111827);
}
.chart-wrap {
  position: relative;
  height: 280px;
}
.chart-wide .chart-wrap { height: 240px; }
.empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
  font-style: italic;
}
@media (max-width: 880px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 240px; }
}

/* ===== Anti-leak / modération ===== */
.anti-leak-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  color: #78350f;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.4s ease both;
}
html[data-theme="dark"] .anti-leak-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}
.anti-leak-banner .al-icon { font-size: 22px; flex-shrink: 0; }
.anti-leak-banner .al-text { flex: 1; }
.anti-leak-banner em { font-style: normal; font-weight: 700; }

.msg.moderated .msg-bubble {
  border: 1px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.msg-moderated-tag {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
html[data-theme="dark"] .msg-moderated-tag { color: #fbbf24; }
.msg.mine .msg-moderated-tag { align-self: flex-end; }

/* ===== Widget "Valeur de l'abo" ===== */
.value-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: #fff;
  border-radius: 18px;
  padding: 22px 24px 18px;
  margin: 0 0 22px;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.45);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease both;
}
.value-card::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  pointer-events: none;
}
.value-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 4px;
}
.value-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.value-item {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(4px);
}
.value-item.value-savings {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
}
.value-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.value-unit {
  font-size: 16px;
  font-weight: 600;
  margin-left: 1px;
  opacity: 0.85;
}
.value-lbl {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.3;
}
.value-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.9;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

/* ===== ADMIN BACKOFFICE ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--bg, #f9fafb);
}
.admin-sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}
.admin-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.admin-title { font-weight: 800; font-size: 15px; }
.admin-subtitle { font-size: 11px; color: #94a3b8; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 9px;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(245,158,11,0.18));
  color: #fff;
  font-weight: 600;
}
.admin-foot {
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 8px;
}
.admin-back, .admin-logout {
  display: block;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.admin-back:hover, .admin-logout:hover { background: rgba(255,255,255,0.12); color: #fff; }
.admin-logout { background: rgba(239,68,68,0.15); color: #fca5a5; }
.admin-logout:hover { background: rgba(239,68,68,0.3); color: #fff; }

.admin-main {
  padding: 28px 32px;
  overflow-x: auto;
}
.admin-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.admin-header p { margin: 0 0 22px; color: var(--text-muted, #6b7280); }
.adm-count {
  font-size: 13px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.admin-kpi {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.admin-kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: #94a3b8;
}
.admin-kpi-revenue::before { background: linear-gradient(180deg, #10b981, #059669); }
.admin-kpi-warn::before { background: linear-gradient(180deg, #f59e0b, #ef4444); }
.admin-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
  font-weight: 700;
  margin-bottom: 6px;
}
.admin-kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text, #111827);
  line-height: 1;
}
.admin-kpi-value span { font-size: 16px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.admin-kpi-sub { margin-top: 6px; font-size: 12px; color: var(--text-muted, #6b7280); }

.admin-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.admin-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 18px 20px;
}
.admin-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.admin-card-wide { grid-column: 1 / -1; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 13px;
}
.admin-list li:last-child { border-bottom: none; }
.admin-list li strong { color: var(--text, #111827); font-weight: 700; }
.admin-list li.admin-warn strong { color: #ef4444; }

.admin-filters {
  display: flex; gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-filters input, .admin-filters select {
  padding: 9px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 9px;
  font-size: 13px;
  background: var(--card-bg, #fff);
  color: var(--text, #111827);
}
.admin-filters input { flex: 1; min-width: 220px; }

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.adm-table thead {
  background: var(--bg, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.adm-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
}
.adm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}
.adm-table tr:hover { background: rgba(99,102,241,0.04); }
.adm-table code { font-size: 12px; color: var(--text-muted); }
.adm-empty { text-align: center; padding: 40px; color: var(--text-muted); }
.adm-row-warn { background: rgba(245, 158, 11, 0.06); }

.adm-user-name { font-weight: 600; }
.adm-user-mail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.adm-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 4px;
}
.adm-pill-green { background: #d1fae5; color: #065f46; }
.adm-pill-red { background: #fee2e2; color: #991b1b; }
.adm-pill-purple { background: #ede9fe; color: #5b21b6; }
html[data-theme="dark"] .adm-pill-green { background: rgba(16,185,129,0.18); color: #6ee7b7; }
html[data-theme="dark"] .adm-pill-red { background: rgba(239,68,68,0.18); color: #fca5a5; }
html[data-theme="dark"] .adm-pill-purple { background: rgba(139,92,246,0.18); color: #c4b5fd; }

.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-btn-sm { padding: 6px 10px !important; font-size: 12px !important; }
.adm-protected { font-size: 11px; color: var(--text-muted); font-style: italic; }

.btn.danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }

/* Modération messages */
.adm-mod-list { display: flex; flex-direction: column; gap: 12px; }
.adm-mod-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 16px 18px;
}
.adm-mod-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 12px;
}
.adm-mod-mail { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.adm-mod-meta { font-size: 11px; color: var(--text-muted); text-align: right; line-height: 1.6; }
.adm-mod-bodies { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.adm-mod-body {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg, #f9fafb);
}
.adm-mod-original { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); }
.adm-mod-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.adm-mod-tag-orig { color: #b91c1c; }
.adm-mod-tag-clean { color: var(--text-muted); }
.adm-mod-text { font-size: 13px; line-height: 1.5; word-break: break-word; }
.adm-mod-actions { display: flex; gap: 8px; }

.nav-item-admin {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(245,158,11,0.08));
  border: 1px dashed rgba(239,68,68,0.3);
}
.nav-item-admin:hover { background: linear-gradient(135deg, rgba(239,68,68,0.16), rgba(245,158,11,0.16)); }

@media (max-width: 880px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-row { grid-template-columns: 1fr; }
  .adm-mod-bodies { grid-template-columns: 1fr; }
}

/* ===== RGPD : Pages légales (privacy / terms) ===== */
.public-shell {
  min-height: 100vh;
  background: var(--bg, #f9fafb);
}
.public-header {
  display: flex;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--card-bg, #fff);
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text, #111827);
  font-weight: 700;
}
.public-main { padding: 36px 24px; }

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 0 60px;
}
.legal-content {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 36px 40px;
  line-height: 1.65;
  color: var(--text, #1f2937);
}
.legal-content h1 {
  font-size: 28px;
  margin: 0 0 6px;
  font-weight: 800;
}
.legal-meta {
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  margin: 0 0 24px;
}
.legal-content h2 {
  font-size: 18px;
  margin: 30px 0 12px;
  padding-top: 6px;
  font-weight: 700;
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 22px;
}
.legal-content h2:first-of-type { border-top: none; padding-top: 0; }
.legal-content p { margin: 10px 0; }
.legal-content ul {
  padding-left: 22px;
  margin: 10px 0;
}
.legal-content ul li { margin: 6px 0; }
.legal-content a {
  color: #6366f1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-content code {
  background: var(--bg, #f3f4f6);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.legal-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
}
.legal-foot a {
  color: var(--text-muted, #6b7280);
  text-decoration: none;
}
.legal-foot a:hover { color: var(--text, #111827); text-decoration: underline; }

/* ===== RGPD : Section profil ===== */
.gdpr-section {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, rgba(99,102,241,0.04), rgba(236,72,153,0.02));
  border-radius: 14px;
  padding: 22px 24px;
  margin-top: 24px;
}
html[data-theme="dark"] .gdpr-section {
  border-color: rgba(99,102,241,0.4);
  background: linear-gradient(180deg, rgba(99,102,241,0.08), rgba(236,72,153,0.05));
}
.gdpr-intro {
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
}
.gdpr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.gdpr-action {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 11px;
  padding: 16px 18px;
}
.gdpr-action.gdpr-danger {
  border-color: #fca5a5;
  background: rgba(254, 226, 226, 0.4);
}
html[data-theme="dark"] .gdpr-action.gdpr-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}
.gdpr-action-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}
.gdpr-icon { font-size: 18px; }
.gdpr-action p {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin: 0 0 14px;
  line-height: 1.5;
}
.gdpr-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
  gap: 8px;
}
.gdpr-links a {
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  margin: 0 2px;
}
.gdpr-links a:hover { color: var(--text, #111827); text-decoration: underline; }

/* Consent checkbox sur register */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  line-height: 1.5;
  padding: 10px 0;
}
.auth-consent input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #6366f1;
}
.auth-consent a { color: #6366f1; text-decoration: underline; }

/* Sidebar legal links */
.sidebar-legal {
  text-align: center;
  padding: 8px 0 4px;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
}
.sidebar-legal a {
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  margin: 0 2px;
}
.sidebar-legal a:hover { color: var(--text, #111827); text-decoration: underline; }

/* Landing footer legal */
.landing-legal {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.landing-legal a {
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  margin: 0 2px;
}
.landing-legal a:hover { color: var(--text, #111827); text-decoration: underline; }

/* ===== ONBOARDING : Tour produit ===== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  animation: fadeIn 0.25s ease both;
}
.tour-cut {
  position: absolute;
  background: rgba(15, 23, 42, 0.72);
  pointer-events: auto;
  backdrop-filter: blur(2px);
}
.tour-spotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.6),
    0 0 0 9999px rgba(15, 23, 42, 0);
  pointer-events: none;
  transition: top 0.25s, left 0.25s, width 0.25s, height 0.25s;
  animation: tourPulse 1.8s ease-in-out infinite;
}
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.6); }
  50% { box-shadow: 0 0 0 7px rgba(99, 102, 241, 0.35); }
}
.tour-tooltip {
  position: absolute;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: tourPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 90vw;
}
@keyframes tourPop {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.tour-progress {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  margin-bottom: 8px;
}
.tour-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text, #111827);
}
.tour-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted, #6b7280);
  margin: 0 0 16px;
}
.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tour-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.tour-btn:active { transform: scale(0.97); }
.tour-btn-skip {
  background: transparent;
  color: var(--text-muted, #6b7280);
}
.tour-btn-skip:hover { background: rgba(0,0,0,0.05); }
.tour-btn-prev {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.tour-btn-prev:hover { background: rgba(99, 102, 241, 0.18); }
.tour-btn-next {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.tour-btn-next:hover { filter: brightness(1.08); }

/* ===== ONBOARDING : Checklist de complétion ===== */
.checklist-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: #fff;
  border-radius: 16px;
  padding: 22px 24px 20px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.4);
  animation: fadeInUp 0.5s ease both;
}

/* Toutes les icônes dans la checklist sont en blanc (fond coloré) */
.checklist-card .icon,
.checklist-card .icon * {
  color: white !important;
  stroke: white !important;
}
.checklist-card::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.checklist-card.checklist-done {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 30px -8px rgba(16, 185, 129, 0.4);
}
.checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
}
.checklist-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  margin-bottom: 4px;
}
.checklist-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}
.checklist-sub {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.88;
}
.checklist-pct {
  font-size: 32px;
  font-weight: 900;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 8px 14px;
  line-height: 1;
}
.checklist-pct-done { background: rgba(255,255,255,0.22); }
.checklist-bar {
  height: 6px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.checklist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.7));
  border-radius: 999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
}
.checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  opacity: 1;
  position: relative;
}

/* Items cliquables : toute la carte est interactive */
.cl-item.cl-clickable {
  cursor: pointer;
}

.cl-item.cl-clickable:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.35);
}

.cl-item.cl-clickable:active {
  transform: scale(0.98);
}

/* Le lien "stretched" couvre toute la carte parente via ::after */
.cl-stretched-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.cl-stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
}
.cl-item.cl-done {
  background: rgba(255,255,255,0.06);
  opacity: 0.7;
  border-color: rgba(34, 197, 94, 0.22);
}
.cl-item.cl-done:hover {
  opacity: 0.9;
}
.cl-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cl-text { flex: 1; }
.cl-text a:not(.cl-stretched-link) {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.cl-text a:not(.cl-stretched-link):hover { opacity: 0.85; }
.cl-text a.cl-stretched-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.cl-boost {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}
.cl-done .cl-text {
  text-decoration: none;
  opacity: 0.85;
}
.cl-done::after {
  content: "Validé";
  font-size: 11px;
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: auto;
  flex-shrink: 0;
  font-weight: 600;
  opacity: 0.9;
}
.checklist-success {
  font-size: 13px;
  opacity: 0.95;
  position: relative;
}

.tour-replay-section {
  border: 1px dashed var(--border, #e5e7eb);
  background: rgba(99, 102, 241, 0.04);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 22px;
}

/* ===== MODE URGENT ===== */
.urgent-toggle {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(245, 158, 11, 0.06));
  border: 1px dashed #ef4444;
  border-radius: 12px;
  cursor: pointer;
}
.urgent-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: #ef4444;
  flex-shrink: 0;
}
.urgent-toggle strong { color: #ef4444; font-size: 14px; display: block; margin-bottom: 4px; }
.urgent-toggle-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.urgent-locked {
  background: var(--bg, #f9fafb);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.urgent-locked a { color: #6366f1; font-weight: 600; }

.card-urgent {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 8px 25px -8px rgba(239, 68, 68, 0.4);
  position: relative;
  overflow: hidden;
}
.card-urgent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
  background-size: 200% 100%;
  animation: urgentSlide 1.6s linear infinite;
}
@keyframes urgentSlide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.urgent-banner {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  margin: -16px -16px 12px;
  border-radius: 12px 12px 0 0;
  letter-spacing: 0.02em;
}

.btn.urgent-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  animation: urgentPulse 1.6s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 4px 22px rgba(239, 68, 68, 0.7); transform: translateY(-1px); }
}
.btn.urgent-btn:hover { filter: brightness(1.1); }
.btn.urgent-btn:disabled { animation: none; opacity: 0.7; cursor: wait; }

/* Strip urgent sur dashboard worker */
.urgent-strip {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 22px 18px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px -10px rgba(239, 68, 68, 0.5);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease both;
}
.urgent-strip::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
}
.urgent-strip-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 16px;
}
.urgent-pulse {
  font-size: 22px;
  display: inline-block;
  animation: urgentBeat 1s ease-in-out infinite;
}
@keyframes urgentBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
.urgent-strip-sub {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.9;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 999px;
}
.urgent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.urgent-mini-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 11px;
  padding: 12px 14px;
  backdrop-filter: blur(4px);
}
.urgent-mini-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}
.urgent-time {
  font-size: 11px;
  background: rgba(0,0,0,0.18);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.urgent-mini-meta { font-size: 12px; opacity: 0.9; margin-bottom: 10px; }
.urgent-mini-card .btn { width: 100%; }

/* ===== ÉQUIPE D'ÉTABLISSEMENT ===== */
.team-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.team-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}
.team-card-sub {
  margin: 0 0 16px;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
}
.team-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.team-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-row.team-owner { background: linear-gradient(90deg, rgba(139,92,246,0.06), transparent); }
.team-row.team-suspended { opacity: 0.6; }
.team-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-info { min-width: 0; }
.team-name {
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.team-mail {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
}
.team-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.team-pill-purple { background: #ede9fe; color: #5b21b6; }
.team-pill-blue { background: #dbeafe; color: #1e40af; }
.team-pill-gray { background: #f3f4f6; color: #4b5563; }
html[data-theme="dark"] .team-pill-purple { background: rgba(139,92,246,0.18); color: #c4b5fd; }
html[data-theme="dark"] .team-pill-blue { background: rgba(59,130,246,0.18); color: #93c5fd; }
html[data-theme="dark"] .team-pill-gray { background: rgba(156,163,175,0.18); color: #d1d5db; }

.team-role-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  background: var(--bg, #f9fafb);
  cursor: pointer;
}
.team-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-radius: 10px;
}

.team-invites-list { display: flex; flex-direction: column; gap: 8px; }
.team-invite-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(99,102,241,0.05);
  border: 1px dashed rgba(99,102,241,0.3);
  border-radius: 10px;
  font-size: 13px;
}

.team-invite-form {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
  margin-bottom: 18px;
}
.team-invite-form input,
.team-invite-form select {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-bg, #fff);
  color: var(--text);
  font-size: 14px;
}

.team-roles-help {
  display: flex; flex-direction: column;
  gap: 8px;
  background: var(--bg, #f9fafb);
  padding: 14px 16px;
  border-radius: 10px;
}
.team-role-help-item {
  display: flex; gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.team-readonly-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.04));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text);
}

/* ===== Page d'acceptation invitation ===== */
.invite-page {
  max-width: 520px;
  margin: 24px auto;
  padding: 0 16px;
}
.invite-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  padding: 36px 36px 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  text-align: center;
}
.invite-icon-good, .invite-icon-bad {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.invite-icon-good {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 12px 24px -8px rgba(99,102,241,0.4);
}
.invite-icon-bad {
  background: #fee2e2;
}
.invite-card h1 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 800;
}
.invite-intro {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.invite-mail {
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-block;
  font-size: 13px;
  margin: 0 0 24px;
}
.invite-form {
  display: flex; flex-direction: column;
  gap: 14px;
  text-align: left;
}
.invite-form label {
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.invite-form input[type="text"],
.invite-form input[type="password"],
.invite-form input[name="name"] {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--card-bg);
}
.invite-form .hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 700px) {
  .team-row { grid-template-columns: 40px 1fr; gap: 10px; }
  .team-row .team-role-cell { grid-column: 2; }
  .team-row .team-actions { grid-column: 2; justify-self: end; }
  .team-invite-form { grid-template-columns: 1fr; }
}

/* ===== BRIEF D'ARRIVÉE ===== */

/* Modal brief (estab) */
.modal-brief {
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-brief .modal-head {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-brief .modal-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  margin-bottom: 4px;
}
.modal-brief h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}
.modal-brief .modal-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.modal-close {
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { background: rgba(0,0,0,0.08); }

.brief-templates {
  padding: 12px 24px;
  background: rgba(99,102,241,0.05);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.brief-templates-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.brief-template-chip {
  background: var(--card-bg);
  border: 1px solid #c7d2fe;
  color: #4338ca;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.brief-template-chip:hover { background: #ede9fe; }

.brief-form {
  padding: 16px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.brief-section {
  margin-bottom: 22px;
}
.brief-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.brief-field {
  display: block;
  margin-bottom: 10px;
}
.brief-field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.brief-field input,
.brief-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}
.brief-field input:focus,
.brief-field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.brief-save-template {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(16,185,129,0.06);
  border: 1px dashed rgba(16,185,129,0.4);
  border-radius: 10px;
}
.brief-save-template label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  cursor: pointer;
}
.brief-save-template input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #10b981;
}
.brief-save-template input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--card-bg);
}
.brief-save-template input[type="text"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* Brief view (worker) */
.brief-view {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease both;
}
.brief-view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}
.brief-view-pin {
  font-size: 36px;
  background: rgba(255,255,255,0.2);
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brief-view-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 2px;
}
.brief-view-header h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
}
.brief-view-meta {
  font-size: 13px;
  opacity: 0.95;
}
.brief-view-header .btn {
  margin-left: auto;
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.3) !important;
}
.brief-view-section {
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
}
.brief-view-section:last-child { border-bottom: none; }
.brief-view-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}
.brief-view-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.brief-view-item {
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.brief-view-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.brief-view-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.brief-view-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}
.brief-view-empty h3 {
  margin: 12px 0 6px;
  color: var(--text);
}

/* Bannière "missions à venir" sur dashboard worker */
.upcoming-strip {
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  border-radius: 16px;
  padding: 18px 22px 16px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px -10px rgba(99,102,241,0.4);
  animation: fadeInUp 0.5s ease both;
}
.upcoming-strip-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
}
.upcoming-strip-head span:first-child { font-size: 22px; }
.upcoming-strip-sub {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.9;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 999px;
}
.upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.upcoming-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 11px;
  padding: 12px 14px;
  text-decoration: none;
  color: #fff;
  display: block;
  transition: transform 0.15s, background 0.15s;
}
.upcoming-card:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.upcoming-imminent {
  border: 2px solid rgba(245, 158, 11, 0.8);
  background: rgba(245, 158, 11, 0.18);
}
.upcoming-card-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}
.upcoming-soon {
  background: rgba(0,0,0,0.25);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.upcoming-card-meta {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 8px;
}
.upcoming-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.upcoming-cta { font-weight: 600; }
.brief-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.brief-status-ok { background: rgba(16,185,129,0.25); color: #d1fae5; }
.brief-status-pending { background: rgba(0,0,0,0.2); color: rgba(255,255,255,0.85); }

/* Print-friendly */
@media print {
  .sidebar, .back-link, .brief-view-header .btn { display: none !important; }
  .brief-view { border: none; box-shadow: none; }
  .brief-view-header { background: #fff !important; color: #000 !important; }
  .brief-view-header h2, .brief-view-meta, .brief-view-eyebrow { color: #000 !important; }
  .brief-view-pin { background: #f3f4f6 !important; }
}

/* =====================================================
   PAGES MARKETING (publiques)
   ===================================================== */
.mk-shell { display: flex; flex-direction: column; min-height: 100vh; }
.mk-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px 32px;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--card-bg, #fff) 85%, transparent);
}
.mk-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.mk-nav-link {
  padding: 8px 14px; border-radius: 8px;
  text-decoration: none; color: var(--text-muted, #6b7280);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.mk-nav-link:hover { background: var(--bg-soft, #f3f4f6); color: var(--text, #111827); }
.mk-nav-link.active { color: var(--primary, #4f46e5); background: var(--primary-soft, rgba(79,70,229,0.08)); }
.mk-cta { display: flex; align-items: center; gap: 12px; }
.btn.small { padding: 6px 14px; font-size: 13px; border-radius: 8px; }

.mk-main { flex: 1; max-width: 1080px; margin: 0 auto; width: 100%; padding: 32px 24px 60px; }

.mk-hero { text-align: center; padding: 48px 16px 24px; }
.mk-hero.compact { padding: 28px 16px 20px; }
.mk-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 12px;
  background: linear-gradient(135deg, var(--text, #111827), var(--primary, #4f46e5));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mk-sub {
  font-size: 17px; color: var(--text-muted, #6b7280);
  max-width: 640px; margin: 0 auto;
}
.mk-mock-note {
  margin-top: 18px; display: inline-block;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309; font-size: 13px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mk-section { padding: 36px 0; }
.mk-section.alt {
  margin: 36px -24px;
  padding: 36px 24px;
  background: var(--bg-soft, #f9fafb);
  border-top: 1px solid var(--border, #e5e7eb);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.mk-section h2 {
  font-size: 22px; font-weight: 700;
  margin: 0 0 24px; text-align: center;
}

.mk-steps {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.mk-step {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 24px;
  position: relative;
}
.mk-step-num {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary, #4f46e5), #7c3aed);
  color: #fff; font-weight: 800; font-size: 16px;
  margin-bottom: 14px;
}
.mk-step h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.mk-step p { font-size: 14px; color: var(--text-muted, #6b7280); margin: 0; line-height: 1.55; }

.mk-cta-box {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-soft, rgba(79,70,229,0.08)), rgba(124,58,237,0.06));
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 36px 24px;
  margin-top: 24px;
}
.mk-cta-box h3 { font-size: 22px; font-weight: 700; margin: 0 0 18px; }
.mk-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.mk-article { max-width: 780px; margin: 0 auto; }

.mk-plans-grid { max-width: 1000px; margin: 0 auto; }
.mk-plan { transition: transform .15s; }
.mk-plan:hover { transform: translateY(-2px); }

.mk-faq { display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin: 0 auto; }
.mk-faq.large { gap: 12px; }
.mk-faq details {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color .15s;
}
.mk-faq details[open] { border-color: var(--primary, #4f46e5); }
.mk-faq summary {
  font-weight: 600; font-size: 15px;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text, #111827);
}
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after {
  content: "+"; font-size: 22px; font-weight: 400;
  color: var(--text-muted, #6b7280);
  transition: transform .15s;
}
.mk-faq details[open] summary::after { transform: rotate(45deg); }
.mk-faq p {
  margin: 12px 0 4px; line-height: 1.6;
  color: var(--text-muted, #6b7280); font-size: 14px;
}
.mk-faq-help {
  text-align: center; margin-top: 24px;
  color: var(--text-muted, #6b7280);
}

.mk-contact-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1fr 1.5fr;
  max-width: 920px; margin: 0 auto;
}
.mk-contact-info h3 { font-size: 14px; font-weight: 700; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text, #111827); }
.mk-contact-info p { margin: 0; line-height: 1.6; }
.mk-contact-info a { color: var(--primary, #4f46e5); text-decoration: none; font-weight: 500; }
.mk-contact-form { background: var(--card-bg, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 24px; }
.mk-muted { color: var(--text-muted, #6b7280); font-size: 13px; }

.mk-footer {
  background: var(--bg-soft, #f9fafb);
  border-top: 1px solid var(--border, #e5e7eb);
  padding: 40px 24px 24px;
  margin-top: auto;
}
.mk-footer-cols {
  display: grid; gap: 32px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  max-width: 1080px; margin: 0 auto;
}
.mk-footer-cols h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; color: var(--text, #111827); }
.mk-footer-cols a { display: block; padding: 4px 0; color: var(--text-muted, #6b7280); text-decoration: none; font-size: 14px; }
.mk-footer-cols a:hover { color: var(--primary, #4f46e5); }
.mk-footer-cols p { color: var(--text-muted, #6b7280); font-size: 14px; line-height: 1.55; margin: 0; }
.mk-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mk-footer-bottom {
  max-width: 1080px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border, #e5e7eb);
  text-align: center; font-size: 13px; color: var(--text-muted, #6b7280);
}

@media (max-width: 768px) {
  .mk-header { flex-wrap: wrap; padding: 12px 16px; }
  .mk-nav { order: 3; width: 100%; justify-content: center; }
  .mk-contact-grid { grid-template-columns: 1fr; }
  .mk-footer-cols { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   2FA + VISIBILITÉ + BANNIÈRES
   ===================================================== */
.banner {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; line-height: 1.5;
  border: 1px solid transparent;
}
.banner-warning {
  background: rgba(245, 158, 11, 0.10);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

.security-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.security-pill {
  padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.security-pill.on { background: rgba(16, 185, 129, 0.15); color: #047857; }
.security-pill.off { background: var(--bg-soft, #f3f4f6); color: var(--text-muted, #6b7280); }

.visibility-options { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.visibility-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.visibility-option:hover { border-color: var(--primary, #4f46e5); }
.visibility-option.active {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--primary-soft, rgba(79,70,229,0.10));
}
.visibility-option input[type="radio"] { margin-top: 4px; accent-color: var(--primary, #4f46e5); }
.visibility-option strong { display: block; margin-bottom: 4px; }
.visibility-option p { font-size: 13px; color: var(--text-muted, #6b7280); margin: 0; line-height: 1.5; }

@media (max-width: 640px) {
  .visibility-options { grid-template-columns: 1fr; }
}

/* Modals (2FA setup / disable) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.55);
  display: grid; place-items: center;
  padding: 20px;
  animation: modalFadeIn .15s ease;
}
@keyframes modalFadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh; overflow-y: auto;
}
.modal-card h2 { margin: 0 0 16px; font-size: 20px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: 0;
  font-size: 26px; line-height: 1; cursor: pointer;
  color: var(--text-muted, #6b7280);
  width: 32px; height: 32px; border-radius: 8px;
}
.modal-close:hover { background: var(--bg-soft, #f3f4f6); color: var(--text, #111827); }

.twofa-steps { padding-left: 20px; line-height: 1.6; }
.twofa-steps li { margin-bottom: 14px; }
.twofa-qr {
  display: grid; place-items: center;
  margin: 12px 0;
  padding: 12px; background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
}
.twofa-qr img { width: 200px; height: 200px; }
.twofa-secret {
  display: block; margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-soft, #f3f4f6);
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; word-break: break-all;
  text-align: center; letter-spacing: 0.05em;
}
.twofa-form { display: flex; gap: 10px; margin-top: 8px; }
.twofa-form input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  font-size: 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-align: center; letter-spacing: 0.4em;
}
.twofa-form input:focus { outline: 2px solid var(--primary, #4f46e5); border-color: transparent; }

/* Profil verrouillé */
.locked-hero { opacity: 0.95; }
.locked-avatar {
  background: linear-gradient(135deg, #94a3b8, #475569) !important;
  font-size: 32px !important;
}

/* Carte "mode démo statique" sur les pages auth (login/register) */
.auth-demo-card { text-align: center; }
.auth-demo-icon {
  font-size: 44px; line-height: 1;
  margin: 0 auto 12px;
  width: 80px; height: 80px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft, rgba(79,70,229,0.10)), rgba(124,58,237,0.10));
}
.auth-demo-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}
.auth-demo-card code {
  background: var(--bg-soft, #f3f4f6);
  padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
@media (max-width: 480px) {
  .auth-demo-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   SUPPORT TICKETS
   ===================================================== */
.support-list { display: flex; flex-direction: column; gap: 10px; }
.support-row {
  display: flex; gap: 16px; align-items: stretch; justify-content: space-between;
  padding: 16px 20px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .08s;
}
.support-row:hover { border-color: var(--primary, #4f46e5); transform: translateY(-1px); }
.support-row-main { flex: 1; min-width: 0; }
.support-row-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.support-row-cat { font-size: 12px; color: var(--text-muted, #6b7280); font-weight: 500; }
.support-row-subject { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.support-row-preview { font-size: 13px; color: var(--text-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.support-row-meta .meta { font-size: 12px; color: var(--text-muted, #6b7280); }
.support-unread {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--primary, #4f46e5); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}

.support-pill {
  display: inline-block;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.support-pill-blue   { background: rgba(59,130,246,0.12);  color: #1d4ed8; }
.support-pill-purple { background: rgba(124,58,237,0.12);  color: #6d28d9; }
.support-pill-orange { background: rgba(245,158,11,0.12);  color: #b45309; }
.support-pill-green  { background: rgba(16,185,129,0.15);  color: #047857; }
.support-pill-red    { background: rgba(239,68,68,0.12);   color: #b91c1c; }
.support-pill-gray   { background: var(--bg-soft, #f3f4f6); color: var(--text-muted, #6b7280); }

.support-form { display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.support-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; color: var(--text); }
.support-form input, .support-form textarea, .support-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.support-form textarea { resize: vertical; min-height: 100px; }
.support-form input:focus, .support-form textarea:focus, .support-form select:focus {
  outline: 2px solid var(--primary); border-color: transparent;
}

/* Catégories sous forme de cartes radio */
.support-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.support-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  position: relative;
}

.support-cat-card:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.support-cat-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.support-cat-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.support-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary);
}

.support-cat-card:has(input:checked) .support-cat-icon {
  background: var(--primary);
  color: white;
}

.support-cat-card:has(input:checked) .support-cat-icon .icon {
  color: white !important;
  stroke: white !important;
}

.support-cat-icon .icon {
  color: var(--primary) !important;
  stroke: var(--primary) !important;
}

.support-cat-label {
  line-height: 1.3;
}

.ticket-header { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ticket-header-cat { font-size: 13px; color: var(--text-muted, #6b7280); font-weight: 500; }
.ticket-header-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ticket-header-meta .meta { font-size: 13px; color: var(--text-muted, #6b7280); }

.ticket-thread { display: flex; flex-direction: column; gap: 14px; margin: 24px 0; }
.ticket-msg {
  padding: 14px 18px; border-radius: 14px; max-width: 720px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card-bg, #fff);
}
.ticket-msg.mine, .ticket-msg.theirs { background: var(--card-bg, #fff); }
.ticket-msg.staff { background: var(--primary-soft, rgba(79,70,229,0.06)); border-color: rgba(79,70,229,0.25); }
.ticket-msg.internal {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.35);
  border-left: 4px solid #f59e0b;
}
.ticket-msg-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.ticket-msg-meta .meta { font-size: 12px; color: var(--text-muted, #6b7280); }
.ticket-msg-body { font-size: 14px; line-height: 1.6; color: var(--text, #111827); }
.ticket-staff-tag { color: var(--primary, #4f46e5); font-weight: 700; font-size: 13px; }
.ticket-internal-tag { color: #b45309; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.ticket-closed-banner {
  margin-top: 20px; padding: 14px 18px;
  background: var(--bg-soft, #f3f4f6); color: var(--text-muted, #6b7280);
  border-radius: 12px; text-align: center; font-size: 14px;
}
.ticket-closed-banner a { color: var(--primary, #4f46e5); }

/* Bannière d'attente de réponse staff */
.ticket-waiting-banner {
  margin-top: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
html[data-theme="dark"] .ticket-waiting-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
  border-color: rgba(129,140,248,0.4);
}
.ticket-waiting-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 50%;
  color: white;
  flex-shrink: 0;
}
.ticket-waiting-icon .icon {
  color: white !important;
  stroke: white !important;
}
.ticket-waiting-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.ticket-waiting-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ticket-internal-toggle { flex-direction: row !important; align-items: center; gap: 10px; cursor: pointer; }
.ticket-internal-toggle input { width: auto; }

/* === Admin support === */
.admin-support-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 18px; }
.admin-support-kpi {
  padding: 14px 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-support-kpi .kpi-label { font-size: 12px; color: var(--text-muted, #6b7280); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-support-kpi .kpi-value { font-size: 26px; font-weight: 800; color: var(--text, #111827); }

.admin-support-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-support-filters input, .admin-support-filters select {
  padding: 9px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--card-bg, #fff);
  font-size: 13px;
}
.admin-support-filters input { flex: 1; min-width: 220px; }

.admin-support-table { display: flex; flex-direction: column; gap: 1px; background: var(--border, #e5e7eb); border-radius: 12px; overflow: hidden; border: 1px solid var(--border, #e5e7eb); }
.admin-support-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr 1fr 1fr;
  gap: 12px; padding: 12px 16px;
  background: var(--card-bg, #fff); color: inherit;
  text-decoration: none;
  align-items: center;
  transition: background .12s;
}
.admin-support-row:not(.admin-support-head):hover { background: var(--bg-soft, #f9fafb); }
.admin-support-head { background: var(--bg-soft, #f9fafb) !important; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted, #6b7280); }
.admin-support-row-cell .meta { font-size: 12px; color: var(--text-muted, #6b7280); }
.admin-support-row-cat { font-size: 12px; color: var(--text-muted, #6b7280); margin-bottom: 2px; }
.admin-support-row-subject { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }

.admin-ticket-user {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  background: var(--bg-soft, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
}
.admin-ticket-user .meta { font-size: 12px; color: var(--text-muted, #6b7280); }

.admin-ticket-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 18px 0; }
.admin-ticket-actions label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted, #6b7280); }
.admin-ticket-actions select { padding: 8px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--card-bg, #fff); }

@media (max-width: 768px) {
  .admin-support-row { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .admin-support-head { display: none; }
  .admin-support-row-cell { font-size: 13px; }
  .support-row { flex-direction: column; }
  .support-row-meta { flex-direction: row; }

  /* Version mobile : afficher la vue semaine, cacher la vue mois */
  .cal-view-desktop {
    display: none;
  }

  .cal-view-mobile {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Sur mobile, on cache la légende (déjà visible via les couleurs des events) */
  .cal-view-mobile + .cal-legend {
    display: none;
  }

  /* Tous les enfants du calendrier mobile doivent respecter la largeur */
  .cal-view-mobile * {
    box-sizing: border-box;
    max-width: 100%;
  }
}

/* Bannière "mode démo statique" (déploiement Netlify sans backend) */
#staticDemoBanner {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #1f2937, #111827);
  color: #fbbf24;
  font-size: 13px; line-height: 1.5;
  border-bottom: 1px solid #fbbf24;
}
#staticDemoBanner strong { color: #fff; }
#staticDemoBanner button {
  background: transparent; border: 0; color: #fbbf24;
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  flex-shrink: 0;
}
#staticDemoBanner button:hover { background: rgba(251, 191, 36, 0.15); }

/* =====================================================
   AI WIDGET STYLES - MODERN & GRAPHICAL
   ===================================================== */

.ai-widget-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  font-family: inherit;
}

/* Floating Button - Message Bubble Shape */
.ai-widget-button {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35), 0 0 0 0 rgba(99, 102, 241, 0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  position: relative;
  overflow: visible;
  border-radius: 24px;
}

.ai-widget-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 60%);
  pointer-events: none;
  border-radius: 24px;
}

.ai-button-icon {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-button-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

/* Message bubble tail */
.ai-button-tail {
  position: absolute;
  bottom: -10px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-top: 10px solid;
  border-top-color: inherit;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.ai-widget-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.4), 0 0 0 12px rgba(99, 102, 241, 0.08);
}

.ai-widget-button:hover .ai-button-tail {
  animation: tailWave 0.6s ease-in-out infinite;
}

@keyframes tailWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.ai-widget-button:active {
  transform: scale(0.95);
}

/* Modal */
.ai-widget-modal {
  position: fixed;
  bottom: 116px;
  right: 28px;
  width: 460px;
  height: 700px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: slideUpSmooth 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.ai-widget-modal[hidden] {
  display: none !important;
}

@keyframes slideUpSmooth {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.ai-widget-header {
  padding: 20px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, transparent 100%);
}

.ai-widget-header-content {
  flex: 1;
}

.ai-widget-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.ai-widget-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-widget-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-widget-close:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: rotate(90deg);
}

/* Chat Thread */
.ai-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(to bottom, transparent 0%, rgba(79, 70, 229, 0.02) 100%);
}

.ai-chat-thread::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-thread::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-thread::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.ai-chat-thread::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.ai-message {
  display: flex;
  gap: 10px;
  animation: fadeInMessage 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-welcome {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.ai-message-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
}

.ai-message-user {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.ai-message-user .ai-message-content {
  background: var(--primary);
  color: white;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.ai-message-bot .ai-message-content {
  background: var(--surface-hover);
  color: var(--text);
  border-radius: 16px 16px 16px 4px;
  border: 1px solid var(--border);
}

.ai-message-content {
  max-width: 300px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
}

.ai-message-content p {
  margin: 0 0 6px;
  &:last-child {
    margin-bottom: 0;
  }
}

.ai-welcome-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.ai-welcome-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.ai-message-content ul {
  margin: 8px 0;
  padding-left: 18px;
}

.ai-message-content li {
  margin: 4px 0;
}

.ai-message-time {
  display: block;
  font-size: 11px;
  opacity: 0.6;
  margin-top: 6px;
}

.ai-message-loading {
  justify-content: flex-start;
}

.ai-loading-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 24px;
}

.ai-loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotsAnimation 1.4s infinite;
}

.ai-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotsAnimation {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Suggestions - Graphical Gradient Style */
.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px 12px;
  max-height: 220px;
  overflow-y: auto;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.03), transparent);
}

.ai-suggestions::-webkit-scrollbar {
  width: 5px;
}

.ai-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.ai-suggestions::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 3px;
}

.ai-suggestions::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.3);
}

.ai-suggestion-chip {
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.ai-suggestion-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent);
  border-radius: 14px;
  pointer-events: none;
}

.ai-suggestion-chip.ai-suggestion-alt2 {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.ai-suggestion-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ai-suggestion-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-suggestion-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.ai-suggestion-chip.ai-suggestion-alt2:hover {
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

.ai-suggestion-chip:active {
  transform: translateY(0);
}

/* Escalation */
.ai-escalation-actions {
  padding: 14px;
  background: linear-gradient(135deg, var(--warning-soft) 0%, rgba(217, 119, 6, 0.05) 100%);
  border-radius: 12px;
  margin: 8px 12px;
  border: 1px solid var(--warning-soft);
  border-left: 3px solid var(--warning);
}

.ai-escalation-actions p {
  margin: 0 0 10px;
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}

.ai-escalate-btn {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--warning) 0%, #ca8a04 100%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.ai-escalate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.ai-escalate-btn:active {
  transform: translateY(0);
}

/* Input Area */
.ai-input-area {
  padding: 14px 14px 14px 14px;
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, rgba(79, 70, 229, 0.02), transparent);
}

.ai-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-input {
  flex: 1;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  line-height: 1.4;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ai-input::placeholder {
  color: var(--text-muted);
}

.ai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.ai-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.ai-send-btn:active {
  transform: translateY(0);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .ai-widget-container {
    bottom: 20px;
    right: 16px;
  }

  .ai-widget-button {
    width: 60px;
    height: 60px;
  }

  .ai-widget-button svg {
    width: 32px;
    height: 32px;
  }

  .ai-widget-modal {
    bottom: 96px;
    right: 16px;
    left: 16px;
    width: auto;
    height: 540px;
    max-height: 75vh;
    border-radius: 22px;
  }

  .ai-message-content {
    max-width: 220px;
    padding: 10px 12px;
  }

  .ai-widget-header {
    padding: 18px 16px 14px;
  }

  .ai-widget-title {
    font-size: 16px;
  }

  .ai-widget-subtitle {
    font-size: 11px;
  }

  .ai-chat-thread {
    padding: 14px 14px;
    gap: 12px;
  }

  .ai-suggestions {
    padding: 14px 12px 10px;
    gap: 9px;
  }

  .ai-suggestion-chip {
    padding: 11px 13px;
    font-size: 12px;
    gap: 9px;
  }

  .ai-suggestion-icon {
    font-size: 15px;
  }

  .ai-input-area {
    padding: 12px 12px 12px 12px;
  }

  .ai-input {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 38px;
  }

  .ai-send-btn {
    width: 38px;
    height: 38px;
  }

  .ai-escalation-actions {
    padding: 12px;
    margin: 8px 12px;
  }

  .ai-escalate-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* Dark Mode adjustments */
html[data-theme="dark"] .ai-widget-button {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  box-shadow: 0 12px 32px rgba(129, 140, 248, 0.35), 0 0 0 0 rgba(129, 140, 248, 0.1);
}

html[data-theme="dark"] .ai-widget-button:hover {
  box-shadow: 0 16px 40px rgba(129, 140, 248, 0.4), 0 0 0 12px rgba(129, 140, 248, 0.08);
}

html[data-theme="dark"] .ai-widget-modal {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .ai-widget-header {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.08) 0%, transparent 100%);
}

html[data-theme="dark"] .ai-chat-thread {
  background: linear-gradient(to bottom, transparent 0%, rgba(129, 140, 248, 0.01) 100%);
}

html[data-theme="dark"] .ai-message-bot .ai-message-content {
  background: #1f2937;
  color: #f1f5f9;
  border-color: #374151;
}

html[data-theme="dark"] .ai-suggestions {
  background: linear-gradient(to bottom, rgba(129, 140, 248, 0.05), transparent);
}

html[data-theme="dark"] .ai-suggestion-chip {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

html[data-theme="dark"] .ai-suggestion-chip.ai-suggestion-alt2 {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

html[data-theme="dark"] .ai-suggestion-chip:hover {
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

html[data-theme="dark"] .ai-suggestion-chip.ai-suggestion-alt2:hover {
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

html[data-theme="dark"] .ai-input {
  background: #1f2937;
  color: #f1f5f9;
  border-color: #374151;
}

html[data-theme="dark"] .ai-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

html[data-theme="dark"] .ai-input-area {
  background: linear-gradient(to top, rgba(129, 140, 248, 0.02), transparent);
}

html[data-theme="dark"] .ai-escalation-actions {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(217, 119, 6, 0.05) 100%);
  border-color: rgba(217, 119, 6, 0.25);
}
