/* =====================================================================
   ERPresta — Refonte « Espace de travail » (V2.0)
   Chargée APRÈS app.css : elle a le dernier mot sur la coquille
   (barre des espaces, panneau de menu, barre haute, palette Ctrl K,
   page Aujourd’hui) et pose une palette chaude et sobre commune à
   tous les écrans. Les préférences par compte (accent, mode sombre,
   arrondis) restent actives : l’accent vient de l’attribut style de <html>.
   ===================================================================== */

/* --- Jetons ---------------------------------------------------------- */
html:root:not([data-theme="dark"]) {
  --paper: #F4F3EE;
  --surface: #FFFFFF;
  --surface-alt: #FAF9F5;
  --ink: #10201B;
  --ink-soft: #4A5A55;
  --ink-faint: #7B8984;
  --line: #E6E4DC;
  --line-strong: #D3D0C5;
  --brand: #0B7A55;
  --brand-dark: #075C40;
  --brand-soft: #E3F2EB;
  --ws-panel: #FAF9F5;
  --ws-hover: #EFEDE6;
  --ws-chip: #EAE8E0;
  --ws-danger: #C2362B;
  --ws-danger-soft: #FBE7E4;
  --ws-warn: #A86200;
  --ws-warn-soft: #FDF1DC;
  --ws-info: #2D5BD0;
  --ws-info-soft: #E7EEFC;
  --ws-violet: #6B4FC8;
  --ws-violet-soft: #EEEAFB;
  --ws-neutral-soft: #ECEBE5;
  --shadow-card: 0 1px 2px rgba(16, 32, 27, .05);
  --shadow-card-hover: 0 6px 18px rgba(16, 32, 27, .08);
  --shadow-pop: 0 18px 50px -12px rgba(16, 32, 27, .35);
}
html:root[data-theme="dark"] {
  --paper: #0D1311;
  --surface: #151D1A;
  --surface-alt: #19221F;
  --ink: #E8EEEB;
  --ink-soft: #AEBBB6;
  --ink-faint: #82918B;
  --line: #27322E;
  --line-strong: #34413C;
  --brand: #3CC48F;
  --brand-dark: #2FA577;
  --brand-soft: #173328;
  --ws-panel: #111816;
  --ws-hover: #1D2724;
  --ws-chip: #1F2926;
  --ws-danger: #F07A6E;
  --ws-danger-soft: #3A1F1C;
  --ws-warn: #F2B35B;
  --ws-warn-soft: #36290F;
  --ws-info: #8FB0FF;
  --ws-info-soft: #1B2747;
  --ws-violet: #B9A7F5;
  --ws-violet-soft: #2A2345;
  --ws-neutral-soft: #222C29;
  --shadow-card: none;
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .7);
}

html body {
  background: var(--paper);
  color: var(--ink);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
html body .net-bg { display: none !important; }

/* --- Coquille -------------------------------------------------------- */
html .shell--ws {
  display: flex;
  min-height: 100vh;
  background: var(--paper);
}
html .shell--ws > .main { min-width: 0; flex: 1; }

/* Barre des espaces (sombre, teintée par l’accent du compte) */
html .shell--ws .wsbar {
  --wsbar-bg: color-mix(in srgb, var(--rail-bg, #1B3F8B) 26%, #0B1311);
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 76px;
  width: 76px;
  height: 100vh;
  padding: 14px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--wsbar-bg);
  color: #A3B5AE;
}
html .shell--ws .wsbar__logo {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
}
html .shell--ws .wsbar__logo img {
  width: 38px;
  height: 38px;
  display: block;
}
html .shell--ws .wsbar__item {
  width: 62px;
  padding: 9px 0 7px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: .01em;
  color: #A3B5AE;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
html .shell--ws .wsbar__item .nav-icon {
  width: 21px;
  height: 21px;
  color: currentColor;
  opacity: 1;
  border: 0;
}
html .shell--ws .wsbar__item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
html .shell--ws .wsbar__item.is-active { background: rgba(255, 255, 255, .12); color: #fff; }
html .shell--ws .wsbar__item.is-active .nav-icon { color: color-mix(in srgb, var(--accent) 45%, #fff); }
html .shell--ws .wsbar__item:focus-visible,
html .shell--ws .wsbar__logo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html .shell--ws .wsbar__spacer { flex: 1; }

/* Panneau de menu de l’espace actif */
html .shell--ws .rail,
html[data-theme="dark"] .shell--ws .rail {
  flex: 0 0 236px;
  width: 236px;
  background: var(--ws-panel) !important;
  background-image: none !important;
  color: var(--ink) !important;
  border-right: 1px solid var(--line) !important;
  box-shadow: none !important;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
html .shell--ws .rail__brand,
html[data-theme="dark"] .shell--ws .rail__brand {
  border-bottom: 1px solid var(--line) !important;
  padding: 16px 16px 12px;
  grid-template-columns: 34px 1fr;
}
html .shell--ws .rail__brand-link { grid-template-columns: 34px 1fr; color: var(--ink) !important; }
html .shell--ws .rail__mark { width: 34px; height: 34px; border-radius: 9px; padding: 3px; box-shadow: 0 0 0 1px var(--line); }
html .shell--ws .rail__logo,
html[data-theme="dark"] .shell--ws .rail__logo { color: var(--ink) !important; font-size: 15px; }
html .shell--ws .rail__logo em,
html[data-theme="dark"] .shell--ws .rail__logo em { color: var(--brand) !important; }
html .shell--ws .rail__company,
html[data-theme="dark"] .shell--ws .rail__company { color: var(--ink-faint) !important; }
html .shell--ws .rail__version,
html[data-theme="dark"] .shell--ws .rail__version {
  background: var(--ws-chip) !important;
  color: var(--ink-soft) !important;
  box-shadow: none !important;
}

/* Identité du tenant : avatar coloré, carte en tête du menu, pastille en barre haute */
.tenant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--tenant, var(--brand));
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .02em;
}
.tenant-avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
html .shell--ws .tenant-card,
html[data-theme="dark"] .shell--ws .tenant-card {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px !important;
  box-shadow: inset 0 3px 0 var(--tenant, var(--brand));
}
html .shell--ws .tenant-card .rail__brand-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: -2px -4px 0;
  border-radius: 10px;
  text-decoration: none;
}
html .shell--ws .tenant-card .rail__brand-link:hover { background: var(--ws-hover); }
html .shell--ws .tenant-card .rail__brand-text { display: flex; flex-direction: column; min-width: 0; }
html .shell--ws .tenant-card__eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tenant, var(--brand));
}
html .shell--ws .tenant-card__name,
html[data-theme="dark"] .shell--ws .tenant-card__name {
  font-size: 15px !important;
  font-weight: 700;
  color: var(--ink) !important;
  margin: 1px 0 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html .shell--ws .tenant-card__detail { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html .shell--ws .tenant-card__product {
  margin: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
html .shell--ws .tenant-card__logo { height: 18px; width: auto; display: block; }
html[data-theme="dark"] .shell--ws .tenant-card__logo { content: url("../img/erpresta-logo-dark.svg"); }
html[data-theme="dark"] .shell--ws .tenant-avatar,
html[data-theme="dark"] .tenant-avatar { background: color-mix(in srgb, var(--tenant, var(--brand)) 80%, #fff); color: #0B1311; }

html .shell--ws .tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 5px 12px 5px 10px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--tenant, var(--brand)) 35%, var(--line));
  background: color-mix(in srgb, var(--tenant, var(--brand)) 9%, var(--surface));
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html .shell--ws .tenant-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--tenant, var(--brand));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tenant, var(--brand)) 22%, transparent);
}
html .shell--ws .topbar__tenant { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
html .shell--ws .topbar__tenant-name { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
html .shell--ws .topbar__tenant-product { font-size: 11px; font-weight: 600; color: var(--ink-faint); }
html .shell--ws .topbar__tenant-product em,
html .shell--ws .rail__logo em { font-style: normal; color: var(--brand) !important; }

/* Connexion : l’espace dans lequel on entre */
.tenant-login {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--tenant, var(--brand)) 30%, var(--line));
  background: color-mix(in srgb, var(--tenant, var(--brand)) 7%, var(--surface));
  font-size: 13.5px;
  color: var(--ink-soft);
  width: fit-content;
  max-width: 100%;
}
.tenant-login strong { color: var(--ink); }
.tenant-login small { display: block; font-size: 11.5px; color: var(--ink-faint); }

html .shell--ws .rail__wstabs { display: none; }
html .shell--ws .rail__wstitle {
  margin: 0;
  padding: 16px 20px 4px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

html .shell--ws .rail__nav,
html[data-theme="dark"] .shell--ws .rail__nav {
  padding: 6px 10px 16px;
  background: transparent !important;
  scrollbar-color: var(--line-strong) transparent;
}
html .shell--ws [data-ws-off] { display: none !important; }

html .shell--ws .rail__group { margin: 0 0 2px; }
html .shell--ws .rail .rail__group-btn,
html[data-theme="dark"] .shell--ws .rail .rail__group-btn {
  color: var(--ink) !important;
  background: transparent !important;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: none !important;
}
html .shell--ws .rail .rail__group-label,
html[data-theme="dark"] .shell--ws .rail .rail__group-label { color: inherit !important; }
html .shell--ws .rail .rail__group.is-current > .rail__group-btn,
html[data-theme="dark"] .shell--ws .rail .rail__group.is-current > .rail__group-btn {
  background: transparent !important;
  color: var(--ink) !important;
}
html .shell--ws .rail .rail__link,
html[data-theme="dark"] .shell--ws .rail .rail__link {
  color: var(--ink-soft) !important;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
}
html .shell--ws .rail .nav-icon,
html .shell--ws .rail .rail__chevron,
html[data-theme="dark"] .shell--ws .rail .nav-icon,
html[data-theme="dark"] .shell--ws .rail .rail__chevron {
  color: var(--ink-faint) !important;
  border-color: var(--ink-faint) !important;
  opacity: 1;
}
html .shell--ws .rail .rail__group-btn:hover,
html .shell--ws .rail .rail__link:hover,
html[data-theme="dark"] .shell--ws .rail .rail__group-btn:hover,
html[data-theme="dark"] .shell--ws .rail .rail__link:hover {
  background: var(--ws-hover) !important;
  color: var(--ink) !important;
}
html .shell--ws .rail .rail__link--active,
html .shell--ws .rail .rail__link--active:hover,
html[data-theme="dark"] .shell--ws .rail .rail__link--active,
html[data-theme="dark"] .shell--ws .rail .rail__link--active:hover {
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 32, 27, .08), 0 0 0 1px var(--line) !important;
}
html .shell--ws .rail .rail__link--active .nav-icon,
html[data-theme="dark"] .shell--ws .rail .rail__link--active .nav-icon { color: var(--accent) !important; }
html .shell--ws .rail .rail__tag {
  background: var(--ws-warn-soft) !important;
  color: var(--ws-warn) !important;
}

/* Accueil : Aujourd’hui, épinglés, récents */
html .shell--ws .ws-home { display: flex; flex-direction: column; gap: 2px; }
html .shell--ws .ws-home__label {
  margin: 14px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
}
html .shell--ws .ws-home__list { list-style: none; margin: 0; padding: 0; }
html .shell--ws .ws-home__list .rail__link {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html .shell--ws .ws-home__list .rail__link span {
  overflow: hidden;
  text-overflow: ellipsis;
}
html .shell--ws .ws-home__empty {
  padding: 4px 10px 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-faint);
}

/* Pied du panneau : état synchro + déconnexion */
html .shell--ws .rail__foot,
html[data-theme="dark"] .shell--ws .rail__foot {
  background: transparent !important;
  border-top: 1px solid var(--line) !important;
  padding: 12px;
}
html .shell--ws .rail__session { display: flex; flex-direction: column; gap: 10px; }
html .shell--ws .rail__cron,
html[data-theme="dark"] .shell--ws .rail__cron {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft) !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
html .shell--ws .rail__cron-label,
html[data-theme="dark"] .shell--ws .rail__cron-label {
  color: var(--ink) !important;
  font-weight: 650;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
html .shell--ws .rail__cron-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}
html .shell--ws .rail__cron.is-ok .rail__cron-label::before {
  background: #2BAA74;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2BAA74 22%, transparent);
}
html .shell--ws .rail__cron time,
html .shell--ws .rail__cron-empty,
html[data-theme="dark"] .shell--ws .rail__cron time,
html[data-theme="dark"] .shell--ws .rail__cron-empty { color: var(--ink-faint) !important; }
html .shell--ws .rail__logout,
html[data-theme="dark"] .shell--ws .rail__logout {
  width: 100%;
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-soft) !important;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
}
html .shell--ws .rail__logout:hover,
html[data-theme="dark"] .shell--ws .rail__logout:hover {
  background: var(--ws-hover) !important;
  color: var(--ink) !important;
}

