/* ==========================================================================
   WP Central : design tokens et composants
   Feuille autonome, sans framework ni build, utilisable telle quelle en HTML/PHP.
   Polices (Google Fonts), à charger dans le <head> :
   <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
   Thème : class="wpc" et data-theme="light" ou "dark" sur <html> ou sur un conteneur.
   ========================================================================== */

/* ---------- 1. Tokens : thème clair ---------- */
:root,
[data-theme="light"] {
  /* Primitives : vert de marque */
  --green-50: #EEF6F1;
  --green-100: #D7EBDF;
  --green-200: #B3D9C3;
  --green-500: #2A9268;  /* graphiques, focus */
  --green-600: #1F7A55;  /* boutons, carte pleine : blanc dessus = 5,3:1 */
  --green-700: #17603F;
  --green-800: #114A31;
  /* Primitives : couleurs d'appoint (graphiques, tuiles d'icônes) */
  --sky-500: #1A9BD7;    --sky-700: #0B6E9E;    --sky-50: #E6F4FB;
  --violet-500: #7C5CFA; --violet-700: #5B3FD6; --violet-50: #F0ECFE;
  --pink-500: #E2559A;   --pink-700: #B2346F;   --pink-50: #FCEBF3;
  --amber-500: #F2A93B;  --amber-700: #8F5300;  --amber-50: #FEF4E3;
  --red-500: #D64545;    --red-600: #C93A3A;    --red-700: #B42323; --red-50: #FDECEC;

  /* Primitives : neutres (gris légèrement verdi) */
  --gray-950: #121A17;
  --gray-800: #26332E;
  --gray-600: #5B6B65;   /* texte secondaire AA : 5,6:1 sur blanc */
  --gray-500: #7E8D87;   /* décor et icônes inactives, jamais du texte courant */
  --gray-300: #C9D2CE;
  --gray-200: #E3E8E6;
  --gray-150: #ECF0EE;
  --gray-100: #F3F5F4;
  --gray-50: #F7F8F8;

  /* Sémantique : surfaces */
  --bg-page: #F6F7F7;
  --bg-shell: #FFFFFF;     /* sidebar, barre du haut */
  --bg-card: #FFFFFF;
  --bg-sunken: #F3F5F4;    /* champs, segments, en-têtes de tableau */
  --bg-hover: #F1F4F2;
  --line: #E7ECE9;
  --line-strong: #D6DDD9;

  /* Sémantique : texte */
  --text-1: #121A17;
  --text-2: #5B6B65;
  --text-3: #7E8D87;

  /* Sémantique : accent */
  --accent: #1F7A55;
  --accent-hover: #17603F;
  --accent-text: #1B6E4C;
  --accent-soft: #EAF4EE;
  --accent-line: #CFE5D8;
  --on-accent: #FFFFFF;
  --hero: linear-gradient(140deg, #23855D 0%, #17603F 100%);

  /* États : couleur pleine (puces, barres), texte AA, fond doux */
  --ok: #24A06B;    --ok-text: #157049;   --ok-soft: #E6F5EC;
  --warn: #E99A1C;  --warn-text: #8F5300; --warn-soft: #FEF3E0;
  --err: #C93A3A;   --err-text: #B42323;  --err-soft: #FDECEC;
  --info: #1A9BD7;  --info-text: #0B6E9E; --info-soft: #E6F4FB;

  /* Note interne (support) */
  --note-bg: #FFF7E0;
  --note-line: #EFCD72;
  --note-text: #6B4E00;

  --toast-bg: #121A17;
  --toast-text: #FFFFFF;
  --scrim: rgba(12, 20, 17, .42);

  /* Typographie */
  --font: "Plus Jakarta Sans", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  /* Rayons */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Ombres : bordure fine + ombre presque invisible */
  --sh-card: 0 1px 2px rgba(18, 26, 23, .04), 0 6px 20px rgba(18, 26, 23, .03);
  --sh-pop: 0 18px 50px rgba(18, 26, 23, .14), 0 2px 8px rgba(18, 26, 23, .06);
  --sh-btn: 0 8px 18px -8px rgba(31, 122, 85, .7);
  --focus: 0 0 0 3px rgba(42, 146, 104, .28);

  /* Espacements (base 4) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 48px; --s-10: 64px;

  /* Dimensions d'interface */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --target: 44px;

  color-scheme: light;
}

/* ---------- 1 bis. Tokens : thème sombre ---------- */
[data-theme="dark"] {
  --bg-page: #0B100E;
  --bg-shell: #111816;
  --bg-card: #151D1A;
  --bg-sunken: #1A2420;
  --bg-hover: #1C2723;
  --line: #22302B;
  --line-strong: #2E3E38;

  --text-1: #E6EEEA;
  --text-2: #9EAFA8;
  --text-3: #73857E;

  --accent: #1F7A55;
  --accent-hover: #23855D;
  --accent-text: #5FCB9B;
  --accent-soft: #15302A;
  --accent-line: #1F4A3A;
  --hero: linear-gradient(140deg, #1F7A55 0%, #0F4632 100%);

  --ok: #2FB57E;   --ok-text: #6AD6A6;   --ok-soft: rgba(47, 181, 126, .14);
  --warn: #F0A030; --warn-text: #F5C16F; --warn-soft: rgba(240, 160, 48, .14);
  --err: #C93A3A;  --err-text: #FF9A9A;  --err-soft: rgba(214, 69, 69, .17);
  --info: #3AAEE6; --info-text: #8ED2F5; --info-soft: rgba(26, 155, 215, .16);

  --sky-50: rgba(26, 155, 215, .16);    --sky-700: #8ED2F5;
  --violet-50: rgba(124, 92, 250, .18); --violet-700: #C2B3FF;
  --pink-50: rgba(226, 85, 154, .17);   --pink-700: #F5A9CD;
  --amber-50: rgba(242, 169, 59, .15);  --amber-700: #F5C16F;
  --green-50: rgba(42, 146, 104, .17);  --green-700: #6AD6A6;

  --note-bg: #2E2611;
  --note-line: #6B5620;
  --note-text: #F2D88C;

  --toast-bg: #E6EEEA;
  --toast-text: #111816;
  --scrim: rgba(0, 0, 0, .6);

  --sh-card: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-pop: 0 18px 50px rgba(0, 0, 0, .55);
  --sh-btn: 0 8px 18px -8px rgba(0, 0, 0, .8);
  --focus: 0 0 0 3px rgba(95, 203, 155, .35);

  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
.wpc {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wpc *, .wpc *::before, .wpc *::after { box-sizing: border-box; }
.wpc h1, .wpc h2, .wpc h3, .wpc h4, .wpc p, .wpc ul, .wpc ol, .wpc figure { margin: 0; padding: 0; }
.wpc ul { list-style: none; }
.wpc button, .wpc input, .wpc select, .wpc textarea { font: inherit; color: inherit; }
.wpc a { color: var(--accent-text); text-decoration: none; }
.wpc a:hover { text-decoration: underline; }
.wpc :focus-visible { outline: none; box-shadow: var(--focus); }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.strong { font-weight: 700; color: var(--text-1); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* Icônes : SVG outline 24×24, trait 1.6px arrondi */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-xs { width: 14px; height: 14px; }
.ico-sm { width: 16px; height: 16px; }
.ico-md { width: 18px; height: 18px; }
.ico-lg { width: 24px; height: 24px; }
.ico-xl { width: 32px; height: 32px; }
.ico-bold { stroke-width: 2.6; }

/* Utilitaires de mise en page */
.row { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.row-top { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.stack-8 { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.stack-16 { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.stack-24 { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ---------- 3. Typographie ---------- */
.t-display { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.h3 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.sub { font-size: var(--fs-base); font-weight: 500; color: var(--text-2); }
.t-small { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.t-caption { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }

/* ---------- 4. Structure de l'application ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100%; background: var(--bg-page); }
.sidebar {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 18px 14px 14px;
  background: var(--bg-shell);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; margin-bottom: 10px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--text-1); }
.brand-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--hero); color: #fff; }
.brand-mark--wpc { background: #222548; overflow: hidden; }
.brand-mark--wpc svg { width: 100%; height: 100%; display: block; }
.side-section { margin: 14px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.side-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.wpc a.side-item:hover { text-decoration: none; }
.side-item:hover { background: var(--bg-hover); color: var(--text-1); }
.side-item.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); font-weight: 700; }
.side-item.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-count { min-width: 24px; height: 20px; padding: 0 7px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--bg-sunken); color: var(--text-2); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.side-item.is-active .side-count { background: var(--bg-card); color: var(--accent-text); }
.side-spacer { flex: 1; }
.side-user { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
/* Variante repliée : icônes seules */
.sidebar.is-collapsed { width: var(--sidebar-w-collapsed); align-items: center; padding: 18px 10px; }
.sidebar.is-collapsed .side-label, .sidebar.is-collapsed .side-count, .sidebar.is-collapsed .side-section, .sidebar.is-collapsed .brand-name, .sidebar.is-collapsed .side-user-info, .sidebar.is-collapsed .side-search { display: none; }
.sidebar.is-collapsed .side-item { width: 44px; height: 44px; justify-content: center; padding: 0; }
.sidebar.is-collapsed .side-item.is-active::before { left: -10px; }

.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: var(--s-3);
  height: var(--topbar-h); padding: 0 24px;
  background: var(--bg-shell); border-bottom: 1px solid var(--line);
}
.topbar-end { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.search-pill {
  display: flex; align-items: center; gap: 10px;
  width: 340px; max-width: 100%; height: 40px; padding: 0 8px 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--bg-sunken); color: var(--text-2);
}
.search-pill:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.search-pill input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 13.5px; color: var(--text-1); }
.search-pill input::placeholder { color: var(--text-2); }
.kbd { display: inline-grid; place-items: center; height: 24px; padding: 0 7px; border-radius: 7px; background: var(--bg-card); border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text-2); }
.pill-time { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pill-time b { color: var(--text-1); font-family: var(--mono); font-weight: 600; }
.content { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; padding: 22px 28px 40px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 5. Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 700; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.wpc a.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--sh-btn); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); border-color: var(--line-strong); color: var(--text-1); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-soft { background: var(--err-soft); color: var(--err-text); }
.btn-white { background: #fff; color: var(--green-700); }
.btn-on-color { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-sm { height: 34px; padding: 0 12px; border-radius: var(--r-sm); font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 22px; border-radius: 14px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.icon-btn {
  position: relative; flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.icon-btn--boxed { border: 1px solid var(--line); background: var(--bg-card); }
.badge-count {
  position: absolute; top: 3px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  box-shadow: 0 0 0 2px var(--bg-shell);
}
.badge-count--err { background: var(--err); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: wpc-spin .8s linear infinite; }
@keyframes wpc-spin { to { transform: rotate(360deg); } }
/* Cibles tactiles : 44px minimum sur écran tactile */
@media (pointer: coarse) {
  .btn, .btn-sm { height: var(--target); }
  .btn-icon, .btn-icon.btn-sm, .icon-btn { width: var(--target); height: var(--target); }
}

/* ---------- 6. Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--text-1); }
.help { font-size: 12px; font-weight: 500; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--bg-card); color: var(--text-1);
  font-size: 13.5px; font-weight: 500;
  outline: 0;
}
.input::placeholder, .textarea::placeholder { color: var(--text-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap > .ico { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-wrap--end > .ico { left: auto; right: 12px; }
.field.is-error .input { border-color: var(--err); }
.field.is-error .help { display: flex; align-items: center; gap: 6px; color: var(--err-text); }
@media (pointer: coarse) { .input, .select { height: var(--target); } }

/* ---------- 7. Cartes ---------- */
.card { min-width: 0; padding: 20px 22px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-card); }
.card--flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: 16px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; color: var(--text-1); }
.card-sub { margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.card-link { font-size: 12.5px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.kpi { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--text-1); }
.kpi small { margin-left: 3px; font-family: var(--font); font-size: 12.5px; font-weight: 700; letter-spacing: 0; color: var(--text-2); }
/* Carte pleine (une seule par écran, pour le chiffre principal) */
.card-hero { position: relative; overflow: hidden; min-width: 0; padding: 20px 22px; border-radius: var(--r-xl); background: var(--hero); color: #fff; box-shadow: 0 16px 36px -18px rgba(23, 96, 63, .8); }
.card-hero .eyebrow { color: rgba(255, 255, 255, .86); }
.hero-value { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.hero-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 700; }
/* Carte d'accent douce : alerte ou chiffre important, à utiliser avec parcimonie */
.card-callout { border-color: var(--accent-line); background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 70%); }
.card-alert { border-color: rgba(201, 58, 58, .35); background: linear-gradient(135deg, var(--err-soft) 0%, var(--bg-card) 75%); }

/* Bandeau de KPI en ligne */
.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 18px 8px; }
.kpi-strip > div { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 16px; }
.kpi-strip > div + div { border-left: 1px solid var(--line); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.kpi-row { display: flex; align-items: baseline; gap: 8px; }
.kpi-val { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -.03em; color: var(--text-1); }

/* Tuiles d'icône pastel */
.tile { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r-md); font-size: 13px; font-weight: 800; }
.tile-sm { width: 32px; height: 32px; border-radius: var(--r-sm); font-size: 12px; }
.tone-green { background: var(--green-50); color: var(--green-700); }
.tone-sky { background: var(--sky-50); color: var(--sky-700); }
.tone-violet { background: var(--violet-50); color: var(--violet-700); }
.tone-pink { background: var(--pink-50); color: var(--pink-700); }
.tone-amber { background: var(--amber-50); color: var(--amber-700); }
.tone-red { background: var(--err-soft); color: var(--err-text); }
.tone-gray { background: var(--bg-sunken); color: var(--text-2); }

/* Variation : flèche + valeur, jamais la couleur seule */
.delta { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.delta .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.delta--up { color: var(--ok-text); }
.delta--down { color: var(--err-text); }
.delta--flat { color: var(--text-2); }

/* ---------- 8. Pastilles, compteurs, tags ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px 0 8px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status .ico { width: 14px; height: 14px; stroke-width: 2.1; }
.status--ok { background: var(--ok-soft); color: var(--ok-text); }
.status--warn { background: var(--warn-soft); color: var(--warn-text); }
.status--err { background: var(--err-soft); color: var(--err-text); }
.status--info { background: var(--info-soft); color: var(--info-text); }
.status--neutral { background: var(--bg-sunken); color: var(--text-2); }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.dot--unread { width: 8px; height: 8px; background: var(--accent); }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); } .dot--err { background: var(--err); }
.count {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken); color: var(--text-2);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
}
.count--accent { background: var(--accent-soft); color: var(--accent-text); }
.count--warn { background: var(--warn-soft); color: var(--warn-text); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--bg-sunken); color: var(--text-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tag--new { background: var(--ok-soft); color: var(--ok-text); }
.tag--hot { background: var(--err-soft); color: var(--err-text); }
.tag--accent { background: var(--accent-soft); color: var(--accent-text); }
.tag--on-color { background: rgba(255, 255, 255, .18); color: #fff; }
.prio { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.prio--err { color: var(--err-text); } .prio--warn { color: var(--warn-text); }
.prio--info { color: var(--info-text); } .prio--neutral { color: var(--text-2); }

/* ---------- 9. Onglets (segments et pilules) ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-sunken); }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--text-1); }
.tab.is-active { background: var(--bg-card); color: var(--accent-text); box-shadow: 0 1px 3px rgba(18, 26, 23, .1); }
.tab .count { height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; background: var(--bg-card); }
.tab.is-active .count { background: var(--accent); color: #fff; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--bg-card); color: var(--text-2);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.pill:hover { border-color: var(--accent); color: var(--text-1); }
.pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill .count { height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
.pill.is-active .count { background: rgba(255, 255, 255, .2); color: #fff; }
.pills--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pills--scroll > * { flex: none; }
@media (pointer: coarse) { .tab, .pill { height: var(--target); } }

/* ---------- 10. Tableau et version cartes empilées ---------- */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 11px 14px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.t-right { text-align: right; }
/* Même grille en <div> (boucles PHP hors <table>, ou défilement virtuel) */
.dtable { display: flex; flex-direction: column; min-width: 0; }
.dt-row {
  display: grid;
  grid-template-columns: minmax(230px, 2.2fr) minmax(170px, 1.5fr) 128px 64px 78px 100px 84px;
  align-items: center; gap: 12px;
  min-height: 52px; padding: 7px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.dt-row:hover { background: var(--bg-hover); }
.dt-row--head { position: sticky; top: 0; z-index: 1; min-height: 40px; background: var(--bg-sunken); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.dt-row--head:hover { background: var(--bg-sunken); }
.dt-row--alert, .dt-row--alert:hover { background: var(--err-soft); }
.cell-site { display: flex; align-items: center; gap: 11px; min-width: 0; }
.site-name { font-weight: 700; color: var(--text-1); line-height: 1.25; }
.site-url { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--text-2); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.wp-old { display: inline-flex; align-items: center; gap: 4px; color: var(--warn-text); font-weight: 600; }
/* Sous 768px : chaque ligne devient une carte (td avec data-label) */
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { margin-bottom: 12px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; white-space: normal; }
  .table-stack td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--text-2); }
  .table-stack td.cell-main::before { display: none; }
  .table-stack tbody tr:hover td { background: transparent; }
}
.site-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.site-card--alert { border-color: rgba(201, 58, 58, .45); background: linear-gradient(135deg, var(--err-soft) 0%, var(--bg-card) 60%); }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-sunken); }
.meta .k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.meta .v { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text-1); }

/* ---------- 11. Progression, anneau, jauge ---------- */
.progress { height: 6px; overflow: hidden; border-radius: var(--r-pill); background: var(--bg-sunken); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress--sky > span { background: var(--sky-500); } .progress--violet > span { background: var(--violet-500); }
.progress--pink > span { background: var(--pink-500); } .progress--amber > span { background: var(--amber-500); }
.progress--err > span { background: var(--err); }
.progress--on-color { background: rgba(255, 255, 255, .22); }
.progress--on-color > span { background: #fff; }
.segbar { display: flex; gap: 3px; height: 8px; }
.segbar > span { border-radius: var(--r-pill); }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .ring-track { stroke: var(--bg-sunken); }
.ring .ring-val { stroke: var(--accent); }
.ring--on-color .ring-track { stroke: rgba(255, 255, 255, .22); }
.ring--on-color .ring-val { stroke: #fff; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.gauge { position: relative; }
.gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.gauge path { fill: none; stroke-linecap: round; }
.gauge .g-track { stroke: var(--bg-sunken); }
.gauge .g-val { stroke: var(--accent); }
.gauge-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.mini-bars > i { flex: 1 1 0; border-radius: 3px; background: rgba(255, 255, 255, .85); }
.mini-bars > i.is-off { background: rgba(255, 255, 255, .3); }
.mini-bars--light > i { background: var(--green-200); }
.mini-bars--light > i.is-off { background: var(--err); }
.mini-slider { position: relative; height: 16px; }
.mini-slider .track { position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ok) 0%, var(--warn) 60%, var(--err) 100%); opacity: .9; }
.mini-slider .thumb { position: absolute; top: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--bg-card); box-shadow: 0 0 0 3px var(--warn), 0 2px 6px rgba(18, 26, 23, .2); }

/* ---------- 12. Graphiques ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.chart-plot { position: relative; height: 180px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid > i { height: 1px; background: var(--line); }
.chart-line { fill: none; stroke: var(--green-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line--2 { stroke: var(--sky-500); }
.chart-area { fill: var(--green-500); opacity: .1; }
.chart-area--2 { fill: var(--sky-500); opacity: .14; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px; margin: -7px 0; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); text-align: right; }
.chart-x { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
.chart-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--bg-card); box-shadow: 0 0 0 2.5px var(--green-500); }
.chart-tip { position: absolute; transform: translate(-50%, -130%); padding: 6px 10px; border-radius: 10px; background: var(--toast-bg); color: var(--toast-text); font-family: var(--mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.bars > i { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--green-100); }
.bars > i.is-hi { background: var(--green-500); }
[data-theme="dark"] .bars > i { background: #1F3B30; }
[data-theme="dark"] .bars > i.is-hi { background: var(--green-500); }

/* ---------- 13. Avatars ---------- */
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12.5px; font-weight: 800; background: var(--accent-soft); color: var(--accent-text); }
.avatar--xs { width: 24px; height: 24px; font-size: 9.5px; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 52px; height: 52px; font-size: 17px; }
.avatar--xl { width: 68px; height: 68px; font-size: 21px; }
.av-1 { background: #DCEFE4; color: #17603F; }
.av-2 { background: #DDF0FA; color: #0B5F8A; }
.av-3 { background: #ECE7FE; color: #5B3FD6; }
.av-4 { background: #FCE6F0; color: #A12D63; }
.av-5 { background: #FDEFD6; color: #84500A; }
.av-6 { background: #E6EBE9; color: #3C4A45; }
[data-theme="dark"] .av-1 { background: #1A3A2D; color: #8EE0BA; }
[data-theme="dark"] .av-2 { background: #133446; color: #9FDCFB; }
[data-theme="dark"] .av-3 { background: #2C2550; color: #CDBFFF; }
[data-theme="dark"] .av-4 { background: #3E1F2E; color: #F7B3D2; }
[data-theme="dark"] .av-5 { background: #3A2C14; color: #F6CF8F; }
[data-theme="dark"] .av-6 { background: #24302C; color: #C4D1CC; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack > .avatar { box-shadow: 0 0 0 2px var(--stack-ring, var(--bg-card)); }
.avatar-stack > .avatar + .avatar { margin-left: -8px; }
.avatar-more { background: var(--bg-sunken); color: var(--text-2); font-family: var(--mono); font-weight: 600; }

/* ---------- 14. Profil, mini-stats, calendrier, événements ---------- */
.profile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-name { font-size: 14px; font-weight: 800; color: var(--text-1); }
.profile-sub { font-size: 12px; font-weight: 500; color: var(--text-2); }
.stat-pill { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-sunken); }
.stat-pill > div { padding: 0 8px; text-align: center; }
.stat-pill > div + div { border-left: 1px solid var(--line-strong); }
.stat-pill .k { font-size: 11px; font-weight: 600; color: var(--text-2); }
.stat-pill .v { margin-top: 2px; font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -.03em; color: var(--text-1); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-height: 70px; padding: 9px 0;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2);
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.day b { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text-1); }
.day .ev { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.day .ev.is-none { background: transparent; }
.day:hover { background: var(--bg-hover); }
.day.is-active { background: var(--accent); color: #fff; box-shadow: var(--sh-btn); }
.day.is-active b { color: #fff; }
.day.is-active .ev { background: #fff; }
.day.is-muted b { color: var(--text-3); }
.event { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-lg); }
.event--hero { background: var(--hero); color: #fff; --stack-ring: #1C7150; }
.event--light { background: var(--bg-card); border: 1px solid var(--line); }
.event-title { font-size: 14px; font-weight: 800; }
.event-meta { font-size: 12.5px; font-weight: 600; }
.event--light .event-meta { color: var(--text-2); }
.event-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event-deco { position: absolute; right: -16px; bottom: -20px; width: 104px; height: 104px; opacity: .14; pointer-events: none; }
.event--light .event-deco { color: var(--accent); opacity: .07; }

/* ---------- 15. Liste « À traiter » ---------- */
.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.task-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ---------- 16. Support : tickets et conversation ---------- */
.inbox { display: grid; grid-template-columns: 352px minmax(0, 1fr) 320px; gap: 16px; min-height: 0; }
.ticket {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  width: 100%; padding: 12px; text-align: left;
  border: 1px solid transparent; border-radius: var(--r-lg); background: transparent; cursor: pointer;
}
.ticket:hover { background: var(--bg-hover); }
.ticket.is-selected { background: var(--accent-soft); border-color: var(--accent-line); }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ticket-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.ticket-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.ticket.is-unread .ticket-subject { font-weight: 800; }
.ticket-excerpt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.ticket-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; min-width: 0; }
.time { font-family: var(--mono); font-size: 11px; color: var(--text-2); white-space: nowrap; }
.thread { display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg--me { flex-direction: row-reverse; margin-left: auto; }
.bubble { padding: 12px 15px; border-radius: 16px; font-size: 13.5px; font-weight: 500; line-height: 1.6; }
.msg--client .bubble { background: var(--bg-sunken); border-top-left-radius: 5px; }
.msg--me .bubble { background: var(--accent); color: #fff; border-top-right-radius: 5px; }
.msg-meta { margin-top: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.msg--me .msg-meta { text-align: right; }
.note { display: flex; gap: 12px; padding: 12px 15px; border: 1px dashed var(--note-line); border-radius: var(--r-lg); background: var(--note-bg); color: var(--note-text); font-size: 13px; font-weight: 600; line-height: 1.55; }
.note-head { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.attach { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-card); color: var(--text-1); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.attach small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--text-2); }
.msg--me .attach { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.msg--me .attach small { color: #fff; }
.attach-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
.thread-sep { display: flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.thread-sep::before, .thread-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.composer { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--bg-card); }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.composer textarea { width: 100%; min-height: 58px; border: 0; outline: 0; resize: none; background: transparent; font-size: 13.5px; line-height: 1.55; color: var(--text-1); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--bg-card); color: var(--text-1);
  font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
@media (pointer: coarse) { .chip { height: var(--target); } }
.timer { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.04em; color: var(--text-1); }
.timer-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--err-text); }
.link-row { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-1); font-size: 13.5px; font-weight: 700; }
.wpc a.link-row { color: var(--text-1); }
.wpc a.link-row:hover { background: var(--bg-hover); text-decoration: none; }
.link-row .ico:first-child { color: var(--accent-text); }
.link-row .ico:last-child { margin-left: auto; color: var(--text-2); }

/* ---------- 17. Superpositions : tiroir, bottom sheet, modale, toast ---------- */
.scrim { position: absolute; inset: 0; z-index: 10; background: var(--scrim); }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; z-index: 11; width: 290px; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--bg-shell); border-radius: 0 24px 24px 0; box-shadow: var(--sh-pop); }
.drawer--right { left: auto; right: 0; border-radius: 24px 0 0 24px; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 11; padding: 10px 18px 22px; background: var(--bg-shell); border-radius: 24px 24px 0 0; box-shadow: 0 -18px 48px rgba(18, 26, 23, .16); }
.sheet-handle { width: 40px; height: 5px; margin: 0 auto 14px; border-radius: 5px; background: var(--line-strong); }
.modal { width: min(440px, 100%); padding: 24px; background: var(--bg-shell); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: var(--sh-pop); }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: var(--r-lg); background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--sh-pop); font-size: 13px; font-weight: 600; }
.toast-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #fff; }
.toast-ico--ok { background: var(--ok); }
.toast-ico--err { background: var(--err); }

/* ---------- 18. États vides, chargement, erreur ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 20px; text-align: center; }
.empty-art { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--accent-soft); color: var(--accent-text); }
.empty-art--err { background: var(--err-soft); color: var(--err-text); }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--bg-sunken) 0%, var(--bg-hover) 50%, var(--bg-sunken) 100%); background-size: 200% 100%; animation: wpc-shimmer 1.4s ease-in-out infinite; }
@keyframes wpc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel, .spinner { animation: none; } }

/* ---------- 19. Mobile ---------- */
.phone { position: relative; overflow: hidden; display: flex; flex-direction: column; flex: none; width: 390px; height: 844px; border: 1px solid var(--line); border-radius: 40px; background: var(--bg-page); box-shadow: 0 30px 70px rgba(18, 26, 23, .12); }
.m-header { display: flex; align-items: center; gap: 6px; height: 64px; padding: 0 12px; background: var(--bg-shell); border-bottom: 1px solid var(--line); }
.m-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.m-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.h-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.h-scroll > * { flex: none; }

/* ---------- 20. Règles responsive ---------- */
/* ≥ 1600px : sidebar étendue par défaut ; 1280–1599px : repliable par l'utilisateur */
/* < 1280px : le panneau droit passe sous le contenu, sidebar repliée en icônes */
@media (max-width: 1279px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .grid-12 > .span-4.is-aside, .grid-12 > .span-8 { grid-column: span 12; }
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox > .inbox-aside { display: none; } /* fiche client : tiroir à droite via un bouton */
}
/* < 1024px : sidebar remplacée par un tiroir (hamburger) */
@media (max-width: 1023px) {
  .app { display: block; }
  .app > .sidebar { display: none; }
  .app > .sidebar.is-open { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 20; width: 290px; box-shadow: var(--sh-pop); }
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .grid-12 > * { grid-column: span 12; }
}
/* < 768px : tableaux en cartes, panneau droit en bottom sheet */
@media (max-width: 767px) {
  .content { padding: 16px; gap: 14px; }
  .topbar { padding: 0 12px; }
  .search-pill .kbd, .topbar .pill-time { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip > div + div { border-left: 0; }
  .is-aside { display: none; }
  .is-aside.is-open { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 85vh; overflow: auto; border-radius: 24px 24px 0 0; }
  .dtable .dt-row--head { display: none; }
  .dtable .dt-row { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); }
  .inbox { display: block; }
  .msg { max-width: 92%; }
}

/* ---------- 21. Documentation (planches du design system) ---------- */
.ds { display: flex; flex-direction: column; gap: 56px; min-height: 100%; padding: 56px 64px 96px; }
.ds-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.ds-title { font-size: 44px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.ds-sec { display: flex; flex-direction: column; gap: 18px; }
.ds-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-num { display: inline-grid; place-items: center; height: 26px; padding: 0 9px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.ds-h2 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.ds-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: var(--sh-card); }
.ds-panel-title { font-size: 15px; font-weight: 800; }
.ds-caption { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.ds-demo { position: relative; overflow: hidden; padding: 18px; border-radius: var(--r-xl); background: var(--bg-page); border: 1px solid var(--line); }
.swatch { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); }
.swatch-color { height: 76px; display: flex; align-items: flex-end; padding: 10px 12px; font-size: 12px; font-weight: 800; }
.swatch-info { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px 11px; }
.code { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--text-2); }
.tok-row { display: grid; grid-template-columns: 180px 170px 170px minmax(0, 1fr); align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tok-row:last-child { border-bottom: 0; }
.chipcolor { display: inline-flex; align-items: center; gap: 8px; }
.chipcolor > i { width: 22px; height: 22px; flex: none; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(18, 26, 23, .14); }
.bp { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bp-frame { position: relative; overflow: hidden; height: 150px; display: flex; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-page); }
.bp-frame i { border-radius: 6px; background: var(--bg-card); border: 1px solid var(--line); }
.bp-frame i.is-side { background: var(--bg-card); border-color: var(--line-strong); }
.bp-frame i.is-accent { background: var(--green-100); border-color: transparent; }
.bp-frame i.is-hero { background: var(--hero); border-color: transparent; }
[data-theme="dark"] .bp-frame i.is-accent { background: #1F3B30; }

/* Visionneuse de pièces jointes (support) */
.attach-thumb { display: block; max-width: 240px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--bg-card); cursor: zoom-in; font-family: inherit; }
.attach-thumb img { display: block; max-width: 240px; max-height: 180px; object-fit: cover; }
.attach-thumb small { display: block; padding: 4px 8px; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); text-align: left; }
button.attach { cursor: pointer; font-family: inherit; text-align: left; }
.viewer { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(5, 12, 10, .92); }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff; }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.viewer-count { font-family: var(--mono); font-size: 11.5px; opacity: .7; }
.viewer-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.viewer-btn:hover { background: rgba(255,255,255,.18); }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px 20px; position: relative; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.08); }
.viewer-body iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 22px; }
.viewer-prev { left: 10px; } .viewer-next { right: 10px; }

/* Courbes lissées (ui_area) */
.spark { position: relative; color: var(--accent, var(--green-500)); }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-dot { position: absolute; right: 0; width: 8px; height: 8px; margin: -4px -4px 0 0; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--surface, #fff); }
.spark-hit { position: absolute; inset: 0; display: flex; }
.spark-hit > i { position: absolute; top: 0; bottom: 0; left: calc(var(--x) - var(--w) / 2); width: var(--w); cursor: default; }
.spark-hit > i:hover { background: linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat; background-color: color-mix(in srgb, currentColor 7%, transparent); }
.spark-hit > i:hover::before { content: ""; position: absolute; left: 50%; top: var(--y); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--surface, #fff); }
.spark-hit > i:hover::after { content: attr(data-l) " : " attr(data-v); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20; white-space: nowrap; padding: 5px 9px; border-radius: 6px; background: #1f2937; color: #fff; font-family: inherit; font-style: normal; font-weight: 600; font-size: 12px; line-height: 1.2; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.spark-hit > i { font-style: normal; }
[data-theme="dark"] .spark-hit > i:hover::after { background: #f1f5f9; color: #0f172a; }
.spark-hit > i.l:hover::after { left: 0; transform: none; }
.spark-hit > i.r:hover::after { left: auto; right: 0; transform: none; }
.chart-plot { color: var(--accent, var(--green-500)); }
