/*
   GENERATED FILE — DO NOT EDIT.
   Vendored verbatim from the live Cannvas product per plan §14 (REAL-FRONTEND DOCTRINE).
   Edit the product source and re-run:  node docs/redesign-spec/scripts/sync-real-ui.mjs

   Sources:
     cannvas-deploy/app/dashboard/tokens.css  sha256 c450f2634435  10383 B
     cannvas-deploy/app/dashboard/components.css  sha256 8180327739de  48224 B

   Scope transforms applied (mechanical, re-applied on every sync):
     cannvas-deploy/app/dashboard/components.css: bare element selector would leak out of .cv and restyle marketing-page inputs
*/

/* ─── cannvas-deploy/app/dashboard/tokens.css ─────────────────────────────────────── */
/* ==========================================================================
   Cannvas — Design Tokens · REDESIGN CANDIDATE (Phase 0)
   Locked language: cool near-monochrome + botanical green, softened dark.
   Same --cv-* names as the live app/dashboard/tokens.css (a value-only retune),
   so the ~9,300 var() references across the dashboards inherit it on one swap.
   NOT YET LIVE — promote to app/dashboard/tokens.css only on approval + deploy.
   ========================================================================== */

:root {
  /* ── COLOR · base palette (light) — cool near-monochrome ─────────────── */
  --cv-bg:           #F6F8F7;
  --cv-surface:      #FFFFFF;
  --cv-surface-2:    #F0F3F2;
  --cv-surface-3:    #E7EBEA;
  --cv-border:       #E4E9E7;
  --cv-border-2:     #EEF2F1;
  --cv-text:         #161A19;
  --cv-text-2:       #5E6664;
  --cv-text-3:       #8A9391;
  --cv-text-inverse: #F6F8F7;

  /* ── COLOR · brand + semantic — ONE green action accent ──────────────── */
  --cv-accent:        #148A4E;
  --cv-accent-hover:  #0F7440;
  --cv-accent-bg:     rgba(20,138,78,0.10);
  --cv-accent-border: rgba(20,138,78,0.24);

  --cv-success:        #2E8B4A;
  --cv-success-bg:     rgba(46,139,74,0.12);
  --cv-success-border: rgba(46,139,74,0.28);

  --cv-warning:        #A87308;
  --cv-warning-bg:     rgba(168,115,8,0.12);
  --cv-warning-border: rgba(168,115,8,0.30);

  --cv-danger:         #C4362E;
  --cv-danger-bg:      rgba(196,54,46,0.10);
  --cv-danger-border:  rgba(196,54,46,0.28);

  /* trend DOWN = warm rust, NOT red — keeps green(up)/red(down) from reading as Christmas.
     Red (--cv-danger) is reserved for genuine critical states (quarantine, errors). */
  --cv-down:           #C05E28;
  --cv-down-bg:        rgba(192,94,40,0.12);

  --cv-info:           #1F5A7A;
  --cv-info-bg:        rgba(31,90,122,0.09);
  --cv-info-border:    rgba(31,90,122,0.26);

  /* ── COLOR · workspace group tones (header-band tint, wayfinding) ────── */
  --cv-cultivation-accent: #1C6B48; --cv-cultivation-bg: rgba(28,107,72,0.06);
  --cv-sales-accent:       #B8842E; --cv-sales-bg:       rgba(184,132,46,0.08);
  --cv-management-accent:  #1F5A7A; --cv-management-bg:  rgba(31,90,122,0.06);
  --cv-marketing-accent:   #6D4AA8; --cv-marketing-bg:   rgba(109,74,168,0.06);
  --cv-health-accent:      #147868; --cv-health-bg:      rgba(20,120,104,0.06);
  --cv-people-accent:      #5E6664; --cv-people-bg:      rgba(94,102,100,0.06);

  /* group header-band tints + inks (used by .cv-card--group-*) */
  --cv-g-prod-bg:rgba(28,107,72,0.06);   --cv-g-prod-ink:#12583A;
  --cv-g-health-bg:rgba(20,120,104,0.075);--cv-g-health-ink:#125A50;
  --cv-g-sales-bg:rgba(184,132,46,0.10);  --cv-g-sales-ink:#7A5310;
  --cv-g-mgmt-bg:rgba(31,90,122,0.075);   --cv-g-mgmt-ink:#1B4C68;
  --cv-g-mktg-bg:rgba(109,74,168,0.075);  --cv-g-mktg-ink:#553A86;
  --cv-g-people-bg:rgba(94,102,100,0.06); --cv-g-people-ink:#4A5250;

  /* ── TYPOGRAPHY — grotesk, NO Inter, NO serif ───────────────────────── */
  --cv-font-sans: -apple-system, "SF Pro Display", "SF Pro Text",
                  "Helvetica Neue", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --cv-font-mono: "SF Mono", ui-monospace, SFMono-Regular, "Menlo",
                  "Roboto Mono", "Courier New", monospace;

  --cv-text-xs:   11px;   --cv-text-xs-lh:   16px;
  --cv-text-sm:   12px;   --cv-text-sm-lh:   18px;
  --cv-text-base: 13px;   --cv-text-base-lh: 20px;
  --cv-text-md:   14px;   --cv-text-md-lh:   22px;
  --cv-text-lg:   16px;   --cv-text-lg-lh:   24px;
  --cv-text-xl:   18px;   --cv-text-xl-lh:   28px;
  --cv-text-2xl:  22px;   --cv-text-2xl-lh:  30px;
  --cv-text-3xl:  26px;   --cv-text-3xl-lh:  32px;   /* page titles — tightened */
  --cv-text-4xl:  34px;   --cv-text-4xl-lh:  40px;

  --cv-weight-regular:  400;
  --cv-weight-medium:   500;
  --cv-weight-semibold: 600;
  --cv-weight-bold:     700;

  --cv-letter-tight:  -0.015em;
  --cv-letter-normal:  0;
  --cv-letter-wide:    0.04em;
  --cv-letter-wider:   0.10em;

  /* ── SPACING / RADIUS — unchanged (4px base) ─────────────────────────── */
  --cv-space-0:0; --cv-space-1:4px; --cv-space-2:8px; --cv-space-3:12px;
  --cv-space-4:16px; --cv-space-5:20px; --cv-space-6:24px; --cv-space-7:28px;
  --cv-space-8:32px; --cv-space-10:40px; --cv-space-12:48px; --cv-space-16:64px; --cv-space-20:80px;

  --cv-radius-xs:3px; --cv-radius-sm:5px; --cv-radius-md:8px; --cv-radius-lg:11px;
  --cv-radius-xl:14px; --cv-radius-2xl:18px; --cv-radius-pill:999px;

  /* ── SHADOW — near-flat, cool ────────────────────────────────────────── */
  --cv-shadow-xs: 0 1px 2px rgba(16,26,23,0.04);
  --cv-shadow-sm: 0 1px 3px rgba(16,26,23,0.06), 0 1px 2px rgba(16,26,23,0.04);
  --cv-shadow-md: 0 4px 12px rgba(16,26,23,0.06), 0 2px 4px rgba(16,26,23,0.04);
  --cv-shadow-lg: 0 14px 30px rgba(16,26,23,0.09), 0 4px 8px rgba(16,26,23,0.05);
  --cv-shadow-xl: 0 24px 48px rgba(16,26,23,0.12), 0 8px 16px rgba(16,26,23,0.06);

  --cv-ring: 0 0 0 3px rgba(20,138,78,0.28);
  --cv-ring-danger: 0 0 0 3px rgba(158,47,44,0.28);

  /* ── MOTION / Z / LAYOUT — unchanged ─────────────────────────────────── */
  --cv-motion-fast:120ms; --cv-motion-base:180ms; --cv-motion-slow:240ms;
  --cv-motion-ease:cubic-bezier(0.4,0,0.2,1); --cv-motion-out:cubic-bezier(0,0,0.2,1);
  --cv-z-base:0; --cv-z-sticky:100; --cv-z-dropdown:500; --cv-z-modal:1000; --cv-z-toast:2000; --cv-z-tooltip:3000;
  --cv-sidebar-width:240px; --cv-header-height:56px; --cv-max-content:1280px;
}