/* --- Barre haute ----------------------------------------------------- */
html .shell--ws .topbar,
html[data-theme="dark"] .shell--ws .topbar {
  background: var(--paper) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html .shell--ws .topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
  min-width: 0;
}
html .shell--ws .topbar__crumbs span:last-child { color: var(--ink); font-weight: 600; }
html .shell--ws .topbar__crumbs-sep { color: var(--line-strong); }

html .shell--ws .cmdk-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 440px;
  height: 38px;
  padding: 0 8px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-faint);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
html .shell--ws .cmdk-trigger:hover { border-color: var(--line-strong); color: var(--ink-soft); }
html .shell--ws .cmdk-trigger .nav-icon { width: 17px; height: 17px; color: currentColor; opacity: 1; border: 0; }
html .shell--ws .cmdk-trigger__text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html .shell--ws .cmdk-trigger kbd,
html .cmdk kbd {
  font: 600 11px/1 var(--font-ui, Inter, system-ui, sans-serif);
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-soft);
}

/* Titre de page + épingle */
html .shell--ws .topbar__heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html .shell--ws .topbar__heading h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
}
html .shell--ws .topbar__crumb { display: none; }
html .shell--ws .pin-toggle {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}
html .shell--ws .pin-toggle .nav-icon { width: 18px; height: 18px; color: currentColor; opacity: 1; border: 0; }
html .shell--ws .pin-toggle:hover { background: var(--ws-hover); color: var(--ink); }
html .shell--ws .pin-toggle[aria-pressed="true"] { color: #E0A21B; }
html .shell--ws .pin-toggle[aria-pressed="true"] .nav-icon { fill: #F5C445; }

@media (min-width: 901px) {
  html .shell--ws .topbar {
    position: relative;
    display: grid !important;
    grid-template-columns: auto minmax(0, auto) minmax(220px, 420px) 1fr auto;
    grid-template-areas:
      "tenant crumbs cmdk gap tools"
      "title title title title title";
    align-items: center;
    column-gap: 18px;
    row-gap: 0;
    padding: 0 32px !important;
    min-height: 0 !important;
  }
  html .shell--ws .topbar__app { display: contents !important; }
  html .shell--ws .tenant-chip { grid-area: tenant; }
  html .shell--ws .topbar__crumbs { grid-area: crumbs; height: 62px; }
  html .shell--ws .cmdk-trigger { grid-area: cmdk; }
  html .shell--ws .topbar__tools { grid-area: tools; height: 62px; display: flex; align-items: center; gap: 8px; }
  html .shell--ws .topbar__title {
    grid-area: title;
    padding: 18px 0 2px;
    border-top: 1px solid var(--line);
  }
  html .shell--ws .content { padding-top: 18px; }
}

/* Écrans moyens : le titre de l’espace (menu) remplace le fil d’Ariane */
@media (min-width: 901px) and (max-width: 1500px) {
  html .shell--ws .topbar__crumbs { display: none; }
  html .shell--ws .topbar { grid-template-columns: auto 0 minmax(200px, 400px) 1fr auto !important; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  html .shell--ws .cmdk-trigger__text { display: none; }
  html .shell--ws .cmdk-trigger { width: 40px; padding: 0; justify-content: center; }
  html .shell--ws .cmdk-trigger kbd { display: none; }
  html .shell--ws .topbar { grid-template-columns: auto 0 40px 1fr auto !important; }
}

/* Outils de la barre : plus discrets, jamais sur deux lignes */
html .shell--ws .topbar__tools { flex-wrap: nowrap !important; }
@media (min-width: 901px) and (max-width: 1380px) {
  html .shell--ws .who__meta { display: none !important; }
}
/* Outils de la barre : plus discrets */
html .shell--ws .radio__label { display: none; }
html .shell--ws .radio .btn--sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
html .shell--ws .who {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 0 0 10px !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
}
html .shell--ws .who__avatar {
  background: var(--ink) !important;
  color: var(--surface) !important;
}
html .shell--ws .who__name { color: var(--ink) !important; }
html .shell--ws .who__role { color: var(--ink-faint) !important; }

/* --- Composants communs : à plat, bordures fines --------------------- */
html .shell--ws .card,
html .shell--ws .kpi,
html .shell--ws .table-wrap,
html .shell--ws .filters,
html .shell--ws .scope-bar,
html .shell--ws .record-head {
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

/* --- Palette de commandes ------------------------------------------- */
html .cmdk {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
html .cmdk[open] { display: flex; }
html .cmdk::backdrop { background: rgba(10, 18, 15, .45); backdrop-filter: blur(2px); }
html .cmdk__box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
html .cmdk__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
html .cmdk__head .nav-icon { width: 20px; height: 20px; color: var(--ink-faint); border: 0; opacity: 1; }
html .cmdk__input,
html[data-theme="dark"] .cmdk__input {
  flex: 1;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 16px;
  color: var(--ink) !important;
  padding: 4px 0 !important;
  min-height: 0 !important;
}
html .cmdk__input::-webkit-search-cancel-button { display: none; }
html .cmdk__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
html .cmdk__section {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
}
html .cmdk__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
}
html .cmdk__opt .nav-icon { width: 18px; height: 18px; color: var(--ink-faint); border: 0; opacity: 1; flex: none; }
html .cmdk__opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html .cmdk__opt-text mark { background: transparent; color: var(--accent); font-weight: 700; }
html .cmdk__opt-hint { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
html .cmdk__opt[aria-selected="true"] { background: var(--ws-hover); }
html .cmdk__opt[aria-selected="true"] .nav-icon { color: var(--accent); }
html .cmdk__empty { margin: 0; padding: 26px 16px; text-align: center; color: var(--ink-faint); font-size: 14px; }
html .cmdk__foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 12px;
  color: var(--ink-faint);
}
html .cmdk__foot kbd { margin-right: 3px; }

/* --- Page Aujourd’hui ------------------------------------------------ */
.today { display: flex; flex-direction: column; gap: 18px; max-width: 1240px; }
.today__hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.today__date { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.today__title { margin: 2px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.today__lede { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.today__urgent { color: var(--ws-danger); font-weight: 650; }
.today__sync {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.today__sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #2BAA74; box-shadow: 0 0 0 3px color-mix(in srgb, #2BAA74 22%, transparent); }

.today-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.today-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
html a.today-kpi,
html a.today-kpi:hover,
html .today-row__link,
html .today-row__link:hover { color: var(--ink); }
a.today-kpi:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-card-hover); }
.today-kpi__label { font-size: 12.5px; color: var(--ink-soft); }
.today-kpi__value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.today-kpi__sub { font-size: 12px; color: var(--ink-faint); }
.today-kpi--up .today-kpi__sub { color: var(--brand); font-weight: 600; }
.today-kpi--down .today-kpi__sub { color: var(--ws-danger); font-weight: 600; }
.today-kpi--alert .today-kpi__value { color: var(--ws-danger); }

.today-inbox,
.today-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.today-inbox__head,
.today-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.today-inbox__head h3,
.today-card__head h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.today-count {
  font-size: 12px;
  font-weight: 650;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--surface);
}
.today-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.today-chip {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.today-chip span { font-weight: 650; margin-left: 2px; }
.today-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.today-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.today-list { list-style: none; margin: 0; padding: 0; }
.today-row { border-bottom: 1px solid var(--line); }
.today-row:last-child { border-bottom: 0; }
.today-row[hidden] { display: none; }
.today-row__link {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background .12s ease;
}
.today-row__link:hover { background: var(--surface-alt); text-decoration: none; }
.today-row__link:hover .today-row__act { background: var(--accent); border-color: var(--accent); color: #fff; }
.today-row--danger .today-row__link { box-shadow: inset 3px 0 0 var(--ws-danger); }
.today-row__text { display: flex; flex-direction: column; min-width: 0; }
.today-row__text strong { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-row__text small { font-size: 12.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-row__due { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.today-row--danger .today-row__due { color: var(--ws-danger); font-weight: 650; }
.today-row--warn .today-row__due { color: var(--ws-warn); font-weight: 650; }
.today-row__act {
  font-size: 12.5px;
  font-weight: 650;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.today-tag {
  justify-self: start;
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background: var(--ws-neutral-soft);
  color: var(--ink-soft);
}
.today-tag--commandes { background: var(--ws-info-soft); color: var(--ws-info); }
.today-tag--clients { background: var(--ws-violet-soft); color: var(--ws-violet); }
.today-tag--rh { background: var(--brand-soft); color: var(--brand-dark); }
.today-tag--suivi { background: var(--ws-warn-soft); color: var(--ws-warn); }
html[data-theme="dark"] .today-tag--rh { color: var(--brand); }

.today-empty { padding: 34px 20px; text-align: center; color: var(--ink-soft); }
.today-empty p { margin: 0; }
.today-empty__title { font-size: 16px; font-weight: 650; color: var(--ink); margin-bottom: 4px !important; }

.today-duo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
.today-card__meta { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.today-card__link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); }
.today-card__chart { padding: 10px 14px 6px; }
.today-card__chart .chart { width: 100%; height: auto; display: block; background: transparent !important; border: 0 !important; }
.today-team { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.today-team__big { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.today-team__big strong { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.today-team__big span { margin-left: auto; }
.today-team__bar { height: 8px; border-radius: 99px; background: var(--ws-chip); overflow: hidden; }
.today-team__bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.today-team__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-team__list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.today-team__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-team__why {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--ws-warn-soft);
  color: var(--ws-warn);
  white-space: nowrap;
}
.today-team__none { margin: 0; font-size: 13px; color: var(--ink-faint); }
.today-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  font-weight: 650;
  background: var(--ws-violet-soft);
  color: var(--ws-violet);
}

/* --- Tablette / mobile ---------------------------------------------- */
@media (max-width: 1100px) {
  .today-duo { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  html .shell--ws .wsbar { display: none; }
  html .shell--ws .rail,
  html[data-theme="dark"] .shell--ws .rail {
    width: min(320px, 90vw) !important;
    flex-basis: auto;
    background: var(--surface) !important;
  }
  html .shell--ws .rail__wstabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px 12px 4px;
  }
  html .shell--ws .rail__wstab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 9px 4px 7px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink-soft);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    min-height: 44px;
    cursor: pointer;
  }
  html .shell--ws .rail__wstab .nav-icon { width: 19px; height: 19px; color: currentColor !important; border: 0; opacity: 1; }
  html .shell--ws .rail__wstab.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
  html .shell--ws .rail__wstitle { padding: 14px 22px 2px; }

  html .shell--ws .topbar__crumbs,
  html .shell--ws .tenant-chip { display: none; }
  /* En-tête mobile : marque, recherche, compte. Le reste vit dans le tiroir et la barre basse. */
  html .shell--ws .radio > .btn,
  html .shell--ws .radio__label,
  html .shell--ws .topbar__session,
  html .shell--ws .rail-toggle { display: none !important; }
  html .shell--ws .rail__foot--desktop { display: block !important; }
  html .shell--ws .who { border-left: 0 !important; padding-left: 0 !important; }
  html .shell--ws .topbar__app-version { display: none !important; }
  html .shell--ws .topbar__tools { overflow: visible !important; }
  html .shell--ws .rail__session { align-items: stretch; }
  html .shell--ws .rail__foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  html .shell--ws .cmdk-trigger {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    flex: none;
    order: 3;
  }
  html .shell--ws .cmdk-trigger__text,
  html .shell--ws .cmdk-trigger kbd { display: none; }
  html .shell--ws .topbar__heading h1 { font-size: 22px; }

  .today__title { font-size: 21px; }
  .today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .today-kpi { padding: 12px 13px; }
  .today-kpi__value { font-size: 20px; }
  .today-row__link {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tag due"
      "text text";
    row-gap: 6px;
    column-gap: 10px;
    padding: 12px 14px;
  }
  .today-tag { grid-area: tag; }
  .today-row__text { grid-area: text; }
  .today-row__text strong,
  .today-row__text small { white-space: normal; }
  .today-row__due { grid-area: due; justify-self: end; }
  .today-row__act { display: none; }
  .today-chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; padding-bottom: 2px; }
  .today-chip { flex: none; min-height: 34px; }
  html .cmdk { margin-top: 10vh; }
  html .cmdk__foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html .shell--ws .wsbar__item,
  .today-row__link,
  .today-kpi { transition: none; }
}

@media print {
  html .shell--ws .wsbar,
  html .shell--ws .cmdk-trigger,
  html .shell--ws .pin-toggle { display: none !important; }
}

/* =====================================================================
   Connexion ERPresta (V2) — sobre et « logiciel » :
   formulaire à gauche, présentation produit à droite (ordinateur).
   ===================================================================== */
body:has(.signin) { background: var(--surface); }
body:has(.signin) > .flash { display: none; }
.signin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 560px) 1fr;
  background: var(--surface);
  color: var(--ink);
}
.signin__panel {
  display: flex;
  flex-direction: column;
  padding: 32px clamp(24px, 5vw, 64px);
  min-height: 100vh;
}
.signin__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signin__logo { height: 34px; width: auto; display: block; }
html[data-theme="dark"] .signin__logo { content: url("../img/erpresta-logo-dark.svg"); }
.signin .auth__version {
  background: var(--ws-chip) !important;
  color: var(--ink-soft) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.signin__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 40px auto;
}
.signin .tenant-login { margin-bottom: 26px; }
.signin__title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.signin__lede { margin: 6px 0 24px; font-size: 14.5px; color: var(--ink-soft); }
.signin .flash { margin: 0 0 16px; }
.signin__form { display: flex; flex-direction: column; gap: 16px; }
.signin__field { display: flex; flex-direction: column; gap: 6px; }
.signin__field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.signin__field input,
html[data-theme="dark"] .signin__field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  font: inherit;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(16, 32, 27, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.signin__field input::placeholder { color: var(--ink-faint); }
.signin__field input:focus {
  outline: 0;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.signin__password { position: relative; display: block; }
.signin__password input { padding-right: 84px; }
.signin__password .password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 0;
  background: var(--ws-chip);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.signin__submit {
  margin-top: 6px;
  height: 46px;
  border-radius: 10px;
  border: 0;
  background: var(--ink);
  color: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.signin__submit:hover { background: color-mix(in srgb, var(--ink) 86%, var(--brand)); }
.signin__submit:active { transform: translateY(1px); }
.signin__submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.signin__help { margin: 18px 0 0; font-size: 13px; color: var(--ink-faint); line-height: 1.5; }
.signin__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-faint);
}
.signin__secure { display: inline-flex; align-items: center; gap: 6px; }
.signin__secure svg { width: 14px; height: 14px; }

.signin__showcase {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% 0%, color-mix(in srgb, #19B07A 22%, transparent), transparent 60%),
    linear-gradient(160deg, #0F1C18, #0A1310 70%);
  color: #E6EEEA;
  display: flex;
  align-items: center;
  padding: 56px clamp(32px, 5vw, 80px);
}
.signin__showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 30%, transparent 75%);
}
.signin__showcase-inner { position: relative; width: 100%; max-width: 620px; }
.signin__showcase-logo { height: 30px; width: auto; display: block; margin-bottom: 36px; opacity: .95; }
.signin__showcase h2 {
  margin: 0 0 26px;
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.025em;
  color: #fff;
}
.signin__points { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 14px; }
.signin__points li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; font-size: 14px; line-height: 1.45; }
.signin__points b { color: #6FE0B2; font-weight: 650; }
.signin__points span { color: rgba(230, 238, 234, .72); }

/* Miniature schématique de l’application (aucune donnée) */
.signin__preview {
  border-radius: 14px;
  background: #F4F3EE;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transform-origin: left center;
}
.sp-bar { height: 26px; background: #E6E4DC; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.sp-bar i { width: 9px; height: 9px; border-radius: 50%; background: #CFCBBF; }
.sp-body { display: flex; height: 230px; }
.sp-rail { width: 44px; background: #10201B; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.sp-rail span { width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.sp-rail span.on { background: #19B07A; }
.sp-main { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sp-title { width: 34%; height: 12px; border-radius: 4px; background: #10201B; }
.sp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sp-kpis span { height: 40px; border-radius: 8px; background: #fff; border: 1px solid #E6E4DC; }
.sp-list { background: #fff; border: 1px solid #E6E4DC; border-radius: 8px; display: flex; flex-direction: column; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #EFEDE6; }
.sp-row:last-child { border-bottom: 0; }
.sp-row em { width: 44px; height: 12px; border-radius: 4px; }
.sp-row em.t1 { background: #E7EEFC; }
.sp-row em.t2 { background: #EEEAFB; }
.sp-row em.t3 { background: #E3F2EB; }
.sp-row b { flex: 1; height: 8px; border-radius: 4px; background: #E3E1D9; }
.sp-row u { width: 38px; height: 8px; border-radius: 4px; background: #E3E1D9; }
.sp-row u.r { background: #F2B1A9; }
.sp-row u.a { background: #F5D59C; }

@media (max-width: 980px) {
  .signin { grid-template-columns: 1fr; }
  .signin__showcase { display: none; }
  .signin__panel { padding: 22px 20px; }
  .signin__body { margin: 28px auto; }
}
@media (prefers-reduced-motion: reduce) {
  .signin__preview { transform: none; }
}

/* Écrans d’accueil / au revoir : logo transparent, plus de plaque blanche */
.auth-gate .auth__logo-plate {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
}
.auth-gate__logo { height: 44px !important; width: auto !important; }

/* --- Bandeaux de licence (démo, retard, dépassement) ------------------- */
.lic-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
}
.lic-banner--demo {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface));
}
.lic-banner--late { border-color: color-mix(in srgb, var(--ws-danger) 40%, var(--line)); background: var(--ws-danger-soft); }
.lic-banner__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.lic-banner__icon svg { width: 18px; height: 18px; }
.lic-banner__text { flex: 1; min-width: 220px; }
.lic-banner__text strong { font-weight: 650; }
.lic-banner__link { font-weight: 650; font-size: 13px; color: var(--ink); white-space: nowrap; }
.lic-countdown { display: inline-flex; gap: 6px; font-variant-numeric: tabular-nums; }
.lic-countdown span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
}
.lic-countdown b { font-size: 16px; font-weight: 700; }

/* =====================================================================
   Composants « pf » : abonnement client et back-office éditeur
   ===================================================================== */
.pf-stack { display: flex; flex-direction: column; gap: 16px; max-width: 1240px; }
.pf-grid { display: grid; gap: 16px; }
.pf-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.pf-card > :first-child { margin-top: 0; }
.pf-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -2px 0 14px; }
.pf-card__head h2, .pf-card__head h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.pf-empty { text-align: center; padding: 40px 24px; }
.pf-empty h2 { margin: 0 0 6px; font-size: 18px; }
.pf-eyebrow { margin: 0 0 6px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
.pf-big { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-big small { font-size: 13px; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.pf-muted { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.pf-link { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.pf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--ws-neutral-soft);
  color: var(--ink-soft);
}
.pf-badge--ok { background: var(--brand-soft); color: var(--brand-dark); }
.pf-badge--warn { background: var(--ws-warn-soft); color: var(--ws-warn); }
.pf-badge--danger { background: var(--ws-danger-soft); color: var(--ws-danger); }
.pf-badge--info { background: var(--ws-info-soft); color: var(--ws-info); }
html[data-theme="dark"] .pf-badge--ok { color: var(--brand); }

.pf-meter { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.pf-meter__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 8px; color: var(--ink); }
.pf-meter__top b { font-size: 18px; }
.pf-meter__bar { height: 8px; border-radius: 99px; background: var(--ws-chip); overflow: hidden; margin-bottom: 8px; }
.pf-meter__bar span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.pf-meter.is-high .pf-meter__bar span { background: var(--ws-warn); }
.pf-meter.is-over .pf-meter__bar span { background: var(--ws-danger); }
.pf-meter p { margin: 0; }

.pf-inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pf-inline-form__title { font-size: 13px; font-weight: 650; color: var(--ink); }
.pf-inline-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.pf-inline-form input[type="number"] { width: 72px; }
.pf-inline-form .pf-muted { margin: 0; flex-basis: 100%; }

.pf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.pf-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); min-width: 0; }
.pf-form__wide { grid-column: 1 / -1; }
.pf-form__actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pf-form__hint { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; color: var(--ink-faint); }
.pf-form input:not([type="checkbox"]):not([type="radio"]),
.pf-form select,
.pf-form textarea,
.pf-inline-form input,
.pf-inline-form select {
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  min-height: 38px;
  width: 100%;
  box-sizing: border-box;
}
.pf-inline-form input, .pf-inline-form select { width: auto; }
.pf-form textarea { resize: vertical; min-height: 70px; }
.pf-form input:focus, .pf-form select:focus, .pf-form textarea:focus,
.pf-inline-form input:focus, .pf-inline-form select:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.pf-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; color: var(--ink) !important; }

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.pf-btn:hover { background: var(--ws-hover); text-decoration: none; }
.pf-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pf-btn--primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--brand)); }
.pf-btn--danger { color: var(--ws-danger); border-color: color-mix(in srgb, var(--ws-danger) 40%, var(--line)); }
.pf-btn--sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }

.pf-table-wrap { overflow-x: auto; margin: 0 -20px; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pf-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pf-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.pf-table tr:last-child td { border-bottom: 0; }
.pf-table th:first-child, .pf-table td:first-child { padding-left: 20px; }
.pf-table th:last-child, .pf-table td:last-child { padding-right: 20px; }
.pf-table tbody tr:hover td { background: var(--surface-alt); }
.pf-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-table .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; white-space: nowrap; }
.pf-table small { display: block; color: var(--ink-faint); font-size: 12px; }
.pf-table a { color: var(--ink); font-weight: 600; }

.pf-modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.pf-modules li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.pf-modules li > span:nth-child(2) { flex: 1; min-width: 0; }
.pf-modules strong { display: block; font-size: 13.5px; color: var(--ink); }
.pf-modules small { display: block; font-size: 12px; color: var(--ink-faint); }
.pf-modules__check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); flex: none; }
.pf-modules li.is-off { opacity: .65; }
.pf-modules li.is-off .pf-modules__check { background: var(--ws-chip); color: var(--ink-faint); }

.pf-feed { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pf-feed li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink); }
.pf-feed small { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 2px; }

@media (max-width: 1100px) {
  .pf-grid--3, .pf-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pf-grid--2, .pf-grid--3, .pf-grid--4, .pf-form, .pf-modules { grid-template-columns: 1fr; }
}

/* =====================================================================
   Back-office éditeur (/plateforme)
   ===================================================================== */
body.bo-body { margin: 0; background: var(--paper); }
.bo { display: flex; min-height: 100vh; }
.bo-side {
  position: sticky;
  top: 0;
  height: 100vh;
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  background: #0F1C18;
  color: #A3B5AE;
  padding: 18px 12px 12px;
  box-sizing: border-box;
}
.bo-side__brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 18px; text-decoration: none; }
.bo-side__brand img { height: 26px; width: auto; display: block; }
.bo-side__brand span {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6FE0B2;
  background: rgba(111, 224, 178, .12);
  padding: 2px 8px;
  border-radius: 99px;
}
.bo-side__nav { flex: 1; overflow-y: auto; }
.bo-side__section { margin: 14px 10px 6px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #6E827A; }
.bo-side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #C6D3CE;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.bo-side__link .nav-icon { width: 18px; height: 18px; color: #8FA39B; opacity: 1; border: 0; flex: none; }
.bo-side__link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.bo-side__link.is-active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 650; }
.bo-side__link.is-active .nav-icon { color: #6FE0B2; }
.bo-side__count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #F2B35B; color: #2A1A00; }
.bo-side__count--danger { background: #F07A6E; color: #2A0A06; }
.bo-side__me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.bo-side__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bo-side__who strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-side__who small { font-size: 11.5px; color: #8FA39B; }
.bo-side__out { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: #A3B5AE; cursor: pointer; }
.bo-side__out .nav-icon { width: 18px; height: 18px; color: currentColor; border: 0; opacity: 1; }
.bo-side__out:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.bo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bo-top { display: flex; align-items: center; gap: 16px; padding: 22px 32px 16px; flex-wrap: wrap; }
.bo-top > div:first-child { flex: 1; min-width: 200px; }
.bo-top h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.bo-top__crumb { margin: 0 0 2px; font-size: 13px; color: var(--ink-faint); }
.bo-top__crumb a { color: var(--ink-soft); }
.bo-top__search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); width: 280px; box-sizing: border-box; }
.bo-top__search .nav-icon { width: 16px; height: 16px; color: var(--ink-faint); border: 0; opacity: 1; }
.bo-top__search input { border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; font: inherit; font-size: 13.5px; flex: 1; min-width: 0; padding: 0 !important; min-height: 0 !important; color: var(--ink); }
.bo-top__actions { display: flex; gap: 8px; }
.bo-content { padding: 0 32px 48px; }
.bo-content > .flash { max-width: 1320px; }
.bo-wide { max-width: 1320px; }
.bo-narrow { max-width: 860px; }
.bo-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.bo-stack-sm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bo-stack-sm select { font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.bo-grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.bo-kpi--alert { border-color: color-mix(in srgb, var(--ws-danger) 40%, var(--line)); }
.bo-chart .chart { width: 100%; height: auto; display: block; background: transparent !important; border: 0 !important; }
.bo-due { color: var(--ws-danger) !important; font-weight: 650; }
.bo-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.bo-filters .today-chip { text-decoration: none; }

.bo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bo-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bo-list li:last-child { border-bottom: 0; }
.bo-list small { flex-basis: 100%; color: var(--ink-faint); font-size: 12px; }
.bo-list a { color: var(--ink); }
.bo-timeline { list-style: none; margin: 0; padding: 0; }
.bo-timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bo-timeline li:last-child { border-bottom: 0; }
.bo-timeline__when { color: var(--ink-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bo-timeline small { display: block; color: var(--ink-faint); font-size: 12px; }
.bo-timeline a { color: var(--ink); font-weight: 600; }

.bo-client { display: flex; align-items: center; gap: 10px; }
.bo-client small { display: block; }
.bo-row-off td { opacity: .55; }
.bo-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bo-row-actions form { margin: 0; }

.bo-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--tenant, var(--brand)), var(--shadow-card);
}
.bo-hero .tenant-avatar { width: 48px; height: 48px; border-radius: 13px; font-size: 16px; }
.bo-hero__id { flex: 1; min-width: 240px; }
.bo-hero__name { margin: 0 0 3px; font-size: 20px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-hero__id .pf-muted { margin: 0; }
.bo-hero__stats { display: flex; gap: 22px; margin: 0; flex-wrap: wrap; }
.bo-hero__stats div { display: flex; flex-direction: column; }
.bo-hero__stats dt { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.bo-hero__stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.bo-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bo-tabs a {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.bo-tabs a:hover { color: var(--ink); text-decoration: none; }
.bo-tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.bo-details { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; }
.bo-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bo-details[open] summary { margin-bottom: 12px; }

.bo-form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bo-span-2 { grid-column: span 2; }
.bo-choice { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bo-choice legend { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.bo-choice__opt { flex-direction: row !important; align-items: flex-start; gap: 10px !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bo-choice__opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bo-choice__opt strong { display: block; font-size: 13.5px; color: var(--ink); }
.bo-choice__opt small { display: block; font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.bo-choice__opt input { margin-top: 3px; }
.bo-choice--modules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bo-choice--modules small { color: var(--ink-faint); font-weight: 400; }
.pf-check.is-included { opacity: .7; }

.bo-quote { list-style: none; margin: 10px 0; padding: 0; border-top: 1px solid var(--line); }
.bo-quote li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.bo-quote li span:last-child { color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

.bo-roles summary { cursor: pointer; font-size: 13px; }
.bo-roles__form { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 4px; }
.bo-rights details > summary { list-style: none; cursor: pointer; }
.bo-rights details > summary::-webkit-details-marker { display: none; }
.bo-rights__head, .pf-card details > summary.bo-rights__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}
.bo-rights__head small { display: block; font-size: 12.5px; color: var(--ink-faint); font-weight: 400; margin-top: 2px; }
.bo-rights__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-rights__form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pf-card details[open] > form.pf-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.bo-rights__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin-bottom: 12px; }
.bo-rights__grid .pf-check { font-size: 13px; display: flex; }
.bo-rights__grid .pf-check.is-default { font-weight: 600 !important; }

.bo-invoice__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.bo-invoice__meta { text-align: right; }
.bo-invoice__meta .pf-muted { margin: 4px 0 0; }
.bo-totals { margin: 14px 0 0 auto; max-width: 320px; }
.bo-totals div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; color: var(--ink-soft); }
.bo-totals dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.bo-totals .is-total { border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: 15px; }

.bo-lines { display: flex; flex-direction: column; gap: 8px; }
.bo-lines__row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 140px; gap: 8px; }
.bo-lines__row input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); min-width: 0; }

.bo-requests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bo-request { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bo-request:last-child { border-bottom: 0; }
.bo-request__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.bo-request__head small { color: var(--ink-faint); font-size: 12px; margin-left: auto; }
.bo-request__head a { color: var(--ink); font-weight: 600; }
.bo-request__detail { margin: 6px 0 0; font-size: 13.5px; color: var(--ink); }
.bo-request__msg { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-soft); font-style: italic; }
.bo-request .pf-inline-form { margin-top: 10px; padding-top: 10px; }
.bo-audit-detail { font-size: 12.5px; color: var(--ink-soft); max-width: 420px; }

@media (max-width: 1180px) {
  .bo-form-4, .bo-choice--modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-rights__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .bo { flex-direction: column; }
  .bo-side { position: static; height: auto; flex: none; }
  .bo-side__nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .bo-side__section { display: none; }
  .bo-top, .bo-content { padding-left: 16px; padding-right: 16px; }
  .bo-top__search { width: 100%; }
  .bo-form-4, .bo-choice, .bo-choice--modules, .bo-rights__grid { grid-template-columns: 1fr; }
  .bo-span-2 { grid-column: auto; }
  .bo-invoice__meta { text-align: left; }
}
/* Le back-office ne charge pas app.js : barres affichées sans animation d’entrée. */
.bo-chart .chart__bar { transform: scaleY(1) !important; }

/* =====================================================================
   Finitions V2.2 — respiration et cohérence des anciens écrans
   ===================================================================== */

/* Tuiles de chiffres : même langage que « Aujourd’hui » (plus de dégradés par position). */
html .shell--ws .kpi,
html .shell--ws .grid > .kpi,
html[data-theme="dark"] .shell--ws .kpi {
  background: var(--surface) !important;
  background-image: none !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-card) !important;
  padding: 16px 18px !important;
}
html .shell--ws .kpi::before,
html .shell--ws .kpi::after,
html .shell--ws .grid > .kpi::before,
html .shell--ws .grid > .kpi::after { display: none !important; }
html .shell--ws .kpi__label,
html[data-theme="dark"] .shell--ws .kpi__label {
  color: var(--ink-soft) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html .shell--ws .kpi__value,
html[data-theme="dark"] .shell--ws .kpi__value { color: var(--ink) !important; letter-spacing: -.02em; }
html .shell--ws .kpi__sub,
html[data-theme="dark"] .shell--ws .kpi__sub { color: var(--ink-faint) !important; }
html .shell--ws .kpi:hover { border-color: var(--line-strong) !important; box-shadow: var(--shadow-card-hover) !important; }

/* Tableaux : jamais collés au bord de leur carte. */
html .shell--ws .table th:first-child,
html .shell--ws .table td:first-child { padding-left: 22px !important; }
html .shell--ws .table th:last-child,
html .shell--ws .table td:last-child { padding-right: 22px !important; }
html .shell--ws .table th { background: var(--surface-alt) !important; color: var(--ink-faint) !important; }

/* Cartes et blocs : intérieur et écart constants. */
html .shell--ws .card__head { padding: 18px 22px !important; }
html .shell--ws .card__body { padding: 20px 22px !important; }
html .shell--ws .card + .card,
html .shell--ws .card + .table-wrap,
html .shell--ws .filters + .card,
html .shell--ws .page-head + .card { margin-top: 16px; }
html .shell--ws .filters { padding: 18px 22px !important; border-radius: 12px; }
html .shell--ws .content > * + * { margin-top: 16px; }
html .shell--ws .content > .lic-banner + *,
html .shell--ws .content > .flash + * { margin-top: 0; }

@media (max-width: 900px) {
  html .shell--ws .content { padding: 14px 16px 110px !important; }
  html .shell--ws .topbar { padding-left: 16px !important; padding-right: 16px !important; }
  html .shell--ws .card__head, html .shell--ws .card__body, html .shell--ws .filters { padding: 16px !important; }
  html .shell--ws .table th:first-child, html .shell--ws .table td:first-child { padding-left: 16px !important; }
  html .shell--ws .table th:last-child, html .shell--ws .table td:last-child { padding-right: 16px !important; }

  /* Bandeau de démo compact sur téléphone */
  .lic-banner { padding: 10px 12px; gap: 8px; font-size: 13px; }
  .lic-banner__icon { display: none; }
  .lic-banner__text { min-width: 0; flex-basis: 100%; }
  .lic-countdown span { padding: 3px 7px; }
  .lic-countdown b { font-size: 14px; }
  .lic-banner__link { margin-left: auto; }
}

/* =====================================================================
   Écrans d’accès « verre » : connexion, bienvenue, au revoir, back-office
   ===================================================================== */
body:has(.glass-auth) { background: #060C0A; margin: 0; }
body:has(.glass-auth) > .flash { display: none; }
.glass-auth {
  --glass-text: #F3F7F5;
  --glass-soft: rgba(243, 247, 245, .72);
  --glass-faint: rgba(243, 247, 245, .5);
  --glass-accent: #6FE0B2;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  color: var(--glass-text);
  background:
    radial-gradient(1200px 700px at 15% 10%, #12352A 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 90%, #0F2537 0%, transparent 60%),
    linear-gradient(160deg, #0A1714 0%, #060C0A 55%, #070B12 100%);
  font-family: var(--font-ui, Inter, system-ui, sans-serif);
}
.glass-auth__net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.glass-auth__orbs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.glass-auth__orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.glass-auth__orbs span:nth-child(1) { width: 520px; height: 520px; left: -120px; top: -140px; background: #0F8A60; animation: glassOrb1 26s ease-in-out infinite alternate; }
.glass-auth__orbs span:nth-child(2) { width: 460px; height: 460px; right: -140px; bottom: -160px; background: #1D4F8C; animation: glassOrb2 30s ease-in-out infinite alternate; }
.glass-auth__orbs span:nth-child(3) { width: 260px; height: 260px; left: 58%; top: 18%; background: #B9822B; opacity: .28; animation: glassOrb3 22s ease-in-out infinite alternate; }
@keyframes glassOrb1 { to { transform: translate(140px, 110px) scale(1.12); } }
@keyframes glassOrb2 { to { transform: translate(-160px, -90px) scale(1.08); } }
@keyframes glassOrb3 { to { transform: translate(-120px, 140px) scale(.9); } }

.glass-auth__stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 40px 16px 28px;
  box-sizing: border-box;
  pointer-events: none;
}
.glass-auth__stage > * { pointer-events: auto; }
.glass-auth__logo { height: 34px; width: auto; display: block; animation: glassIn .8s cubic-bezier(.2, .8, .2, 1) both; }

.glass-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  width: min(440px, 100%);
  box-sizing: border-box;
  padding: 32px 32px 26px;
  border-radius: 26px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .04) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, .75),
    0 10px 30px -10px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(255, 255, 255, .04);
  animation: glassIn .9s .08s cubic-bezier(.2, .8, .2, 1) both;
}
/* Reflet qui suit le curseur */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .14), transparent 45%);
  transition: opacity .3s ease;
}
/* Liseré lumineux en haut, façon verre poli */
.glass-card::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card { background: rgba(18, 30, 27, .92); }
}
@keyframes glassIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  color: var(--glass-soft);
}
.glass-chip strong { color: var(--glass-text); font-weight: 650; }
.glass-chip small { display: block; font-size: 11px; color: var(--glass-faint); }
.glass-chip .tenant-avatar { background: var(--tenant, #19B07A); color: #fff; }
.glass-chip--bo { padding: 6px 14px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; color: var(--glass-accent); }

.glass-card__title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--glass-text); }
.glass-card__lede { margin: 8px 0 24px; font-size: 14.5px; line-height: 1.5; color: var(--glass-soft); }
.glass-card__help { margin: 20px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--glass-faint); }
.glass-card .flash {
  margin: 0 0 16px !important;
  border-radius: 12px !important;
  background: rgba(240, 122, 110, .16) !important;
  border: 1px solid rgba(240, 122, 110, .4) !important;
  color: #FFD9D4 !important;
}
.glass-card .flash--success { background: rgba(111, 224, 178, .14) !important; border-color: rgba(111, 224, 178, .4) !important; color: #D6FBEA !important; }
.glass-card .flash * { color: inherit !important; }

.glass-form { display: flex; flex-direction: column; gap: 16px; }
.glass-field { display: flex; flex-direction: column; gap: 7px; }
.glass-field label { font-size: 12.5px; font-weight: 600; color: var(--glass-soft); letter-spacing: .01em; }
.glass-field input,
html[data-theme="dark"] .glass-field input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  background: rgba(255, 255, 255, .07) !important;
  color: var(--glass-text) !important;
  font: inherit;
  font-size: 15px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25) !important;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.glass-field input::placeholder { color: rgba(243, 247, 245, .38); }
.glass-field input:hover { background: rgba(255, 255, 255, .1) !important; }
.glass-field input:focus {
  outline: 0;
  border-color: rgba(111, 224, 178, .7) !important;
  background: rgba(255, 255, 255, .1) !important;
  box-shadow: 0 0 0 4px rgba(111, 224, 178, .18), inset 0 1px 2px rgba(0, 0, 0, .2) !important;
}
.glass-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--glass-text);
  -webkit-box-shadow: 0 0 0 40px #1A2B26 inset !important;
  caret-color: var(--glass-text);
}
.glass-password { position: relative; display: block; }
.glass-password input { padding-right: 92px; }
.glass-password .password-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .1);
  color: var(--glass-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.glass-password .password-toggle:hover { background: rgba(255, 255, 255, .18); }

.glass-submit {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #E6EEEA 100%);
  color: #0B1714;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(111, 224, 178, .55), inset 0 -1px 0 rgba(0, 0, 0, .08);
  transition: transform .15s ease, box-shadow .25s ease;
}
.glass-submit::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .85), transparent);
  transform: skewX(-18deg);
  transition: left .7s ease;
}
.glass-submit:hover { text-decoration: none; box-shadow: 0 14px 38px -10px rgba(111, 224, 178, .75), inset 0 -1px 0 rgba(0, 0, 0, .08); }
.glass-submit:hover::after { left: 120%; }
.glass-submit:active { transform: translateY(1px) scale(.995); }
.glass-submit:focus-visible { outline: 3px solid rgba(111, 224, 178, .6); outline-offset: 3px; }
.glass-submit span { position: relative; z-index: 1; }

.glass-auth__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: var(--glass-faint);
  animation: glassIn .9s .2s cubic-bezier(.2, .8, .2, 1) both;
}
.glass-auth__foot img { height: 18px; width: auto; opacity: .85; }
.glass-auth__secure { display: inline-flex; align-items: center; gap: 6px; }
.glass-auth__secure svg { width: 14px; height: 14px; }
.glass-auth .auth__version {
  background: rgba(255, 255, 255, .1) !important;
  color: var(--glass-soft) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  box-shadow: none !important;
}

/* Bienvenue / au revoir */
.glass-card--gate { text-align: center; padding: 36px 32px 30px; }
.glass-card--gate .glass-card__lede { margin-bottom: 26px; }
.glass-boot { margin: 0 auto 22px; max-width: 300px; }
.glass-boot__bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.glass-boot__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #19B07A, #6FE0B2);
  box-shadow: 0 0 14px rgba(111, 224, 178, .8);
  transition: width .12s linear;
}
.glass-boot--out .glass-boot__fill { animation: glassFill 2.3s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes glassFill { to { width: 100%; } }
.glass-boot__status { margin: 10px 0 0; font-size: 12.5px; color: var(--glass-faint); letter-spacing: .02em; }
.glass-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 18px; }
.glass-pill {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: var(--glass-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease;
}
.glass-pill:hover { background: rgba(255, 255, 255, .14); text-decoration: none; color: #fff; }

.mark-anim { display: block; margin: 0 auto 18px; filter: drop-shadow(0 10px 24px rgba(25, 176, 122, .45)); }
.mark-anim rect, .mark-anim circle { transform-box: fill-box; transform-origin: left center; }
.mark-anim__s1 { animation: markSlide .7s .15s cubic-bezier(.2, .9, .2, 1) both; }
.mark-anim__s2 { animation: markSlide .7s .3s cubic-bezier(.2, .9, .2, 1) both; }
.mark-anim__s3 { animation: markSlide .7s .45s cubic-bezier(.2, .9, .2, 1) both; }
.mark-anim__dot { transform-origin: center; animation: markPop .5s .85s cubic-bezier(.3, 1.6, .5, 1) both, markPulse 2.4s 1.5s ease-in-out infinite; }
@keyframes markSlide { from { opacity: 0; transform: translateX(-14px) scaleX(.4); } to { opacity: 1; transform: none; } }
@keyframes markPop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes markPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

@media (max-width: 520px) {
  .glass-card { padding: 26px 20px 22px; border-radius: 22px; }
  .glass-card__title { font-size: 26px; }
  .glass-auth__orbs span:nth-child(1) { width: 340px; height: 340px; }
  .glass-auth__orbs span:nth-child(2) { width: 300px; height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .glass-auth__orbs span, .glass-auth__logo, .glass-card, .glass-auth__foot,
  .mark-anim rect, .mark-anim circle, .glass-boot--out .glass-boot__fill { animation: none !important; }
  .glass-boot--out .glass-boot__fill { width: 100%; }
  .glass-submit::after { display: none; }
}

/* =====================================================================
   Mouvement — entrées, cascades, survols, transitions de page
   Toujours désactivé si l’utilisateur réduit les animations.
   ===================================================================== */
@keyframes wsRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wsPop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wsSlideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* Entrée du contenu : plus ample et plus douce que l’ancienne */
html.motion-ok .shell--ws .content:not(.is-ready) > * { opacity: 0; transform: translateY(14px); }
html.motion-ok .shell--ws .content.is-ready > * {
  transition: opacity .5s cubic-bezier(.2, .8, .2, 1), transform .6s cubic-bezier(.2, .8, .2, 1);
}
html.motion-ok .shell--ws .content.is-ready > *:nth-child(2) { transition-delay: 60ms; }
html.motion-ok .shell--ws .content.is-ready > *:nth-child(3) { transition-delay: 120ms; }
html.motion-ok .shell--ws .content.is-ready > *:nth-child(4) { transition-delay: 180ms; }
html.motion-ok .shell--ws .content.is-ready > *:nth-child(n+5) { transition-delay: 240ms; }

/* Cascades à l’intérieur des pages refaites */
html.motion-ok .today > *,
html.motion-ok .pf-stack > *,
html.motion-ok .pf-grid > *,
html.motion-ok .today-kpis > *,
html.motion-ok .bo-content > .pf-stack > * { animation: wsRise .6s cubic-bezier(.2, .8, .2, 1) both; }
html.motion-ok .today > *:nth-child(2), html.motion-ok .pf-stack > *:nth-child(2),
html.motion-ok .pf-grid > *:nth-child(2), html.motion-ok .today-kpis > *:nth-child(2) { animation-delay: 70ms; }
html.motion-ok .today > *:nth-child(3), html.motion-ok .pf-stack > *:nth-child(3),
html.motion-ok .pf-grid > *:nth-child(3), html.motion-ok .today-kpis > *:nth-child(3) { animation-delay: 140ms; }
html.motion-ok .today > *:nth-child(4), html.motion-ok .pf-stack > *:nth-child(4),
html.motion-ok .pf-grid > *:nth-child(4), html.motion-ok .today-kpis > *:nth-child(4) { animation-delay: 210ms; }
html.motion-ok .today > *:nth-child(n+5), html.motion-ok .pf-stack > *:nth-child(n+5),
html.motion-ok .pf-grid > *:nth-child(n+5) { animation-delay: 260ms; }
html.motion-ok .today-row { animation: wsSlideIn .45s cubic-bezier(.2, .8, .2, 1) both; }
html.motion-ok .today-row:nth-child(1) { animation-delay: 220ms; }
html.motion-ok .today-row:nth-child(2) { animation-delay: 270ms; }
html.motion-ok .today-row:nth-child(3) { animation-delay: 320ms; }
html.motion-ok .today-row:nth-child(4) { animation-delay: 370ms; }
html.motion-ok .today-row:nth-child(5) { animation-delay: 420ms; }
html.motion-ok .today-row:nth-child(n+6) { animation-delay: 460ms; }
html.motion-ok .lic-banner { animation: wsPop .5s cubic-bezier(.2, .8, .2, 1) both; }

/* Survols : légère élévation, jamais de saut */
.today-kpi, .pf-card, .shell--ws .kpi, .shell--ws .card, .bo-hero {
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, border-color .2s ease;
}
html.motion-ok a.today-kpi:hover,
html.motion-ok .shell--ws .kpi:hover { transform: translateY(-2px); }
html.motion-ok .today-row__link { transition: background .15s ease, transform .2s ease; }
html.motion-ok .today-row__link:hover { transform: translateX(3px); }
html.motion-ok .shell--ws .rail .rail__link { transition: background .15s ease, color .15s ease, transform .15s ease; }
html.motion-ok .shell--ws .rail .rail__link:hover { transform: translateX(2px); }
html.motion-ok .wsbar__item .nav-icon { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
html.motion-ok .wsbar__item:hover .nav-icon { transform: translateY(-2px) scale(1.06); }
html.motion-ok .wsbar__item.is-active .nav-icon { animation: wsPop .35s ease both; }
.pf-btn, .today-row__act, .cmdk-trigger, .today-chip { transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .2s ease; }
.pf-btn:active, .today-chip:active, .today-row__act:active { transform: scale(.97); }
.pf-meter__bar span, .today-team__bar span { transition: width 1s cubic-bezier(.2, .8, .2, 1); }

/* Changement d’espace : le panneau se renouvelle en glissant */
html.motion-ok .rail__nav.is-switching > [data-ws]:not([data-ws-off]) { animation: wsSlideIn .3s cubic-bezier(.2, .8, .2, 1) both; }
html.motion-ok .rail__wstitle.is-switching { animation: wsFade .3s ease both; }

/* Palette Ctrl K : ouverture souple */
html.motion-ok .cmdk[open] { animation: wsPop .22s cubic-bezier(.2, .9, .3, 1.1) both; }
html.motion-ok .cmdk[open]::backdrop { animation: wsFade .2s ease both; }
html.motion-ok .cmdk__opt { transition: background .12s ease; }

/* Barre de progression de navigation (en haut de l’écran) */
.ws-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #6FE0B2);
  box-shadow: 0 0 10px rgba(111, 224, 178, .7);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  pointer-events: none;
}
.ws-progress.is-on { opacity: 1; animation: wsProgress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes wsProgress { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }

/* Transition entre pages (navigateurs récents) : fondu enchaîné, menus immobiles */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: wsFadeOut .18s ease both; }
  ::view-transition-new(root) { animation: wsFade .28s ease both; }
  .wsbar { view-transition-name: ws-bar; }
  .shell--ws .rail { view-transition-name: ws-rail; }
}
@keyframes wsFadeOut { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .today > *, .pf-stack > *, .pf-grid > *, .today-kpis > *, .today-row, .lic-banner,
  .rail__nav [data-ws], .cmdk[open], .ws-progress.is-on { animation: none !important; }
  .today-kpi, .pf-card, .today-row__link, .rail__link, .wsbar__item .nav-icon { transition: none !important; transform: none !important; }
}

/* =====================================================================
   VERRE — tout l’ERP, mode clair et mode sombre (V2.2)
   Fond à halos teintés par l’accent du compte ; surfaces en verre dépoli.
   Seuls les blocs de premier niveau ont un vrai flou (performances) ;
   les éléments imbriqués sont simplement translucides.
   ===================================================================== */
html:root:not([data-theme="dark"]) {
  --g-base: #E7EDEA;
  --g-bg: rgba(255, 255, 255, .62);
  --g-bg-strong: rgba(255, 255, 255, .8);
  --g-bg-soft: rgba(255, 255, 255, .4);
  --g-border: rgba(255, 255, 255, .78);
  --g-edge: rgba(16, 32, 27, .07);
  --g-hi: rgba(255, 255, 255, .95);
  --g-shadow: 0 12px 32px -14px rgba(16, 32, 27, .22), 0 2px 6px -2px rgba(16, 32, 27, .06);
  --g-field: rgba(255, 255, 255, .72);
  --g-orb-a: color-mix(in srgb, var(--accent, #2458D3) 55%, #ffffff);
  --g-orb-b: #9CDCC4;
  --g-orb-c: #F7D8A8;
  --g-orb-d: #C7D3F7;
  --g-orb-opacity: .75;
  --line: rgba(16, 32, 27, .09);
  --line-strong: rgba(16, 32, 27, .17);
  --surface-alt: rgba(255, 255, 255, .45);
  --ws-hover: rgba(255, 255, 255, .55);
  --ws-chip: rgba(16, 32, 27, .06);
}
html:root[data-theme="dark"] {
  --g-base: #070C0A;
  --g-bg: rgba(20, 29, 26, .5);
  --g-bg-strong: rgba(22, 31, 28, .84);
  --g-bg-soft: rgba(255, 255, 255, .04);
  --g-border: rgba(255, 255, 255, .09);
  --g-edge: rgba(0, 0, 0, .4);
  --g-hi: rgba(255, 255, 255, .08);
  --g-shadow: 0 18px 44px -18px rgba(0, 0, 0, .75), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --g-field: rgba(255, 255, 255, .05);
  --g-orb-a: color-mix(in srgb, var(--accent, #2458D3) 80%, #000000);
  --g-orb-b: #15845E;
  --g-orb-c: #8A5E1C;
  --g-orb-d: #2A4F96;
  --g-orb-opacity: .62;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .15);
  --surface-alt: rgba(255, 255, 255, .035);
  --ws-hover: rgba(255, 255, 255, .06);
  --ws-chip: rgba(255, 255, 255, .07);
}

/* --- Fond ------------------------------------------------------------- */
html body { background: var(--g-base) !important; }
.ws-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 0% 0%, color-mix(in srgb, var(--g-orb-b) 35%, transparent), transparent 60%),
    var(--g-base);
}
.ws-backdrop span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--g-orb-opacity); will-change: transform; }
.ws-backdrop span:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: var(--g-orb-a); }
.ws-backdrop span:nth-child(2) { width: 40vw; height: 40vw; right: -12vw; top: 18vh; background: var(--g-orb-b); }
.ws-backdrop span:nth-child(3) { width: 30vw; height: 30vw; left: 30vw; bottom: -12vw; background: var(--g-orb-c); }
.ws-backdrop span:nth-child(4) { width: 34vw; height: 34vw; right: 10vw; bottom: -16vw; background: var(--g-orb-d); }
html.motion-ok .ws-backdrop span:nth-child(1) { animation: glassOrb1 48s ease-in-out infinite alternate; }
html.motion-ok .ws-backdrop span:nth-child(2) { animation: glassOrb2 56s ease-in-out infinite alternate; }
html.motion-ok .ws-backdrop span:nth-child(3) { animation: glassOrb3 44s ease-in-out infinite alternate; }
html.motion-ok .ws-backdrop span:nth-child(4) { animation: glassOrb1 60s ease-in-out infinite alternate-reverse; }
html body .shell--ws, html body .bo { position: relative; z-index: 1; background: transparent !important; }

/* Les conteneurs de page laissent voir le fond */
html body .shell--ws > .main,
html body .shell--ws .content,
html body .shell--ws .topbar,
html[data-theme="dark"] body .shell--ws .topbar,
html body .bo-main { background: transparent !important; }
html body .shell--ws .topbar__title { border-top-color: var(--line) !important; }

/* --- Barre des espaces : verre teinté sombre, dans les deux modes ----- */
html body .shell--ws .wsbar {
  background: color-mix(in srgb, var(--wsbar-bg) 82%, transparent) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}

/* --- Panneau de menu ------------------------------------------------- */
html body .shell--ws .rail,
html[data-theme="dark"] body .shell--ws .rail {
  background: var(--g-bg) !important;
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border-right: 1px solid var(--g-border) !important;
  box-shadow: inset -1px 0 0 var(--g-edge), 4px 0 24px -16px rgba(0, 0, 0, .25) !important;
}
html body .shell--ws .rail__brand,
html body .shell--ws .rail__foot,
html[data-theme="dark"] body .shell--ws .rail__brand,
html[data-theme="dark"] body .shell--ws .rail__foot { border-color: var(--line) !important; }
html body .shell--ws .rail .rail__link--active,
html body .shell--ws .rail .rail__link--active:hover,
html[data-theme="dark"] body .shell--ws .rail .rail__link--active {
  background: var(--g-bg-strong) !important;
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 1px var(--g-border), 0 4px 12px -6px rgba(0, 0, 0, .2) !important;
}
html body .shell--ws .rail__cron,
html[data-theme="dark"] body .shell--ws .rail__cron { background: var(--g-bg-soft) !important; border-color: var(--g-border) !important; }

/* --- Surfaces de premier niveau : verre dépoli ------------------------ */
html body .shell--ws .card,
html body .shell--ws .kpi,
html body .shell--ws .filters,
html body .shell--ws .record-head,
html body .shell--ws .scope-bar,
html body .shell--ws .ribbon,
html body .shell--ws .dashboard-welcome,
html body .shell--ws .play-hero,
html body .shell--ws .table-wrap:not(.card .table-wrap):not(.pf-card .table-wrap),
html body .shell--ws .today-kpi,
html body .shell--ws .today-inbox,
html body .shell--ws .today-card,
html body .shell--ws .lic-banner,
html body .pf-card,
html body .bo-hero,
html[data-theme="dark"] body .shell--ws .card,
html[data-theme="dark"] body .shell--ws .kpi,
html[data-theme="dark"] body .shell--ws .filters,
html[data-theme="dark"] body .shell--ws .record-head,
html[data-theme="dark"] body .shell--ws .scope-bar,
html[data-theme="dark"] body .shell--ws .ribbon,
html[data-theme="dark"] body .shell--ws .dashboard-welcome,
html[data-theme="dark"] body .shell--ws .table-wrap:not(.card .table-wrap) {
  background: var(--g-bg) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--g-border) !important;
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge) !important;
}
html body .shell--ws .lic-banner--demo {
  background: linear-gradient(100deg, color-mix(in srgb, var(--brand) 16%, var(--g-bg)), var(--g-bg)) !important;
}
html body .shell--ws .lic-banner--late { background: color-mix(in srgb, var(--ws-danger) 14%, var(--g-bg)) !important; }

