@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@400;500;600&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  /* Typographie alignée sur la console refondue : titres Spectral, UI Figtree. */
  --serif: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --ui: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f6f2ec;
  --surface: #ffffff;
  --surface-soft: #f3ede6;
  --surface-muted: #ede5db;
  --text: #1d1b19;
  --text-soft: #6b645c;
  --text-faint: #756a5f;
  --line: #e5dbcf;
  --line-strong: #d9cebf;
  --surface-raised: #fbf8f4; /* sidebar, fonds légèrement teintés (chantier 41) */
  --hover: #f4eee7;          /* état survol des boutons/cellules (chantier 41) */
  --accent: #d6ae8a;
  --accent-strong: #bb845f;
  --accent-deep: #8a6047;
  --success: #5d7b60;
  --warning: #b78558;
  --danger: #a05f58;
  --shadow: 0 18px 44px rgba(31, 24, 18, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body.workspace-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
}

/* Champs de saisie : théma-conscients par défaut. Beaucoup d'inputs n'ont
   qu'une bordure en inline (sans fond) → sans cette règle ils tombaient en
   blanc du navigateur, illisibles en mode sombre. Les styles inline plus
   spécifiques (caisse, modales) restent prioritaires. */
.workspace-body input:not([type="checkbox"]):not([type="radio"]),
.workspace-body select,
.workspace-body textarea {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: inherit;
}
.workspace-body input::placeholder,
.workspace-body textarea::placeholder { color: var(--text-faint); }
.workspace-body input:not([type="checkbox"]):not([type="radio"]):focus,
.workspace-body select:focus,
.workspace-body textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
}