/* ── Dark theme — softened charcoal (NOT pure black), off-white ink ─────── */
@media (prefers-color-scheme: dark) {
  :root[data-cv-theme="auto"] {
    --cv-bg:#141817; --cv-surface:#1C2120; --cv-surface-2:#232928; --cv-surface-3:#2C3331;
    --cv-border:#2C3331; --cv-border-2:#232928;
    --cv-text:#E7ECEA; --cv-text-2:#AAB2B0; --cv-text-3:#828B89;
    --cv-accent:#5BBE8C; --cv-accent-hover:#79D0A4; --cv-accent-bg:rgba(91,190,140,0.14); --cv-accent-border:rgba(91,190,140,0.28);
    --cv-success:#7FC58F; --cv-success-bg:rgba(84,150,100,0.18);
    --cv-warning:#D9B166; --cv-warning-bg:rgba(190,150,70,0.18);
    --cv-danger:#E58A82;  --cv-danger-bg:rgba(200,90,80,0.18);
    --cv-info:#7BB8D4;    --cv-info-bg:rgba(90,150,180,0.18);
    --cv-g-prod-bg:rgba(91,190,140,0.13); --cv-g-health-bg:rgba(70,196,172,0.15); --cv-g-sales-bg:rgba(214,168,92,0.15);
    --cv-g-mgmt-bg:rgba(123,184,212,0.15); --cv-g-mktg-bg:rgba(183,155,224,0.15); --cv-g-people-bg:rgba(160,178,176,0.11);
    --cv-g-prod-ink:#8FDCB2; --cv-g-health-ink:#7FD6C4; --cv-g-sales-ink:#E1BE7E; --cv-g-mgmt-ink:#9CCBE0; --cv-g-mktg-ink:#C3AEE8; --cv-g-people-ink:#B4BCBA;
    --cv-ring:0 0 0 3px rgba(91,190,140,0.30);
    --cv-shadow-xs:0 1px 2px rgba(0,0,0,0.40); --cv-shadow-sm:0 1px 3px rgba(0,0,0,0.44),0 1px 2px rgba(0,0,0,0.24);
    --cv-shadow-md:0 4px 12px rgba(0,0,0,0.46),0 2px 4px rgba(0,0,0,0.24); --cv-shadow-lg:0 14px 30px rgba(0,0,0,0.54),0 4px 8px rgba(0,0,0,0.28);
    --cv-shadow-xl:0 24px 48px rgba(0,0,0,0.62),0 8px 16px rgba(0,0,0,0.32);
  }
}
:root[data-cv-theme="dark"] {
  --cv-bg:#141817; --cv-surface:#1C2120; --cv-surface-2:#232928; --cv-surface-3:#2C3331;
  --cv-border:#2C3331; --cv-border-2:#232928;
  --cv-text:#E7ECEA; --cv-text-2:#AAB2B0; --cv-text-3:#828B89;
  --cv-accent:#5BBE8C; --cv-accent-hover:#79D0A4; --cv-accent-bg:rgba(91,190,140,0.14); --cv-accent-border:rgba(91,190,140,0.28);
  --cv-success:#7FC58F; --cv-success-bg:rgba(84,150,100,0.18);
  --cv-warning:#D9B166; --cv-warning-bg:rgba(190,150,70,0.18);
  --cv-danger:#E58A82;  --cv-danger-bg:rgba(200,90,80,0.18);
  --cv-info:#7BB8D4;    --cv-info-bg:rgba(90,150,180,0.18);
  --cv-cultivation-bg:rgba(91,190,140,0.12); --cv-sales-bg:rgba(214,168,92,0.12); --cv-management-bg:rgba(123,184,212,0.12); --cv-marketing-bg:rgba(183,155,224,0.12); --cv-health-bg:rgba(70,196,172,0.12);
  --cv-g-prod-bg:rgba(91,190,140,0.13); --cv-g-health-bg:rgba(70,196,172,0.15); --cv-g-sales-bg:rgba(214,168,92,0.15);
  --cv-g-mgmt-bg:rgba(123,184,212,0.15); --cv-g-mktg-bg:rgba(183,155,224,0.15); --cv-g-people-bg:rgba(160,178,176,0.11);
  --cv-g-prod-ink:#8FDCB2; --cv-g-health-ink:#7FD6C4; --cv-g-sales-ink:#E1BE7E; --cv-g-mgmt-ink:#9CCBE0; --cv-g-mktg-ink:#C3AEE8; --cv-g-people-ink:#B4BCBA;
  --cv-ring:0 0 0 3px rgba(91,190,140,0.30);
  --cv-shadow-xs:0 1px 2px rgba(0,0,0,0.40); --cv-shadow-sm:0 1px 3px rgba(0,0,0,0.44),0 1px 2px rgba(0,0,0,0.24);
  --cv-shadow-md:0 4px 12px rgba(0,0,0,0.46),0 2px 4px rgba(0,0,0,0.24); --cv-shadow-lg:0 14px 30px rgba(0,0,0,0.54),0 4px 8px rgba(0,0,0,0.28);
  --cv-shadow-xl:0 24px 48px rgba(0,0,0,0.62),0 8px 16px rgba(0,0,0,0.32);
}

/* Print is ALWAYS light (report print-to-PDF path) */
@media print {
  :root[data-cv-theme="dark"], :root[data-cv-theme="auto"] {
    --cv-bg:#FFFFFF; --cv-surface:#FFFFFF; --cv-surface-2:#F0F3F2; --cv-surface-3:#E7EBEA;
    --cv-border:#E4E9E7; --cv-border-2:#EEF2F1; --cv-text:#161A19; --cv-text-2:#5E6664; --cv-text-3:#8A9391;
    --cv-shadow-xs:none; --cv-shadow-sm:none; --cv-shadow-md:none; --cv-shadow-lg:none; --cv-shadow-xl:none;
  }
}

