/* Wastreet V3 — "Quiet & alive"
   Direction : moins chargé, plus de respiration, animations subtiles.
   Imported verbatim from the design bundle (src-v3-stripped). The :root
   block below replaces the JS-driven applyTheme() with static SEPUR
   defaults so the stylesheet works as a pure CSS import. */

:root {
  /* Contract palette — SEPUR */
  /* Darkened 0.55 -> 0.50 so white-on-teal reaches WCAG AA: ~#007475 = 5.6:1
     on white, converging on the documented brand teal #007474 (DESIGN.md
     §2/§9). The maquette's 0.55 rendered #008384 = 4.59:1 (below AA). */
  --c-primary:      oklch(0.50 0.10 195);
  --c-primary-fg:   #ffffff;
  --c-primary-soft: oklch(0.95 0.030 195);
  --c-primary-rim:  oklch(0.78 0.06 195);
  --c-secondary:    oklch(0.30 0.05 235);
  --c-secondary-fg: #ffffff;
  --c-accent:       oklch(0.72 0.18 130);
  --c-accent-soft:  oklch(0.95 0.05 130);

  /* Semantic */
  --s-success: oklch(0.58 0.13 155); --s-success-soft: oklch(0.95 0.04 155);
  --s-success-rim: oklch(0.80 0.06 155); --s-success-fg: #ffffff; --s-success-on: oklch(0.35 0.10 155);
  --s-info: oklch(0.55 0.13 235); --s-info-soft: oklch(0.95 0.035 235);
  --s-info-rim: oklch(0.80 0.06 235); --s-info-fg: #ffffff; --s-info-on: oklch(0.34 0.10 235);
  --s-warn: oklch(0.75 0.13 80); --s-warn-soft: oklch(0.96 0.05 80);
  --s-warn-rim: oklch(0.82 0.10 80); --s-warn-fg: oklch(0.25 0.05 80); --s-warn-on: oklch(0.42 0.13 65);
  --s-error: oklch(0.58 0.18 25); --s-error-soft: oklch(0.95 0.04 25);
  --s-error-rim: oklch(0.80 0.08 25); --s-error-fg: #ffffff; --s-error-on: oklch(0.40 0.16 25);
  --s-critical: oklch(0.50 0.22 15); --s-critical-soft: oklch(0.93 0.06 15);
  --s-critical-rim: oklch(0.75 0.12 15); --s-critical-fg: #ffffff; --s-critical-on: oklch(0.38 0.18 15);
  --s-neutral: oklch(0.55 0.01 240); --s-neutral-soft: oklch(0.95 0.005 240);
  --s-neutral-rim: oklch(0.85 0.01 240); --s-neutral-fg: #ffffff; --s-neutral-on: oklch(0.40 0.02 240);
  --s-inactive: oklch(0.70 0.005 240); --s-inactive-soft: oklch(0.97 0.003 240);
  --s-inactive-rim: oklch(0.88 0.005 240); --s-inactive-fg: #ffffff; --s-inactive-on: oklch(0.55 0.01 240);

  /* Neutrals — light (camelCase to match the V3 prototype tokens) */
  --n-bg:           #F6F5F0;
  --n-surface:      #FFFFFF;
  --n-surfaceAlt:   #F1F0EA;
  --n-surfaceDim:   #E8E7E0;
  --n-border:       #E5E3D9;
  --n-borderStrong: #CFCDC2;
  --n-text:         #13151A;
  --n-textMuted:    #525864;
  /* Darkened from #7B8290 (3.86:1, sub-AA on small text) to ~5:1 on the field
     backgrounds so 11–13px labels/meta stay legible in daylight (WCAG AA). */
  --n-textSubtle:   #616773;
  --n-textDim:      #A9AFB9;

  /* Density — standard */
  --d-row-h: 48px;
  --d-header-h: 40px;
  --d-field-h: 38px;
  --d-btn-h: 38px;
  --d-section-gap: 24px;
  --d-block-gap: 16px;
  --d-inline-gap: 8px;
  --d-cell-px: 14px;
  --d-cell-py: 12px;

  /* Fonts (uses our self-hosted Geist as Inter Tight substitute) */
  --font-sans: "Geist Sans", "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --n-bg:           #0E1116;
  --n-surface:      #171B22;
  --n-surfaceAlt:   #1F242C;
  --n-surfaceDim:   #272D36;
  --n-border:       #2D343F;
  --n-borderStrong: #3D4654;
  --n-text:         #F1F2F4;
  --n-textMuted:    #B5BAC4;
  --n-textSubtle:   #8A9099;
  --n-textDim:      #5C6470;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-sans, system-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--n-text);
  background: color-mix(in oklab, var(--n-bg), white 35%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
[data-theme="dark"] body { background: color-mix(in oklab, var(--n-bg), white 6%); background-attachment: fixed; }

/* ===================== Texture variants (toggle via tweak) ===================== */

/* TEXTURE: paper — pronounced fractal grain + crosshatch, warm radial washes */
body[data-tex="paper"] {
  background:
    radial-gradient(ellipse 110% 80% at 50% -10%, color-mix(in oklab, var(--c-primary) 9%, transparent) 0%, transparent 65%),
    radial-gradient(ellipse 70% 60% at 100% 100%, color-mix(in oklab, var(--c-accent) 6%, transparent) 0%, transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(0,0,0,0.022) 3px 4px),
    repeating-linear-gradient(-45deg, transparent 0 3px, rgba(0,0,0,0.020) 3px 4px),
    color-mix(in oklab, var(--n-bg), white 35%);
  background-attachment: fixed;
}

/* TEXTURE: linen — tighter weave, less noise, more elegant */
body[data-tex="linen"] {
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, color-mix(in oklab, var(--c-primary) 7%, transparent) 0%, transparent 60%),
    repeating-linear-gradient(0deg,   transparent 0 1px, rgba(0,0,0,0.035) 1px 2px),
    repeating-linear-gradient(90deg,  transparent 0 1px, rgba(0,0,0,0.025) 1px 2px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    color-mix(in oklab, var(--n-bg), white 40%);
  background-attachment: fixed;
}

/* TEXTURE: concrete — coarse grain, mottled cool, brutalist */
body[data-tex="concrete"] {
  background:
    radial-gradient(circle at 25% 30%,  rgba(0,0,0,0.06) 0%, transparent 35%),
    radial-gradient(circle at 75% 70%,  rgba(0,0,0,0.05) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, color-mix(in oklab, var(--c-secondary) 6%, transparent) 0%, transparent 40%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' stitchTiles='stitch' seed='9'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    color-mix(in oklab, var(--n-bg), white 28%);
  background-attachment: fixed;
}

/* TEXTURE: dots — fine geometric stippling, modern editorial */
body[data-tex="dots"] {
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, color-mix(in oklab, var(--c-primary) 8%, transparent) 0%, transparent 55%),
    radial-gradient(circle at center, rgba(0,0,0,0.05) 0.7px, transparent 1.2px) 0 0 / 18px 18px,
    color-mix(in oklab, var(--n-bg), white 42%);
  background-attachment: fixed;
}

/* TEXTURE: grid — engineering blueprint feel, thin lines */
body[data-tex="grid"] {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, color-mix(in oklab, var(--c-primary) 7%, transparent) 0%, transparent 60%),
    linear-gradient(rgba(0,0,0,0.040) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(0,0,0,0.040) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(0,0,0,0.018) 1px, transparent 1px) 0 0 / 6px 6px,
    linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px) 0 0 / 6px 6px,
    color-mix(in oklab, var(--n-bg), white 42%);
  background-attachment: fixed;
}

/* TEXTURE: topo — topographic-map curves, organic + technique */
body[data-tex="topo"] {
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, color-mix(in oklab, var(--c-primary) 8%, transparent) 0%, transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'><g fill='none' stroke='%23000' stroke-opacity='0.045' stroke-width='1'><path d='M0,200 Q150,140 300,200 T600,200'/><path d='M0,240 Q150,180 300,240 T600,240'/><path d='M0,280 Q150,220 300,280 T600,280'/><path d='M0,320 Q150,260 300,320 T600,320'/><path d='M0,360 Q150,300 300,360 T600,360'/><path d='M0,400 Q150,340 300,400 T600,400'/><path d='M0,440 Q150,380 300,440 T600,440'/><path d='M0,480 Q150,420 300,480 T600,480'/></g></svg>"),
    color-mix(in oklab, var(--n-bg), white 38%);
  background-attachment: fixed;
}

/* TEXTURE: aurora — animated soft color washes, no grain */
body[data-tex="aurora"] {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, color-mix(in oklab, var(--c-primary) 18%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 30%, color-mix(in oklab, var(--c-accent) 15%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 60% 90%, color-mix(in oklab, var(--c-secondary) 14%, transparent) 0%, transparent 50%),
    color-mix(in oklab, var(--n-bg), white 38%);
  background-attachment: fixed;
}

/* TEXTURE: none — flat (default canvas) */
body[data-tex="none"] {
  background: color-mix(in oklab, var(--n-bg), white 35%);
}

/* ===== Dark-mode variants — invert noise polarity, use lighter base ===== */
[data-theme="dark"] body[data-tex="paper"] {
  background:
    radial-gradient(ellipse 110% 80% at 50% -10%, color-mix(in oklab, var(--c-primary) 22%, transparent) 0%, transparent 65%),
    radial-gradient(ellipse 70% 60% at 100% 100%, color-mix(in oklab, var(--c-accent) 14%, transparent) 0%, transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(255,255,255,0.022) 3px 4px),
    repeating-linear-gradient(-45deg, transparent 0 3px, rgba(255,255,255,0.020) 3px 4px),
    color-mix(in oklab, var(--n-bg), white 6%);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-tex="linen"] {
  background:
    repeating-linear-gradient(0deg,  transparent 0 1px, rgba(255,255,255,0.025) 1px 2px),
    repeating-linear-gradient(90deg, transparent 0 1px, rgba(255,255,255,0.018) 1px 2px),
    color-mix(in oklab, var(--n-bg), white 6%);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-tex="concrete"] {
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,0.04) 0%, transparent 35%),
    radial-gradient(circle at 75% 70%, rgba(255,255,255,0.035) 0%, transparent 38%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' stitchTiles='stitch' seed='9'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    color-mix(in oklab, var(--n-bg), white 8%);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-tex="dots"] {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.05) 0.7px, transparent 1.2px) 0 0 / 18px 18px,
    color-mix(in oklab, var(--n-bg), white 8%);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-tex="grid"] {
  background:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    color-mix(in oklab, var(--n-bg), white 6%);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-tex="aurora"] {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, color-mix(in oklab, var(--c-primary) 30%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 30%, color-mix(in oklab, var(--c-accent) 22%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 60% 90%, color-mix(in oklab, var(--c-secondary) 22%, transparent) 0%, transparent 50%),
    var(--n-bg);
  background-attachment: fixed;
}
/* V3 element resets — moved into @layer base so Tailwind utility classes
   (which Tailwind v4 places in `@layer utilities`) can override them.
   Without the layer, the unlayered `button { background: none }` reset
   always wins over `.bg-[var(--c-primary)]` regardless of specificity,
   which made every <button> render flat (no bg / no border / no padding).
   See docs/solutions/erreurs-build/tailwind-v4-button-reset-* . */
@layer base {
  button, input, select, textarea { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.20); background-clip: padding-box; border: 2px solid transparent; }

/* Unified typography — same font everywhere, including numeric fields.
   We keep tabular numerals so columns still align, but drop the monospace
   family so the look stays consistent with the rest of the UI. */
.text-mono,
.mono,
.ws-cell-id,
.ws-msg-dock-last,
.ws-msg-dock-count,
.ws-iconbtn-badge,
.ws-list-card-id,
.ws-list-card-date,
.ws-page-actions kbd,
.ws-cmdk-foot kbd,
.ws-cmdk-input kbd,
.ws-cmdk-item-kbd,
.ws-sidebar-search kbd,
.ws-sidebar-cmdk kbd,
.ws-detail-head-id,
.ws-score,
.ws-taux,
.ws-pending-skel {
  font-family: var(--font-sans) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
}

/* ===================== V2 ease tokens ===================== */
:root {
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    360ms;
}

/* ===================== Buttons ===================== */
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
}
/* Hover lift only — removed the global `filter: brightness(0.96)` because
   on outline / ghost buttons (white surface) it darkens the text + icon +
   border *on top of* the bg-hover utility, producing a muddy double-shift.
   Filled variants get their hover feedback from variant-specific utilities
   (see button.tsx — `hover:brightness-95` on default/destructive). */
.ws-btn:hover:not(:disabled) { transform: translateY(-0.5px); }
.ws-btn:active:not(:disabled) { transform: translateY(0.5px); }
.ws-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 35%, transparent); }
/* Native <button> / interactive controls need the same focus ring as .ws-btn (a11y). */
.ws-stage:focus-visible,
.ws-chip:focus-visible,
.ws-allswitch:focus-visible,
.ws-iconbtn:focus-visible,
.ws-row-kebab:focus-visible,
.ws-acc-head:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 35%, transparent); }
.ws-list-card:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 35%, transparent); }

.ws-iconbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  position: relative;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-iconbtn:hover { background: var(--n-surfaceAlt); color: var(--n-text); }
.ws-iconbtn-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 14px; height: 14px; padding: 0 4px;
  background: var(--s-critical); color: #fff;
  border-radius: 999px; font-size: 9px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--n-surface);
}