/* Lien d'évitement (accessibilité clavier) : invisible jusqu'au focus. */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--accent); color: #241a10;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  font-weight: 700; text-decoration: none; transition: top 160ms ease;
}
.skip-link:focus { top: 0; outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.workspace-main:focus { outline: none; }

.workspace-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.workspace-sidebar {
  background: var(--surface-raised);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  /* La nav peut dépasser la hauteur de l'écran (15 onglets) : on rend la barre
     défilable au lieu de tronquer le bas. overscroll-behavior évite d'entraîner
     le scroll de la page quand on arrive en butée. */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.workspace-sidebar .workspace-brand { flex: none; }
.workspace-sidebar .workspace-nav { flex: 1 1 auto; }

.workspace-brand {
  position: relative; /* ancre du bouton réduire/rouvrir en haut (chantier 40) */
  padding: 10px 12px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
/* Chantier 40 : bouton haut de fermeture/réouverture de la barre latérale. */
.ws-nav-toggle-top {
  position: absolute;
  top: 6px;
  right: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.2s ease;
}
.ws-nav-toggle-top:hover { color: var(--text); background: var(--hover); }
.ws-nav-toggle-top svg { width: 17px; height: 17px; }
.workspace-logo {
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 0.9;
}
.workspace-brand span {
  display: block;
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.workspace-nav {
  display: grid;
  gap: 8px;
}
.nav-item {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}
.nav-item .nav-ic {
  flex: none;
  display: inline-flex;
  width: 19px;
  height: 19px;
  color: var(--text-soft);
}
.nav-item .nav-ic svg { width: 100%; height: 100%; }
.nav-item.active .nav-ic { color: var(--accent-strong); }
.nav-item .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--hover);
}
.nav-item.active {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

/* ----- Chantier 38 : sidebar réductible en colonne d'icônes ----- */
.ws-nav-collapse {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.ws-nav-collapse:hover { color: var(--text); background: var(--hover); border-radius: 14px; }
.ws-nav-collapse .nav-ic {
  flex: none;
  display: inline-flex;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.ws-nav-collapse .nav-ic svg { width: 100%; height: 100%; }
.workspace-brand .brand-mini {
  display: none;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  text-align: center;
}
/* Le mode réduit n'existe que lorsque la sidebar est une vraie colonne
   (au-dessus de 1180px : en dessous elle passe en bloc/tiroir mobile). */
@media (min-width: 1181px) {
  body.ws-nav-mini .workspace-shell { grid-template-columns: 86px 1fr; }
  body.ws-nav-mini .workspace-sidebar { padding: 24px 14px; }
  body.ws-nav-mini .workspace-brand { padding: 4px 0 16px; }
  body.ws-nav-mini .workspace-logo,
  body.ws-nav-mini .workspace-brand span { display: none; }
  body.ws-nav-mini .workspace-brand .brand-mini { display: block; }
  body.ws-nav-mini .nav-item,
  body.ws-nav-mini .ws-nav-collapse { justify-content: center; padding: 0; gap: 0; }
  body.ws-nav-mini .nav-item .nav-label,
  body.ws-nav-mini .ws-nav-collapse .nav-label { display: none; }
  body.ws-nav-mini .nav-item .nav-ic { width: 21px; height: 21px; }
  body.ws-nav-mini .ws-nav-collapse .nav-ic { transform: rotate(180deg); }
  /* Bouton haut : centré au-dessus des initiales, flèches inversées (rouvrir). */
  body.ws-nav-mini .ws-nav-toggle-top { position: static; margin: 0 auto 10px; display: flex; transform: rotate(180deg); }
  body.ws-nav-mini .workspace-brand { display: flex; flex-direction: column; align-items: center; }
}
@media (max-width: 1180px) {
  .ws-nav-collapse { display: none; } /* pas de mode réduit hors colonne */
  .ws-nav-toggle-top { display: none; }
}

.workspace-main {
  padding: 26px;
}

.workspace-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.workspace-kicker {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
}
.workspace-topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
}

.workspace-top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.ws-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ws-btn-outline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.ws-btn-accent {
  border: none;
  color: #2a1c12;
  background: var(--accent-strong);
}
.ws-btn-accent:hover { background: var(--accent-deep); color: #fff; }
.ws-btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-radius: 8px;
}
.ws-btn-sm + .ws-btn-sm { margin-left: 6px; }

/* --- Header (topbar) : hiérarchie claire ------------------------------------
   Action principale « Voir le site public » mise en avant (accent chaud, aplat)
   · actions secondaires (rafraîchir, cloche) en icônes discrètes · déconnexion
   en simple lien effacé. Plus d'e-mail affiché. */
.ws-btn-hero {
  border: none;
  color: #2a1c12;
  background: var(--accent);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(138, 96, 71, 0.22);
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.ws-btn-hero:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(138, 96, 71, 0.30);
}
.ws-icon-btn {
  width: 42px; height: 42px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.ws-icon-btn:hover { background: var(--hover); color: var(--text); border-color: var(--line-strong); }
.ws-icon-btn:active { transform: translateY(1px); }
.ws-icon-btn:disabled { opacity: 0.5; cursor: default; }
.ws-linkbtn {
  align-self: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-faint);
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.02em; padding: 6px 4px;
  transition: color 140ms ease;
}
.ws-linkbtn:hover { color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.ws-muted { color: var(--text-soft, #999); }

/* Puces d'options (add-ons) dans le catalogue des prestations. */
.svc-addon-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text);
  background: var(--surface-muted, #f5f2ee);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; margin: 2px 4px 2px 0;
}
.svc-addon-del {
  border: none; background: none; cursor: pointer;
  color: var(--text-soft, #999); font-size: 0.78rem; padding: 0 2px;
}
.svc-addon-del:hover { color: var(--danger); }

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.metric-card,
/* Aperçu de la photo de couverture (migration 084). Ratio 16/9 fixe : c'est le
   cadrage réel du hero, donc la patronne voit ce que verront ses clientes, et
   la carte ne saute pas quand l'image arrive. */
.ws-cover-preview {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background-color: var(--surface-soft);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-top: 12px;
}
/* Galerie de la boutique (migration 084) : vignettes carrées, bouton de
   suppression au survol/focus — jamais caché au clavier. */
.ws-gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ws-gal-item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--surface-soft);
  background-size: cover;
  background-position: center;
}
.ws-gal-del {
  position: absolute;
  top: 5px; right: 5px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(20, 16, 12, .72); color: #fff;
  font-size: 1rem; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.ws-gal-item:hover .ws-gal-del,
.ws-gal-del:focus-visible { opacity: 1; }
/* Sur écran tactile, il n'y a pas de survol : le bouton reste visible. */
@media (hover: none) { .ws-gal-del { opacity: 1; } }
.ws-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.metric-card {
  padding: 24px;
}
.metric-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.metric-card strong {
  font-size: 2.2rem;
  letter-spacing: -0.05em;
}

.ws-grid {
  display: grid;
  gap: 20px;
}
.ws-grid.cols-2 {
  grid-template-columns: 1.4fr 0.9fr;
}
.ws-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ws-card {
  padding: 24px;
}
/* Cartes KPI cliquables du tableau de bord (chantier 38) : plus aucune case
   « morte » — le curseur, le survol et le focus disent qu'on peut cliquer. */
.kpi-card { padding: 18px 16px; }
.kpi-nav { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; }
.kpi-nav:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 22px 48px rgba(31, 24, 18, 0.1);
}
.kpi-nav:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.ws-card h2,
.ws-card h3 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}
.ws-subtitle {
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.8;
}

.ws-list {
  display: grid;
  gap: 12px;
}
.ws-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 18px;
}
.ws-item strong {
  display: block;
  margin-bottom: 6px;
}
.ws-item span {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.ws-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ws-slot-col {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.ws-slot-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
}
.ws-slot {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid #ece3d8;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.ws-slot.ok {
  background: #edf5ee;
  border-color: #cfe0d2;
}
.ws-slot.busy {
  background: #f5efea;
}

.ws-table {
  width: 100%;
  border-collapse: collapse;
}
/* Grands tableaux : défilement horizontal DANS leur conteneur (jamais la page
   entière), pour l'usage mobile au comptoir. Sur écran étroit, le tableau
   garde des colonnes lisibles et défile au lieu d'être écrasé. */
.ws-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  .ws-table-scroll > .ws-table { min-width: max-content; }
}

/* ===================================================================
   BACK-OFFICE AU DOIGT (2 août 2026). La patronne travaille debout, au
   comptoir, souvent d'une seule main. Mesuré avant la correction : champs
   et boutons entre 37 et 39 px de haut, sous le minimum tactile.
   44 px = minimum Apple HIG / WCAG 2.5.8 « Target Size ». 16 px sur les
   champs = seul moyen d'empêcher iOS Safari de zoomer à la mise au point ;
   c'est ce zoom qui donne l'impression que l'écran « saute » quand on tape.
   =================================================================== */
@media (max-width: 860px) {
  .workspace-body input, .workspace-body select, .workspace-body textarea,
  .ws-btn, .ws-form input, .ws-form select, .ws-form textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .ws-btn { padding-left: 18px; padding-right: 18px; }
  /* Deux actions côte à côte doivent pouvoir passer à la ligne plutôt que
     de se serrer jusqu'à se toucher au doigt. */
  .ws-actions, .ws-card-actions { gap: 10px; flex-wrap: wrap; }
  /* Plancher de lisibilité : les sous-titres descendaient sous 12 px. */
  .ws-subtitle, .ws-meta, .ws-badge { font-size: .8rem; }
}
.ws-table th,
.ws-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}
.ws-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

/* Tableaux d'administration éditables (Prestations, Équipe). */
.admin-tbl td { padding: 8px 10px; vertical-align: middle; }
.admin-tbl input[type="text"],
.admin-tbl input[type="number"],
.admin-tbl input[type="time"],
.admin-tbl input:not([type]) {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 9px;
  font-size: 14px;
  font-family: inherit;
}
.admin-tbl .svc-desc-row td { padding-top: 0; border-bottom: 1px solid var(--line); }
.admin-tbl tr.svc-off input { opacity: 0.55; }
.admin-tbl tr.svc-off td:first-child::before { content: '⏻ '; color: var(--text-faint); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* Jeu de badges unique et tokenisé. Fonds en teintes translucides
   théma-agnostiques (lisibles clair ET sombre sans règle dédiée), texte via
   les tokens sémantiques. Remplace les anciens systèmes rv-tag-* / po-* . */
.badge.neutral { background: rgba(140, 128, 110, 0.16); color: var(--text-soft); }
.badge.ok { background: rgba(93, 123, 96, 0.16); color: var(--success); }
.badge.wait { background: rgba(183, 133, 88, 0.17); color: var(--warning); }
.badge.alert { background: rgba(160, 95, 88, 0.16); color: var(--danger); }

.ws-form {
  display: grid;
  gap: 14px;
}
.ws-form input,
.ws-form select,
.ws-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 16px;
}
.ws-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* ------------------------------------------------------------------ */
/* Listes déroulantes maison (chantier 47) — le menu natif du système  */
/* ignorait la DA du salon ; ici bouton + popover 100 % thémés.        */
/* ------------------------------------------------------------------ */
.uisel-native { display: none !important; }
.uisel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.uisel-btn:hover:not(:disabled) { border-color: var(--accent-strong); }
.uisel-btn:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.uisel-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.uisel-btn .uisel-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uisel-btn.is-placeholder .uisel-label { color: var(--text-soft); }
.uisel-caret {
  flex: none;
  font-size: 0.72rem;
  color: var(--accent-strong);
  transition: transform 0.15s ease;
}
/* Le popover, dans la DA du salon (même famille que le mini-calendrier). */
.uisel-pop {
  position: absolute;
  z-index: 1600; /* au-dessus des modals (1500) et du plein écran (1400) */
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(31, 24, 18, 0.2);
  overflow: hidden;
  animation: agDpIn 0.14s ease-out;
}
.uisel-search { padding: 8px; border-bottom: 1px solid var(--line); }
.uisel-search input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
}
.uisel-list {
  max-height: 288px;
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 2px;
}
.uisel-group {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.uisel-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.uisel-opt:hover:not(:disabled), .uisel-opt.is-active { background: var(--hover); }
.uisel-opt.is-sel {
  background: var(--accent);
  color: #3a2a1c;
  font-weight: 700;
}
.uisel-opt:disabled { opacity: 0.45; cursor: not-allowed; }
.uisel-opt .uisel-opt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uisel-opt .uisel-opt-sub {
  flex: none;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.uisel-opt.is-sel .uisel-opt-sub { color: inherit; opacity: 0.75; }
.uisel-empty { padding: 14px 12px; font-size: 0.85rem; color: var(--text-soft); text-align: center; }
[data-theme="dark"] .uisel-pop { box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .uisel-opt.is-sel { color: #241a10; }

.ws-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Ligne de champs côte à côte dans un formulaire de paramètres. */
.ws-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.ws-form-row:has(> label:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .ws-form-row { grid-template-columns: 1fr; } }

/* Horaires d'ouverture : une ligne par jour. */
.ws-hours { display: grid; gap: 8px; }
.ws-hour-row {
  display: grid;
  grid-template-columns: 90px auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.ws-hour-row input[type="time"] { width: 100%; }
.ws-hour-day { font-weight: 600; font-size: .92rem; }
.ws-hour-closed {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; color: var(--text-soft); white-space: nowrap;
}
.ws-hour-row:has(.set-hc:checked) input[type="time"] { opacity: .4; pointer-events: none; }
@media (max-width: 560px) {
  .ws-hour-row { grid-template-columns: 1fr 1fr; }
  .ws-hour-day { grid-column: 1 / -1; }
}

/* Chantier D — horaires multi-plages (écran Paramètres uniquement, modificateur
   .ws-hours-multi). Chaque jour est un groupe : ligne principale (jour + Fermé
   + 1re plage + « + ») puis N lignes de plage supplémentaires (« × »). Le
   placeholder « Fermé » invisible des lignes extra garde les colonnes alignées. */
.ws-hours-multi .ws-hour-grp { display: grid; gap: 6px; }
.ws-hours-multi .ws-hour-row { grid-template-columns: 90px auto 1fr auto 1fr 30px; }
.ws-hour-ph { visibility: hidden; }
.ws-hour-plus, .ws-hour-del {
  width: 30px; height: 30px; justify-self: end;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font-size: 1rem; line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.ws-hour-plus:hover, .ws-hour-del:hover { background: var(--hover); color: var(--text); border-color: var(--line-strong); }
/* Jour coché « Fermé » : tout le groupe (plages extra et boutons compris) est estompé. */
.ws-hour-grp:has(.set-hc:checked) input[type="time"],
.ws-hour-grp:has(.set-hc:checked) .ws-hour-plus,
.ws-hour-grp:has(.set-hc:checked) .ws-hour-del { opacity: .4; pointer-events: none; }
@media (max-width: 560px) {
  .ws-hours-multi .ws-hour-row { grid-template-columns: auto 1fr auto 1fr 30px; }
  /* Ligne extra : le libellé de jour vide disparaît (sinon il occuperait une
     rangée à lui seul) ; le placeholder « Fermé » invisible garde l'alignement. */
  .ws-hours-multi .ws-hour-extra .ws-hour-day { display: none; }
}

/* Groupes de cases à cocher (canaux, langues). */
.ws-checks { display: flex; flex-wrap: wrap; gap: 14px; }
.ws-check {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .9rem; cursor: pointer;
}
.ws-check input { width: auto; }

/* Lien discret « + Nouvelle cliente » dans le modal RDV. */
.ws-link-btn {
  justify-self: start;
  background: none;
  border: none;
  padding: 0;
  margin: -6px 0 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent, #a9743f);
  cursor: pointer;
}
.ws-link-btn:hover { text-decoration: underline; }
.ag-newclient {
  align-items: flex-end;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(0,0,0,0.02);
}
.ag-newclient[hidden] { display: none; }

@media (max-width: 1180px) {
  .workspace-shell,
  .workspace-metrics,
  .ws-grid.cols-2,
  .ws-grid.cols-3,
  .ws-slot-grid {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 760px) {
  .workspace-main {
    padding: 16px;
  }

  .workspace-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-top-actions {
    flex-direction: column;
  }

  .ws-btn {
    width: 100%;
  }
}

/* Ajout : label utilisateur dans la topbar admin */
.workspace-user-label {
  font-size: 13px;
  color: var(--text-soft);
  margin-right: 8px;
  align-self: center;
}

/* Horloge temps réel (heure exacte du salon). */
.workspace-clock {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.15;
  align-self: center;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}
.workspace-clock .ws-clock-time {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.workspace-clock .ws-clock-date {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: capitalize;
}
@media (max-width: 720px) {
  .workspace-clock { border-right: none; align-items: flex-start; padding-right: 0; }
}

/* Cloche de notifications (topbar). */
.ws-bell-wrap { position: relative; align-self: center; }
.ws-bell { position: relative; }
.ws-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger, #c0392b);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.ws-bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-width: 88vw;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
  z-index: 60;
  overflow: hidden;
}
.ws-bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text);
}
.ws-bell-head button {
  border: none;
  background: none;
  color: var(--accent-deep);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.ws-bell-head button:hover { text-decoration: underline; }
.ws-bell-list { max-height: 360px; overflow-y: auto; }
.ws-bell-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-soft);
}
.ws-bell-item:last-child { border-bottom: none; }
.ws-bell-item strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.ws-bell-item.unread { background: color-mix(in srgb, var(--accent, #d6ae8a) 10%, transparent); }
.ws-bell-item.unread strong::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  vertical-align: 1px;
}
.ws-bell-item time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-soft);
}
.ws-bell-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--text-soft); }

/* =====================================================================
   AGENDA PROFESSIONNEL (vue jour + semaine)
   ===================================================================== */
.agenda-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.agenda-toolbar .spacer { flex: 1; }
.agenda-seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
}
.agenda-seg button {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-soft);
}
.agenda-seg button.active {
  background: var(--accent);
  color: #2a1c12;
}
/* Barre allégée : rangée 1 (date + actions), rangée 2 (vues), rangée 3 filtres
   repliable et visuellement détachée. */
.agenda-bar-main { margin-bottom: 12px; }
.agenda-bar-views { margin-bottom: 14px; }
.agenda-filters {
  margin-top: -4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  gap: 10px;
}
/* Bouton « Filtres » (repli/déplie la rangée de filtres). */
.agenda-tool-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 42px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: transparent; color: var(--text-soft);
  font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.agenda-tool-btn:hover { background: var(--hover); color: var(--text); border-color: var(--line-strong); }
.agenda-tool-btn.has-active { border-color: var(--accent-strong); color: var(--text); }
.agenda-filter-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent-strong); color: #2a1c12;
  font-size: 0.7rem; font-weight: 700;
}
.agenda-datenav { align-items: stretch; }
.agenda-datenav [data-ag-prev],
.agenda-datenav [data-ag-next] { font-size: 1.2rem; padding: 0 16px; line-height: 1; }
.agenda-datenav .agenda-date-btn {
  border-radius: 0;
  padding: 4px 18px;
  min-height: 42px;
  background: transparent;
}
.agenda-datenav .agenda-date-btn .agenda-date-label { color: var(--text); }
.agenda-today-btn { color: var(--text-soft); font-size: 0.85rem; }
.agenda-today-btn:hover:not(:disabled) { color: var(--text); }
/* Sélecteur de format de planning (Calendrier / Kanban / Liste / …). */
.agenda-formats {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.agenda-formats button {
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text-soft);
}
.agenda-formats button + button { border-left: 1px solid var(--line); }
.agenda-formats button.active {
  background: var(--accent);
  color: #2a1c12;
}
/* Carte de RDV réutilisable (Kanban, Collaboratrices) — aérée (chantier 40). */
.appt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid #9a8f82;
  border-radius: 12px;
  padding: 13px 15px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