/* ── Global base (unchanged behavior) ───────────────────────────────────── */
.cv { font-family: var(--cv-font-sans); font-size: var(--cv-text-base); line-height: var(--cv-text-base-lh);
      color: var(--cv-text); background: var(--cv-bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.cv *, .cv *::before, .cv *::after { box-sizing: border-box; }
.cv :focus-visible { outline: none; box-shadow: var(--cv-ring); border-color: var(--cv-accent); }
.cv button { font-family: inherit; }

/* trend-DOWN rust: brighter terracotta (#C05E28) reads on the LIGHT ground; dark keeps the
   approved muted rust (#9E5A2C) which already reads well on charcoal. */
:root[data-cv-theme="dark"] { --cv-down: #9E5A2C; }
@media (prefers-color-scheme: dark) { :root[data-cv-theme="auto"] { --cv-down: #9E5A2C; } }


/* ─── cannvas-deploy/app/dashboard/components.css ─────────────────────────────────────── */
/* ==========================================================================
   Cannvas v2 — Component styles
   All rules namespaced under .cv to avoid colliding with v1.
   Reads tokens from tokens.css only — no hardcoded colors/sizes here.
   ========================================================================== */

/* ── BUTTON ──────────────────────────────────────────────────────────────── */
.cv .cv-btn,
.cv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cv-space-2);
  font-family: var(--cv-font-sans);
  font-weight: var(--cv-weight-medium);
  letter-spacing: var(--cv-letter-tight);
  border: 1px solid transparent;
  border-radius: var(--cv-radius-md);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--cv-motion-fast) var(--cv-motion-ease),
              border-color var(--cv-motion-fast) var(--cv-motion-ease),
              color var(--cv-motion-fast) var(--cv-motion-ease),
              box-shadow var(--cv-motion-fast) var(--cv-motion-ease);
}
.cv-btn:focus-visible { outline: none; box-shadow: var(--cv-ring); }
.cv-btn[disabled],
.cv-btn.is-loading { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* sizes */
.cv-btn--sm { font-size: var(--cv-text-sm); padding: 4px 10px; height: 26px; }
.cv-btn--md { font-size: var(--cv-text-base); padding: 6px 12px; height: 32px; }
.cv-btn--lg { font-size: var(--cv-text-md); padding: 8px 16px; height: 40px; }
.cv-btn--full { width: 100%; }

/* variants */
.cv-btn--primary       { background: var(--cv-accent); color: #fff; border-color: var(--cv-accent); }
.cv-btn--primary:hover { background: var(--cv-accent-hover); border-color: var(--cv-accent-hover); }
:root[data-cv-theme="dark"] .cv-btn--primary       { background: var(--cv-accent); color: #0C1310; border-color: var(--cv-accent); }
:root[data-cv-theme="dark"] .cv-btn--primary:hover { background: var(--cv-accent-hover); }

.cv-btn--secondary       { background: var(--cv-surface); color: var(--cv-text); border-color: var(--cv-border); box-shadow: var(--cv-shadow-xs); }
.cv-btn--secondary:hover { background: var(--cv-surface-2); border-color: var(--cv-text-3); }

.cv-btn--ghost       { background: transparent; color: var(--cv-text); }
.cv-btn--ghost:hover { background: var(--cv-surface-2); }

.cv-btn--subtle       { background: var(--cv-surface-2); color: var(--cv-text); }
.cv-btn--subtle:hover { background: var(--cv-surface-3); }

.cv-btn--destructive       { background: var(--cv-danger); color: #fff; border-color: var(--cv-danger); }
.cv-btn--destructive:hover { filter: brightness(0.92); }
.cv-btn--destructive:focus-visible { box-shadow: var(--cv-ring-danger); }

@keyframes cv-spin { to { transform: rotate(360deg); } }
.cv-btn__spinner { animation: cv-spin 0.8s linear infinite; }

/* icon-only button */
.cv-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--cv-radius-md);
  background: transparent;
  color: var(--cv-text-2);
  cursor: pointer;
  transition: background var(--cv-motion-fast) var(--cv-motion-ease), color var(--cv-motion-fast) var(--cv-motion-ease);
}
.cv-icon-btn:hover { background: var(--cv-surface-2); color: var(--cv-text); }
.cv-icon-btn:focus-visible { outline: none; box-shadow: var(--cv-ring); }
.cv-icon-btn--sm { width: 26px; height: 26px; }
.cv-icon-btn--md { width: 32px; height: 32px; }
.cv-icon-btn--lg { width: 40px; height: 40px; }
.cv-icon-btn--secondary { background: var(--cv-surface); border-color: var(--cv-border); box-shadow: var(--cv-shadow-xs); }

/* ── BACK BUTTON ─────────────────────────────────────────────────────────── */
.cv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--cv-text-2);
  font-family: var(--cv-font-sans);
  font-size: var(--cv-text-sm);
  font-weight: var(--cv-weight-medium);
  letter-spacing: var(--cv-letter-tight);
  padding: 5px 10px 5px 8px;
  border-radius: var(--cv-radius-md);
  cursor: pointer;
  transition: background var(--cv-motion-fast), color var(--cv-motion-fast), border-color var(--cv-motion-fast), transform var(--cv-motion-fast);
  margin-bottom: var(--cv-space-3);
}
.cv-back-btn:hover {
  background: var(--cv-surface-2);
  color: var(--cv-text);
  border-color: var(--cv-border);
}
.cv-back-btn:hover .cv-icon {
  transform: translateX(-2px);
}
.cv-back-btn .cv-icon { transition: transform var(--cv-motion-fast); }
.cv-back-btn:focus-visible { outline: none; box-shadow: var(--cv-ring); }

/* ── BADGE ───────────────────────────────────────────────────────────────── */
.cv-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--cv-space-1);
  font-size: var(--cv-text-xs);
  font-weight: var(--cv-weight-medium);
  line-height: 1;
  padding: 3px 8px;
  border-radius: var(--cv-radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.cv-badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.cv-badge--neutral { background: var(--cv-surface-2); color: var(--cv-text-2); border-color: var(--cv-border); }
.cv-badge--accent  { background: var(--cv-accent-bg);  color: var(--cv-accent);  border-color: var(--cv-accent-border); }
.cv-badge--success { background: var(--cv-success-bg); color: var(--cv-success); border-color: var(--cv-success-border); }
.cv-badge--warning { background: var(--cv-warning-bg); color: var(--cv-warning); border-color: var(--cv-warning-border); }
.cv-badge--danger  { background: var(--cv-danger-bg);  color: var(--cv-danger);  border-color: var(--cv-danger-border); }
.cv-badge--info    { background: var(--cv-info-bg);    color: var(--cv-info);    border-color: var(--cv-info-border); }

/* ── CARD ────────────────────────────────────────────────────────────────── */
.cv-card {
  background: var(--cv-surface);
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-lg);
  box-shadow: var(--cv-shadow-xs);
  overflow: hidden;
}
.cv-card--hover { transition: border-color var(--cv-motion-fast), box-shadow var(--cv-motion-fast), transform var(--cv-motion-fast); }
.cv-card--hover:hover { border-color: var(--cv-text-3); box-shadow: var(--cv-shadow-md); }
.cv-card--accent-cultivation { border-top: 2px solid var(--cv-cultivation-accent); }
.cv-card--accent-sales       { border-top: 2px solid var(--cv-sales-accent); }
.cv-card--accent-management  { border-top: 2px solid var(--cv-management-accent); }

.cv-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--cv-space-4);
  padding: var(--cv-space-4) var(--cv-space-5);
  border-bottom: 1px solid var(--cv-border-2);
}
.cv-card__titlewrap { min-width: 0; flex: 1; }
.cv-card__title {
  font-size: var(--cv-text-md);
  font-weight: var(--cv-weight-semibold);
  letter-spacing: var(--cv-letter-tight);
  color: var(--cv-text);
  margin: 0;
}
.cv-card__desc {
  margin: 4px 0 0;
  font-size: var(--cv-text-sm);
  color: var(--cv-text-2);
}
.cv-card__actions { display: flex; gap: var(--cv-space-2); flex-shrink: 0; }
.cv-card__body { padding: var(--cv-space-5); }
.cv-card__body--flush { padding: 0; }
.cv-card__footer {
  padding: var(--cv-space-3) var(--cv-space-5);
  border-top: 1px solid var(--cv-border-2);
  background: var(--cv-surface-2);
}

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.cv-pageheader {
  padding: var(--cv-space-6) 0 var(--cv-space-5);
  border-bottom: 1px solid var(--cv-border);
  margin-bottom: var(--cv-space-6);
}
.cv-pageheader__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--cv-space-4);
}
.cv-pageheader__titlewrap { min-width: 0; flex: 1; }
.cv-pageheader__title {
  display: flex;
  align-items: center;
  gap: var(--cv-space-3);
  font-size: var(--cv-text-3xl);
  line-height: var(--cv-text-3xl-lh);
  font-weight: var(--cv-weight-semibold);
  letter-spacing: var(--cv-letter-tight);
  color: var(--cv-text);
  margin: 0;
}
.cv-pageheader__desc {
  margin: var(--cv-space-2) 0 0;
  font-size: var(--cv-text-md);
  color: var(--cv-text-2);
  max-width: 64ch;
}
.cv-pageheader__actions { display: flex; gap: var(--cv-space-2); }