/* ===================== Badge ===================== */
.ws-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}
.ws-badge.pulse {
  position: relative;
}
.ws-badge.pulse::before {
  content: ""; position: absolute; inset: -2px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  opacity: 0;
  animation: ws-pulse 2.2s ease-out infinite;
}
@keyframes ws-pulse {
  0%   { transform: scale(0.98); opacity: 0.5; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* ===================== Field ===================== */
.ws-field { display: flex; flex-direction: column; gap: 6px; }
.ws-field-label {
  font-size: 12px; font-weight: 500; color: var(--n-textMuted);
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 4px;
}
.ws-field-req { color: var(--s-error); font-weight: 600; }
.ws-field-error { font-size: 12px; color: var(--s-error-on); display: inline-flex; align-items: center; gap: 4px; }
.ws-field-help { font-size: 12px; color: var(--n-textSubtle); }

.ws-input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--n-surface);
  border: 1px solid var(--n-borderStrong);
  border-radius: 10px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.ws-input-wrap:hover { border-color: color-mix(in oklab, var(--n-borderStrong), black 10%); }
.ws-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 18%, transparent);
}
.ws-input-wrap.is-error { border-color: var(--s-error); }
.ws-input-wrap input, .ws-input-wrap select {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 0 12px;
  height: 100%;
  font-size: 14px; color: var(--n-text);
}
.ws-input-wrap select { appearance: none; padding-right: 32px; cursor: pointer; }
.ws-input-icon { position: absolute; left: 12px; color: var(--n-textDim); display: flex; align-items: center; pointer-events: none; }
.ws-input-wrap > .ws-input-icon + input,
.ws-input-wrap > .ws-input-icon + select { padding-left: 36px; }
.ws-input-prefix, .ws-input-suffix {
  padding: 0 10px; color: var(--n-textSubtle); font-size: 13px;
  display: inline-flex; align-items: center;
}
.ws-input-prefix { border-right: 1px solid var(--n-border); }
.ws-input-suffix { border-left: 1px solid var(--n-border); }

.ws-textarea {
  width: 100%; min-height: 80px; resize: vertical;
  padding: 10px 12px;
  background: var(--n-surface);
  border: 1px solid var(--n-borderStrong);
  border-radius: 10px;
  font-size: 14px; color: var(--n-text);
  outline: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.ws-textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 18%, transparent);
}

/* ===================== Checkbox / Toggle ===================== */
.ws-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.ws-checkbox input { display: none; }
.ws-checkbox-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--n-borderStrong);
  background: var(--n-surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.ws-checkbox-box[data-checked="1"] {
  background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-fg);
  transform: scale(1.02);
}
.ws-checkbox-label { font-size: 13.5px; }

.ws-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.ws-toggle input { display: none; }
.ws-toggle-track {
  width: 34px; height: 20px; border-radius: 999px;
  background: var(--n-borderStrong);
  position: relative;
  transition: background var(--dur-base);
}
.ws-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left var(--dur-base) var(--ease-spring);
}
.ws-toggle-track[data-checked="1"] { background: var(--c-primary); }
.ws-toggle-track[data-checked="1"] .ws-toggle-thumb { left: 16px; }
.ws-toggle-label { font-size: 13.5px; }

/* ===================== Card / Section ===================== */
.ws-card {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-base), transform var(--dur-base);
}
.ws-card.is-interactive { cursor: pointer; }
.ws-card.is-interactive:hover {
  border-color: var(--n-borderStrong);
  box-shadow: 0 1px 2px rgba(20,22,28,0.04), 0 10px 28px rgba(20,22,28,0.06);
  transform: translateY(-1px);
}

.ws-section { display: flex; flex-direction: column; gap: 12px; }
.ws-section-head { display: flex; align-items: center; justify-content: space-between; }
.ws-section-title {
  margin: 0; font-size: 11px; font-weight: 600; color: var(--n-textMuted);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.ws-section-title-icon {
  color: var(--c-primary);
  opacity: 0.9;
}
.ws-section-body { display: flex; flex-direction: column; }

.ws-divider { height: 1px; background: var(--n-border); }
.ws-divider-v { width: 1px; background: var(--n-border); align-self: stretch; }

/* ===================== Tabs ===================== */
.ws-tabs { display: inline-flex; align-items: center; gap: 2px; position: relative; }
.ws-tabs--underline { border-bottom: 1px solid var(--n-border); padding-bottom: 0; }
.ws-tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  font-size: 13.5px; font-weight: 500; color: var(--n-textMuted);
  border-radius: 8px 8px 0 0;
  position: relative;
  white-space: nowrap;
  transition: color var(--dur-fast);
}
.ws-tabs--underline .ws-tab[data-active="1"] { color: var(--n-text); }
.ws-tabs--underline .ws-tab[data-active="1"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--c-primary); border-radius: 2px;
  animation: ws-slidein-x var(--dur-base) var(--ease-out);
}
@keyframes ws-slidein-x {
  from { transform: scaleX(0.6); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
.ws-tab:hover { color: var(--n-text); }
.ws-tab-count {
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.ws-tabs--pill { background: var(--n-surfaceAlt); padding: 4px; border-radius: 12px; }
.ws-tabs--pill .ws-tab { height: 32px; border-radius: 8px; }
.ws-tabs--pill .ws-tab[data-active="1"] {
  background: var(--n-surface); color: var(--n-text);
  box-shadow: 0 1px 2px rgba(20,22,28,0.06), 0 0 0 1px var(--n-border);
}

/* ===================== Empty / Skeleton ===================== */
.ws-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center; color: var(--n-textMuted);
}
.ws-empty-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--n-surfaceAlt); color: var(--n-textSubtle);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.ws-empty-title { font-size: 15px; font-weight: 600; color: var(--n-text); margin-bottom: 4px; letter-spacing: -0.01em; }
.ws-empty-hint { font-size: 13.5px; max-width: 380px; line-height: 1.5; }

.ws-skel {
  background: linear-gradient(90deg, var(--n-surfaceAlt) 0%, var(--n-surfaceDim) 50%, var(--n-surfaceAlt) 100%);
  background-size: 200% 100%;
  animation: ws-skel 1.4s linear infinite;
}
@keyframes ws-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ===================== Toolbar ===================== */
.ws-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0;
}
.ws-toolbar-l, .ws-toolbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===================== Avatar ===================== */
.ws-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ===================== Sidebar V2 — LIGHT + HOVER EXPAND ===================== */
.ws-sidebar {
  background: var(--n-surface);
  color: var(--n-text);
  border-right: 1px solid var(--n-border);
  display: flex; flex-direction: column;
  width: 68px;
  flex-shrink: 0;
  transition: width var(--dur-slow) var(--ease-spring);
  position: relative;
  z-index: 20;
}
.ws-sidebar:hover, .ws-sidebar[data-pinned="1"] {
  width: 232px;
  box-shadow: 4px 0 24px rgba(20,22,28,0.04);
}
/* ≤900px the V4 responsive overlay (styles-v4-responsive.css) re-pins this same
   `.ws-sidebar` as a fixed off-canvas drawer (slide-in via body[data-mnav]), so
   it must stay `display:flex` here — no mobile hide rule. (The former 767.98px
   `.ws-sidebar--rail { display:none }`, which served the now-removed Sheet-based
   mobile nav, would otherwise zero out the drawer.) */

.ws-sidebar-head {
  padding: 16px 14px 10px;
  display: flex; align-items: center; gap: 10px;
  height: 64px;
}
.ws-sidebar-logo {
  font-size: 17px; font-weight: 700; letter-spacing: -0.025em;
  color: var(--n-text);
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.ws-sidebar-logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--c-primary);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-primary-fg);
  font-weight: 800; font-size: 16px; letter-spacing: -0.04em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--c-primary) 30%, transparent);
}
.ws-sidebar-logo > span {
  opacity: 0; transition: opacity var(--dur-base);
  transition-delay: 60ms;
  white-space: nowrap;
}
.ws-sidebar:hover .ws-sidebar-logo > span,
.ws-sidebar[data-pinned="1"] .ws-sidebar-logo > span { opacity: 1; }

.ws-sidebar-pin {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--n-textDim);
  opacity: 0;
  transition: opacity var(--dur-base), background var(--dur-fast), color var(--dur-fast);
  flex-shrink: 0;
}
.ws-sidebar:hover .ws-sidebar-pin { opacity: 1; }
.ws-sidebar-pin:hover { background: var(--n-surfaceAlt); color: var(--n-text); }
.ws-sidebar-pin[data-pinned="1"] { color: var(--c-primary); opacity: 1; }

.ws-sidebar-section { padding: 6px 12px; }
.ws-sidebar-section + .ws-sidebar-section { margin-top: 8px; }
.ws-sidebar-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--n-textSubtle);
  padding: 8px 10px 6px;
  opacity: 0; transition: opacity var(--dur-base);
  white-space: nowrap;
  height: 28px;
}
.ws-sidebar:hover .ws-sidebar-section-label,
.ws-sidebar[data-pinned="1"] .ws-sidebar-section-label { opacity: 1; }

.ws-sidebar-item {
  display: flex; align-items: center; gap: 14px;
  height: 42px; padding: 0 12px;
  border-radius: 10px;
  color: var(--n-textMuted);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
  cursor: pointer;
  width: 100%;
}
.ws-sidebar-item:hover { background: var(--n-surfaceAlt); color: var(--n-text); }
.ws-sidebar-item[data-active="1"] {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}
.ws-sidebar-item[data-active="1"]::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--c-primary); border-radius: 0 3px 3px 0;
  animation: ws-bar 280ms var(--ease-spring);
}
@keyframes ws-bar {
  from { height: 0; }
  to { height: 22px; }
}
.ws-sidebar-item > svg { flex-shrink: 0; }
.ws-sidebar-item-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity var(--dur-base) var(--ease-soft);
}
.ws-sidebar:hover .ws-sidebar-item-label,
.ws-sidebar[data-pinned="1"] .ws-sidebar-item-label { opacity: 1; }
.ws-sidebar-item-count {
  font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  padding: 2px 8px; border-radius: 999px;
  font-weight: 600;
  opacity: 0; transition: opacity var(--dur-base);
}
.ws-sidebar:hover .ws-sidebar-item-count,
.ws-sidebar[data-pinned="1"] .ws-sidebar-item-count { opacity: 1; }
.ws-sidebar-item[data-active="1"] .ws-sidebar-item-count {
  background: var(--c-primary); color: var(--c-primary-fg);
}

/* search trigger inside sidebar */
.ws-sidebar-cmdk {
  margin: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px;
  border-radius: 10px;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ws-sidebar-cmdk:hover { background: var(--n-surfaceDim); color: var(--n-text); }
.ws-sidebar-cmdk-text {
  flex: 1; min-width: 0; overflow: hidden;
  opacity: 0; transition: opacity var(--dur-base);
  white-space: nowrap;
}
.ws-sidebar:hover .ws-sidebar-cmdk-text,
.ws-sidebar[data-pinned="1"] .ws-sidebar-cmdk-text { opacity: 1; }
.ws-sidebar-cmdk kbd {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--n-surface);
  color: var(--n-textMuted);
  border: 1px solid var(--n-border);
  font-family: var(--font-mono);
  opacity: 0; transition: opacity var(--dur-base);
}
.ws-sidebar:hover .ws-sidebar-cmdk kbd,
.ws-sidebar[data-pinned="1"] .ws-sidebar-cmdk kbd { opacity: 1; }

.ws-sidebar-foot {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--n-border);
  display: flex; flex-direction: column; gap: 6px;
}