/* Puce de date sur les cartes quand la période couvre plusieurs jours. */
.appt-card-date {
  display: inline-block;
  background: var(--surface-muted, #f6f1ea);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  margin-right: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: capitalize;
}
.appt-card:hover { box-shadow: 0 6px 16px rgba(31,24,18,0.12); transform: translateY(-1px); }
.appt-card.status-ANNULE { opacity: 0.55; }
.appt-card.status-NO_SHOW { border-left-color: #c0603f; }
.appt-card.status-TERMINE { border-left-color: #5c8c7a; }
.appt-card-time { font-weight: 700; font-size: 0.82rem; color: var(--text-soft); }
.appt-card-client { font-weight: 700; font-size: 0.98rem; margin: 2px 0; }
.appt-card-svc { font-size: 0.86rem; color: var(--text-soft); }
.appt-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.appt-card-emp { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-soft); }
.appt-card-actions { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.ws-btn-sm { padding: 5px 9px; font-size: 0.72rem; min-height: 0; }
/* Format KANBAN : colonnes par statut — aéré (chantier 40). */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.kanban-col {
  background: var(--surface-muted, #f6f1ea);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  min-height: 120px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.kanban-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.78rem;
}
.kanban-col-body { display: flex; flex-direction: column; gap: 12px; }
.kanban-empty { color: var(--text-soft); font-size: 0.85rem; text-align: center; padding: 18px 4px; }
/* Format PAR COLLABORATRICE : une colonne-liste par personne — aéré. */
.staff-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.staff-col {
  flex: 0 0 290px;
  background: var(--surface-muted, #f6f1ea);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.staff-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.staff-col-head .agenda-emp-dot { flex: none; }
.staff-col-sched { font-size: 0.78rem; color: var(--text-soft); font-weight: 600; }
.staff-col-count { margin-left: auto; font-size: 0.78rem; color: var(--text-soft); }
.staff-col-body { display: flex; flex-direction: column; gap: 12px; }
.staff-empty { color: var(--text-soft); font-size: 0.85rem; text-align: center; padding: 18px 4px; }
/* Format TIMELINE horizontale : frise par collaboratrice — aérée. */
.tl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tl-board { position: relative; min-width: 720px; }
.tl-ruler { position: relative; height: 26px; border-bottom: 1px solid var(--line); margin-left: 160px; }
/* Sections par jour (mode Semaine/Mois/Année de la timeline). */
.tl-day { border-bottom: 1px solid var(--line); }
.tl-day:last-child { border-bottom: none; }
.tl-day-head {
  padding: 12px 14px 10px;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  color: var(--text-soft);
  background: var(--surface-muted, #f6f1ea);
  border-bottom: 1px solid var(--line);
  position: sticky;
  left: 0;
}
.tl-hour {
  position: absolute;
  top: 0;
  font-size: 0.72rem;
  color: var(--text-soft);
  transform: translateX(-50%);
  border-left: 1px solid var(--line);
  padding-left: 4px;
  height: 100%;
}
.tl-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 64px; }
.tl-row:last-child { border-bottom: none; }
.tl-row-head {
  flex: 0 0 160px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  border-right: 1px solid var(--line);
  background: var(--surface-muted, #f6f1ea);
}
.tl-row-track { position: relative; flex: 1; }
.tl-appt {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background: linear-gradient(180deg, #efb083, #de9467);
  border-radius: 10px;
  padding: 7px 10px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(31,24,18,0.15);
}
.tl-appt.status-ANNULE { opacity: 0.5; }
/* NO_SHOW / TERMINE : le fond suit la couleur employée (inline) ; on les
   distingue par une opacité réduite (les anciens dégradés étaient écrasés). */
.tl-appt.status-NO_SHOW, .tl-appt.status-TERMINE { opacity: 0.65; }
.tl-appt-time { font-size: 0.7rem; font-weight: 700; opacity: 0.92; }
.tl-appt-client { font-size: 0.8rem; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #d64a3f; z-index: 3; }
/* --- Chantier 40 : temps libre (cases vertes) ------------------------------ */
/* Segment libre dans la timeline : cliquer = créer un RDV sur le trou. */
.tl-free {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border: 1.5px dashed var(--success);
  background: rgba(93, 170, 125, 0.14);
  border-radius: 10px;
  color: var(--success);
  font-weight: 700;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s;
}
.tl-free:hover { background: rgba(93, 170, 125, 0.26); }
/* Bloc libre dans la grille Jour (colonne collaboratrice). */
.agenda-free {
  position: absolute;
  left: 3px;
  right: 3px;
  border: 1.5px dashed var(--success);
  background: rgba(93, 170, 125, 0.14);
  border-radius: 10px;
  color: var(--success);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  z-index: 1;
  overflow: hidden;
  font-family: inherit;
  transition: background 0.15s;
}
.agenda-free:hover { background: rgba(93, 170, 125, 0.26); }
.agenda-free .af-time { font-weight: 800; font-size: 0.78rem; }
.agenda-free .af-dur { font-weight: 600; font-size: 0.72rem; opacity: 0.85; }
/* Créneau libre trop bas pour deux lignes : une seule ligne compacte. */
.agenda-free.is-thin { flex-direction: row; gap: 6px; }
.agenda-free.is-thin .af-time { font-size: 0.72rem; }
.agenda-free.is-thin .af-dur { display: none; }
/* Carte libre dans la vue Collaboratrices. */
.free-card {
  border: 1.5px dashed var(--success);
  background: rgba(93, 170, 125, 0.12);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}
.free-card:hover { background: rgba(93, 170, 125, 0.24); }
.free-card .af-time { font-weight: 800; font-size: 0.86rem; }
.free-card .af-dur { font-weight: 600; font-size: 0.78rem; opacity: 0.85; }
/* --- Chantier 40 : ligne de filtres de la toolbar --------------------------- */
.ag-filter-q {
  flex: 1 1 220px;
  max-width: 320px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
}
.ag-filter-q:focus { outline: 2px solid rgba(92, 140, 122, 0.45); outline-offset: 1px; }
.ag-filter-svc {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  max-width: 240px;
  cursor: pointer;
}
.ag-free-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ag-free-btn .ag-free-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px dashed var(--success);
  background: rgba(93, 170, 125, 0.25);
}
.ag-free-btn:hover { border-color: var(--success); color: var(--success); }
.ag-free-btn.active {
  background: var(--success);
  border-color: var(--success);
  color: #17271a;
}
.ag-free-btn.active .ag-free-dot { border-color: rgba(0,0,0,0.45); background: rgba(0,0,0,0.18); }
.ag-filter-clear {
  min-height: 42px;
  padding: 0 13px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: underline;
  cursor: pointer;
}
.ag-filter-clear:hover { color: var(--text); }
@media (max-width: 720px) {
  .kanban-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-formats button { padding: 9px 10px; font-size: 0.72rem; }
}
/* RDV en sous-colonne (chevauchement) : bord marqué + padding resserré. */
.agenda-appt.is-split { padding-left: 6px; padding-right: 6px; box-shadow: 0 4px 12px rgba(31,24,18,0.18); }
.agenda-appt.is-split .a-svc { display: none; }
.agenda-nav-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.agenda-nav-btn:hover { background: var(--hover); }
.agenda-nav-btn:disabled { opacity: 0.4; cursor: default; }
/* Navigation temporelle groupée (‹ Aujourd'hui ›) : même langage visuel que
   les autres groupes segmentés de la barre. */
.agenda-nav {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface);
}
.agenda-nav button {
  border: none;
  background: transparent;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-soft);
  cursor: pointer;
}
.agenda-nav button + button { border-left: 1px solid var(--line); }
.agenda-nav button:hover { background: var(--hover); color: var(--text); }
.agenda-nav button:disabled { opacity: 0.4; cursor: default; background: transparent; }
/* Bouton-date : ouvre le mini-calendrier maison (plus d'input natif). */
.agenda-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 10px;
}
.agenda-date-btn:hover { background: var(--hover); }
.agenda-date-label {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-transform: capitalize;
  line-height: 1.1;
}
.agenda-date-caret { font-size: 0.7rem; color: var(--text-soft); }
/* Champ date des formulaires (ex. modal Nouveau RDV) : bouton qui ouvre le
   mini-calendrier maison — même rendu qu'un input, plus de widget natif. */
.ag-date-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.ag-date-field:hover { background: var(--hover); }
.ag-date-field-label { text-transform: capitalize; }
/* Mini-calendrier (popover) */
.ag-datepop {
  position: absolute;
  /* Au-dessus du plein écran agenda (1400) ET des modals .ws-overlay (1500) :
     le champ date du modal Nouveau RDV ouvre ce même popover (chantier 45). */
  z-index: 1600;
  width: 292px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(31,24,18,0.2);
  padding: 12px;
  animation: agDpIn 0.14s ease-out;
}
@keyframes agDpIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ag-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ag-dp-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: capitalize;
}
.ag-dp-nav {
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
}
.ag-dp-nav:hover { background: var(--hover); color: var(--text); }
.ag-dp-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.ag-dp-dows span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  padding: 4px 0;
}
.ag-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ag-dp-cell {
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.ag-dp-cell:hover { background: var(--hover); }
.ag-dp-cell.is-void { pointer-events: none; }
.ag-dp-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--accent-strong, #b06f3f); }
.ag-dp-cell.is-sel { background: var(--accent-strong); color: #2a1c12; font-weight: 800; }
.ag-dp-cell.is-sel:hover { background: var(--accent-deep); }
.ag-dp-today {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.ag-dp-today:hover { background: var(--hover); }

/* ----- vue jour : colonnes par collaboratrice ----- */
.agenda-day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.agenda-head-row {
  display: grid;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 3;
}
.agenda-head-gutter { border-right: 1px solid var(--line); }
.agenda-emp-head {
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.agenda-emp-head:last-child { border-right: none; }
.agenda-emp-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.agenda-emp-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.agenda-emp-sub {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.agenda-body {
  display: grid;
  position: relative;
}
.agenda-gutter {
  border-right: 1px solid var(--line);
  position: relative;
}
.agenda-hour-label {
  position: absolute;
  right: 8px;
  font-size: 0.72rem;
  color: var(--text-faint);
  transform: translateY(-6px);
  font-weight: 600;
}
.agenda-col {
  position: relative;
  border-right: 1px solid var(--line);
}
.agenda-col:last-child { border-right: none; }
/* Colonne survolée pendant un glisser de RDV : cible mise en évidence. */
.agenda-col.drop-target { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--accent-strong); }
.agenda-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #f0e9df;
  pointer-events: none;
}
.agenda-offhours {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    45deg, #f6f1ea, #f6f1ea 6px, #f1e9df 6px, #f1e9df 12px);
  pointer-events: none;
}
.agenda-break {
  position: absolute;
  left: 3px;
  right: 3px;
  background: rgba(180, 160, 140, 0.14);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.agenda-col.is-off .agenda-off-label {
  position: absolute;
  top: 12px;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.agenda-appt {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 10px;
  padding: 6px 9px;
  color: #fff;
  overflow: hidden;
  cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10), 0 6px 16px rgba(31, 24, 18, 0.14);
  border: 1px solid rgba(255,255,255,0.45);
  font-size: 0.8rem;
  line-height: 1.3;
  z-index: 2;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  /* Empêche le scroll de la page pendant un glisser tactile (tablette). */
  touch-action: none;
}
.agenda-appt:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(31,24,18,0.22); }
.agenda-appt.dragging { opacity: 0.6; cursor: grabbing; z-index: 10; }
/* Nom du client = information prioritaire : toujours en première ligne, jamais coupé net. */
.agenda-appt .a-client {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-appt .a-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--appt-faint, rgba(255,255,255,0.9));
  margin-top: 1px;
}
.agenda-appt .a-time { font-weight: 700; flex: 0 0 auto; }
.agenda-appt .a-svc { overflow: hidden; text-overflow: ellipsis; }
/* Bloc trop court pour trois lignes : on ne garde que le nom (+ heure au survol via title). */
.agenda-appt.is-compact { padding: 3px 8px; }
.agenda-appt.is-compact .a-meta { display: none; }
.agenda-appt.status-ANNULE { opacity: 0.5; text-decoration: line-through; }
/* RDV annulé = ruban discret à droite de la colonne (largeur posée en inline) :
   il reste consultable au clic mais ne recouvre plus créneaux libres ni RDV actifs. */
.agenda-appt.is-ghost {
  z-index: 1;
  border-style: dashed;
  box-shadow: none;
  filter: saturate(0.55);
}
.agenda-appt.is-ghost .a-meta { display: none; }
.agenda-appt.is-ghost .agenda-appt-resize { display: none; }
.agenda-appt.status-TERMINE::after {
  content: '✓'; position: absolute; top: 4px; right: 6px; font-size: 0.7rem; opacity: 0.85;
}
.agenda-appt.resizing { opacity: 0.92; z-index: 10; box-shadow: 0 10px 24px rgba(31,24,18,0.28); }
.agenda-appt-resize {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12px;
  cursor: ns-resize;
  z-index: 3;
  touch-action: none;
}
.agenda-appt-resize::after {
  content: ''; position: absolute; left: 50%; bottom: 3px;
  width: 28px; height: 4px; transform: translateX(-50%);
  border-radius: 3px; background: rgba(255,255,255,0.45);
  transition: background 0.12s, width 0.12s;
}
.agenda-appt:hover .agenda-appt-resize::after { background: rgba(255,255,255,0.95); width: 36px; }
/* Bulle live pendant l'étirement : « → 15:30 · 75 min ». */
.agenda-resize-tip {
  position: absolute;
  right: 4px; bottom: 14px;
  background: rgba(24, 18, 12, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 12;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ----- panneau d'édition d'un RDV ----- */
.appt-edit-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.appt-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--text-soft, #6b5f52); }
.appt-edit-form input, .appt-edit-form select, .appt-edit-form textarea {
  font: inherit; font-weight: 500; color: var(--text, #241c14);
  padding: 8px 10px; border: 1px solid var(--line, #e2d8cc); border-radius: 8px; background: var(--surface);
}
.appt-edit-form textarea { resize: vertical; }
/* Dans les formulaires compacts, le bouton-liste s'aligne sur les inputs. */
.appt-edit-form .uisel-btn { padding: 8px 10px; border-radius: 8px; border-color: var(--line, #e2d8cc); font-weight: 500; }
.ws-toolbar .uisel-btn, .agenda-toolbar .uisel-btn, td .uisel-btn { padding: 8px 12px; border-radius: 10px; width: auto; }
/* Le filtre prestation s'aligne sur les autres contrôles de la barre agenda. */
.agenda-toolbar .uisel-btn { min-height: 42px; padding: 0 12px; border-radius: 11px; border-color: var(--line-strong); max-width: 240px; font-size: 0.88rem; }
.appt-edit-client {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-muted, #f6f0e8);
  font-weight: 700; margin-bottom: 4px;
}
.appt-edit-actions { display: flex; gap: 10px; margin-top: 6px; }
.appt-edit-actions .ws-btn { flex: 1; }
#ae-del { color: var(--danger); border-color: var(--line-strong); }

/* Messages IA — liste des conversations */
.chat-row { cursor: pointer; }
.chat-row:hover { background: var(--surface-muted, #f6f0e8); }
.chat-preview {
  color: var(--text-soft);
  font-size: 13px;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-channel-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-muted, #f6f0e8);
}

/* Messages IA — transcript */
.chat-thread {
  display: flex; flex-direction: column; gap: 12px;
  padding: 4px 2px 8px;
}
.chat-msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.chat-msg-who {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-soft);
}
.chat-msg-bubble {
  padding: 10px 14px; border-radius: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.is-user { align-self: flex-end; align-items: flex-end; }
.chat-msg.is-user .chat-msg-bubble {
  background: var(--accent, #b8895b); color: #fff; border-bottom-right-radius: 4px;
}
.chat-msg.is-assistant { align-self: flex-start; align-items: flex-start; }
.chat-msg.is-assistant .chat-msg-bubble {
  background: var(--surface-muted, #f6f0e8); color: var(--text, #2a231c);
  border-bottom-left-radius: 4px;
}
.chat-msg.is-system { align-self: center; align-items: center; }
.chat-msg.is-system .chat-msg-bubble {
  background: transparent; color: var(--text-soft);
  font-size: 12px; font-style: italic;
}
.chat-msg-time { font-size: 11px; color: var(--text-soft); }

/* Avis clients — modération */
.rv-stars { white-space: nowrap; }
.rv-star { color: #d9cdbb; font-size: 15px; letter-spacing: 1px; }
.rv-star.on { color: #d1a53c; }
.rv-is-hidden { opacity: .55; }
.wl-notified { opacity: .55; }
/* Réponse du salon sous un avis (workspace). */
.rv-response {
  margin-top: 8px; padding: 8px 10px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.86rem; color: var(--text-soft); line-height: 1.45;
}
.rv-response strong { color: var(--text); }
/* rv-tag-* et po-* supprimés : unifiés sur le jeu .badge (voir plus haut). */
.call-row { cursor: pointer; }
.call-actions { margin: 8px 0 0; padding-left: 18px; }
.call-actions li { margin: 4px 0; }
.call-actions .ok { color: #2e7d43; }
.call-actions .ko { color: #b3503f; }
.agenda-now {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid #d23b3b;
  z-index: 5;
  pointer-events: none;
  transition: top .5s linear;
}
.agenda-now::before {
  content: '';
  position: absolute;
  left: -4px; top: -5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #d23b3b;
}
/* Segments de la ligne « maintenant » hors colonne du jour : même trait,
   sans pastille — la ligne traverse tout le calendrier d'un seul tenant. */
.agenda-now[data-dim] { border-top-color: rgba(210, 59, 59, 0.55); }
.agenda-now[data-dim]::before { display: none; }
/* Dans la gouttière : pas de trait, seulement l'étiquette de l'heure. */
.agenda-gutter .agenda-now { border-top-color: transparent; }
.agenda-gutter .agenda-now::before { display: none; }
.agenda-drop-hint {
  position: absolute; left: 4px; right: 4px;
  border: 2px dashed var(--accent-strong);
  border-radius: 10px;
  background: rgba(214,174,138,0.14);
  z-index: 4; pointer-events: none;
}
/* Créneau libre : fantôme vert. Créneau déjà pris : fantôme orange (le dépôt
   proposera d'écraser / déplacer quand même). */
.agenda-drop-hint.is-free { border-color: var(--success); background: rgba(93,123,96,0.15); }
.agenda-drop-hint.is-free .agenda-drop-time { color: #fff; background: var(--success); }
.agenda-drop-hint.is-taken { border-color: var(--warning); background: rgba(183,133,88,0.18); }
.agenda-drop-hint.is-taken .agenda-drop-time { color: #2a1c12; background: var(--warning); }
/* Heure cible affichée dans le fantôme pendant le glisser-déposer. */
.agenda-drop-time {
  position: absolute;
  top: 2px; left: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-strong, #b06f3f);
  background: rgba(255,255,255,0.92);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
/* Confirmation de déplacement : ligne « prévenir la cliente ». */
.ag-notify-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.ag-notify-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent-strong); cursor: pointer; }
.ag-notify-hint { margin: 0 0 4px 28px; font-size: 0.78rem; color: var(--text-soft); }
/* Avertissement de double réservation (déplacement sur un créneau occupé). */
.ag-overlap-warn {
  margin: 4px 0 12px; padding: 10px 12px; font-size: 0.86rem; line-height: 1.45;
  border-radius: 10px; color: var(--text);
  background: rgba(183,133,88,0.15); border: 1px solid rgba(183,133,88,0.4);
}
.ws-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ws-btn-danger:hover { filter: brightness(1.06); }

/* ----- vue semaine : grille horaire (7 jours) ----- */
.agenda-week-grid .agenda-body { overflow-x: auto; }
.agenda-wk-head { cursor: pointer; text-align: center; }
.agenda-wk-head.today { background: rgba(187,132,95,0.12); border-radius: 8px 8px 0 0; }
.agenda-wk-head.today .agenda-emp-name { color: var(--accent-strong); }
.agenda-wk-head:hover .agenda-emp-name { text-decoration: underline; }
/* Chantier 56 : lisibilité de la semaine chargée. Taille de police plancher
   (le nom et l'heure restent lisibles même en sous-colonne) + padding resserré
   pour les cartes en sous-colonnes étroites. */
.agenda-week-grid .agenda-appt { font-size: max(0.76rem, 11px); }
.agenda-week-grid .agenda-appt .a-client { font-size: max(0.78rem, 12px); }
.agenda-week-grid .agenda-appt.is-split { padding-left: 5px; padding-right: 5px; }
/* Survol : la carte passe au premier plan et s'étale sur toute la colonne du
   jour → le nom complet (tronqué en sous-colonne) devient lisible. Le title
   (tooltip natif) donne en plus heure · client · prestation · collaborateur.
   !important nécessaire : left/width sont posés en style inline par le rendu. */
.agenda-week-grid .agenda-appt:hover {
  z-index: 9;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 12px 28px rgba(31,24,18,0.28);
}
.agenda-week-grid .agenda-appt.is-split:hover {
  left: 1px !important;
  width: calc(100% - 4px) !important;
  right: auto !important;
}
.agenda-week-grid .agenda-appt.is-split:hover .a-svc { display: inline; }
/* Badge « +N » : RDV masqués au-delà de 3 sous-colonnes — clic = vue Jour. */
.agenda-wk-more {
  position: absolute;
  right: 2px;
  z-index: 6;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31,24,18,0.18);
}
.agenda-wk-more:hover { background: var(--hover); border-color: var(--accent-strong); }

/* ----- vue semaine (ancienne grille résumé, conservée pour compat) ----- */
.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.agenda-week-day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-height: 180px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.1s ease;
}
.agenda-week-day:hover { border-color: var(--accent); }
.agenda-week-day.today { border-color: var(--accent-strong); box-shadow: 0 0 0 2px rgba(187,132,95,0.25), var(--shadow); }
.agenda-week-day.closed { background: repeating-linear-gradient(45deg,#f6f1ea,#f6f1ea 6px,#f1e9df 6px,#f1e9df 12px); }
.agenda-week-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.agenda-week-dow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; }
.agenda-week-num { font-family: var(--serif); font-size: 1.5rem; }
.agenda-week-count { font-size: 0.72rem; color: var(--text-soft); margin-bottom: 8px; }
.agenda-week-chip {
  font-size: 0.72rem;
  padding: 4px 7px;
  border-radius: 7px;
  color: #fff;
  margin-bottom: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.agenda-week-more { font-size: 0.72rem; color: var(--text-soft); }

/* ----- badge remplissage (vue jour) ----- */
.agenda-emp-fill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(140, 128, 110, 0.16);
  color: var(--text-soft);
  vertical-align: middle;
}
.agenda-emp-fill.is-high { background: rgba(183, 133, 88, 0.17); color: var(--warning); }
.agenda-emp-fill.is-full { background: rgba(160, 95, 88, 0.16); color: var(--danger); }

/* ----- ligne « maintenant » : étiquette d'heure ----- */
.agenda-now-label {
  position: absolute;
  left: 2px; top: -9px;
  background: #d23b3b;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.3;
  pointer-events: none;
}

/* ----- vue mois ----- */
.agenda-month {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.agenda-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.agenda-month-dow {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
}
.agenda-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.agenda-month-day {
  min-height: 92px;
  padding: 8px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}
.agenda-month-day:nth-child(7n) { border-right: none; }
.agenda-month-day:hover { background: var(--surface-muted, #f6f0e8); }
.agenda-month-day.out { background: var(--surface-raised); }
.agenda-month-day.out .agenda-month-num { color: var(--text-faint); }
.agenda-month-day.closed { background: repeating-linear-gradient(45deg,#f6f1ea,#f6f1ea 6px,#f1e9df 6px,#f1e9df 12px); }
.agenda-month-day.today { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.agenda-month-num { font-family: var(--serif); font-size: 1.25rem; }
.agenda-month-bar {
  margin-top: 8px; height: 6px; border-radius: 999px;
  background: var(--accent-strong);
}
.agenda-month-count { margin-top: 5px; font-size: 0.72rem; font-weight: 700; color: var(--text-soft); }
.agenda-month-closed { margin-top: 8px; font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
/* Mode « Temps libre » : temps disponible cumulé du jour (badge vert). */
.agenda-month-free {
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #2e7d4f;
  background: rgba(58, 154, 90, 0.12);
  border: 1px solid rgba(58, 154, 90, 0.35);
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-block;
}
[data-theme="dark"] .agenda-month-free { color: #7dd0a0; background: rgba(58, 154, 90, 0.14); }

/* ----- vue année ----- */
.agenda-year {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .agenda-year { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .agenda-year { grid-template-columns: repeat(2, 1fr); } }
.agenda-year-month {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 12px;
}
.agenda-year-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-bottom: 8px;
  cursor: pointer;
}
.agenda-year-title:hover { color: var(--accent-strong); }
.agenda-year-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.ay-d {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  border-radius: 5px;
  color: var(--text-soft);
  cursor: pointer;
}
.ay-d.empty { visibility: hidden; cursor: default; }
.ay-d.lvl-0:hover { background: var(--surface-muted, #f6f0e8); }
.ay-d.lvl-1 { background: #f3e5d6; }
.ay-d.lvl-2 { background: #e6c39c; color: #4a3a2a; }
.ay-d.lvl-3 { background: var(--accent-strong); color: #fff; }
.ay-d.today { box-shadow: inset 0 0 0 2px #d23b3b; font-weight: 700; }
/* Mode « Temps libre » : teinte verte = capacité restante du jour. */
.ay-d.fr-0:hover { background: var(--surface-muted, #f6f0e8); }
.ay-d.fr-1 { background: #ddefe2; }
.ay-d.fr-2 { background: #a9d8b8; color: #1f4a30; }
.ay-d.fr-3 { background: #3a9a5a; color: #fff; }
[data-theme="dark"] .ay-d.fr-1 { background: #23352a; }
[data-theme="dark"] .ay-d.fr-2 { background: #2f5b3e; color: #d7f0e0; }

/* ----- plein écran de l'agenda (chantier 39 : DA dédiée) -----
   Structure : le wrap devient une colonne plein viewport ; les deux barres
   d'outils forment un en-tête en verre dépoli qui reste TOUJOURS visible,
   seule la grille (#agenda-container) défile. Entrée animée en douceur. */
body.agenda-fs-open { overflow: hidden; }
.agenda-wrap.agenda-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  padding: 0;
  background:
    radial-gradient(1100px 380px at 50% -160px, rgba(176, 111, 63, 0.10), transparent 70%),
    var(--bg, #f6f2ec);
  animation: agFsIn 0.24s cubic-bezier(0.22, 0.7, 0.3, 1);
}
@keyframes agFsIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
/* En-tête : les deux barres partagent le même fond translucide + flou. */
.agenda-wrap.agenda-fullscreen > .agenda-toolbar {
  margin-bottom: 0;
  padding: 14px 24px 4px;
  background: rgba(250, 246, 240, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.agenda-wrap.agenda-fullscreen > .agenda-toolbar-nav {
  margin-top: 0;
  padding: 6px 24px 4px;
}
/* La ligne de filtres clôt l'en-tête : c'est elle qui porte le liseré. */
.agenda-wrap.agenda-fullscreen > .agenda-toolbar-filters {
  margin-top: 0;
  padding: 6px 24px 14px;
  border-bottom: 1px solid var(--line, #e5dccf);
  box-shadow: 0 14px 34px rgba(31, 24, 18, 0.06);
}
/* La date devient la pièce maîtresse : serif élégant, plus grande. */
.agenda-wrap.agenda-fullscreen .agenda-date-label {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.agenda-wrap.agenda-fullscreen .agenda-date-btn:hover .agenda-date-label { color: var(--accent-strong, #b06f3f); }
/* Seule la grille défile ; l'en-tête ne bouge jamais. */
.agenda-wrap.agenda-fullscreen #agenda-container {
  max-width: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 28px;
  overscroll-behavior: contain;
}
/* Bouton ⛶ actif : signal clair qu'un clic ressort du mode. */
#ag-fullscreen.active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
#ag-fullscreen.active:hover { background: #96582c; }
/* Bascule jour/nuit dans la barre de l'agenda : masquée en temps normal (la
   barre latérale porte déjà le toggle), visible SEULEMENT en plein écran où la
   barre latérale disparaît. Spécificité > theme.js (.theme-toggle). */
.workspace-body .ag-fs-theme { display: none; }
body.agenda-fs-open .ag-fs-theme { display: inline-flex; }
/* Confort : la grille garde un liseré arrondi propre en bas du viewport. */
.agenda-wrap.agenda-fullscreen .agenda-day,
.agenda-wrap.agenda-fullscreen .agenda-week { box-shadow: 0 10px 30px rgba(31, 24, 18, 0.07); }

/* ----- liste clientes : tri + lignes cliquables ----- */
.clients-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 4px;
}
.clients-table th.client-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.clients-table th.client-sort:hover { color: var(--accent-strong); }
.clients-table tr.client-row, .client-row { cursor: pointer; }
.client-row:hover { background: var(--surface-muted, #f6f0e8); }
.client-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ----- panneau fiche cliente + modale ----- */
.ws-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 24, 18, 0.4);
  z-index: 1500;
  display: flex;
  justify-content: flex-end;
  opacity: 0; transition: opacity 0.18s ease;
}
.ws-overlay.show { opacity: 1; }
.ws-overlay.center { justify-content: center; align-items: center; }
.ws-panel {
  width: min(460px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: -20px 0 50px rgba(0,0,0,0.2);
  padding: 26px;
  overflow-y: auto;
  transform: translateX(24px);
  transition: transform 0.2s ease;
}
.ws-overlay.show .ws-panel { transform: translateX(0); }
.ws-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(0,0,0,0.28);
  padding: 26px;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.ws-overlay.show .ws-modal { transform: translateY(0); }
.ws-panel-head, .ws-modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.ws-panel-head h2, .ws-modal-head h2 {
  margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500;
}
.ws-close {
  border: none; background: var(--surface-soft);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; color: var(--text-soft);
}
.ws-close:hover { background: var(--surface-muted); }

/* Modal d'envoi ticket/facture (caisse) */
.ws-send-modal .ws-modal-head h3 { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.ws-modal-close {
  border: none; background: var(--surface-soft);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  font-size: 1.15rem; color: var(--text-soft); line-height: 1;
}
.ws-modal-close:hover { background: var(--surface-muted); }
.ws-send-sub { margin: -6px 0 16px; font-size: 0.88rem; color: var(--text-soft); line-height: 1.5; }
.ws-send-modal .ws-field { display: block; margin-bottom: 14px; }
.ws-send-modal .ws-field span {
  display: block; margin-bottom: 5px;
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft);
}
.ws-send-modal .ws-field input {
  width: 100%; box-sizing: border-box; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; background: var(--surface);
}
.ws-send-modal .ws-field input:focus { outline: none; border-color: #b98a5e; box-shadow: 0 0 0 3px rgba(185, 138, 94, 0.15); }
.ws-send-hint { min-height: 18px; margin-bottom: 10px; font-size: 0.82rem; color: var(--danger); }
.ws-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ws-btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text-soft); }
.ws-btn-ghost:hover { background: var(--surface-soft); }
.ws-btn-primary { background: var(--accent-strong); color: #2a1c12; border: 1px solid var(--accent-strong); }
.ws-btn-primary:hover { filter: brightness(1.06); }
.ws-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.fiche-meta { display: grid; gap: 10px; margin-bottom: 20px; }
.fiche-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fiche-row span:first-child { color: var(--text-soft); }
.fiche-row span:last-child { font-weight: 600; text-align: right; }
.fiche-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.fiche-stat { background: var(--surface-soft); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.fiche-stat strong { display: block; font-size: 1.8rem; letter-spacing: -0.04em; }
.fiche-stat span { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); }
.fiche-hist { display: grid; gap: 8px; }
.fiche-appt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fiche-appt .fa-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 3px; }
.fiche-appt .fa-sub { font-size: 0.85rem; color: var(--text-soft); }
/* Liens de la fiche (📅 Calendrier…) : lisibles dans les deux thèmes
   (avant : bleu navigateur par défaut, illisible en mode nuit). */
.fiche-appt a { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.fiche-appt a:hover { text-decoration: underline; }
/* Bandeau acompte / no-show : fond thémé (avant : #fdf3ee codé en dur,
   texte clair sur fond clair en mode nuit). */
.fiche-deposit { background: var(--surface-soft); }
/* Bulles « Échanges avec Liah » : couleur de texte explicite — les fonds
   restent clairs, donc le texte doit être foncé même en thème sombre
   (avant : couleur héritée → blanc sur blanc en mode nuit). */
.fiche-chat-msg {
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #3c342b;
}
.fiche-chat-msg.is-liah { align-self: flex-start; background: #f3ece4; }
.fiche-chat-msg.is-client { align-self: flex-end; background: #e8f0ea; }
.fiche-chat-msg .fcm-who { display: block; font-size: 11px; opacity: .65; margin-bottom: 2px; }
[data-theme="dark"] .fiche-chat-msg.is-liah { background: #2e2a24; color: #ece4d8; }
[data-theme="dark"] .fiche-chat-msg.is-client { background: #24312a; color: #dcebe1; }

/* Bannières du tableau de bord (À traiter / L'IA vous suggère / Anniversaires) :
   fonds & bordures thémés — avant : #fdf6f0/#fbf7ec/#fbf6ef + items #fff codés
   en dur, illisibles en mode nuit. */
.ws-banner-todo, .ws-banner-ai, .ws-banner-bday { border: 1px solid var(--line); background: var(--surface-soft); }
.ws-banner-item { background: var(--surface); border: 1px solid var(--line); }
[data-theme="dark"] .ws-banner-item { background: var(--surface); border-color: var(--line); }

/* Barres de progression (objectif du mois, commissions) : piste thémée. */
.ws-track { background: #eee5d5; border-radius: 999px; overflow: hidden; }
[data-theme="dark"] .ws-track { background: #3a332b; }

/* Carte anomalies (pré-compta) : rouge doux thémé. */
.ws-anom { background: #fdf3f2; border-color: #f0c9c4; }
.ws-anom strong { color: #a03b30; }
[data-theme="dark"] .ws-anom { background: #322220; border-color: #5a3531; }
[data-theme="dark"] .ws-anom strong { color: #f0a89e; }

/* Encadré mot de passe temporaire (Accès & connexions). */
.ws-secret-box { border: 1px dashed #b08d57; background: #faf6ef; }
[data-theme="dark"] .ws-secret-box { background: #2b251c; }

/* Disponibilités en direct (modal Nouveau rendez-vous) */
.ag-avail { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; margin: 2px 0 4px; background: var(--surface-soft, #faf8f4); }
.ag-avail-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-soft); margin: 0 0 8px; }
.ag-avail-title + .ag-avail-title, .ag-legend + .ag-avail-title { margin-top: 12px; }
.ag-avail-empty { font-size: 0.86rem; color: var(--text-soft); padding: 4px 0 8px; }
.ag-prow { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.ag-pname {
  flex: 0 0 118px; font-size: 0.82rem; font-weight: 600; line-height: 1.2;
  padding-left: 8px; border-left: 3px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ag-pname em { display: block; font-style: normal; font-weight: 400; font-size: 0.72rem; color: var(--text-soft); }
.ag-pcells { flex: 1; display: flex; gap: 1px; }
.ag-cell { flex: 1; height: 20px; border-radius: 3px; min-width: 3px; }
.ag-st-available { background: #7fb069; }
.ag-cell.ag-st-available { cursor: pointer; }
.ag-cell.ag-st-available:hover { background: #5e9147; transform: scaleY(1.25); }
.ag-st-occupied { background: #d98a7a; }
.ag-st-break { background: #e8d9a8; }
.ag-st-free { background: var(--surface-muted); }
.ag-st-off { background: var(--surface-soft); }
.ag-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; font-size: 0.74rem; color: var(--text-soft); }
.ag-legend .ag-lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.ag-slots { display: flex; flex-wrap: wrap; gap: 7px; }
.ag-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 13px; font-size: 0.86rem; font-family: inherit; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ag-chip:hover { border-color: #b98a5e; background: #fbf4ea; }
.ag-chip.on { background: var(--accent-strong); border-color: var(--accent-strong); color: #2a1c12; font-weight: 600; }
.ag-next { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ag-next-label { font-size: 0.82rem; color: var(--text-soft); }
.ag-chip-next { border-style: dashed; }

/* Portfolio (fiche équipe) — vignettes des réalisations */
.te-pf-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.te-pf-item { position: relative; margin: 0; width: 120px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-muted, #f5f3ee); }
.te-pf-item img { display: block; width: 100%; height: 90px; object-fit: cover; }
.te-pf-item figcaption { font-size: 0.72rem; padding: 4px 6px; color: var(--text-soft); }
.te-pf-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; font-size: 0.9rem; line-height: 1;
}
.te-pf-del:hover { background: var(--danger); }

/* ============================================================
   Page de connexion admin (login.html)
   ============================================================ */
body.workspace-auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(214, 174, 138, 0.25), transparent 60%),
    radial-gradient(900px 500px at 110% 120%, rgba(187, 132, 95, 0.18), transparent 55%),
    var(--bg);
}

.workspace-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.workspace-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 38px 34px 30px;
}

.workspace-auth-brand { text-align: center; margin-bottom: 24px; }

.workspace-auth-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 14px;
}

.workspace-auth-brand h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--text);
}

.workspace-auth-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.workspace-auth-switch {
  display: flex;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px;
  margin-bottom: 22px;
}
.workspace-auth-switch .workspace-btn { flex: 1; padding: 9px 12px; font-size: 0.82rem; }

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

.workspace-auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

.workspace-auth-form input {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.workspace-auth-form input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(187, 132, 95, 0.15);
}

/* Boutons génériques du workspace */
.workspace-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease, background 0.15s ease;
}
.workspace-btn:active { transform: translateY(1px); }
.workspace-btn.full { width: 100%; }

.workspace-btn-primary {
  background: var(--accent-strong);
  color: #2a1c12;
}
.workspace-btn-primary:hover { filter: brightness(1.06); }

.workspace-btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--line-strong);
}
.workspace-btn-ghost:hover { background: var(--surface-muted); color: var(--text); }

.workspace-status {
  min-height: 1.1em;
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--danger);
  text-align: center;
}
.workspace-status.ok { color: var(--success); }

.workspace-auth-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
}
.workspace-auth-footer a { color: var(--accent-deep); text-decoration: none; }
.workspace-auth-footer a:hover { text-decoration: underline; }

/* ---- Cases à cocher / radios : ne jamais hériter du width:100% des champs --- */
/* Sans ceci, les checkboxes dans .ws-form sont étirées et déforment les lignes. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  accent-color: var(--accent-strong, #2f6b4f);
  cursor: pointer;
  flex: none;
}

/* ---- Accessibilité : réduire les animations si la personne le demande ------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Mobile admin (chantier 37) : barre du haut + tiroir de navigation.
   La sidebar devient un tiroir coulissant, le contenu passe d'abord.
   ========================================================================== */
.ws-mobile-bar { display: none; }
.ws-nav-backdrop { display: none; }

@media (max-width: 1180px) {
  /* Tablette : nav en grille compacte au lieu d'une longue liste verticale. */
  .workspace-nav { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .workspace-sidebar { height: auto; overflow: visible; }
}

@media (max-width: 760px) {
  .ws-mobile-bar {
    position: sticky; top: 0; z-index: 940;
    display: flex; align-items: center; gap: 12px;
    background: rgba(251, 248, 244, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .ws-burger {
    width: 44px; height: 44px; flex: none;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: var(--surface); cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .ws-burger span,
  .ws-burger span::before,
  .ws-burger span::after {
    content: ""; display: block; width: 20px; height: 2px;
    background: var(--text); position: relative;
    transition: transform 200ms ease, background 160ms ease;
  }
  .ws-burger span::before { position: absolute; top: -6px; left: 0; }
  .ws-burger span::after { position: absolute; top: 6px; left: 0; }
  body.ws-nav-open .ws-burger span { background: transparent; }
  body.ws-nav-open .ws-burger span::before { transform: translateY(6px) rotate(45deg); }
  body.ws-nav-open .ws-burger span::after { transform: translateY(-6px) rotate(-45deg); }
  .ws-mb-title {
    font-family: var(--serif); font-size: 1.35rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }

  .workspace-shell { display: block; }
  .workspace-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 960;
    width: min(300px, 86vw); height: 100dvh;
    transform: translateX(-105%);
    transition: transform 240ms ease;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    overflow-y: auto;
  }
  body.ws-nav-open .workspace-sidebar { transform: none; }
  .workspace-nav { grid-template-columns: 1fr; }
  .ws-nav-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 950;
    background: rgba(24, 18, 12, 0.45);
    opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  }
  body.ws-nav-open .ws-nav-backdrop { opacity: 1; pointer-events: auto; }

  /* Le titre de vue reste lisible sans écraser la page. */
  .workspace-topbar h1 { font-size: 2.1rem; }
}

/* ==========================================================================
   CHANTIER 41 — MODE SOMBRE du workspace admin (et de la page login).
   Le workspace est clair (crème/or) par défaut ; quand html[data-theme=
   "dark"] est posé par theme.js (bouton soleil/lune, réglage partagé
   'colabs_theme'), on redéfinit la palette puis on retouche les rares
   couleurs codées en dur pensées pour le clair.
   ========================================================================== */
:root[data-theme="dark"] {
  /* Espresso « moins sombre » : fonds remontés d'un cran pour respirer. */
  --bg: #221d16;
  --surface: #2e281f;
  --surface-soft: #282219;
  --surface-muted: #383021;
  --surface-raised: #29231b;
  --hover: #3a3227;
  --text: #f2ece1;
  --text-soft: #bcb19c;
  --text-faint: #9d927f;
  --line: #473e2f;
  --line-strong: #5a4f3c;
  --accent: #d6ae8a;
  --accent-strong: #c98f63;
  --accent-deep: #e0bb95;
  --success: #8fbe93;
  --warning: #d8a86b;
  --danger: #d99089;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* Retouches ciblées du sombre : couleurs codées en dur pensées pour le clair. */
/* NB : les badges (.badge, .agenda-emp-fill) sont désormais théma-agnostiques
   (teintes translucides + tokens) — plus besoin d'override sombre ici. */
[data-theme="dark"] .ws-slot.ok { background: rgba(143, 190, 147, 0.14); border-color: rgba(143, 190, 147, 0.35); }
[data-theme="dark"] .ws-slot.busy { background: rgba(216, 168, 107, 0.12); }
[data-theme="dark"] .call-actions .ok { color: #9fd4ab; }
[data-theme="dark"] .call-actions .ko { color: #e0a396; }

/* Cases « temps libre » (vert pointillé) : texte éclairci pour rester lisible. */
[data-theme="dark"] .tl-free,
[data-theme="dark"] .agenda-free,
[data-theme="dark"] .free-card { color: #8fd0a8; border-color: var(--success); }
[data-theme="dark"] .ag-free-btn { color: #8fd0a8; background: rgba(93, 170, 125, 0.16); }
[data-theme="dark"] .ag-free-btn:hover { color: #a9e0bd; }

/* Jour sélectionné du mini-calendrier : inversé (clair sur sombre). */
[data-theme="dark"] .ag-dp-cell.is-sel { background: #efe8db; color: #1d1b19; }
[data-theme="dark"] .ag-dp-cell.is-sel:hover { background: #efe8db; }
[data-theme="dark"] .ag-notify-row input { accent-color: #d6ae8a; }

/* Rayures « fermé » + jours hors mois : version sombre. */
[data-theme="dark"] .agenda-week-day.closed,
[data-theme="dark"] .agenda-month-day.closed {
  background: repeating-linear-gradient(45deg, #1d1812, #1d1812 6px, #262017 6px, #262017 12px);
}
[data-theme="dark"] .agenda-offhours {
  background: repeating-linear-gradient(45deg, #1d1812, #1d1812 6px, #262017 6px, #262017 12px);
}

/* Heatmap année : niveaux recalculés pour le sombre. */
[data-theme="dark"] .ay-d.lvl-1 { background: #3a2f22; }
[data-theme="dark"] .ay-d.lvl-2 { background: #6b5433; color: #f0e4d2; }

/* Barres du plein écran agenda : fond translucide sombre. */
[data-theme="dark"] .agenda-wrap.agenda-fullscreen > .agenda-toolbar {
  background: rgba(22, 19, 16, 0.88);
}
[data-theme="dark"] .agenda-wrap.agenda-fullscreen {
  background: radial-gradient(1100px 380px at 50% -160px, rgba(176, 111, 63, 0.12), transparent 70%), var(--bg);
}

/* Divers : survols/inversions codés en dur pour le clair. */
[data-theme="dark"] .client-row:hover { background: var(--surface-muted); }
[data-theme="dark"] .ag-chip:hover { background: rgba(214, 174, 138, 0.14); border-color: var(--accent); }
[data-theme="dark"] .ws-overlay { background: rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .agenda-hour-line, [data-theme="dark"] .agenda-hourline { border-top-color: #2b241b; }
[data-theme="dark"] .ws-slot { border-color: #3a3226; }
[data-theme="dark"] #ae-del { color: #e0837a; border-color: rgba(224, 131, 122, 0.4); }
[data-theme="dark"] .rv-star { color: #554a3e; }

/* Liens de contact (tel:/mailto:) dans les vues : jamais le bleu navigateur
   par défaut (illisible sur fond sombre) — accent du thème, souligné discret,
   contraste AA dans les deux modes. */
#workspace-view a[href^="tel:"],
#workspace-view a[href^="mailto:"] {
  color: var(--accent-strong, var(--accent));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bandeau « données de démonstration » (2 août 2026). Volontairement en tête
   du contenu et non en survol : la patronne doit le lire AVANT les chiffres,
   pas après. Ton d'avertissement (pas d'erreur) : rien n'est cassé, c'est un
   état de découverte. Utilise les tokens de la boutique, jamais de hex en dur. */
.ws-demo-bandeau {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning) 11%, transparent);
  color: var(--text);
  font-size: .88rem;
  line-height: 1.5;
}
.ws-demo-bandeau b { color: var(--text); }
@media (max-width: 860px) { .ws-demo-bandeau { font-size: .84rem; padding: 12px 14px; } }