/* Imbriqués : translucides, sans second flou */
html body .shell--ws .card .card,
html body .shell--ws .card .kpi,
html body .shell--ws .card .filters,
html body .shell--ws .card .table-wrap,
html body .pf-card .pf-card,
html body .pf-card .pf-meter,
html body .pf-card .pf-modules li,
html body .shell--ws .today-inbox .today-row,
html[data-theme="dark"] body .shell--ws .card .card,
html[data-theme="dark"] body .shell--ws .card .kpi {
  background: var(--g-bg-soft) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none !important;
  border-color: var(--line) !important;
}
html body .shell--ws .today-inbox .today-row { background: transparent !important; border-color: var(--line) !important; }
html body .shell--ws .table th,
html[data-theme="dark"] body .shell--ws .table th { background: var(--g-bg-soft) !important; }
html body .shell--ws .table tbody tr:hover td,
html[data-theme="dark"] body .shell--ws .table tbody tr:hover td { background: var(--ws-hover) !important; }
html body .shell--ws .table td,
html[data-theme="dark"] body .shell--ws .table td { border-color: var(--line) !important; }
html body .shell--ws .card__head { border-color: var(--line) !important; }

/* --- Champs : translucides, nets au focus ---------------------------- */
html body .shell--ws .content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html body .shell--ws .content select,
html body .shell--ws .content textarea,
html body .pf-form input:not([type="checkbox"]):not([type="radio"]),
html body .pf-form select,
html body .pf-form textarea,
html[data-theme="dark"] body .shell--ws .content input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body .shell--ws .content select,
html[data-theme="dark"] body .shell--ws .content textarea {
  background-color: var(--g-field) !important;
  border-color: var(--line-strong) !important;
}
html body .shell--ws .content input:focus,
html body .shell--ws .content select:focus,
html body .shell--ws .content textarea:focus,
html body .pf-form input:focus, html body .pf-form select:focus, html body .pf-form textarea:focus {
  background-color: var(--g-bg-strong) !important;
}