/* contract switcher — light version */
.ws-contract-switcher {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
  width: 100%;
  text-align: left;
  border: 1px solid var(--n-border);
  background: var(--n-surface);
}
.ws-contract-switcher:hover { background: var(--n-surfaceAlt); }
.ws-contract-swatch {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0; color: #fff;
}
.ws-contract-switcher-meta {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
  opacity: 0; transition: opacity var(--dur-base);
}
.ws-sidebar:hover .ws-contract-switcher-meta,
.ws-sidebar[data-pinned="1"] .ws-contract-switcher-meta { opacity: 1; }
.ws-contract-switcher-label {
  font-size: 13px; font-weight: 600; color: var(--n-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-contract-switcher-sub {
  font-size: 10.5px; color: var(--n-textSubtle);
  letter-spacing: 0.04em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ws-contract-menu {
  position: absolute; top: calc(100% + 6px); left: 0; width: 240px;
  background: var(--n-surface); color: var(--n-text);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 24px 60px rgba(20,22,28,0.18), 0 4px 12px rgba(20,22,28,0.10);
  z-index: 50;
  border: 1px solid var(--n-border);
  animation: ws-pop var(--dur-base) var(--ease-spring);
}
@keyframes ws-pop {
  from { transform: scale(0.96) translateY(4px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.ws-contract-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%; text-align: left;
  transition: background var(--dur-fast);
}
.ws-contract-menu-item:hover { background: var(--n-surfaceAlt); }
.ws-contract-menu-item[data-active="1"] { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }

/* user button in sidebar foot */
.ws-sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
  width: 100%;
  text-align: left;
}
.ws-sidebar-user:hover { background: var(--n-surfaceAlt); }
.ws-sidebar-user-meta {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
  opacity: 0; transition: opacity var(--dur-base);
}
.ws-sidebar:hover .ws-sidebar-user-meta,
.ws-sidebar[data-pinned="1"] .ws-sidebar-user-meta { opacity: 1; }
.ws-sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--n-text); white-space: nowrap; }
.ws-sidebar-user-role { font-size: 11px; color: var(--n-textSubtle); white-space: nowrap; }

/* ===================== Sidebar collapsed state =====================
   When the sidebar is neither hovered nor pinned, every interactive
   element (logo, search, contract, modules, user) centers around the
   same vertical axis. Without this the items had different left paddings
   and looked misaligned.
   We also hide the inner text/labels with display:none so they don't
   keep occupying flex width and pushing icons off-center. */
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-head {
  padding: 16px 0;
  justify-content: center;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-logo {
  flex: 0;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-logo > span {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-pin {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-cmdk {
  margin: 8px;
  padding: 0;
  justify-content: center;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-cmdk-text,
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-cmdk kbd {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-contract-switcher {
  margin: 8px;
  padding: 8px 0;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  width: calc(100% - 16px);
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-contract-switcher-meta {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-section {
  padding: 6px 8px;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-section-label {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-item {
  padding: 0;
  justify-content: center;
  gap: 0;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-item-label,
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-item-count {
  display: none;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-item[data-active="1"]::before {
  left: -8px;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-foot {
  padding: 8px;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-user {
  padding: 0;
  justify-content: center;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-user-meta {
  display: none;
}
/* Center the brand logo when sidebar is collapsed */
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-brand-logo {
  flex: 0;
  justify-content: center;
  width: 100%;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-brand-words {
  display: none;
}

/* ===================== Per-contract brand logo in sidebar ===================== */
.ws-brand-logo {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.ws-brand-mark {
  flex-shrink: 0;
  display: inline-flex;
  filter: drop-shadow(0 4px 10px color-mix(in oklab, var(--c-primary) 28%, transparent));
}
.ws-brand-img {
  height: 34px; width: auto; max-width: 130px;
  object-fit: contain;
  display: block;
  transition: max-width var(--dur-base) var(--ease-spring), width var(--dur-base) var(--ease-spring);
}
/* When sidebar is collapsed, crop the wordmark to show only its first letter */
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-brand-logo--image {
  width: 40px;
  overflow: hidden;
  justify-content: flex-start;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-brand-img {
  height: 32px;
  width: auto;
  max-width: none;
  object-fit: cover;
  object-position: left center;
  /* Show only the first character — clip with a fixed crop width */
  clip-path: inset(0 calc(100% - 32px) 0 0);
  margin-left: 4px;
}
.ws-brand-logo--image .ws-brand-words { display: none; }
.ws-brand-logo--image { justify-content: center; }
[data-theme="dark"] .ws-brand-img { filter: brightness(0) invert(1) drop-shadow(0 0 6px color-mix(in oklab, var(--c-primary) 50%, transparent)); }
.ws-brand-words {
  display: flex; flex-direction: column; min-width: 0;
  opacity: 0; transition: opacity var(--dur-base);
  transition-delay: 60ms;
}
.ws-sidebar:hover .ws-brand-words,
.ws-sidebar[data-pinned="1"] .ws-brand-words { opacity: 1; }
.ws-brand-name {
  font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--n-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-brand-tag {
  font-size: 10.5px; color: var(--n-textSubtle);
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sidebar accent stripe — vertical bar at the very top, hints at contract palette */
.ws-sidebar::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--c-primary) 0%,
    var(--c-primary) 40%,
    var(--c-accent) 100%);
  z-index: 1;
}

/* Page header accent — small left rule + tint behind title for "white-label" feel */
.ws-page-title {
  position: relative;
  display: inline-block;
  padding-left: 14px;
}
.ws-page-title::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
}

/* Accent wash on KPI value baseline */
.ws-kpi { position: relative; overflow: hidden; }
.ws-kpi::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--c-accent) 50%, transparent), transparent);
  opacity: 0.6;
}

/* Cmd-K backdrop — subtle accent glow behind the dialog */
.ws-cmdk { position: relative; }
.ws-cmdk::before {
  content: "";
  position: absolute; inset: -40px;
  background: radial-gradient(ellipse at top, color-mix(in oklab, var(--c-primary) 12%, transparent) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Stage actives use contract accent on the underline pip */
.ws-stage[data-active="1"]::after {
  background: linear-gradient(90deg, currentColor 0%, var(--c-accent) 100%) !important;
  opacity: 0.85;
}
.ws-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
/* Sidebar — logo & contract personalisation */

/* Light/dark mode toggle */
.ws-sidebar-mode {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
  width: 100%;
  text-align: left;
  margin-bottom: 4px;
}
.ws-sidebar-mode:hover { background: var(--n-surfaceAlt); }
.ws-sidebar-mode-track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: var(--c-secondary);
  flex-shrink: 0;
  transition: background var(--dur-base);
  overflow: hidden;
}
.ws-sidebar-mode-track[data-mode="light"] { background: var(--c-primary); }
.ws-sidebar-mode-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-primary);
  transition: left var(--dur-base) var(--ease-spring), color var(--dur-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  z-index: 2;
}
.ws-sidebar-mode-track[data-mode="dark"] .ws-sidebar-mode-thumb {
  left: 16px; color: var(--c-secondary);
}
.ws-sidebar-mode-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.75);
  display: inline-flex;
}
.ws-sidebar-mode-icon--light { left: 4px; }
.ws-sidebar-mode-icon--dark { right: 4px; }
.ws-sidebar-mode-label {
  font-size: 12px; color: var(--n-textMuted); font-weight: 500;
  opacity: 0; transition: opacity var(--dur-base);
  white-space: nowrap;
}
.ws-sidebar:hover .ws-sidebar-mode-label,
.ws-sidebar[data-pinned="1"] .ws-sidebar-mode-label { opacity: 1; }

/* Collapsed state — center the mode toggle */
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-mode {
  padding: 0;
  justify-content: center;
}
.ws-sidebar:not(:hover):not([data-pinned="1"]) .ws-sidebar-mode-label { display: none; }

/* ===================== Dark-mode tweaks ===================== */
[data-theme="dark"] body { background: var(--n-bg); }
[data-theme="dark"] .ws-sidebar { background: var(--n-surface); border-right-color: var(--n-border); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }

/* Soft surfaces that used `color-mix(... white)` for tinting break in dark mode.
   Override with surface-based mixes so foreground stays readable. */
[data-theme="dark"] .ws-list-card[data-active="1"] {
  background: color-mix(in oklab, var(--c-primary) 18%, var(--n-surface));
}
[data-theme="dark"] .ws-list-card[data-bulk="1"] {
  background: color-mix(in oklab, var(--c-primary) 14%, var(--n-surface));
}
[data-theme="dark"] .ws-att-thumb.pdf {
  background: color-mix(in oklab, var(--s-error) 22%, var(--n-surface));
  color: #fff;
}
[data-theme="dark"] .ws-att-thumb.image {
  background: repeating-linear-gradient(45deg, var(--n-surfaceAlt) 0 6px, var(--n-surfaceDim) 6px 12px);
}
[data-theme="dark"] .ws-task-pdf {
  background: color-mix(in oklab, var(--s-error) 25%, var(--n-surface));
  color: #fff;
}
[data-theme="dark"] .ws-map {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.06) 0%, transparent 60%),
    repeating-linear-gradient(0deg,  transparent 0 40px, rgba(255,255,255,0.04) 40px 41px),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(255,255,255,0.04) 40px 41px),
    linear-gradient(135deg, #1A2129 0%, #232C36 100%);
}
[data-theme="dark"] .ws-map-pin { border-color: var(--n-surface); }
[data-theme="dark"] .ws-map-pin::after { background: var(--n-surface); }

/* Soft semantic backgrounds — semantic *-soft tokens are tuned for light mode.
   In dark mode, fall back to a tinted surface mix. */
[data-theme="dark"] .ws-callout { background: color-mix(in oklab, var(--c-primary) 14%, var(--n-surface)); }
[data-theme="dark"] .ws-callout.warn     { background: color-mix(in oklab, var(--s-warn) 14%, var(--n-surface)); }
[data-theme="dark"] .ws-callout.critical { background: color-mix(in oklab, var(--s-critical) 16%, var(--n-surface)); }
[data-theme="dark"] .ws-callout-label   { color: var(--c-accent); }
[data-theme="dark"] .ws-callout-body    { color: var(--n-text); }

/* Badges in soft variant — switch to dark-friendly surface mix */
[data-theme="dark"] .ws-badge { color: var(--n-text); }
[data-theme="dark"] .ws-trait-banner[data-tone="info"]    { background: color-mix(in oklab, var(--s-info) 18%, var(--n-surface)); color: var(--n-text); }
[data-theme="dark"] .ws-trait-banner[data-tone="warn"]    { background: color-mix(in oklab, var(--s-warn) 18%, var(--n-surface)); color: var(--n-text); }
[data-theme="dark"] .ws-trait-banner[data-tone="success"] { background: color-mix(in oklab, var(--s-success) 18%, var(--n-surface)); color: var(--n-text); }

/* Table — fix unreadable header tint and primary-soft backgrounds */
[data-theme="dark"] .ws-ac-table thead th {
  background: var(--n-surfaceAlt) !important;
  color: var(--n-text) !important;
}
[data-theme="dark"] .ws-ac-table .ws-th-group,
[data-theme="dark"] .ws-ac-table .ws-th-sub {
  background: var(--n-surfaceAlt) !important;
  color: var(--n-textMuted) !important;
}
[data-theme="dark"] .ws-ac-table tbody tr:hover {
  background: color-mix(in oklab, var(--c-primary) 14%, var(--n-surface)) !important;
}
[data-theme="dark"] .ws-ac-table tbody tr[data-tone="warn"] {
  background: color-mix(in oklab, var(--s-warn) 12%, var(--n-surface)) !important;
}
[data-theme="dark"] .ws-ac-table tbody tr[data-tone="critical"] {
  background: color-mix(in oklab, var(--s-critical) 14%, var(--n-surface)) !important;
}
[data-theme="dark"] .ws-ac-table tbody tr[data-selected="1"] {
  background: color-mix(in oklab, var(--c-primary) 22%, var(--n-surface)) !important;
}

/* Row expanded — fix white surfaces */
[data-theme="dark"] .ws-row-expanded > td {
  background: color-mix(in oklab, var(--c-primary) 8%, var(--n-surface));
}
[data-theme="dark"] .ws-row-expanded[data-tone="warn"] > td {
  background: color-mix(in oklab, var(--s-warn) 12%, var(--n-surface));
}
[data-theme="dark"] .ws-row-expanded[data-tone="critical"] > td {
  background: color-mix(in oklab, var(--s-critical) 14%, var(--n-surface));
}
[data-theme="dark"] .ws-nc-line { background: var(--n-surfaceAlt); }

/* Page bg + sticky cells need surface background, not white */
[data-theme="dark"] .ws-cell-sticky { background: var(--n-surface); }
[data-theme="dark"] .ws-th-sticky {
  background: var(--n-surfaceAlt) !important;
  color: var(--n-text) !important;
}

/* Planning — calendar */
[data-theme="dark"] .ws-planning-month-head { background: color-mix(in oklab, var(--c-primary) 12%, var(--n-surface)); }
[data-theme="dark"] .ws-planning-cell { background: var(--n-surface); }
[data-theme="dark"] .ws-planning-cell--empty {
  background: repeating-linear-gradient(135deg, var(--n-surface) 0 8px, var(--n-surfaceAlt) 8px 9px);
}
[data-theme="dark"] .ws-planning-cell[data-today="1"] {
  background: linear-gradient(180deg, color-mix(in oklab, var(--c-primary) 22%, var(--n-surface)) 0%, var(--n-surface) 100%);
}
[data-theme="dark"] .ws-planning-chip { background: var(--n-surfaceAlt); color: var(--n-text); }
[data-theme="dark"] .ws-planning-card { background: var(--n-surface); color: var(--n-text); }
[data-theme="dark"] .ws-planning-week-col { background: var(--n-surface); }
[data-theme="dark"] .ws-planning-week-head { background: var(--n-surfaceAlt); }

/* Cmdk + popover surfaces */
[data-theme="dark"] .ws-cmdk,
[data-theme="dark"] .ws-row-menu,
[data-theme="dark"] .ws-contract-menu,
[data-theme="dark"] .ws-loc-preview { background: var(--n-surface); border-color: var(--n-border); }

/* Pending shimmer needs to be visible on dark surfaces */
[data-theme="dark"] .ws-pending-skel {
  background: linear-gradient(90deg, var(--n-surfaceAlt) 0%, var(--n-surfaceDim) 50%, var(--n-surfaceAlt) 100%);
  background-size: 200% 100%;
}

/* Inputs / cards — make sure surface vars take over */
[data-theme="dark"] .ws-input-wrap,
[data-theme="dark"] .ws-textarea,
[data-theme="dark"] .ws-card,
[data-theme="dark"] .ws-trait,
[data-theme="dark"] .ws-acc { background: var(--n-surface); }
[data-theme="dark"] .ws-acc-body { background: color-mix(in oklab, var(--c-primary) 8%, var(--n-surface)); }
[data-theme="dark"] .ws-task[data-state="nc"] { background: color-mix(in oklab, var(--s-error) 12%, var(--n-surface)); }

/* Page header title accent works fine, but page sub needs muted */
[data-theme="dark"] .ws-page-sub { color: var(--n-textMuted); }
[data-theme="dark"] .ws-section-title-icon { color: var(--c-accent); }

/* Accent uses */
.ws-kpi-value.green { color: var(--c-accent); }
.ws-live-dot { background: var(--c-accent); }
.ws-live-dot::after { border-color: var(--c-accent); }
.ws-kpi-trend.up { background: color-mix(in oklab, var(--c-accent) 18%, var(--n-surface)); color: var(--c-accent); }

/* Contract swatch ring */
.ws-contract-swatch {
  box-shadow:
    inset 0 0 0 2px color-mix(in oklab, var(--c-accent) 55%, transparent);
}
.ws-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.ws-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  gap: 0;
  min-height: 0;
  animation: ws-pagein var(--dur-slow) var(--ease-out);
}
@keyframes ws-pagein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ws-page[data-single="1"] { grid-template-columns: minmax(0, 1fr); }

.ws-list-col { display: flex; flex-direction: column; border-right: 1px solid var(--n-border); min-width: 0; background: transparent; overflow: hidden; }
.ws-detail-col { display: flex; flex-direction: column; min-width: 0; background: transparent; overflow: hidden; }

/* ===================== Suivi opérations layout =====================
   Page is a column. Header + Tabs + KPIs span the full width across the top.
   Below, a horizontal row contains the Table (left) and an optional Detail
   panel (right). Detail panel can be closed → table goes full-width. */
.ws-suivi {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  animation: ws-pagein var(--dur-slow) var(--ease-out);
  transition: padding-right var(--dur-base) var(--ease-spring);
}
.ws-suivi[data-panel-open="1"] {
  padding-right: 560px;
}
.ws-suivi-body {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1; min-height: 0;
  overflow: hidden;
}
.ws-suivi-body[data-detail-open="1"] {
  grid-template-columns: minmax(360px, 0.95fr) minmax(440px, 1.05fr);
}
.ws-suivi-table {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  overflow: hidden;
}
.ws-suivi-detail {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--n-border);
  background: var(--n-surface);
  animation: ws-slidein-detail var(--dur-base) var(--ease-spring);
}
@keyframes ws-slidein-detail {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.ws-suivi-detail .ws-detail { height: 100%; }

/* ===================== Page header ===================== */
.ws-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 28px 28px 14px;
  gap: 16px;
  flex-wrap: wrap;
}
.ws-page-header > div:first-child { flex: 1; min-width: 200px; }
.ws-page-title {
  margin: 0;
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--n-text);
  line-height: 1.1;
}
.ws-page-sub { color: var(--n-textMuted); font-size: 14px; margin-top: 6px; }
.ws-page-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===================== Cards V2 — Signalements list ===================== */
.ws-list-stack {
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 24px 24px;
  overflow-y: auto;
}
.ws-list-card {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-base), transform var(--dur-base);
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  margin: 0 1px;
}
.ws-list-card:hover {
  border-color: var(--n-borderStrong);
  box-shadow: 0 1px 2px rgba(20,22,28,0.04), 0 12px 28px rgba(20,22,28,0.06);
  transform: translateY(-1px);
}
.ws-list-card[data-active="1"] {
  border-color: var(--c-primary);
  background: color-mix(in oklab, var(--c-primary-soft), white 30%);
}
.ws-list-card[data-active="1"]::before {
  content: "";
  position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px;
  background: var(--c-primary); border-radius: 0 3px 3px 0;
  animation: ws-bar 280ms var(--ease-spring);
}
.ws-list-card-top { display: flex; align-items: center; gap: 8px; }
.ws-list-card-id {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--n-textMuted);
}
.ws-list-card-date {
  margin-right: 36px;
  font-size: 12px; color: var(--n-textSubtle); font-variant-numeric: tabular-nums;
}
.ws-list-card-top { display: flex; align-items: center; gap: 8px; }
.ws-list-card-top > .ws-list-card-date { margin-left: auto; }
.ws-list-card-title { font-size: 15.5px; font-weight: 600; color: var(--n-text); line-height: 1.3; letter-spacing: -0.01em; }
.ws-list-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--n-textMuted);
  flex-wrap: wrap; row-gap: 4px;
}
.ws-list-card-meta > * { white-space: nowrap; }
.ws-list-card-meta-sep { color: var(--n-textDim); }

.ws-list-card-actions {
  position: absolute; right: 14px; top: 14px;
  display: flex; gap: 4px;
  opacity: 1;
}

/* ===================== Detail (right column) ===================== */
.ws-detail { display: flex; flex-direction: column; height: 100%; background: var(--n-surface); }
.ws-detail-head {
  padding: 28px 28px 18px;
  display: flex; align-items: flex-start; gap: 16px;
}
.ws-detail-head-main { flex: 1; min-width: 0; overflow: hidden; }
.ws-detail-head-id {
  font-family: var(--font-mono); font-size: 11px; color: var(--n-textMuted);
  margin-bottom: 8px; letter-spacing: 0.04em; text-transform: uppercase;
}
.ws-detail-head-title {
  margin: 0;
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--n-text); line-height: 1.2;
}
.ws-detail-head-actions { display: flex; align-items: center; gap: 4px; }

.ws-detail-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 0 28px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex; flex-direction: column;
  gap: 24px;
}
.ws-detail-foot {
  border-top: 1px solid var(--n-border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 8px;
  background: var(--n-surface);
}

/* Definition list */
.ws-dlist { display: grid; grid-template-columns: 120px 1fr; row-gap: 10px; column-gap: 16px; }
.ws-dlist dt { font-size: 12.5px; color: var(--n-textSubtle); font-weight: 500; }
.ws-dlist dd { margin: 0; font-size: 13.5px; color: var(--n-text); }

/* Callout */
.ws-callout {
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--c-primary-soft);
  display: flex; align-items: flex-start; gap: 12px;
  border-left: 3px solid var(--c-primary);
}
.ws-callout-icon { color: var(--c-primary); flex-shrink: 0; margin-top: 1px; }
.ws-callout-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-primary);
  margin-bottom: 2px;
}
.ws-callout-body { font-size: 14px; color: var(--n-text); line-height: 1.5; }
.ws-callout.warn { background: var(--s-warn-soft); border-left-color: var(--s-warn); }
.ws-callout.warn .ws-callout-label, .ws-callout.warn .ws-callout-icon { color: var(--s-warn-on); }
.ws-callout.critical { background: var(--s-critical-soft); border-left-color: var(--s-critical); }
.ws-callout.critical .ws-callout-label, .ws-callout.critical .ws-callout-icon { color: var(--s-critical-on); }