/* ── FORM FIELDS ─────────────────────────────────────────────────────────── */
.cv-field { display: flex; flex-direction: column; gap: var(--cv-space-1); }
.cv-field__label {
  font-size: var(--cv-text-sm);
  font-weight: var(--cv-weight-medium);
  color: var(--cv-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cv-field__required { color: var(--cv-danger); }
.cv-field__hint  { font-size: var(--cv-text-xs); color: var(--cv-text-2); margin: 0; }
.cv-field__help  { font-size: var(--cv-text-xs); color: var(--cv-text-3); margin: 2px 0 0; }
.cv-field__error { font-size: var(--cv-text-xs); color: var(--cv-danger); margin: 2px 0 0; }

.cv-input, .cv-select, .cv-textarea {
  width: 100%;
  font-family: var(--cv-font-sans);
  font-size: var(--cv-text-base);
  line-height: var(--cv-text-base-lh);
  color: var(--cv-text);
  background: var(--cv-surface);
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-md);
  padding: 7px 10px;
  transition: border-color var(--cv-motion-fast), box-shadow var(--cv-motion-fast);
}
.cv-input:hover, .cv-select:hover, .cv-textarea:hover { border-color: var(--cv-text-3); }
.cv-input:focus, .cv-select:focus, .cv-textarea:focus {
  outline: none;
  border-color: var(--cv-accent);
  box-shadow: var(--cv-ring);
}
.cv-input::placeholder, .cv-textarea::placeholder { color: var(--cv-text-3); }
.cv-input.is-invalid, .cv-select.is-invalid, .cv-textarea.is-invalid {
  border-color: var(--cv-danger);
}
.cv-input.is-invalid:focus, .cv-select.is-invalid:focus, .cv-textarea.is-invalid:focus {
  box-shadow: var(--cv-ring-danger);
}
.cv-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.cv-textarea { min-height: 80px; resize: vertical; }
.cv-input[disabled], .cv-select[disabled], .cv-textarea[disabled] {
  background: var(--cv-surface-2);
  color: var(--cv-text-3);
  cursor: not-allowed;
}

/* checkbox + radio */
.cv-checkbox, .cv-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--cv-space-2);
  cursor: pointer;
  font-size: var(--cv-text-base);
  color: var(--cv-text);
}
.cv-checkbox.is-disabled, .cv-radio.is-disabled { opacity: 0.5; cursor: not-allowed; }
.cv-checkbox input, .cv-radio input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.cv-checkbox__box, .cv-radio__box {
  width: 16px; height: 16px;
  border: 1px solid var(--cv-border);
  background: var(--cv-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--cv-motion-fast), border-color var(--cv-motion-fast);
}
.cv-checkbox__box { border-radius: var(--cv-radius-xs); }
.cv-radio__box    { border-radius: 50%; }
.cv-checkbox input:checked + .cv-checkbox__box {
  background: var(--cv-accent); border-color: var(--cv-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
:root[data-cv-theme="dark"] .cv-checkbox input:checked + .cv-checkbox__box {
  background: var(--cv-accent); border-color: var(--cv-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.cv-radio input:checked + .cv-radio__box {
  border-color: var(--cv-accent);
  box-shadow: inset 0 0 0 4px var(--cv-accent);
}
/* Bare <input type=checkbox|radio> — rendered directly in 20 dashboard pages
   (task checklists, biosafety acks, pest/disease chips, filter lists). With no
   accent-color the browser paints its own blue, which reads off-brand on dark.
   ONE rule themes every consumer; the .cv-checkbox component hides its own input
   (opacity:0) and paints __box above, so this never double-applies. */
.cv input[type="checkbox"], .cv input[type="radio"] { accent-color: var(--cv-accent); }
.cv-checkbox input:focus-visible + .cv-checkbox__box,
.cv-radio    input:focus-visible + .cv-radio__box { box-shadow: var(--cv-ring); }

/* switch */
.cv-switch { display: inline-flex; align-items: center; gap: var(--cv-space-2); cursor: pointer; }
.cv-switch input { position: absolute; opacity: 0; }
.cv-switch__track {
  width: 32px; height: 18px;
  background: var(--cv-surface-3);
  border-radius: var(--cv-radius-pill);
  position: relative;
  transition: background var(--cv-motion-fast);
  flex-shrink: 0;
}
.cv-switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--cv-shadow-sm);
  transition: transform var(--cv-motion-base) var(--cv-motion-ease);
}
.cv-switch input:checked + .cv-switch__track { background: var(--cv-accent); }
.cv-switch input:checked + .cv-switch__track .cv-switch__thumb { transform: translateX(14px); }
.cv-switch input:focus-visible + .cv-switch__track { box-shadow: var(--cv-ring); }
.cv-switch__label { font-size: var(--cv-text-base); color: var(--cv-text); }

/* ── TABS ────────────────────────────────────────────────────────────────── */
.cv-tabs { display: inline-flex; gap: 4px; }
.cv-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: var(--cv-text-base);
  font-weight: var(--cv-weight-medium);
  color: var(--cv-text-2);
  cursor: pointer;
  transition: color var(--cv-motion-fast), background var(--cv-motion-fast);
}
.cv-tabs__tab:hover { color: var(--cv-text); }
.cv-tabs__tab.is-active { color: var(--cv-text); }
.cv-tabs__count {
  font-size: var(--cv-text-xs);
  background: var(--cv-surface-2);
  color: var(--cv-text-2);
  padding: 1px 6px;
  border-radius: var(--cv-radius-pill);
}
.cv-tabs__tab.is-active .cv-tabs__count { background: var(--cv-text); color: var(--cv-text-inverse); }
:root[data-cv-theme="dark"] .cv-tabs__tab.is-active .cv-tabs__count { background: var(--cv-text-inverse); color: var(--cv-bg); }

.cv-tabs--underline { border-bottom: 1px solid var(--cv-border); gap: 0; }
.cv-tabs--underline .cv-tabs__tab {
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cv-tabs--underline .cv-tabs__tab.is-active { border-bottom-color: var(--cv-text); }

.cv-tabs--pill { background: var(--cv-surface-2); padding: 3px; border-radius: var(--cv-radius-md); }
.cv-tabs--pill .cv-tabs__tab { padding: 5px 12px; border-radius: var(--cv-radius-sm); }
.cv-tabs--pill .cv-tabs__tab.is-active { background: var(--cv-surface); box-shadow: var(--cv-shadow-xs); }

/* ── BREADCRUMB ──────────────────────────────────────────────────────────── */
.cv-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--cv-space-2);
  font-size: var(--cv-text-sm);
  color: var(--cv-text-3);
}
.cv-breadcrumb__item { display: inline-flex; align-items: center; gap: var(--cv-space-2); }
.cv-breadcrumb__item a { color: var(--cv-text-2); text-decoration: none; }
.cv-breadcrumb__item a:hover { color: var(--cv-text); }
.cv-breadcrumb__item [aria-current="page"] { color: var(--cv-text); font-weight: var(--cv-weight-medium); }
.cv-breadcrumb__sep { color: var(--cv-text-3); display: inline-flex; }