/* Boutons secondaires et pastilles : verre léger */
html body .shell--ws .btn:not(.btn--primary):not(.btn--danger):not(.btn--link):not(.btn--brand),
html body .pf-btn:not(.pf-btn--primary),
html body .today-chip:not(.is-on),
html body .cmdk-trigger,
html[data-theme="dark"] body .shell--ws .btn:not(.btn--primary):not(.btn--danger):not(.btn--link):not(.btn--brand) {
  background: var(--g-bg-strong) !important;
  border-color: var(--g-border) !important;
  box-shadow: inset 0 1px 0 var(--g-hi), 0 1px 2px rgba(0, 0, 0, .06) !important;
}
html body .shell--ws .tenant-chip { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* --- Palette, dock mobile, tiroir ------------------------------------ */
html body .cmdk,
html[data-theme="dark"] body .cmdk {
  background: var(--g-bg-strong) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--g-border) !important;
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--g-hi) !important;
}
html body .cmdk__foot { background: var(--g-bg-soft) !important; }
html body .mobile-dock,
html[data-theme="dark"] body .mobile-dock {
  background: var(--g-bg-strong) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--g-border) !important;
}
@media (max-width: 900px) {
  html body .shell--ws .rail,
  html[data-theme="dark"] body .shell--ws .rail { background: var(--g-bg-strong) !important; }
}