/* KPI tiles */
.ws-kpi {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  padding: 18px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--dur-fast), transform var(--dur-base);
}
.ws-kpi:hover { border-color: var(--n-borderStrong); transform: translateY(-1px); }
.ws-kpi-label {
  font-size: 11px; font-weight: 600; color: var(--n-textSubtle);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ws-kpi-value {
  font-size: 32px; font-weight: 600; color: var(--n-text);
  letter-spacing: -0.025em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ws-kpi-value.green { color: var(--s-success-on); }
.ws-kpi-value.warn { color: var(--s-warn-on); }
.ws-kpi-value.danger { color: var(--s-error-on); }
.ws-kpi-sub { font-size: 12.5px; color: var(--n-textMuted); display: flex; align-items: center; gap: 4px; }
.ws-kpi-trend { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.ws-kpi-trend.up { background: var(--s-success-soft); color: var(--s-success-on); }
.ws-kpi-trend.down { background: var(--s-error-soft); color: var(--s-error-on); }
.ws-kpi-spark { height: 24px; margin-top: 2px; }

/* ===================== Messagerie ===================== */
.ws-msg-list { display: flex; flex-direction: column; gap: 12px; }
.ws-msg { display: flex; gap: 10px; }
.ws-msg.self { flex-direction: row-reverse; }
.ws-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--n-surfaceAlt);
  font-size: 13.5px; line-height: 1.45;
  max-width: 85%;
}
.ws-msg.self .ws-msg-bubble {
  background: var(--c-primary-soft);
  color: var(--n-text);
}
.ws-msg-meta { font-size: 11px; color: var(--n-textSubtle); margin-top: 4px; }
.ws-msg-author { font-size: 12px; font-weight: 600; color: var(--n-textMuted); margin-bottom: 4px; }

.ws-composer {
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  border: 1px solid var(--n-borderStrong);
  border-radius: 12px;
  background: var(--n-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.ws-composer:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 18%, transparent);
}
.ws-composer input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 13.5px; padding: 0 8px;
}

/* Attachments */
.ws-att {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--n-border);
  border-radius: 12px;
  background: var(--n-surface);
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-base);
  min-width: 0;
  overflow: hidden;
}
.ws-att-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 720px) {
  .ws-att-grid { grid-template-columns: 1fr 1fr; }
}
.ws-att:hover { border-color: var(--n-borderStrong); transform: translateY(-1px); }
.ws-att-thumb {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--n-surfaceAlt);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--n-textSubtle);
  flex-shrink: 0; position: relative; overflow: hidden;
}
.ws-att-thumb.image { background: repeating-linear-gradient(45deg, #E8E6DE 0 6px, #DEDCD3 6px 12px); }
.ws-att-thumb.pdf { background: color-mix(in oklab, var(--s-error-soft), white 30%); color: var(--s-error-on); font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.ws-att-meta { flex: 1; min-width: 0; }
.ws-att-name { font-size: 13px; font-weight: 500; color: var(--n-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-att-sub { font-size: 11px; color: var(--n-textSubtle); }

.ws-uploader {
  border: 1.5px dashed var(--n-borderStrong);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  font-size: 13px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  cursor: pointer;
}
.ws-uploader:hover { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }

/* ===================== Traitement section (3 vertical steps) ===================== */
.ws-trait-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px; line-height: 1.4;
  background: var(--s-info-soft); color: var(--s-info-on);
  margin-bottom: 8px;
}
.ws-trait-banner[data-tone="warn"]    { background: var(--s-warn-soft);    color: var(--s-warn-on); }
.ws-trait-banner[data-tone="success"] { background: var(--s-success-soft); color: var(--s-success-on); }

.ws-trait {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  padding: 20px 22px 8px;
  position: relative;
}
/* Continuous vertical guide line on the left, threading all step markers */
.ws-trait::before {
  content: "";
  position: absolute;
  left: 35px; top: 40px; bottom: 30px;
  width: 1.5px;
  background: var(--n-border);
}
.ws-trait-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 16px;
  padding-bottom: 24px;
  align-items: start;
}
.ws-trait-step[data-last="1"] { padding-bottom: 6px; }
.ws-trait-step-marker {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--n-surface);
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 1;
  margin-top: 2px;
  transition: background var(--dur-base), color var(--dur-base);
}
.ws-trait-step[data-done="1"] .ws-trait-step-marker {
  background: var(--c-primary); color: var(--c-primary-fg);
}
.ws-trait-step-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ws-trait-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

/* ===================== Map placeholder ===================== */
.ws-map {
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.6) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 40px, rgba(15,80,140,0.04) 40px 41px),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(15,80,140,0.04) 40px 41px),
    linear-gradient(135deg, #EEF1EC 0%, #DDE3DD 100%);
  position: relative;
  overflow: hidden;
}
.ws-map-pin {
  position: absolute;
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  background: var(--c-primary);
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(20,22,28,0.2);
  border: 2px solid #fff;
}
.ws-map-pin::after {
  content: ""; position: absolute; top: 7px; left: 7px;
  width: 10px; height: 10px; border-radius: 50%; background: #fff;
}