/* ── AVATAR ──────────────────────────────────────────────────────────────── */
.cv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: var(--cv-weight-semibold);
  overflow: hidden;
  flex-shrink: 0;
}
.cv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cv-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.cv-avatar--md { width: 32px; height: 32px; font-size: 12px; }
.cv-avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.cv-avatar--xl { width: 56px; height: 56px; font-size: 18px; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.cv-empty {
  text-align: center;
  padding: var(--cv-space-10) var(--cv-space-6);
  color: var(--cv-text-2);
}
.cv-empty__icon {
  display: inline-flex;
  width: 56px; height: 56px;
  align-items: center;
  justify-content: center;
  background: var(--cv-surface-2);
  color: var(--cv-text-3);
  border-radius: 50%;
  margin: 0 auto var(--cv-space-4);
}
.cv-empty__title {
  font-size: var(--cv-text-lg);
  font-weight: var(--cv-weight-semibold);
  color: var(--cv-text);
  margin: 0 0 var(--cv-space-1);
}
.cv-empty__desc { margin: 0 auto var(--cv-space-4); max-width: 36ch; font-size: var(--cv-text-base); }
.cv-empty__action { display: inline-flex; gap: var(--cv-space-2); }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.cv-toast-root {
  position: fixed;
  bottom: var(--cv-space-6);
  right: var(--cv-space-6);
  z-index: var(--cv-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--cv-space-2);
  pointer-events: none;
}
.cv-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--cv-space-3);
  background: var(--cv-surface);
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-lg);
  padding: var(--cv-space-3) var(--cv-space-3) var(--cv-space-3) var(--cv-space-4);
  box-shadow: var(--cv-shadow-lg);
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--cv-motion-base), transform var(--cv-motion-base);
}
.cv-toast.is-shown { opacity: 1; transform: none; }
.cv-toast.is-leaving { opacity: 0; transform: translateY(-4px); }
.cv-toast__icon { margin-top: 2px; flex-shrink: 0; }
.cv-toast--success .cv-toast__icon { color: var(--cv-success); }
.cv-toast--danger  .cv-toast__icon { color: var(--cv-danger); }
.cv-toast--warning .cv-toast__icon { color: var(--cv-warning); }
.cv-toast--info    .cv-toast__icon { color: var(--cv-info); }
.cv-toast__body { flex: 1; font-size: var(--cv-text-base); color: var(--cv-text); }
.cv-toast__title { font-weight: var(--cv-weight-semibold); margin-bottom: 2px; }
.cv-toast__msg { color: var(--cv-text-2); }
.cv-toast__close {
  background: transparent;
  border: none;
  color: var(--cv-text-3);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--cv-radius-sm);
  flex-shrink: 0;
}
.cv-toast__close:hover { background: var(--cv-surface-2); color: var(--cv-text); }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
.cv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--cv-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--cv-space-4);
  animation: cv-fade-in var(--cv-motion-base) var(--cv-motion-ease);
}
@keyframes cv-fade-in { from { opacity: 0; } }
.cv-modal {
  background: var(--cv-surface);
  border-radius: var(--cv-radius-xl);
  box-shadow: var(--cv-shadow-xl);
  width: 100%;
  max-height: calc(100vh - var(--cv-space-8));
  display: flex;
  flex-direction: column;
  animation: cv-modal-in var(--cv-motion-base) var(--cv-motion-out);
}
@keyframes cv-modal-in { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.cv-modal--sm { max-width: 400px; }
.cv-modal--md { max-width: 560px; }
.cv-modal--lg { max-width: 800px; }
.cv-modal--xl { max-width: 1080px; }

.cv-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--cv-space-4) var(--cv-space-5);
  border-bottom: 1px solid var(--cv-border-2);
}
.cv-modal__title {
  font-size: var(--cv-text-lg);
  font-weight: var(--cv-weight-semibold);
  letter-spacing: var(--cv-letter-tight);
  margin: 0;
  color: var(--cv-text);
}
.cv-modal__close {
  background: transparent;
  border: none;
  color: var(--cv-text-2);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--cv-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cv-modal__close:hover { background: var(--cv-surface-2); color: var(--cv-text); }

.cv-modal__body {
  padding: var(--cv-space-5);
  overflow-y: auto;
  flex: 1;
}
.cv-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--cv-space-2);
  padding: var(--cv-space-3) var(--cv-space-5);
  border-top: 1px solid var(--cv-border-2);
  background: var(--cv-surface-2);
}

/* ── DRAWER ──────────────────────────────────────────────────────────────── */
.cv-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--cv-z-modal);
  animation: cv-fade-in var(--cv-motion-base) var(--cv-motion-ease);
}
.cv-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--cv-surface);
  box-shadow: var(--cv-shadow-xl);
  display: flex;
  flex-direction: column;
  animation: cv-drawer-in var(--cv-motion-base) var(--cv-motion-out);
}
.cv-drawer--right { right: 0; }
.cv-drawer--left  { left: 0; }
@keyframes cv-drawer-in { from { transform: translateX(8px); opacity: 0.8; } }

.cv-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--cv-space-4) var(--cv-space-5);
  border-bottom: 1px solid var(--cv-border-2);
}
.cv-drawer__title {
  font-size: var(--cv-text-lg);
  font-weight: var(--cv-weight-semibold);
  letter-spacing: var(--cv-letter-tight);
  margin: 0;
}
.cv-drawer__close {
  background: transparent;
  border: none;
  color: var(--cv-text-2);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--cv-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cv-drawer__close:hover { background: var(--cv-surface-2); color: var(--cv-text); }
.cv-drawer__body { padding: var(--cv-space-5); overflow-y: auto; flex: 1; }
.cv-drawer__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--cv-space-2);
  padding: var(--cv-space-3) var(--cv-space-5);
  border-top: 1px solid var(--cv-border-2);
  background: var(--cv-surface-2);
}

/* ── SIDEBAR NAV ─────────────────────────────────────────────────────────── */
.cv-nav-group { margin-bottom: var(--cv-space-5); }
.cv-nav-group__label {
  font-size: var(--cv-text-xs);
  letter-spacing: var(--cv-letter-wider);
  text-transform: uppercase;
  color: var(--cv-text-3);
  font-weight: var(--cv-weight-semibold);
  padding: 0 var(--cv-space-3) var(--cv-space-2);
}
.cv-nav-group__items { list-style: none; margin: 0; padding: 0; }