/* --- Back-office : mêmes matériaux ----------------------------------- */
html body .bo-side {
  background: rgba(10, 20, 17, .82) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}
html body .bo-top__search { background: var(--g-bg-strong) !important; border-color: var(--g-border) !important; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
html body .bo-tabs { border-color: var(--line) !important; }

/* Sans prise en charge du flou : surfaces plus opaques pour rester lisibles */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:root:not([data-theme="dark"]) { --g-bg: rgba(255, 255, 255, .92); --g-bg-strong: #fff; }
  html:root[data-theme="dark"] { --g-bg: rgba(24, 33, 30, .95); --g-bg-strong: #18211E; }
}
@media (prefers-reduced-transparency: reduce) {
  html:root:not([data-theme="dark"]) { --g-bg: rgba(255, 255, 255, .94); --g-bg-strong: #fff; }
  html:root[data-theme="dark"] { --g-bg: rgba(24, 33, 30, .96); --g-bg-strong: #18211E; }
}
@media print {
  .ws-backdrop { display: none !important; }
  html body { background: #fff !important; }
}
/* Mode sombre : l’ancienne feuille rend ces conteneurs opaques, on les libère. */
html[data-theme] body .shell--ws,
html[data-theme] body .shell--ws > .main,
html[data-theme] body .shell--ws .content,
html[data-theme] body .shell--ws .topbar { background: transparent !important; background-image: none !important; }
html[data-theme] body .today-kpi__value { color: var(--ink) !important; }
html[data-theme] body .today-kpi--alert .today-kpi__value { color: var(--ws-danger) !important; }
html[data-theme] body .today-row__text strong { color: var(--ink) !important; }

/* =====================================================================
   Planning partagé — grille horaire, mois, agenda, fenêtre, ludique
   ===================================================================== */
.plan { display: flex; flex-direction: column; gap: 16px; }
.plan-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 16px;
  background: var(--g-bg, var(--surface)); border: 1px solid var(--g-border, var(--line));
  -webkit-backdrop-filter: blur(22px) saturate(165%); backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--g-shadow, var(--shadow-card)), inset 0 1px 0 var(--g-hi, transparent);
}
.plan-head__nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-head__title { margin: 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.plan-round {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--g-border, var(--line)); background: var(--g-bg-strong, var(--surface));
  color: var(--ink); font-size: 20px; line-height: 1; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--g-hi, transparent); transition: transform .15s ease, background .15s ease;
}
.plan-round:hover { text-decoration: none; transform: scale(1.06); background: var(--surface); }
.plan-today {
  padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 650; text-decoration: none;
  background: var(--ink); color: var(--surface);
}
.plan-today:hover { text-decoration: none; opacity: .9; }
.plan-head__tools { display: flex; align-items: center; gap: 10px; }
.plan-seg { display: flex; padding: 3px; border-radius: 11px; background: var(--ws-chip); }
.plan-seg a { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.plan-seg a.is-on { background: var(--g-bg-strong, var(--surface)); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.plan-new {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #6FE0B2));
  color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none;
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .15s ease, box-shadow .2s ease;
}
.plan-new span { font-size: 18px; line-height: 1; }
.plan-new:hover { text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--brand) 80%, transparent); }

.plan-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plan-legend__chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 99px;
  border: 1px solid var(--g-border, var(--line)); background: var(--g-bg, var(--surface));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none;
}
.plan-legend__chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--cal, var(--ink-faint)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cal, #888) 22%, transparent); }
.plan-legend__chip:hover { text-decoration: none; color: var(--ink); }
.plan-legend__chip.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.plan-legend__add summary { list-style: none; cursor: pointer; padding: 6px 12px; border-radius: 99px; border: 1px dashed var(--line-strong); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.plan-legend__add summary::-webkit-details-marker { display: none; }
.plan-legend__add[open] { flex-basis: 100%; }
.plan-legend__form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.plan-legend__form input[name="name"] { font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--g-field, var(--surface)); color: var(--ink); }
.plan-legend__form input[type="color"] { width: 38px; height: 34px; border: 0; background: none; padding: 0; cursor: pointer; }

.plan-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plan-stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; min-width: 0;
  background: var(--g-bg, var(--surface)); border: 1px solid var(--g-border, var(--line));
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--g-shadow, var(--shadow-card)), inset 0 1px 0 var(--g-hi, transparent);
}
.plan-stat__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--ws-chip); flex: none; }
.plan-stat > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.plan-stat__value { font-size: 22px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-stat__value--sm { font-size: 16px; }
.plan-stat small { font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-stat--next .plan-stat__value { color: var(--brand); }
.plan-bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; flex: none; }
.plan-bars__col { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.plan-bars__bar { width: 8px; height: max(3px, var(--h)); border-radius: 4px; background: color-mix(in srgb, var(--brand) 55%, var(--ws-chip)); transform-origin: bottom; }
.plan-bars__col.is-today .plan-bars__bar { background: var(--brand); box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 60%, transparent); }
.plan-bars__col small { font-size: 9px; color: var(--ink-faint); }
html.motion-ok .plan-bars__bar { animation: planGrow .7s cubic-bezier(.2, .8, .2, 1) both; }
html.motion-ok .plan-bars__col:nth-child(2) .plan-bars__bar { animation-delay: 40ms; }
html.motion-ok .plan-bars__col:nth-child(3) .plan-bars__bar { animation-delay: 80ms; }
html.motion-ok .plan-bars__col:nth-child(4) .plan-bars__bar { animation-delay: 120ms; }
html.motion-ok .plan-bars__col:nth-child(5) .plan-bars__bar { animation-delay: 160ms; }
html.motion-ok .plan-bars__col:nth-child(6) .plan-bars__bar { animation-delay: 200ms; }
html.motion-ok .plan-bars__col:nth-child(7) .plan-bars__bar { animation-delay: 240ms; }
@keyframes planGrow { from { transform: scaleY(0); } to { transform: none; } }

.plan-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.plan-board {
  border-radius: 18px; overflow: hidden;
  background: var(--g-bg, var(--surface)); border: 1px solid var(--g-border, var(--line));
  -webkit-backdrop-filter: blur(22px) saturate(165%); backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--g-shadow, var(--shadow-card)), inset 0 1px 0 var(--g-hi, transparent);
}