/* ===================== Section accordion (autocontrole) ===================== */
.ws-acc {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  overflow: visible;
  transition: border-color var(--dur-fast);
}
.ws-acc[data-open="1"] { border-color: var(--n-borderStrong); }
.ws-acc + .ws-acc { margin-top: 10px; }
.ws-acc-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--n-text);
  font-size: 14.5px;
  width: 100%; text-align: left;
  transition: background var(--dur-fast);
}
.ws-acc-head:hover { background: var(--n-surfaceAlt); }
.ws-acc-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: background var(--dur-base), color var(--dur-base);
}
.ws-acc[data-open="1"] .ws-acc-num { background: var(--c-primary); color: var(--c-primary-fg); }
.ws-acc-summary {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  font-weight: 400; font-size: 13px; color: var(--n-textMuted);
}
.ws-acc-summary svg { transition: transform var(--dur-base) var(--ease-spring); }
.ws-acc[data-open="1"] .ws-acc-summary svg { transform: rotate(180deg); }
.ws-acc-body {
  padding: 6px 18px 18px;
  border-top: 1px solid var(--n-border);
  animation: ws-accopen var(--dur-base) var(--ease-out);
}
@keyframes ws-accopen {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Conformite control */
.ws-conformite {
  display: inline-flex;
  background: var(--n-surfaceAlt);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.ws-conformite button {
  height: 30px; padding: 0 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  color: var(--n-textMuted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-conformite button:hover { color: var(--n-text); }
.ws-conformite button[data-active="1"][data-state="conf"] { background: var(--s-success); color: var(--s-success-fg); }
.ws-conformite button[data-active="1"][data-state="nc"]   { background: var(--s-error);   color: var(--s-error-fg); }
.ws-conformite button[data-active="1"][data-state="na"]   { background: var(--n-text);    color: var(--n-surface); }

/* Photo thumbs */
.ws-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ws-photo {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #E8E6DE 0 6px, #DEDCD3 6px 12px);
  position: relative; cursor: pointer;
  border: 1px solid var(--n-border);
  transition: transform var(--dur-base);
}
.ws-photo:hover { transform: scale(1.02); }
.ws-photo-add {
  aspect-ratio: 1; border-radius: 12px;
  border: 1.5px dashed var(--n-borderStrong);
  display: flex; align-items: center; justify-content: center;
  color: var(--n-textMuted); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.ws-photo-add:hover { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }

/* Signature pad */
.ws-sigpad {
  height: 160px; border-radius: 14px;
  border: 1.5px dashed var(--n-borderStrong);
  background: var(--n-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--n-textMuted);
  font-size: 13px; position: relative;
}
.ws-sigpad svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Stepper */
.ws-stepper {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 0;
  overflow-x: auto;
}
.ws-step {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  color: var(--n-textMuted);
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  white-space: nowrap; flex-shrink: 0;
  transition: background var(--dur-base), color var(--dur-base);
}
.ws-step[data-state="done"] { color: var(--s-success-on); background: var(--s-success-soft); border-color: transparent; }
.ws-step[data-state="active"] { color: var(--c-primary-fg); background: var(--c-primary); border-color: transparent; }
.ws-step-num {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.06);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
}
.ws-step[data-state="active"] .ws-step-num { background: rgba(255,255,255,0.25); }
.ws-step-connector { width: 14px; height: 1px; background: var(--n-border); flex-shrink: 0; }

/* Filter chips */
.ws-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  color: var(--n-textMuted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.ws-chip:hover { background: var(--n-surfaceAlt); color: var(--n-text); }
.ws-chip[data-active="1"] {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-primary-fg);
}
.ws-chip-count {
  font-size: 11px; padding: 0 5px; border-radius: 999px;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  font-variant-numeric: tabular-nums;
}
.ws-chip[data-active="1"] .ws-chip-count { background: rgba(255,255,255,0.22); color: var(--c-primary-fg); }

/* Bandeau communication (slim) */
.ws-bandeau {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  font-size: 13px;
  background: var(--s-info-soft);
  color: var(--s-info-on);
  border-bottom: 1px solid color-mix(in oklab, var(--s-info-rim) 60%, transparent);
}
.ws-bandeau.warn { background: var(--s-warn-soft); color: var(--s-warn-on); border-color: var(--s-warn-rim); }
.ws-bandeau-title { font-weight: 600; }

/* Smart suggestion banner */
.ws-suggest {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in oklab, var(--c-primary) 6%, var(--n-surface)) 0%, var(--n-surface) 100%);
  border: 1px solid color-mix(in oklab, var(--c-primary) 20%, var(--n-border));
  margin: 0 24px 12px;
}
.ws-suggest-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--c-primary); color: var(--c-primary-fg);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-suggest-body { flex: 1; min-width: 0; font-size: 13.5px; }
.ws-suggest-title { font-weight: 600; color: var(--n-text); }
.ws-suggest-sub { color: var(--n-textMuted); margin-top: 2px; font-size: 12.5px; }

/* Side panel */
.ws-overlay {
  position: fixed; inset: 0;
  background: color-mix(in oklab, var(--n-text) 30%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex; justify-content: flex-end;
  animation: ws-fade var(--dur-base);
}
@keyframes ws-fade { from { opacity: 0; } to { opacity: 1; } }
.ws-side {
  width: 600px; max-width: 100vw;
  height: 100vh;
  background: var(--n-surface);
  display: flex; flex-direction: column;
  animation: ws-slidein var(--dur-slow) var(--ease-spring);
  box-shadow: -20px 0 60px rgba(20,22,28,0.18);
  overflow: hidden;
  position: relative;
}
.ws-side::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--c-primary) 0%,
    var(--c-primary) 40%,
    var(--c-accent) 100%);
  z-index: 2;
}
.ws-side-floating::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--c-primary) 0%,
    var(--c-primary) 40%,
    var(--c-accent) 100%);
  z-index: 2;
}
.ws-side[data-wide="1"] { width: 820px; }

/* Floating variant — panel anchored to the right edge of the viewport with no
   backdrop/overlay, so the page behind keeps receiving clicks. Used by Suivi
   opérations so the user can jump between operations by clicking the table. */
.ws-side-floating {
  position: fixed;
  right: 0; top: 0;
  height: 100vh;
  z-index: 40;
  width: 560px; max-width: 100vw;
  background: var(--n-surface);
  display: flex; flex-direction: column;
  box-shadow: -16px 0 40px rgba(20,22,28,0.12), -4px 0 12px rgba(20,22,28,0.06);
  animation: ws-slidein var(--dur-slow) var(--ease-spring);
  overflow: hidden;
}
.ws-side-floating[data-wide="1"] { width: 560px; }

/* Flux pictogram — colored rounded square with white icon inside */
.ws-flux-picto {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ===================== Suivi — Planning + Statistics tabs ===================== */
.ws-planning, .ws-stats {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  padding: 0 24px 24px;
  overflow: auto;
  animation: ws-pagein var(--dur-slow) var(--ease-out);
}
.ws-planning-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0 16px;
}
.ws-planning-label {
  font-size: 16px; font-weight: 600; color: var(--n-text);
  letter-spacing: -0.015em; margin-left: 8px;
}

/* Month grid — softer, modern */
.ws-planning-month {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,22,28,0.03), 0 12px 28px rgba(20,22,28,0.05);
}
.ws-planning-month-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: color-mix(in oklab, var(--c-primary-soft) 35%, var(--n-surface));
  border-bottom: 1px solid var(--n-border);
}
.ws-planning-day-name {
  padding: 12px 14px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--n-textMuted);
  text-align: left;
}
.ws-planning-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.ws-planning-cell {
  min-height: 118px;
  padding: 10px 11px;
  border-right: 1px solid var(--n-border);
  border-bottom: 1px solid var(--n-border);
  display: flex; flex-direction: column; gap: 8px;
  background: var(--n-surface);
  transition: background var(--dur-fast);
  position: relative;
}
.ws-planning-cell:nth-child(7n) { border-right: 0; }
.ws-planning-cell--empty {
  background: repeating-linear-gradient(135deg, var(--n-surface) 0 8px, color-mix(in oklab, var(--n-surfaceAlt) 50%, transparent) 8px 9px);
  min-height: 118px;
}
.ws-planning-cell:hover { background: color-mix(in oklab, var(--c-primary-soft) 30%, var(--n-surface)); }
.ws-planning-cell[data-today="1"] {
  background: linear-gradient(180deg, color-mix(in oklab, var(--c-primary-soft) 70%, var(--n-surface)) 0%, var(--n-surface) 100%);
}
.ws-planning-cell[data-today="1"]::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
}
.ws-planning-cell-head {
  display: flex; align-items: center; justify-content: space-between;
}
.ws-planning-cell-num {
  font-size: 13px; font-weight: 600; color: var(--n-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ws-planning-cell[data-today="1"] .ws-planning-cell-num {
  background: var(--c-primary); color: var(--c-primary-fg);
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px color-mix(in oklab, var(--c-primary) 32%, transparent);
}
.ws-planning-cell-count {
  font-size: 10px; font-weight: 600; color: var(--n-textMuted);
  background: var(--n-surfaceAlt);
  padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.ws-planning-cell-list { display: flex; flex-direction: column; gap: 4px; }
.ws-planning-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--n-surfaceAlt);
  border: 0;
  border-radius: 7px;
  padding: 4px 7px 4px 5px;
  font-size: 11.5px; color: var(--n-text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.ws-planning-chip:hover {
  background: var(--c-primary-soft);
  transform: translateX(1px);
}
.ws-planning-chip[data-selected="1"] {
  background: var(--c-primary); color: var(--c-primary-fg);
  box-shadow: 0 2px 6px color-mix(in oklab, var(--c-primary) 28%, transparent);
}
.ws-planning-chip[data-selected="1"] .ws-flux-picto { background: var(--c-primary-fg) !important; }
.ws-planning-chip[data-selected="1"] .ws-flux-picto svg { stroke: var(--c-primary) !important; }
.ws-planning-chip-label {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.ws-planning-more { font-size: 10.5px; color: var(--n-textSubtle); padding-left: 6px; font-weight: 500; }

/* Week view */
.ws-planning-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  flex: 1; min-height: 0; min-width: 0;
  align-items: stretch;
}
.ws-planning-week-col {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-base);
}
.ws-planning-week-col:hover {
  box-shadow: 0 1px 2px rgba(20,22,28,0.04), 0 12px 28px rgba(20,22,28,0.06);
}
.ws-planning-week-col[data-today="1"] {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--c-primary) 18%, transparent);
}
.ws-planning-week-head {
  padding: 12px 14px;
  background: var(--n-surfaceAlt);
  border-bottom: 1px solid var(--n-border);
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.ws-planning-day-month {
  font-size: 11px; color: var(--n-textMuted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ws-planning-week-col[data-today="1"] .ws-planning-week-head {
  background: linear-gradient(180deg, color-mix(in oklab, var(--c-primary-soft) 80%, var(--n-surface)) 0%, var(--c-primary-soft) 100%);
}
.ws-planning-week-num {
  font-size: 18px; font-weight: 700; color: var(--n-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ws-planning-week-body {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  flex: 1; min-height: 0;
}
.ws-planning-empty { color: var(--n-textDim); text-align: center; padding: 22px 0; font-size: 14px; }

/* Week card */
.ws-planning-card {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-base);
}
.ws-planning-card:hover {
  background: color-mix(in oklab, var(--c-primary-soft) 35%, var(--n-surface));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in oklab, var(--c-primary) 8%, transparent);
}
.ws-planning-card[data-selected="1"] {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--c-primary) 25%, transparent);
}
.ws-planning-card-top { display: flex; align-items: center; gap: 8px; }
.ws-planning-card-time {
  margin-left: auto; font-size: 11px; color: var(--n-textMuted);
  font-variant-numeric: tabular-nums;
  background: var(--n-surfaceAlt);
  padding: 1px 6px; border-radius: 999px;
}
.ws-planning-card-title {
  font-size: 13px; font-weight: 600; color: var(--n-text); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-planning-card-sub {
  font-size: 11.5px; color: var(--n-textMuted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-planning-card-meta {
  font-size: 11px; color: var(--n-textSubtle); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* When the side panel is open, the week view becomes a focus+context lens:
   the focused day takes more width, the days before/after stay easy to
   click, and other days shrink. Cards stay visible everywhere so the user
   can still pick an operation directly. */
.ws-suivi[data-panel-open="1"] .ws-planning-week {
  gap: 6px;
  display: flex;
}
.ws-suivi[data-panel-open="1"] .ws-planning-week-col {
  flex: 1 1 0;
  min-width: 0;
  transition: flex-grow var(--dur-base) var(--ease-spring);
}
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"]   { flex-grow: 0.6; }
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="near"]  { flex-grow: 1.2; }
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="focus"] { flex-grow: 2.4; border-color: var(--c-primary); }
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-week-head {
  padding: 8px 6px;
}
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-day-name { font-size: 10px; }
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-week-num { font-size: 15px; }
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-card-title,
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-card-sub,
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"] .ws-planning-card-meta {
  font-size: 10.5px;
}
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="focus"] .ws-planning-week-head {
  background: linear-gradient(180deg, var(--c-primary-soft) 0%, color-mix(in oklab, var(--c-primary-soft) 60%, var(--n-surface)) 100%);
}
/* Visual hint that columns are clickable to refocus */
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"],
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="near"] {
  cursor: pointer;
}
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="far"]:hover,
.ws-suivi[data-panel-open="1"] .ws-planning-week-col[data-zoom="near"]:hover {
  border-color: var(--c-primary-rim);
}
/* ===================== Print rules for the PDF report ===================== */
@media print {
  body[data-print-scope="stats"] .ws-sidebar,
  body[data-print-scope="stats"] .ws-tweaks-panel,
  body[data-print-scope="stats"] .ws-page-header .ws-page-actions,
  body[data-print-scope="stats"] .ws-tabs,
  body[data-print-scope="stats"] .ws-stats-filters,
  body[data-print-scope="stats"] .ws-stat-card-actions,
  body[data-print-scope="stats"] .ws-side,
  body[data-print-scope="stats"] .ws-side-floating,
  body[data-print-scope="stats"] .ws-overlay,
  body[data-print-scope="stats"] .ab-switch {
    display: none !important;
  }
  body[data-print-scope="stats"] {
    background: #fff !important;
    color: #000 !important;
  }
  body[data-print-scope="stats"] .ws-app,
  body[data-print-scope="stats"] .ws-main,
  body[data-print-scope="stats"] .ws-suivi,
  body[data-print-scope="stats"] .ws-stats {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body[data-print-scope="stats"] .ws-page-header {
    padding: 24px 24px 12px !important;
  }
  body[data-print-scope="stats"] .ws-stats-group {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  body[data-print-scope="stats"] .ws-card,
  body[data-print-scope="stats"] .ws-stats-grid > * {
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: none !important;
  }
  @page { margin: 14mm; size: A4; }
}
.ws-chart-tooltip {
  position: absolute; top: -8px;
  transform: translateX(-50%) translateY(-100%);
  background: var(--n-text); color: var(--n-surface);
  padding: 6px 10px; border-radius: 8px;
  font-size: 12px; line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(20,22,28,0.18);
  pointer-events: none;
}
.ws-chart-tooltip-label { font-size: 10px; opacity: 0.7; }
.ws-chart-tooltip-value { font-weight: 700; }
.ws-chart-tooltip::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  width: 8px; height: 8px; background: var(--n-text);
  transform: translateX(-50%) rotate(45deg);
}
.ws-stats-group {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.ws-stats-group-head {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
}
.ws-stats-group-bar {
  width: 3px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
}
.ws-stats-group-title {
  font-size: 12px; font-weight: 700; color: var(--n-text);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Download icon buttons in each chart card header */
.ws-stat-card-head { display: flex; align-items: flex-start; gap: 12px; }
.ws-stat-card-actions { display: inline-flex; gap: 4px; flex-shrink: 0; }
.ws-stat-dl {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px;
  border-radius: 999px;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  font-size: 10.5px; font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-stat-dl:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* Stats grid */
.ws-stats-filters {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 16px;
  flex-wrap: wrap;
}
.ws-stats-seg {
  display: inline-flex; background: var(--n-surfaceAlt);
  padding: 3px; border-radius: 10px; gap: 2px;
}
.ws-stats-seg button {
  height: 28px; padding: 0 12px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--n-textMuted);
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-stats-seg button:hover { color: var(--n-text); }
.ws-stats-seg button[data-active="1"] {
  background: var(--n-surface); color: var(--n-text);
  box-shadow: 0 1px 2px rgba(20,22,28,0.06);
}
.ws-stats-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 14px;
}
.ws-stat-kpi {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  padding: 16px;
}
.ws-stat-kpi-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.ws-stat-kpi-value {
  font-size: 26px; font-weight: 700; color: var(--n-text);
  letter-spacing: -0.02em; line-height: 1;
}
.ws-stat-kpi-unit { font-size: 14px; font-weight: 500; color: var(--n-textMuted); }
.ws-stat-kpi-delta {
  font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}
.ws-stat-kpi-delta.is-good { background: var(--s-success-soft); color: var(--s-success-on); }
.ws-stat-kpi-delta.is-bad  { background: var(--s-error-soft);   color: var(--s-error-on); }
.ws-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
/* Suivi opérations — sticky "Code · Chantier" column for horizontal scroll */
.ws-th-sticky {
  position: sticky;
  left: 0;
  z-index: 3 !important;
  /* Recette 01/07 — la 1re colonne (id le plus souvent) épouse son contenu
     au lieu d'un bloc fixe de 220px. `width: 1%` + auto-layout = largeur =
     contenu ; le floor évite un rendu trop serré face à l'ombre. */
  min-width: 56px;
  width: 1%;
  white-space: nowrap;
  background: var(--n-surface) !important;
  box-shadow: 4px 0 8px -4px rgba(0,0,0,0.10);
}
.ws-cell-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--n-surface);
  min-width: 56px;
  width: 1%;
  white-space: nowrap;
  box-shadow: 4px 0 8px -4px rgba(0,0,0,0.06);
}
.ws-ac-table tbody tr:hover .ws-cell-sticky        { background: color-mix(in oklab, var(--c-primary) 8%, var(--n-surface)); }
.ws-ac-table tbody tr[data-tone="warn"] .ws-cell-sticky     { background: color-mix(in oklab, var(--s-warn) 10%, var(--n-surface)); }
.ws-ac-table tbody tr[data-tone="critical"] .ws-cell-sticky { background: color-mix(in oklab, var(--s-critical) 12%, var(--n-surface)); }
.ws-ac-table tbody tr[data-selected="1"] .ws-cell-sticky    { background: color-mix(in oklab, var(--c-primary) 14%, var(--n-surface)); }

/* ID-only sticky first column — pin to content width instead of the 220px
   label reserve. The sticky column defaults to min-width:220px because it is
   meant to hold a primary label (e.g. "Nom", "Type"); when it holds nothing
   but the record id it looks disproportionately wide. Both the header
   (.ws-th-id) and the cell (sticky cell wrapping a .ws-cell-id) must shrink,
   since the column width is the max of the two. Stays sticky, just narrow. */
.ws-table th.ws-th-id,
.ws-table td.ws-cell-sticky:has(> .ws-cell-id) {
  min-width: 0;
  width: 1px;
  white-space: nowrap;
}

/* Two-source indicator (planning + GPS) */
.ws-sources { display: inline-flex; gap: 4px; }
.ws-source-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--n-surfaceAlt); color: var(--n-textDim);
  font-size: 9px;
}
.ws-source-dot.is-on { background: var(--s-success); color: #fff; }
/* Filled localisation — values display as read-only by default, the input
   chrome appears only on hover/focus so the form doesn't look "empty to fill". */
.ws-loc--filled .ws-input-wrap {
  border-color: transparent;
  background: transparent;
}
.ws-loc--filled .ws-input-wrap input {
  font-weight: 500;
  color: var(--n-text);
  cursor: text;
}
.ws-loc--filled .ws-input-wrap:hover {
  background: var(--n-surfaceAlt);
  border-color: var(--n-border);
}
.ws-loc--filled .ws-input-wrap:focus-within {
  background: var(--n-surface);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 18%, transparent);
}
.ws-loc--filled .ws-field-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Signalement detail — compact localisation block with hover map preview */
.ws-loc { display: flex; flex-direction: column; gap: 6px; }
.ws-loc-grid {
  display: grid; gap: 10px;
}
.ws-loc-grid--main {
  grid-template-columns: 1fr 60px 1.6fr;
}
.ws-loc-grid--extra {
  grid-template-columns: 1.6fr 1fr;
}
.ws-loc-address { position: relative; }
.ws-loc-preview {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 30;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(20,22,28,0.16), 0 4px 12px rgba(20,22,28,0.08);
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--dur-base), transform var(--dur-base);
}
.ws-loc-address:hover .ws-loc-preview,
.ws-loc-address:focus-within .ws-loc-preview {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}
.ws-loc-preview-map {
  height: 160px;
  position: relative;
}
.ws-loc-preview-foot {
  padding: 8px 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--n-textMuted);
  border-top: 1px solid var(--n-border);
  background: var(--n-surface);
}
/* Pending placeholder — blurred skeleton over the value, hover-tooltip explains */
.ws-pending {
  display: inline-flex; align-items: center;
  position: relative;
  cursor: help;
}
.ws-pending-skel {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, var(--n-surfaceAlt) 0%, var(--n-surfaceDim) 50%, var(--n-surfaceAlt) 100%);
  background-size: 200% 100%;
  animation: ws-skel 1.8s linear infinite;
  border-radius: 6px;
  padding: 1px 8px;
  filter: blur(0.5px);
  opacity: 0.9;
  user-select: none;
  font-size: 12.5px;
}
.ws-pending::after {
  content: "En attente";
  font-size: 9.5px; font-weight: 600;
  color: var(--s-warn-on);
  background: var(--s-warn-soft);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@keyframes ws-slidein {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===================== Command Palette (⌘K) ===================== */
.ws-cmdk-overlay {
  position: fixed; inset: 0;
  background: color-mix(in oklab, var(--n-text) 35%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: ws-fade var(--dur-base);
}
.ws-cmdk {
  width: 600px; max-width: 92vw;
  background: var(--n-surface);
  border-radius: 16px;
  box-shadow: 0 40px 80px rgba(20,22,28,0.30), 0 12px 32px rgba(20,22,28,0.12);
  border: 1px solid var(--n-border);
  overflow: hidden;
  animation: ws-cmdkin var(--dur-base) var(--ease-spring);
}
@keyframes ws-cmdkin {
  from { transform: scale(0.96) translateY(-8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.ws-cmdk-input {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--n-border);
}
.ws-cmdk-input svg { color: var(--n-textMuted); }
.ws-cmdk-input input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--n-text);
  font-family: inherit;
}
.ws-cmdk-input input::placeholder { color: var(--n-textSubtle); }
.ws-cmdk-input kbd {
  font-size: 11px; padding: 2px 7px; border-radius: 5px;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  border: 1px solid var(--n-border);
  font-family: var(--font-mono);
}
.ws-cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.ws-cmdk-group-label {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--n-textSubtle);
  padding: 10px 12px 4px;
}
.ws-cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px; color: var(--n-text);
  cursor: pointer;
  width: 100%; text-align: left;
  transition: background var(--dur-fast);
}
.ws-cmdk-item:hover, .ws-cmdk-item[data-selected="1"] {
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.ws-cmdk-item-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--n-surfaceAlt);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--n-textMuted);
  flex-shrink: 0;
}
.ws-cmdk-item:hover .ws-cmdk-item-icon, .ws-cmdk-item[data-selected="1"] .ws-cmdk-item-icon {
  background: var(--c-primary); color: var(--c-primary-fg);
}
.ws-cmdk-item-label { flex: 1; min-width: 0; }
.ws-cmdk-item-sub { font-size: 12px; color: var(--n-textSubtle); }
.ws-cmdk-item:hover .ws-cmdk-item-sub, .ws-cmdk-item[data-selected="1"] .ws-cmdk-item-sub { color: currentColor; opacity: 0.7; }
.ws-cmdk-item-kbd {
  font-size: 11px; padding: 2px 6px; border-radius: 5px;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  border: 1px solid var(--n-border);
  font-family: var(--font-mono);
}
.ws-cmdk-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--n-border);
  font-size: 11.5px; color: var(--n-textSubtle);
}
.ws-cmdk-foot kbd {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  border: 1px solid var(--n-border);
  font-family: var(--font-mono);
}