.cv-nav-item {}
.cv-nav-item__link {
  display: flex;
  align-items: center;
  gap: var(--cv-space-3);
  padding: 6px var(--cv-space-3);
  border-radius: var(--cv-radius-md);
  text-decoration: none;
  color: var(--cv-text-2);
  font-size: var(--cv-text-base);
  font-weight: var(--cv-weight-medium);
  transition: background var(--cv-motion-fast), color var(--cv-motion-fast);
}
.cv-nav-item__link:hover { background: var(--cv-surface-2); color: var(--cv-text); }
.cv-nav-item.is-active > .cv-nav-item__link {
  background: var(--cv-surface-2);
  color: var(--cv-text);
}
.cv-nav-item__icon {
  display: inline-flex;
  width: 16px;
  color: var(--cv-text-3);
  flex-shrink: 0;
}
.cv-nav-item.is-active > .cv-nav-item__link .cv-nav-item__icon { color: var(--cv-text); }
.cv-nav-item__label { flex: 1; min-width: 0; }
.cv-nav-item__count {
  font-size: 10px;
  font-weight: var(--cv-weight-semibold);
  color: var(--cv-text-3);
  background: var(--cv-surface-2);
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
  border-radius: var(--cv-radius-pill);
  line-height: 16px;
}
.cv-nav-item__count--info    { background: var(--cv-info-bg);    color: var(--cv-info); }
.cv-nav-item__count--success { background: var(--cv-success-bg); color: var(--cv-success); }
.cv-nav-item__count--warning { background: var(--cv-warning-bg); color: var(--cv-warning); }
.cv-nav-item__count--danger  {
  background: var(--cv-danger);
  color: #fff;
  box-shadow: 0 0 0 2px var(--cv-danger-bg);
  animation: cv-pulse 2.5s ease-in-out infinite;
}
@keyframes cv-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--cv-danger-bg); }
  50%      { box-shadow: 0 0 0 4px var(--cv-danger-bg); }
}
.cv-nav-item__chev { color: var(--cv-text-3); transition: transform var(--cv-motion-fast); }
.cv-nav-item.has-children.is-open > .cv-nav-item__link .cv-nav-item__chev { transform: rotate(180deg); }
.cv-nav-item__children {
  list-style: none;
  margin: 2px 0 0;
  padding: 0 0 0 var(--cv-space-7);
}
.cv-nav-item__children .cv-nav-item__link { font-size: var(--cv-text-sm); padding: 5px var(--cv-space-3); }

/* ── TABLE ───────────────────────────────────────────────────────────────── */
.cv-table-wrap {
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-lg);
  overflow: hidden;
  background: var(--cv-surface);
}
.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--cv-text-base);
}
.cv-table thead {
  background: var(--cv-surface-2);
}
.cv-table th {
  text-align: left;
  font-size: var(--cv-text-xs);
  letter-spacing: var(--cv-letter-wider);
  text-transform: uppercase;
  font-weight: var(--cv-weight-semibold);
  color: var(--cv-text-2);
  padding: var(--cv-space-2) var(--cv-space-4);
  border-bottom: 1px solid var(--cv-border);
}
.cv-table td {
  padding: var(--cv-space-3) var(--cv-space-4);
  border-bottom: 1px solid var(--cv-border-2);
  color: var(--cv-text);
  vertical-align: middle;
}
.cv-table tbody tr:last-child td { border-bottom: none; }
.cv-table tbody tr.is-clickable { cursor: pointer; transition: background var(--cv-motion-fast); }
.cv-table tbody tr.is-clickable:hover { background: var(--cv-surface-2); }
.cv-table__null { color: var(--cv-text-3); }
/* ruled structure — solid horizontal rows (above) + dotted PARTIAL vertical ticks between columns (locked) */
.cv-table td { position: relative; }
.cv-table td:not(:first-child)::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 22px;
  background: repeating-linear-gradient(to bottom, var(--cv-text-3) 0 2px, transparent 2px 6px);
  opacity: .5;
}

/* ── STAT ────────────────────────────────────────────────────────────────── */
.cv-stat {
  background: var(--cv-surface);
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-lg);
  padding: var(--cv-space-4) var(--cv-space-5);
}
.cv-stat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--cv-space-2);
}
.cv-stat__label {
  font-size: var(--cv-text-sm);
  color: var(--cv-text-2);
  font-weight: var(--cv-weight-medium);
}
.cv-stat__icon { color: var(--cv-text-3); }
.cv-stat__value {
  font-size: var(--cv-text-3xl);
  line-height: var(--cv-text-3xl-lh);
  font-weight: var(--cv-weight-semibold);
  letter-spacing: var(--cv-letter-tight);
  color: var(--cv-text);
}
.cv-stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--cv-text-xs);
  font-weight: var(--cv-weight-medium);
  margin-top: var(--cv-space-1);
}
.cv-stat__delta--up   { color: var(--cv-success); }
.cv-stat__delta--down { color: var(--cv-down); }
.cv-stat__hint { font-size: var(--cv-text-xs); color: var(--cv-text-3); margin-top: 4px; }

/* ── ICON ────────────────────────────────────────────────────────────────── */
.cv-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.cv-icon--missing {
  background: var(--cv-danger-bg);
  border: 1px dashed var(--cv-danger);
  border-radius: var(--cv-radius-xs);
}

/* ── INFO TIP ──────────────────────────────────────────────────────────────
   Anchored, click-toggled feature explainer (cv.InfoTip). In-context popover,
   not a modal — opens on click, dismisses on click-away / Esc. */
.cv-infotip { position: relative; display: inline-flex; vertical-align: middle; line-height: 0; }
.cv-infotip__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  border: none; background: transparent; color: var(--cv-text-3);
  border-radius: var(--cv-radius-pill); cursor: pointer;
  transition: color .12s, background .12s;
}
.cv-infotip__btn:hover { color: var(--cv-text); background: var(--cv-surface-2); }
.cv-infotip__pop {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: var(--cv-z-tooltip);
  display: none; width: max-content; max-width: 300px;
  padding: 10px 12px; text-align: left; white-space: normal; line-height: 1.5;
  background: var(--cv-surface); border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-md); box-shadow: var(--cv-shadow-lg);
}
.cv-infotip--right .cv-infotip__pop { left: auto; right: 0; }
.cv-infotip.is-open .cv-infotip__pop { display: block; }
.cv-infotip__title { display: block; font-size: var(--cv-text-xs); font-weight: var(--cv-weight-bold); color: var(--cv-text); margin-bottom: 4px; }
.cv-infotip__body { display: block; font-size: var(--cv-text-xs); color: var(--cv-text-2); }

/* ==========================================================================
   Set tag drill-down (shared) — set → cultivar (count) → individual METRC
   plant tags. Used by cv.setTagsBody / cv.setTagsTree / cv.openSetTagsDrawer.
   (pipeline.html also defines these inline historically; identical rules.)
   ========================================================================== */