/* Semaine : grille horaire */
.plan-week {
  --hour: 52px;
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(0, 1fr));
  grid-template-rows: auto auto calc(var(--rows) * var(--hour));
}
.plan-week__corner, .plan-week__alllabel { border-bottom: 1px solid var(--line); }
.plan-week__alllabel { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; }
.plan-week__dayhead {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
}
.plan-week__dayhead b { font-size: 22px; letter-spacing: -.02em; color: var(--ink); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; text-transform: none; }
.plan-week__dayhead.is-today { color: var(--brand); }
.plan-week__dayhead.is-today b { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--brand) 70%, transparent); }
.plan-week__allday { min-height: 34px; padding: 4px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-week__allday.is-today, .plan-week__col.is-today { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.plan-week__hours { display: grid; grid-template-rows: repeat(var(--rows), var(--hour)); }
.plan-week__hours span { font-size: 11px; color: var(--ink-faint); text-align: right; padding: 0 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.plan-week__hours span:first-child { visibility: hidden; }
.plan-week__col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour));
  cursor: cell;
}
.plan-week__col.is-weekend, .plan-week__dayhead.is-weekend { background-color: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.plan-ev {
  position: absolute;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  padding: 6px 8px 6px 10px; overflow: hidden; box-sizing: border-box;
  border: 0; border-radius: 10px; font: inherit; color: var(--ink); cursor: pointer;
  background: color-mix(in srgb, var(--ev) 18%, var(--g-bg-strong, var(--surface)));
  box-shadow: inset 3px 0 0 var(--ev), 0 4px 14px -8px color-mix(in srgb, var(--ev) 80%, transparent);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, filter .2s ease;
  touch-action: none;
}
.plan-ev:hover { transform: translateY(-1px) scale(1.015); z-index: 3; box-shadow: inset 3px 0 0 var(--ev), 0 10px 24px -8px color-mix(in srgb, var(--ev) 85%, transparent); }
.plan-ev:focus-visible { outline: 2px solid var(--ev); outline-offset: 2px; }
.plan-ev__time { font-size: 11px; font-weight: 650; color: color-mix(in srgb, var(--ev) 70%, var(--ink)); font-variant-numeric: tabular-nums; }
.plan-ev__title { font-size: 12.5px; font-weight: 650; line-height: 1.25; }
.plan-ev__loc { font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.plan-ev.is-short { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.plan-ev.is-short .plan-ev__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-ev.is-dragging { z-index: 10; opacity: .92; cursor: grabbing; transition: none; box-shadow: inset 3px 0 0 var(--ev), 0 18px 40px -10px rgba(0, 0, 0, .45); filter: saturate(1.2); }
.plan-ev.is-dropping { transition: opacity .2s ease; opacity: .55; }
.plan-drag-label { position: fixed; z-index: 300; pointer-events: none; padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 650; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .4); }
.plan-pill {
  display: block; width: 100%; text-align: left; padding: 4px 8px; border: 0; border-radius: 7px; font: inherit;
  font-size: 11.5px; font-weight: 650; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, var(--ev), color-mix(in srgb, var(--ev) 75%, #fff));
}
.plan-pill.is-cont { border-top-left-radius: 0; border-bottom-left-radius: 0; opacity: .85; }
.plan-pill.is-open { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.plan-now { position: absolute; left: -4px; right: 0; height: 0; border-top: 2px solid #E5484D; z-index: 4; pointer-events: none; }
.plan-now i { position: absolute; left: -2px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 4px rgba(229, 72, 77, .25); }
html.motion-ok .plan-now i { animation: planPulse 2s ease-in-out infinite; }
@keyframes planPulse { 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } }

.plan-avs { display: inline-flex; margin-top: 2px; }
.plan-av {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 9.5px; font-weight: 750; font-style: normal; color: #fff; background: var(--av, #888);
  box-shadow: 0 0 0 2px var(--g-bg-strong, var(--surface));
}
.plan-avs .plan-av + .plan-av { margin-left: -6px; }
.plan-av--more { background: var(--ws-chip); color: var(--ink-soft); }

/* Mois */
.plan-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.plan-month__dow { padding: 10px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); text-align: center; border-bottom: 1px solid var(--line); }
.plan-month__cell { min-height: 116px; padding: 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: cell; min-width: 0; }
.plan-month__cell:nth-child(7n + 1) { border-left: 0; }
.plan-month__cell.is-weekend { background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.plan-month__cell.is-out { opacity: .45; }
.plan-month__cell.is-today { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.plan-month__num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 650; color: var(--ink); }
.plan-month__cell.is-today .plan-month__num { background: var(--brand); color: #fff; }
.plan-dot { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-dot:hover { background: color-mix(in srgb, var(--ev) 14%, transparent); }
.plan-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ev); flex: none; }
.plan-dot time { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.plan-month__more { font-size: 11.5px; font-weight: 650; color: var(--accent); padding-left: 6px; }

/* Agenda (téléphone) */
.plan-agenda { display: none; list-style: none; margin: 0; padding: 8px; }
.plan-agenda__day { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.plan-agenda__day:last-child { border-bottom: 0; }
.plan-agenda__date { grid-row: span 20; margin: 0; display: flex; flex-direction: column; align-items: center; }
.plan-agenda__date b { font-size: 24px; color: var(--ink); line-height: 1.1; }
.plan-agenda__date span { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; text-align: center; }
.plan-agenda__day.is-today .plan-agenda__date b { color: var(--brand); }
.plan-agenda__ev {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-radius: 12px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: color-mix(in srgb, var(--ev) 14%, var(--g-bg-strong, var(--surface))); box-shadow: inset 3px 0 0 var(--ev);
}
.plan-agenda__ev strong { font-size: 14px; }
.plan-agenda__ev small { font-size: 12px; color: var(--ink-soft); }
.plan-agenda__time { font-size: 11.5px; font-weight: 650; color: color-mix(in srgb, var(--ev) 70%, var(--ink)); }
.plan-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 10px; text-align: center; color: var(--ink-soft); }
.plan-empty span { font-size: 34px; }
.plan-empty b { color: var(--ink); font-size: 16px; }

/* Journal à droite */
.plan .activity-feed {
  border-radius: 18px; padding: 16px 16px 8px;
  background: var(--g-bg, var(--surface)); border: 1px solid var(--g-border, var(--line));
  -webkit-backdrop-filter: blur(22px) saturate(165%); backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--g-shadow, var(--shadow-card)), inset 0 1px 0 var(--g-hi, transparent);
}
.plan .activity-feed__title { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.plan .activity-feed__lead { margin: 2px 0 10px; font-size: 12.5px; }
.plan .activity-feed__list { list-style: none; margin: 0; padding: 0; }
.plan .activity-feed__item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.plan .activity-feed__avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #2D5BD0)); }
.plan .activity-feed__summary { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink); }
.plan .activity-feed__summary a { color: var(--ink); }
.plan .activity-feed__time { font-size: 11.5px; color: var(--ink-faint); }

/* Fenêtre événement */
.plan-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border-radius: 22px; overflow: auto;
  border: 1px solid var(--g-border, var(--line)); color: var(--ink);
  background: var(--g-bg-strong, var(--surface));
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5), inset 0 1px 0 var(--g-hi, transparent);
}
.plan-dialog::backdrop { background: rgba(8, 14, 12, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
html.motion-ok .plan-dialog[open] { animation: wsPop .25s cubic-bezier(.2, .9, .3, 1.1) both; }
.plan-dialog__form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 18px; }
.plan-dialog__head { display: flex; align-items: center; gap: 10px; }
.plan-dialog__head h3 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.plan-dialog__swatch { width: 14px; height: 14px; border-radius: 5px; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent); }
.plan-dialog__close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ws-chip); color: var(--ink); font-size: 20px; cursor: pointer; }
.plan-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.plan-field input, .plan-field textarea {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--g-field, var(--surface)); min-width: 0;
}
.plan-field input:focus, .plan-field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.plan-field--title input { font-size: 20px; font-weight: 650; padding: 10px 12px; border-radius: 12px; }
.plan-dialog__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.plan-cals, .plan-people { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-people legend { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.plan-cals__opt input, .plan-people__opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-cals__opt span, .plan-people__opt span {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--g-field, var(--surface)); font-size: 13px; font-weight: 600; color: var(--ink-soft);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.plan-cals__opt i { width: 10px; height: 10px; border-radius: 50%; background: var(--cal); }
.plan-cals__opt input:checked + span { background: color-mix(in srgb, var(--cal) 18%, transparent); border-color: var(--cal); color: var(--ink); }
.plan-people__opt span { padding: 4px 12px 4px 4px; }
.plan-people__opt input:checked + span { background: color-mix(in srgb, var(--brand) 14%, transparent); border-color: var(--brand); color: var(--ink); }
.plan-cals__opt input:focus-visible + span, .plan-people__opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-cals__opt span:active, .plan-people__opt span:active { transform: scale(.96); }
.plan-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; padding-bottom: 8px; }
.plan-switch input { position: absolute; opacity: 0; }
.plan-switch span { width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s ease; flex: none; }
.plan-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.plan-switch input:checked + span { background: var(--brand); }
.plan-switch input:checked + span::after { transform: translateX(16px); }
.plan-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-dialog__meta { margin: 0; font-size: 12px; color: var(--ink-faint); }
.plan-dialog__foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.plan-dialog__spacer { flex: 1; }
.plan-view__line { margin: 0; font-size: 14px; color: var(--ink); }
.plan-view__desc { margin: 0; font-size: 13.5px; color: var(--ink-soft); white-space: pre-line; }
.plan-person { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 6px 0; font-size: 13px; }

/* Confettis à l’ajout d’un événement */
.plan-confetti { position: fixed; left: 0; right: 0; top: 30%; height: 0; pointer-events: none; z-index: 250; }
.plan-confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: planConfetti 1.4s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes planConfetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) * -1.4)) rotate(var(--rot)); opacity: 0; }
}