/* ===================== Activity feed (floating) ===================== */
.ws-activity {
  position: fixed;
  right: 16px; top: 16px;
  width: 280px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(20,22,28,0.08), 0 4px 12px rgba(20,22,28,0.04);
  z-index: 40;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 32px);
  animation: ws-fade var(--dur-base);
}
.ws-activity-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 10px;
  font-size: 12px; font-weight: 600; color: var(--n-textMuted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ws-activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--s-success);
  position: relative;
}
.ws-activity-dot::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%; border: 2px solid var(--s-success);
  opacity: 0;
  animation: ws-activity-pulse 2s ease-out infinite;
}
@keyframes ws-activity-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
.ws-activity-body { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 4px 8px; }
.ws-activity-item {
  display: flex; gap: 10px; padding: 8px 8px;
  border-radius: 9px;
  transition: background var(--dur-fast);
  animation: ws-itemin var(--dur-base) var(--ease-out);
}
@keyframes ws-itemin {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ws-activity-item:hover { background: var(--n-surfaceAlt); }
.ws-activity-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-activity-icon.success { background: var(--s-success-soft); color: var(--s-success-on); }
.ws-activity-icon.warn    { background: var(--s-warn-soft); color: var(--s-warn-on); }
.ws-activity-icon.info    { background: var(--s-info-soft); color: var(--s-info-on); }
.ws-activity-icon.error   { background: var(--s-error-soft); color: var(--s-error-on); }
.ws-activity-text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--n-text); line-height: 1.4; }
.ws-activity-strong { font-weight: 600; }
.ws-activity-time { font-size: 11px; color: var(--n-textSubtle); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Floating action button */
.ws-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--c-primary); color: var(--c-primary-fg);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px color-mix(in oklab, var(--c-primary) 32%, transparent);
  z-index: 30;
  transition: transform var(--dur-base) var(--ease-spring);
}
.ws-fab:hover { transform: scale(1.06); }
.ws-fab:active { transform: scale(0.98); }

/* Utilities */
.muted { color: var(--n-textMuted); }
.subtle { color: var(--n-textSubtle); }
.text-strong { font-weight: 600; }
.text-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
/* NOTE: the maquette's `.gap-N` px utilities were removed — their class names
   collide with Tailwind's gap scale (gap-6 = 24px, gap-8 = 32px, …). Because
   this stylesheet is unlayered and Tailwind v4 emits utilities inside @layer,
   the maquette rules silently won the cascade and shrank every Tailwind gap
   app-wide. The React app is Tailwind-native and never used these on purpose.
   Use Tailwind `gap-*` (or arbitrary `gap-[Npx]`) instead. */
.grow { flex: 1; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; }
.h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.h3 { font-size: 15px; font-weight: 600; }
.label { font-size: 12px; font-weight: 500; color: var(--n-textMuted); }
.micro { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-textSubtle); }

/* Inline expand for cards */
.ws-card-expanded {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--n-border);
  font-size: 13px;
  animation: ws-accopen var(--dur-base) var(--ease-out);
}

/* Messagerie dock — pinned at the bottom of the detail column, always visible. */
.ws-msg-dock {
  flex-shrink: 0;
  border-top: 1px solid var(--n-border);
  background: var(--n-surface);
  display: flex; flex-direction: column;
}
.ws-msg-dock-inner {
  display: flex; flex-direction: column;
  max-height: 52vh;
  min-height: 0;
}
.ws-msg-dock-inner[data-open="0"] { max-height: none; }
.ws-msg-dock-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  font-size: 13px; color: var(--n-text);
  width: 100%; text-align: left;
  background: var(--n-surfaceAlt);
  border-bottom: 1px solid var(--n-border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ws-msg-dock-head:hover { background: var(--n-surfaceDim); }
.ws-msg-dock-inner[data-open="0"] .ws-msg-dock-head { border-bottom-color: transparent; }
.ws-msg-dock-count {
  font-size: 11px; font-weight: 600;
  background: var(--c-primary); color: var(--c-primary-fg);
  padding: 1px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.ws-msg-dock-last {
  font-size: 11.5px; color: var(--n-textSubtle);
  font-variant-numeric: tabular-nums;
}
.ws-msg-dock-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 24px;
  display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--n-surfaceAlt) 0%, var(--n-surface) 60%);
}
.ws-msg-dock-composer {
  padding: 10px 24px 14px;
  border-top: 1px solid var(--n-border);
  background: var(--n-surface);
}

/* When messagerie dock is present, detail-foot is hidden — actions move into messagerie context */
.ws-detail-col .ws-msg-dock + * { display: none; }

/* Adjust detail body to be flex 1 with messagerie pinned below */
.ws-detail { overflow: hidden; }
.ws-detail-body { padding-bottom: 16px; }
/* ===================== Workflow stages =====================
   Compact horizontal pipeline that doubles as primary filter and
   action context. All 5 stages fit on screen — no horizontal scroll. */