.cv-drawer-strain {
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-md);
  background: var(--cv-surface);
  overflow: hidden;
  transition: border-color var(--cv-motion-fast), box-shadow var(--cv-motion-fast);
}
.cv-drawer-strain:hover { border-color: var(--cv-text-3); }
.cv-drawer-strain[open] { border-color: var(--cv-text-3); box-shadow: var(--cv-shadow-sm); }
.cv-drawer-strain.is-matched { border-color: var(--cv-accent); }
.cv-drawer-strain__head {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  transition: background var(--cv-motion-fast);
}
.cv-drawer-strain__head::-webkit-details-marker { display: none; }
.cv-drawer-strain__head:hover { background: var(--cv-surface-2); }
.cv-drawer-strain__chev { color: var(--cv-text-3); display: inline-flex; transition: transform var(--cv-motion-fast); }
.cv-drawer-strain[open] .cv-drawer-strain__chev { transform: rotate(90deg); color: var(--cv-text); }
.cv-drawer-strain__title { min-width: 0; }
.cv-drawer-strain__name {
  font-size: var(--cv-text-base);
  font-weight: var(--cv-weight-semibold);
  color: var(--cv-text);
  letter-spacing: var(--cv-letter-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-drawer-strain__meta { font-size: var(--cv-text-xs); color: var(--cv-text-2); margin-top: 2px; }
.cv-drawer-strain__children {
  border-top: 1px solid var(--cv-border-2);
  background: var(--cv-surface-2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cv-drawer-strain--setcv { background: var(--cv-surface); }
.cv-drawer-strain--setcv .cv-drawer-strain__name { font-size: 12px; }
.cv-drawer-strain--setcv .cv-drawer-strain__children { background: var(--cv-surface-2); }
.cv-drawer-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--cv-surface);
  border: 1px solid var(--cv-border-2);
  border-radius: var(--cv-radius-sm);
  cursor: pointer;
  transition: border-color var(--cv-motion-fast), background var(--cv-motion-fast);
}
.cv-drawer-child:hover { border-color: var(--cv-text-3); background: var(--cv-surface); }
.cv-drawer-child__left { flex: 1; min-width: 0; }
.cv-drawer-child__metrc {
  font-family: var(--cv-font-mono);
  font-size: 11px;
  color: var(--cv-text);
  font-weight: var(--cv-weight-medium);
  word-break: break-all;
  line-height: 1.3;
}
.cv-drawer-child__metrc--missing {
  font-family: var(--cv-font-sans);
  color: var(--cv-warning);
  font-style: italic;
  font-weight: var(--cv-weight-regular);
}
.cv-drawer-child__meta { font-size: 10.5px; color: var(--cv-text-2); margin-top: 2px; }
.cv-drawer-child__chip {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: var(--cv-weight-semibold);
  padding: 2px 8px;
  border-radius: var(--cv-radius-pill);
  background: var(--cv-surface-2);
  color: var(--cv-text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cv-drawer-child__chip.is-warning { background: var(--cv-warning-bg); color: var(--cv-warning); }
.cv-drawer-child__chip.is-danger  { background: var(--cv-danger); color: #fff; }
.cv-drawer-batch { display: flex; flex-direction: column; }
/* drill-down drawer helpers */
.cv-stt-sub { font-size: var(--cv-text-xs); color: var(--cv-text-2); margin: 0 0 12px; line-height: 1.4; }
.cv-stt-note { font-size: var(--cv-text-xs); color: var(--cv-warning); font-style: italic; margin: 0 0 8px; }
.cv-stt-empty { padding: 20px; text-align: center; color: var(--cv-text-3); font-size: var(--cv-text-sm); font-style: italic; }
/* clickable plant-count → opens the tag drill-down (cv.openSetTagsDrawer) */
.cv-tagcount { background: none; border: none; padding: 0 1px; margin: 0; font: inherit; color: var(--cv-accent); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; font-variant-numeric: tabular-nums; }
.cv-tagcount:hover { text-decoration: underline; }


/* ══════════════════════════════════════════════════════════════════════════
   MOBILE (M1, 2026-07-04) — drawers become bottom sheets; touch density rules.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cv-drawer, .cv-drawer--right, .cv-drawer--left {
    width: 100% !important; max-width: 100%;
    left: 0; right: 0; top: auto; bottom: 0; height: auto; max-height: 90vh;
    border-radius: 16px 16px 0 0;
    animation: cv-sheet-up var(--cv-motion-base) var(--cv-motion-out);
  }
  .cv-drawer__body { max-height: calc(90vh - 116px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .cv-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cv-card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cv-input, .cv-select, .cv-textarea { font-size: 16px; }  /* 16px stops iOS zoom-on-focus */
  .cv-btn { min-height: 40px; }
  .cv-btn--sm { min-height: 36px; }
  .cv-cal__day { min-height: 60px; }
  .cv-cal__evt { font-size: 8.5px; padding: 1px 3px; }
}
@keyframes cv-sheet-up { from { transform: translateY(24px); opacity: 0.85; } }


/* ── MOBILE M1.2: page header wraps — actions drop below the title instead of
   squeezing it into a sliver (operator phone test, Pipeline header). ── */
@media (max-width: 768px) {
  .cv-pageheader__row { flex-wrap: wrap; gap: 10px; }
  .cv-pageheader__titlewrap { min-width: 0; flex: 1 1 100%; }
  .cv-pageheader__actions { flex-wrap: wrap; }
}


/* ── MOBILE M1.3: tab strips scroll horizontally on phones. The page-level
   overflow clamp (which fixed the viewport blowout) removed the accidental
   page-scroll that used to reach off-screen tabs — the strip itself scrolls
   now (management tabsbar, sops tabs, everywhere cv-tabs renders). ── */
@media (max-width: 768px) {
  .cv-tabs {
    display: flex; max-width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 2px;
  }
  .cv-tabs::-webkit-scrollbar { display: none; }
  .cv-tabs__tab { flex-shrink: 0; }
  .mgmt-tabsbar { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mgmt-tabsbar::-webkit-scrollbar { display: none; }
}


/* ── MOBILE M2 (2026-07-27 redesign) — more native phone density: a tighter,
   more prominent page title and compact stat cards so the content leads. Shared,
   additive → every page inherits it (part of the mobile-Today build). ── */
@media (max-width: 768px) {
  .cv-pageheader { padding: var(--cv-space-4) 0 var(--cv-space-4); margin-bottom: var(--cv-space-4); }
  .cv-pageheader__title { font-size: 26px; line-height: 1.12; }
  .cv-pageheader__desc { font-size: var(--cv-text-sm); margin-top: 6px; max-width: none; }
  .cv-stat { padding: 12px 14px; }
  .cv-stat__header { margin-bottom: 4px; }
  .cv-stat__value { font-size: var(--cv-text-2xl); line-height: 1.12; }
  /* card headers wrap on phones — actions drop BELOW the title (mirrors the pageheader
     M1.2 fix). Without this a full-width card whose header carries action buttons
     (e.g. "Today's production tasks" → Health check · New task) runs off the right edge. */
  .cv-card__header { flex-wrap: wrap; }
  .cv-card__titlewrap { flex: 1 1 100%; }
  .cv-card__actions { flex-wrap: wrap; }
  /* long unbroken strings (protocol tokens like release_beneficials) wrap instead of forcing width */
  .cv-card__desc, .cv-card__title { overflow-wrap: anywhere; }
}


/* ══════════════════════════════════════════════════════════════════════════
   REDESIGN (Phase 0, 2026-07-26) — LOCKED components. Token-driven, .cv-scoped.
   Ref: docs/design-references/01-LOCKED-patterns-refinements.html — DO NOT DRIFT.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Group-toned card header — subtle workspace tint (wayfinding) ───────────
   Add .cv-card--group-{prod|health|sales|mgmt|mktg|people} to a .cv-card. */
.cv-card--group-prod   > .cv-card__header { background: var(--cv-g-prod-bg); }
.cv-card--group-health > .cv-card__header { background: var(--cv-g-health-bg); }
.cv-card--group-sales  > .cv-card__header { background: var(--cv-g-sales-bg); }
.cv-card--group-mgmt   > .cv-card__header { background: var(--cv-g-mgmt-bg); }
.cv-card--group-mktg   > .cv-card__header { background: var(--cv-g-mktg-bg); }
.cv-card--group-people > .cv-card__header { background: var(--cv-g-people-bg); }
.cv-card--group-prod   > .cv-card__header .cv-card__title { color: var(--cv-g-prod-ink); }
.cv-card--group-health > .cv-card__header .cv-card__title { color: var(--cv-g-health-ink); }
.cv-card--group-sales  > .cv-card__header .cv-card__title { color: var(--cv-g-sales-ink); }
.cv-card--group-mgmt   > .cv-card__header .cv-card__title { color: var(--cv-g-mgmt-ink); }
.cv-card--group-mktg   > .cv-card__header .cv-card__title { color: var(--cv-g-mktg-ink); }
.cv-card--group-people > .cv-card__header .cv-card__title { color: var(--cv-g-people-ink); }

/* ── Status icons (shared) ─────────────────────────────────────────────────
   In-progress SPINNER is the ONE sanctioned motion — active work only. */
.cv-status { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; }
.cv-status-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--cv-warning-bg); border-top-color: var(--cv-warning);
  animation: cv-spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .cv-status-spin { animation: none; } }
.cv-status-ring  { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--cv-accent); }
.cv-status-check { color: var(--cv-success); display: inline-flex; }

/* ── Status-grouped work list (Today feed · task-log · sync queue) ─────────── */
.cv-worklist { display: flex; flex-direction: column; }
.cv-wl-group__label {
  display: flex; align-items: center; gap: var(--cv-space-2);
  font-size: var(--cv-text-xs); font-weight: var(--cv-weight-bold);
  letter-spacing: var(--cv-letter-wider); text-transform: uppercase;
  color: var(--cv-text-3); padding: var(--cv-space-4) 0 var(--cv-space-2);
}
.cv-wl-group__count {
  font-family: var(--cv-font-mono); font-size: var(--cv-text-xs); font-weight: var(--cv-weight-bold);
  color: var(--cv-text-3); background: var(--cv-surface-2); border-radius: var(--cv-radius-sm); padding: 1px 6px;
}
.cv-wl-row {
  display: grid; grid-template-columns: 20px 1fr auto; gap: var(--cv-space-3);
  align-items: center; padding: var(--cv-space-3) 0; border-top: 1px solid var(--cv-border-2);
}
.cv-wl-row__body { min-width: 0; }
.cv-wl-row__title { font-size: var(--cv-text-md); font-weight: var(--cv-weight-medium); letter-spacing: var(--cv-letter-tight); color: var(--cv-text); }
.cv-wl-row__meta  { font-size: var(--cv-text-sm); color: var(--cv-text-2); margin-top: 2px; }
.cv-wl-row__time  { font-size: var(--cv-text-sm); color: var(--cv-text-3); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ── Activity timeline with connectors (case page · activity feeds) ────────── */
.cv-timeline { padding: var(--cv-space-1) 0 0; }
.cv-tl-item {
  display: grid; grid-template-columns: 34px 1fr; gap: var(--cv-space-3);
  position: relative; padding-bottom: var(--cv-space-5);
}
.cv-tl-item:last-child { padding-bottom: 0; }
.cv-tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 16px; top: 30px; bottom: -2px; width: 1px; background: var(--cv-border);
}
.cv-tl-node {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--cv-surface); border: 1px solid var(--cv-border);
  display: grid; place-items: center; color: var(--cv-text-2); z-index: 1;
}
.cv-tl-node--accent { background: var(--cv-accent-bg); border-color: var(--cv-accent-border); color: var(--cv-accent); }
.cv-tl-node--warn   { background: var(--cv-warning-bg); border-color: var(--cv-warning-border); color: var(--cv-warning); }
.cv-tl-content { padding-top: 5px; min-width: 0; }
.cv-tl-content__who  { font-size: var(--cv-text-base); font-weight: var(--cv-weight-semibold); color: var(--cv-text); }
.cv-tl-content__when { font-size: var(--cv-text-sm); color: var(--cv-text-3); }
.cv-tl-content__say  { margin-top: 7px; background: var(--cv-surface); border: 1px solid var(--cv-border); border-radius: var(--cv-radius-md); padding: 9px 12px; font-size: var(--cv-text-base); color: var(--cv-text-2); }
.cv-tl-content__meta { font-size: var(--cv-text-sm); color: var(--cv-text-2); margin-top: 3px; }

/* ── State-driven gate (verify-before-close · dual sign-off · COA gating) ──── */
.cv-gate { border: 1px solid var(--cv-border); border-radius: var(--cv-radius-lg); background: var(--cv-surface); overflow: hidden; }
.cv-gate--ready { border-color: var(--cv-accent-border); }
.cv-gate__head { display: flex; align-items: center; gap: var(--cv-space-3); padding: var(--cv-space-4); }
.cv-gate__ring { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--cv-warning); flex-shrink: 0; display: grid; place-items: center; }
.cv-gate--ready .cv-gate__ring { border-color: var(--cv-success); color: var(--cv-success); }
.cv-gate__title { font-size: var(--cv-text-md); font-weight: var(--cv-weight-semibold); color: var(--cv-text); }
.cv-gate__sub   { font-size: var(--cv-text-sm); color: var(--cv-text-3); margin-top: 2px; }
.cv-gate__row   { display: flex; align-items: center; gap: var(--cv-space-3); padding: var(--cv-space-3) var(--cv-space-4); border-top: 1px solid var(--cv-border-2); font-size: var(--cv-text-base); }
.cv-gate__row--ok   { color: var(--cv-text); } .cv-gate__row--ok .cv-icon   { color: var(--cv-success); }
.cv-gate__row--pend { color: var(--cv-text-2); } .cv-gate__row--pend .cv-icon { color: var(--cv-warning); }
.cv-gate__row-note  { margin-left: auto; font-size: var(--cv-text-xs); color: var(--cv-text-3); font-variant-numeric: tabular-nums; }
.cv-gate__foot  { display: flex; align-items: center; gap: var(--cv-space-3); padding: var(--cv-space-4); border-top: 1px solid var(--cv-border-2); }
.cv-gate__foot-note { font-size: var(--cv-text-sm); color: var(--cv-text-3); }

/* ── Canonical trend pair (cv.trendPair) — BOTH bases, labeled; green-up / rust-down ──────── */
.cv-trendpair { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 8px; align-items: baseline; margin-top: 3px; }
.cv-trendpair--inline { display: inline-flex; justify-content: flex-start; margin-top: 0; margin-left: 6px; }
.cv-trend { display: inline-flex; align-items: baseline; gap: 3px; font-size: var(--cv-text-xs); font-weight: var(--cv-weight-semibold); white-space: nowrap; }
.cv-trend--up   { color: var(--cv-success); }
.cv-trend--down { color: var(--cv-down); }
.cv-trend__basis { font-size: 9px; font-weight: var(--cv-weight-medium); text-transform: uppercase; letter-spacing: .04em; color: var(--cv-text-3); margin-left: 1px; }