@media (max-width: 1600px) {
  .plan-body { grid-template-columns: 1fr; }
  .plan .activity-feed__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 18px; }
}
@media (max-width: 1100px) {
  .plan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .plan-week, .plan-month { display: none; }
  .plan-agenda { display: block; }
  .plan-head { padding: 12px; }
  .plan-head__title { font-size: 17px; margin: 0 4px; flex-basis: 100%; order: -1; }
  .plan-head__tools { width: 100%; justify-content: space-between; }
  .plan-stat__icon { width: 34px; height: 34px; font-size: 17px; }
  .plan-stat__value { font-size: 18px; }
  .plan-bars { display: none; }
  .plan-dialog__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .plan-ev, .plan-round, .plan-new, .plan-cals__opt span, .plan-people__opt span, .plan-switch span::after { transition: none !important; }
  .plan-confetti { display: none; }
}
/* Planning : couleurs de liens indépendantes du thème (l’ancienne feuille colore tous les liens en sombre) */
html[data-theme] .plan a.plan-today { color: var(--surface) !important; }
html[data-theme] .plan .plan-seg a { color: var(--ink-soft) !important; }
html[data-theme] .plan .plan-seg a.is-on { color: var(--ink) !important; }
html[data-theme] .plan a.plan-legend__chip { color: var(--ink-soft) !important; }
html[data-theme] .plan a.plan-legend__chip.is-on { color: var(--surface) !important; }
html[data-theme] .plan a.plan-round { color: var(--ink) !important; }
html[data-theme] .plan a.plan-new { color: #fff !important; }
html[data-theme="dark"] .plan a.plan-new { color: #04140E !important; }
html[data-theme] .plan .activity-feed__summary a { color: var(--ink) !important; }