.ws-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 0 24px 14px;
}
.ws-stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 28px auto;
  column-gap: 10px;
  row-gap: 6px;
  padding: 10px 12px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 12px;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  position: relative;
  overflow: hidden;
}
.ws-stage:hover { border-color: var(--n-borderStrong); }
.ws-stage-icon {
  grid-column: 1; grid-row: 1;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-stage-body {
  display: none; /* legacy — JSX flattened, label & count are now direct grid children */
}
.ws-stage-label {
  grid-column: 1 / -1; grid-row: 2;
  font-size: 13px; font-weight: 600; color: var(--n-text);
  letter-spacing: -0.005em;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.ws-stage-count {
  grid-column: 2; grid-row: 1;
  align-self: center; justify-self: end;
  font-size: 20px; font-weight: 600; color: var(--n-text);
  letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ws-stages-arrow { display: none; }

/* Active stage — colored by tone */
.ws-stage[data-active="1"][data-tone="info"]     { background: var(--s-info-soft);     border-color: transparent; }
.ws-stage[data-active="1"][data-tone="info"] .ws-stage-label   { color: var(--s-info-on); }
.ws-stage[data-active="1"][data-tone="info"] .ws-stage-icon    { background: var(--s-info); color: #fff; }

.ws-stage[data-active="1"][data-tone="neutral"]  { background: var(--n-surfaceAlt);    border-color: transparent; }
.ws-stage[data-active="1"][data-tone="neutral"] .ws-stage-label{ color: var(--n-text); }
.ws-stage[data-active="1"][data-tone="neutral"] .ws-stage-icon { background: var(--n-text); color: var(--n-surface); }

.ws-stage[data-active="1"][data-tone="warn"]     { background: var(--s-warn-soft);     border-color: transparent; }
.ws-stage[data-active="1"][data-tone="warn"] .ws-stage-label   { color: var(--s-warn-on); }
.ws-stage[data-active="1"][data-tone="warn"] .ws-stage-icon    { background: var(--s-warn); color: var(--s-warn-fg); }

.ws-stage[data-active="1"][data-tone="critical"] { background: var(--s-critical-soft); border-color: transparent; }
.ws-stage[data-active="1"][data-tone="critical"] .ws-stage-label{ color: var(--s-critical-on); }
.ws-stage[data-active="1"][data-tone="critical"] .ws-stage-icon { background: var(--s-critical); color: #fff; }

.ws-stage[data-active="1"][data-tone="success"]  { background: var(--s-success-soft);  border-color: transparent; }
.ws-stage[data-active="1"][data-tone="success"] .ws-stage-label{ color: var(--s-success-on); }
.ws-stage[data-active="1"][data-tone="success"] .ws-stage-icon { background: var(--s-success); color: #fff; }

/* Active highlight bar at bottom */
.ws-stage[data-active="1"]::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 3px; border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

/* Narrower list columns — even tighter */
@media (max-width: 1180px) {
  .ws-stage { padding: 8px 10px; min-height: 80px; }
  .ws-stage-icon { width: 24px; height: 24px; }
  .ws-stage-label { font-size: 11px; }
  .ws-stage-count { font-size: 18px; }
}

/* ===================== Stage action banner ===================== */
.ws-stage-banner {
  display: flex; align-items: center; gap: 14px;
  margin: 0 24px 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-left: 3px solid var(--c-primary);
  animation: ws-pagein var(--dur-base) var(--ease-out);
}
.ws-stage-banner[data-tone="info"]     { border-left-color: var(--s-info); }
.ws-stage-banner[data-tone="warn"]     { border-left-color: var(--s-warn); }
.ws-stage-banner[data-tone="critical"] { border-left-color: var(--s-critical); }
.ws-stage-banner[data-tone="success"]  { border-left-color: var(--s-success); }
.ws-stage-banner[data-tone="neutral"]  { border-left-color: var(--n-borderStrong); }
.ws-stage-banner-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-stage-banner[data-tone="info"]     .ws-stage-banner-icon { background: var(--s-info-soft);     color: var(--s-info-on); }
.ws-stage-banner[data-tone="warn"]     .ws-stage-banner-icon { background: var(--s-warn-soft);     color: var(--s-warn-on); }
.ws-stage-banner[data-tone="critical"] .ws-stage-banner-icon { background: var(--s-critical-soft); color: var(--s-critical-on); }
.ws-stage-banner[data-tone="success"]  .ws-stage-banner-icon { background: var(--s-success-soft);  color: var(--s-success-on); }
.ws-stage-banner-body { flex: 1; min-width: 0; }
.ws-stage-banner-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.ws-stage-banner-count {
  font-size: 15px; font-weight: 600; color: var(--n-text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ws-stage-banner-stage {
  font-size: 13.5px; color: var(--n-textMuted);
}
.ws-stage-banner-desc {
  font-size: 13px; color: var(--n-textMuted); line-height: 1.45;
}
.ws-stage-banner-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}

/* ===================== Card — bulk select + stage CTA ===================== */
.ws-list-card-check {
  position: absolute; left: 14px; top: 14px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.ws-list-card:hover .ws-list-card-check,
.ws-list-card[data-bulk="1"] .ws-list-card-check { opacity: 1; }
.ws-list-card[data-bulk="1"] {
  border-color: var(--c-primary);
  background: color-mix(in oklab, var(--c-primary-soft), white 50%);
}
.ws-list-card[data-bulk="1"] .ws-list-card-top { padding-left: 28px; }
.ws-list-card[data-bulk="1"] .ws-list-card-title,
.ws-list-card[data-bulk="1"] .ws-list-card-meta { padding-left: 28px; }
.ws-list-card .ws-list-card-actions { gap: 6px; }
.ws-list-card-actions .ws-btn { padding: 0 12px; height: 32px; font-size: 12.5px; }
/* List toolbar — slim row above cards: search, filter button, sort, count */
.ws-list-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 24px 18px;
  flex-wrap: wrap;
}
.ws-list-toolbar-search { flex: 1; min-width: 200px; max-width: 360px; }
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  overflow: auto;
}
.ws-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ws-table thead th {
  background: var(--n-surfaceAlt);
  color: var(--n-textMuted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left;
  height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--n-border);
  white-space: nowrap;
}
.ws-table tbody td {
  height: var(--d-row-h);
  padding: 12px 14px;
  border-bottom: 1px solid var(--n-border);
  vertical-align: middle;
  color: var(--n-text);
}
.ws-table tbody tr { transition: background var(--dur-fast); cursor: pointer; }
.ws-table tbody tr:hover { background: var(--n-surfaceAlt); }
.ws-cell-id { font-family: var(--font-mono); font-size: 12.5px; color: var(--n-textMuted); }
.ws-cell-strong { font-weight: 500; }
.ws-cell-muted { color: var(--n-textMuted); }
.ws-cell-r { text-align: right; }

/* Recette 01/07 — chiffres, heures & dates uniformes dans TOUTES les tables :
   même police mono, même taille que l'id, chiffres à chasse fixe, et jamais
   coupés sur deux lignes (une date = une ligne). Cible les cellules qui
   portent déjà les utilitaires Tailwind `font-mono` / `tabular-nums`. */
.ws-table td.font-mono,
.ws-table td .font-mono,
.ws-table td.tabular-nums,
.ws-table td .tabular-nums {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ws-allswitch {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  color: var(--n-textSubtle);
  background: transparent;
  border: 1px dashed var(--n-borderStrong);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.ws-allswitch:hover { color: var(--n-text); border-color: var(--n-textMuted); }
.ws-allswitch[data-active="1"] {
  background: var(--n-text); color: var(--n-surface);
  border-color: var(--n-text); border-style: solid;
}
.ws-stage-bar {
  display: flex; align-items: stretch; gap: 8px;
  padding: 0 24px 14px;
}
.ws-stage-bar .ws-stages {
  flex: 1; min-width: 0; padding: 0;
}
.ws-chip--all {
  flex-shrink: 0;
  align-self: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px dashed var(--n-borderStrong);
  color: var(--n-textSubtle);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.ws-chip--all:hover { color: var(--n-text); border-color: var(--n-textMuted); }
.ws-chip--all[data-active="1"] {
  background: var(--n-text); color: var(--n-surface);
  border-color: var(--n-text); border-style: solid;
}
.ws-chip--all .ws-chip-count {
  font-size: 10px; padding: 0 5px; height: 16px;
  display: inline-flex; align-items: center;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  border-radius: 999px; font-weight: 600;
}
.ws-chip--all[data-active="1"] .ws-chip-count {
  background: rgba(255,255,255,0.18); color: var(--n-surface);
}
/* When "Voir tous" is active, fade the stage navigator slightly to show it isn't filtering */
.ws-stages[data-muted="1"] { opacity: 0.5; pointer-events: auto; }
.ws-stages[data-muted="1"] .ws-stage[data-active="1"]::after { background: var(--n-textDim) !important; }
/* ===================== Création / Traitement groups in signalement detail ===================== */
.ws-group {
  display: flex; flex-direction: column;
  gap: 22px;
  border-radius: 0 !important;
  padding: 16px 18px 22px;
  border-radius: 14px;
  position: relative;
}
.ws-group[data-group="creation"] {
  background: color-mix(in oklab, var(--c-primary-soft) 35%, transparent);
  border-left: 3px solid var(--c-primary);
}
.ws-group[data-group="traitement"] {
  background: color-mix(in oklab, var(--c-accent-soft) 45%, transparent);
  border-left: 3px solid var(--c-accent);
  margin-top: 8px;
}
.ws-group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--n-textMuted);
  margin-bottom: 4px;
}
.ws-group-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.ws-group[data-group="creation"] .ws-group-dot,
.ws-group[data-group="creation"] .ws-group-label { color: var(--c-primary); }
.ws-group[data-group="creation"] .ws-group-dot { background: var(--c-primary); }
.ws-group[data-group="traitement"] .ws-group-dot,
.ws-group[data-group="traitement"] .ws-group-label { color: var(--c-accent); }
.ws-group[data-group="traitement"] .ws-group-dot { background: var(--c-accent); }
.ws-group-label { font-weight: 700; }
.ws-group-rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, currentColor 0%, transparent 100%);
  opacity: 0.18;
}
.ws-group-meta {
  font-size: 10.5px; color: var(--n-textSubtle);
  font-weight: 500; text-transform: none; letter-spacing: 0;
  white-space: nowrap;
}

[data-theme="dark"] .ws-group[data-group="creation"]  { background: color-mix(in oklab, var(--c-primary) 14%, var(--n-surface)); }
[data-theme="dark"] .ws-group[data-group="traitement"] { background: color-mix(in oklab, var(--c-accent) 14%, var(--n-surface)); }
/* ===================== AutoContrôle table specifics ===================== */
.ws-ac-filters {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 0 24px 12px;
  flex-wrap: wrap;
}
.ws-ac-filters .ws-field { width: 130px; }
.ws-ac-filters > div:first-child { flex: 1 1 280px; }

.ws-ac-table {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  box-shadow: 0 1px 2px rgba(20,22,28,0.04);
  border-radius: 14px;
  overflow: auto;
}
.ws-ac-table .ws-table { min-width: 1100px; }

/* ===== Modern header — flat, light, with hairline accent ===== */
.ws-ac-table thead th {
  background: var(--n-surface) !important;
  color: var(--n-textMuted) !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  border-bottom: 1px solid var(--n-border) !important;
  padding: 14px 14px 10px !important;
  height: auto !important;
  position: relative;
  white-space: nowrap;
}
.ws-ac-table thead tr:first-child th {
  border-bottom-width: 0 !important;
}
/* Bottom hairline in primary tint to separate header from rows */
.ws-ac-table thead::after {
  content: "";
  display: table-row;
  height: 0;
}
.ws-ac-table thead tr:last-child th {
  border-bottom: 2px solid var(--c-primary) !important;
  box-shadow: 0 -1px 0 var(--n-border);
}

/* "Note" group label — pill-style ribbon above sub-columns */
.ws-ac-table .ws-th-group {
  text-align: center !important;
  background: var(--n-surface) !important;
  color: var(--n-textSubtle) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  border: none !important;
  padding: 8px 8px 2px !important;
}
.ws-ac-table .ws-th-group::before {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: var(--c-accent);
  border-radius: 999px;
  margin: 0 auto 6px;
}
/* Sub-cols under group */
.ws-ac-table .ws-th-sub {
  text-align: center !important;
  font-size: 11px !important;
  background: var(--n-surface) !important;
  color: var(--n-textMuted) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  border: none !important;
  border-bottom: 2px solid var(--c-primary) !important;
}
.ws-ac-table thead th.ws-cell-r { text-align: right !important; }

/* Sort hint icon, appears on hover */
.ws-ac-table thead th .sort-hint {
  display: inline-flex; vertical-align: middle;
  margin-left: 4px; color: var(--n-textDim);
  opacity: 0; transition: opacity var(--dur-fast);
}
.ws-ac-table thead th:hover .sort-hint { opacity: 1; }

/* Zebra rows toned down */
.ws-ac-table tbody tr:nth-child(even) { background: transparent; }
.ws-ac-table tbody tr:hover { background: color-mix(in oklab, var(--c-primary-soft) 50%, transparent) !important; }
.ws-ac-table tbody td { padding: 10px 14px; }
.ws-ac-table tbody td.ws-cell-r { text-align: right; }
.ws-ac-table tbody td:nth-child(7),
.ws-ac-table tbody td:nth-child(8),
.ws-ac-table tbody td:nth-child(9),
.ws-ac-table tbody td:nth-child(10) {
  text-align: center;
  border-left: 1px solid var(--n-border);
}
.ws-ac-table tbody td:nth-child(10) {
  border-right: 1px solid var(--n-border);
}

/* ===== Action column — single kebab + popover ===== */
.ws-cell-actions {
  width: 44px;
  text-align: center;
  white-space: nowrap;
}
.ws-row-kebab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 999px;
  color: var(--n-textDim);
  background: transparent;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.ws-ac-table tbody tr:hover .ws-row-kebab { color: var(--n-textMuted); background: var(--n-surfaceAlt); }
.ws-row-kebab:hover, .ws-row-kebab[data-open="1"] {
  background: var(--c-primary-soft) !important;
  color: var(--c-primary) !important;
  transform: scale(1.06);
}

.ws-row-menu {
  z-index: 200;
  min-width: 220px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(20,22,28,0.18), 0 4px 12px rgba(20,22,28,0.10);
  padding: 5px;
  animation: ws-pop var(--dur-base) var(--ease-spring);
}
.ws-row-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px; color: var(--n-text);
  cursor: pointer; text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ws-row-menu-item:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.ws-row-menu-item[data-tone="danger"] { color: var(--s-error-on); }
.ws-row-menu-item[data-tone="danger"]:hover { background: var(--s-error-soft); color: var(--s-error-on); }
.ws-row-menu-item > svg { flex-shrink: 0; color: var(--n-textMuted); }
.ws-row-menu-item:hover > svg { color: var(--c-primary); }
.ws-row-menu-item[data-tone="danger"] > svg { color: var(--s-error-on); }
.ws-row-menu-sep {
  height: 1px;
  background: var(--n-border);
  margin: 4px 8px;
}

/* Table fills container — no right white space */
.ws-ac-table { display: flex; flex-direction: column; }
.ws-ac-table .ws-table {
  width: 100%;
  min-width: 980px;
  table-layout: auto;
}

/* Flux icon — small colored square */
.ws-flux-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
}

/* Score cell — "n/m" + optional red NC count badge */
.ws-score {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--n-text);
  font-variant-numeric: tabular-nums;
}
.ws-score .is-partial { color: var(--n-textMuted); }
.ws-score-nc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 4px;
  background: var(--s-error); color: var(--s-error-fg);
  font-size: 10.5px; font-weight: 700;
  font-family: var(--font-sans);
}

/* Taux conformité — large coloured cell (green / orange / red) */
.ws-taux {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 28px; padding: 0 10px;
  border-radius: 7px;
  font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ws-taux::after { content: "%"; margin-left: 1px; font-size: 12px; opacity: 0.85; }
.ws-taux-ok   { background: linear-gradient(135deg, color-mix(in oklab, var(--s-success), white 12%) 0%, color-mix(in oklab, var(--s-success), black 32%) 100%); color: var(--s-success-fg); box-shadow: 0 1px 3px color-mix(in oklab, var(--s-success) 35%, transparent); }
.ws-taux-warn { background: linear-gradient(135deg, color-mix(in oklab, var(--s-warn),    white 12%) 0%, color-mix(in oklab, var(--s-warn),    black 32%) 100%); color: var(--s-warn-fg);    box-shadow: 0 1px 3px color-mix(in oklab, var(--s-warn) 35%, transparent); }
.ws-taux-bad  { background: linear-gradient(135deg, color-mix(in oklab, var(--s-error),   white 12%) 0%, color-mix(in oklab, var(--s-error),   black 32%) 100%); color: var(--s-error-fg);   box-shadow: 0 1px 3px color-mix(in oklab, var(--s-error) 35%, transparent); }

/* ===================== AutoContrôle task rows (in side panel) =====================
   Each task is a self-contained card-like row : label + help + PDF chip + tools
   (photo, comment), then conformity buttons. Extras (photo grid, comment textarea)
   are hidden by default and toggle in/out via the tool buttons. */
.ws-acc-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--n-border);
  background: color-mix(in oklab, var(--c-primary-soft) 20%, var(--n-surface));
  animation: ws-accopen var(--dur-base) var(--ease-out);
  max-height: none;
  overflow: visible;
  border-radius: 0 0 14px 14px;
}
.ws-task {
  padding: 12px 0;
  border-bottom: 1px solid var(--n-border);
  display: flex; flex-direction: column;
  gap: 8px;
}
.ws-task:last-child { border-bottom: 0; }
.ws-task[data-state="nc"]  { background: color-mix(in oklab, var(--s-error-soft) 25%, transparent); margin: 0 -16px; padding: 12px 16px; }
.ws-task[data-state="na"]  { opacity: 0.78; }
.ws-task-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.ws-task-label {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 500; color: var(--n-text);
  line-height: 1.4;
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ws-task-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--n-surfaceAlt); color: var(--n-textMuted);
  font-size: 9px; font-weight: 700; cursor: help;
}
.ws-task-pdf {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px 1px 4px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--s-error-soft), white 30%);
  color: var(--s-error-on);
  cursor: pointer;
}
.ws-task-tools {
  display: inline-flex; gap: 4px;
  flex-shrink: 0;
}
.ws-task-tool {
  position: relative;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  color: var(--n-textMuted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.ws-task-tool:hover { background: var(--n-surfaceAlt); color: var(--n-text); }
.ws-task-tool[data-active="1"] {
  background: var(--c-primary); color: var(--c-primary-fg);
  border-color: var(--c-primary);
}
.ws-task-tool-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 14px; height: 14px; padding: 0 3px;
  background: var(--s-error); color: var(--s-error-fg);
  border-radius: 999px;
  font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--n-surface);
}
.ws-task-tool-dot {
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-success);
}
.ws-task-extra {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  padding: 10px;
  animation: ws-accopen var(--dur-base) var(--ease-out);
}

/* Conformité buttons — make sure all three states (Conforme / Non conforme / N/A) are
   visually distinct and equally clickable. */
.ws-conformite {
  display: inline-flex;
  background: var(--n-surfaceAlt);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  width: auto;
}
.ws-conformite button {
  height: 32px; padding: 0 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  color: var(--n-textMuted);
  transition: background var(--dur-fast), color var(--dur-fast);
  flex: 1;
}
.ws-conformite button:hover { color: var(--n-text); background: var(--n-surface); }
.ws-conformite button[data-active="1"][data-state="conf"] { background: var(--s-success); color: var(--s-success-fg); }
.ws-conformite button[data-active="1"][data-state="nc"]   { background: var(--s-error);   color: var(--s-error-fg); }
.ws-conformite button[data-active="1"][data-state="na"]   { background: var(--n-text);    color: var(--n-surface); }

/* In task rows, conformity fills the width */
.ws-task .ws-conformite { display: flex; width: 100%; }
.ws-task .ws-conformite button { flex: 1; }

/* Accordion score (n/m) — neutral chip next to the badge in section header */
.ws-acc-score {
  display: inline-flex; align-items: center;
  background: var(--n-text); color: var(--n-surface);
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ws-acc-score .is-partial {
  /* still readable when partial */
  opacity: 0.85;
}

/* ===================== AC table — UX enhancements ===================== */

/* Sticky thead at vertical scroll */
.ws-ac-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.ws-ac-table thead tr:first-child th { top: 0; }
.ws-ac-table thead tr:nth-child(2) th { top: 36px; }

/* NC row tone — coloured left border + tinted background */
.ws-ac-table tbody tr[data-tone="warn"] td:first-child {
  box-shadow: inset 3px 0 0 var(--s-warn);
}
.ws-ac-table tbody tr[data-tone="warn"] {
  background: color-mix(in oklab, var(--s-warn-soft) 30%, transparent) !important;
}
.ws-ac-table tbody tr[data-tone="critical"] td:first-child {
  box-shadow: inset 3px 0 0 var(--s-critical);
}
.ws-ac-table tbody tr[data-tone="critical"] {
  background: color-mix(in oklab, var(--s-critical-soft) 32%, transparent) !important;
}
.ws-ac-table tbody tr[data-tone="warn"]:hover {
  background: color-mix(in oklab, var(--s-warn-soft) 55%, transparent) !important;
}
.ws-ac-table tbody tr[data-tone="critical"]:hover {
  background: color-mix(in oklab, var(--s-critical-soft) 55%, transparent) !important;
}

/* Selected row */
.ws-ac-table tbody tr[data-selected="1"] {
  background: color-mix(in oklab, var(--c-primary-soft) 70%, transparent) !important;
}
.ws-ac-table tbody tr[data-selected="1"] td:first-child {
  box-shadow: inset 3px 0 0 var(--c-primary) !important;
}

/* Check + expand column polish */
.ws-cell-check { width: 32px; }
.ws-cell-expand { width: 28px; padding-left: 4px !important; padding-right: 0 !important; }
.ws-ac-table .ws-th-check { background: color-mix(in oklab, var(--c-primary-soft) 70%, var(--n-surface)) !important; }

/* Row actions — hidden by default, revealed on hover */
.ws-cell-actions {
  width: 130px;
  text-align: right;
}
.ws-row-actions {
  display: inline-flex; gap: 2px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.ws-ac-table tbody tr:hover .ws-row-actions,
.ws-ac-table tbody tr[data-selected="1"] .ws-row-actions {
  opacity: 1; transform: translateX(0);
}
.ws-row-actions .ws-iconbtn {
  width: 26px; height: 26px;
}
.ws-row-actions .ws-iconbtn:hover { background: var(--n-surface); }

/* Expanded row — quick NC drill-down without opening side panel */
.ws-row-expanded > td {
  padding: 0 !important;
  border-bottom: 1px solid var(--n-border) !important;
  background: color-mix(in oklab, var(--c-primary-soft) 20%, var(--n-surface));
}
.ws-row-expanded[data-tone="warn"] > td {
  background: color-mix(in oklab, var(--s-warn-soft) 40%, var(--n-surface));
}
.ws-row-expanded[data-tone="critical"] > td {
  background: color-mix(in oklab, var(--s-critical-soft) 35%, var(--n-surface));
}
.ws-row-expanded-body {
  padding: 14px 24px 16px;
  display: flex; flex-direction: column; gap: 8px;
  animation: ws-accopen var(--dur-base) var(--ease-out);
}
.ws-nc-line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  font-size: 13px;
}

/* Quick filter chips — tone variants */
.ws-chip[data-tone="warn"][data-active="1"] {
  background: var(--s-warn) !important;
  border-color: var(--s-warn) !important;
  color: var(--s-warn-fg) !important;
}
.ws-chip[data-tone="warn"][data-active="1"] .ws-chip-count {
  background: rgba(255,255,255,0.25) !important;
  color: var(--s-warn-fg) !important;
}
.ws-chip[data-tone="critical"][data-active="1"] {
  background: var(--s-critical) !important;
  border-color: var(--s-critical) !important;
  color: #fff !important;
}
.ws-chip[data-tone="critical"][data-active="1"] .ws-chip-count {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}
.ws-chip[data-tone="success"][data-active="1"] {
  background: var(--s-success) !important;
  border-color: var(--s-success) !important;
  color: #fff !important;
}
.ws-chip[data-tone="success"][data-active="1"] .ws-chip-count {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}

/* Live update indicator dot */
.ws-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-success);
  display: inline-block;
  position: relative;
}
.ws-live-dot::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--s-success);
  animation: ws-activity-pulse 2.2s ease-out infinite;
}

/* Floating bulk action bar */
.ws-bulk-bar {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--n-text);
  color: var(--n-surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(20,22,28,0.30), 0 4px 16px rgba(20,22,28,0.16);
  z-index: 45;
  min-width: 480px;
  animation: ws-bulkbar-in 280ms var(--ease-spring);
}
@keyframes ws-bulkbar-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.ws-bulk-bar .ws-btn {
  background: rgba(255,255,255,0.08);
  color: var(--n-surface);
  border-color: transparent;
}
.ws-bulk-bar .ws-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.16);
  filter: none;
}
.ws-bulk-bar .ws-btn.is-secondary,
.ws-bulk-bar .ws-btn[class*="secondary"] {
  background: var(--n-surface);
  color: var(--n-text);
}


/* ===================== Transfer modal ===================== */
.ws-modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in oklab, var(--n-text) 35%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: ws-fade var(--dur-base);
}
.ws-modal {
  width: 640px; max-width: 100%;
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 14px;
  box-shadow: 0 40px 80px rgba(20,22,28,0.30), 0 12px 32px rgba(20,22,28,0.12);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
  animation: ws-cmdkin var(--dur-base) var(--ease-spring);
}
.ws-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--n-border);
}
.ws-modal-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--n-text); }
.ws-modal-body {
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.ws-modal-intro {
  margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--n-textMuted);
  text-align: center;
}
.ws-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--n-border);
  background: var(--n-surface);
}
.ws-multiselect { position: relative; }
.ws-multiselect-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: var(--d-field-h);
  padding: 0 12px;
  background: var(--n-surface);
  border: 1px solid var(--n-borderStrong);
  border-radius: 8px;
  font-size: 14px; color: var(--n-text);
  cursor: pointer; text-align: left;
}
.ws-multiselect-trigger:hover { border-color: var(--n-textMuted); }
.ws-multiselect-trigger .is-placeholder { color: var(--n-textSubtle); }
.ws-multiselect[data-open="1"] .ws-multiselect-trigger {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 18%, transparent);
}
.ws-multiselect-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(20,22,28,0.18);
  max-height: 280px; overflow-y: auto;
  z-index: 5;
  animation: ws-pop var(--dur-base) var(--ease-spring);
}
.ws-multiselect-actions {
  display: flex; background: var(--n-surfaceAlt);
  border-bottom: 1px solid var(--n-border);
}
.ws-multiselect-actions button {
  flex: 1; padding: 10px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--n-textMuted);
  cursor: pointer; transition: color var(--dur-fast);
}
.ws-multiselect-actions button:hover { color: var(--c-primary); }
.ws-multiselect-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px; color: var(--n-text);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ws-multiselect-item:hover { background: var(--n-surfaceAlt); }
