:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f1f3f8;
  --text: #0f1729;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #3b82f6;
  --primary-soft: #eff6ff;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --risk: #ef4444;
  --risk-soft: #fef2f2;
  --sh: 0 1px 3px rgba(0,0,0,.06);
  --sh-lg: 0 4px 20px rgba(0,0,0,.07);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #09090b;
  --surface: #141419;
  --surface-alt: #1c1c24;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --muted: #64748b;
  --border: #1e293b;
  --primary: #60a5fa;
  --primary-soft: rgba(96,165,250,.12);
  --ok: #34d399;
  --ok-soft: rgba(52,211,153,.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251,191,36,.12);
  --risk: #f87171;
  --risk-soft: rgba(248,113,113,.12);
  --sh: 0 1px 3px rgba(0,0,0,.25);
  --sh-lg: 0 4px 20px rgba(0,0,0,.32);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "tnum";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── NAV ─── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(12px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.logo-text { letter-spacing: -.02em; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 22px;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.nav-link:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.nav-link-locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.nav-link-locked:hover {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}

.nav-lock-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 11px;
  line-height: 1;
}

.nav-link-secondary {
  color: var(--muted);
}

.nav-center { flex: 1; display: flex; justify-content: center; min-width: 90px; }

.mode-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: .3s;
}

.mode-badge.performance { background: var(--ok-soft); color: var(--ok); }
.mode-badge.balanced { background: var(--warn-soft); color: var(--warn); }
.mode-badge.recovery { background: var(--risk-soft); color: var(--risk); }

.nav-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-label {
  font-size: 12px;
  color: var(--muted);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: .2s;
}

.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Текущий пользователь в навбаре (единый стиль на всех страницах) */
.auth-user-pill {
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── ЕДИНАЯ СИСТЕМА КНОПОК ───
   Единственное определение .btn / .btn-primary / .btn-ghost / .btn-sm.
   Раньше дублировалось в dialog.css / terminal.css / my.css с расходящимися
   fallback-цветами — теперь источник один, переменные темы без хардкода. */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--sh);
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-lg);
}
.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:not(:disabled):hover { border-color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── LAYOUT ─── */

.dash {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  display: grid;
  gap: 16px;
}

.row-wide {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
}

.row-eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── CARD ─── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--sh);
  transition: box-shadow .2s;
}

.card:hover { box-shadow: var(--sh-lg); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ─── TAGS / BADGES ─── */

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  letter-spacing: .02em;
}

.tag-risk { background: var(--risk-soft); color: var(--risk); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }

/* ─── COO KPI HOME ─── */

.coo-home .dash {
  gap: 14px;
}

.coo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: stretch;
}

.coo-kicker {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.coo-hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.coo-hero p {
  max-width: 760px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}

.coo-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.coo-scorebox {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  text-align: right;
}

.coo-scorebox span,
.coo-scorebox em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.coo-scorebox strong {
  color: var(--risk);
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.coo-scorebox b {
  color: var(--text);
  font-size: 20px;
}

.coo-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.coo-metric {
  min-height: 164px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--sh);
}

.coo-metric-top,
.coo-metric-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.coo-metric-top span {
  color: var(--text-2);
  font-weight: 800;
}

.coo-metric-top b {
  font-weight: 800;
}

.coo-metric.tone-good .coo-metric-top b { color: var(--ok); }
.coo-metric.tone-watch .coo-metric-top b { color: var(--warn); }
.coo-metric.tone-risk .coo-metric-top b { color: var(--risk); }

.coo-metric-main {
  margin: 18px 0 12px;
}

.coo-metric-main strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

.coo-metric-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.coo-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.coo-progress div {
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.coo-metric.tone-good .coo-progress div { background: var(--ok); }
.coo-metric.tone-watch .coo-progress div { background: var(--warn); }
.coo-metric.tone-risk .coo-progress div { background: var(--risk); }

.coo-metric-foot {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.coo-actions-list,
.coo-quality-list {
  display: grid;
  gap: 8px;
}

.coo-actions-list div,
.coo-quality {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.42;
}

.coo-quality {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--warn);
}

.coo-quality.tone-risk {
  border-left-color: var(--risk);
}

.coo-quality b {
  color: var(--text);
}

.coo-quality span {
  color: var(--muted);
}

/* ─── LABEL ─── */

.lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ─── HERO CARD ─── */

.hero {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .45;
  pointer-events: none;
  transition: background .5s;
}

.hero[data-mode="performance"]::before {
  background: radial-gradient(ellipse at 5% 40%, var(--ok-soft), transparent 50%);
}

.hero[data-mode="balanced"]::before {
  background: radial-gradient(ellipse at 5% 40%, var(--warn-soft), transparent 50%);
}

.hero[data-mode="recovery"]::before {
  background: radial-gradient(ellipse at 5% 40%, var(--risk-soft), transparent 50%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  position: relative;
  z-index: 1;
}

/* gauge */

.hero-gauge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gauge {
  position: relative;
  width: 168px;
  height: 168px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 7;
}

.gauge-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 527.79;
  stroke-dashoffset: 527.79;
  transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1), stroke .4s;
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 45%, transparent));
}

.gauge-fill.good { stroke: var(--ok); }
.gauge-fill.watch { stroke: var(--warn); }
.gauge-fill.risk { stroke: var(--risk); }

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.g-score {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
}

.g-score.good { color: var(--ok); }
.g-score.watch { color: var(--warn); }
.g-score.risk { color: var(--risk); }

.g-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.gauge-footer { text-align: center; }

.gauge-caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.g-mode {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.g-mode.performance { color: var(--ok); }
.g-mode.balanced { color: var(--warn); }
.g-mode.recovery { color: var(--risk); }

/* hero info column */

.hero-info-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.info-block { }

.summary {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.focus-box {
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--primary) 20%);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.focus-body {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-2);
}

/* vitals strip */

.vitals-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.vital {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 2px solid var(--border);
  transition: border-color .3s;
}

.vital.tone-good { border-top-color: var(--ok); }
.vital.tone-watch { border-top-color: var(--warn); }
.vital.tone-risk { border-top-color: var(--risk); }

.vital-num {
  font-size: 22px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.vital-lbl {
  font-size: 11px;
  color: var(--muted);
}

.vital-unit {
  font-size: 10px;
  color: var(--muted);
}

.vital-ts .vital-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

/* extended WHOOP strip */

.ext-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.ext-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ext-val { font-weight: 650; color: var(--text); }

/* ─── RITUALS BAR ─── */

.rituals-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ritual {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  line-height: 1.5;
}

.ritual strong { color: var(--text); }

/* ─── DECISION FEED ─── */

.df-list { display: grid; gap: 10px; }

.df-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  transition: border-color .2s, background .2s;
}

.df-item:first-child {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.df-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.df-rank.sig-critical { background: var(--risk); }
.df-rank.sig-at-risk { background: var(--warn); }
.df-rank.sig-schedule { background: var(--primary); }
.df-rank.sig-delegatable { background: var(--ok); }
.df-rank.sig-stable { background: var(--muted); }

.df-body { min-width: 0; }

.df-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.df-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.5;
}

.df-action {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary);
  white-space: nowrap;
  padding-top: 2px;
}

.df-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.df-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--warn), var(--risk));
  transition: width .4s;
}

.df-chips {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.df-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ─── EXECUTIVE PULSE ─── */

.ep-list { display: grid; gap: 10px; }

.ep-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}

.ep-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ep-label {
  font-size: 12px;
  color: var(--text-2);
}

.ep-value {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.ep-value.good { color: var(--ok); }
.ep-value.watch { color: var(--warn); }
.ep-value.risk { color: var(--risk); }

.ep-bar {
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.ep-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .4s;
}

.ep-bar-fill.good { background: var(--ok); }
.ep-bar-fill.watch { background: var(--warn); }
.ep-bar-fill.risk { background: var(--risk); }

.ep-hint {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── KPI ─── */

.kpi-list { display: grid; gap: 10px; }

.kpi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}

.kpi-left { min-width: 0; }

.kpi-domain {
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.kpi-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.kpi-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.kpi-num {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.02em;
}

/* ─── PROJECTS ─── */

.proj-list { display: grid; gap: 10px; }

.proj-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.proj-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.proj-priority {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.proj-name {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.proj-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proj-pill {
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.proj-pill.st-ok { background: var(--ok-soft); color: var(--ok); }
.proj-pill.st-warn { background: var(--warn-soft); color: var(--warn); }
.proj-pill.st-risk { background: var(--risk-soft); color: var(--risk); }

/* ─── DEADLINES TABLE ─── */

.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl thead th {
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tbl tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-alt); }

.tbl .r { text-align: right; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.pill-risk { background: var(--risk-soft); color: var(--risk); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }

.row-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--risk);
}

/* ─── RESPONSIVE ─── */

@media (max-width: 1100px) {
  .nav-inner { height: auto; min-height: 52px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
  .nav-menu { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
  .nav-center { justify-content: flex-end; }
  .hero-grid { grid-template-columns: 1fr; justify-items: center; }
  .hero-info-col { align-items: stretch; }
  .row-wide, .row-eq { grid-template-columns: 1fr; }
  .coo-hero { grid-template-columns: 1fr; }
  .coo-scorebox { text-align: left; }
  .coo-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vitals-strip { grid-template-columns: repeat(3, 1fr); }
  .rituals-bar { grid-template-columns: 1fr; }
  .tf-row-compact { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .dash { padding: 12px 14px 32px; gap: 12px; }
  .nav-inner { padding: 0 14px; }
  .nav-menu { gap: 6px; }
  .nav-link { font-size: 12px; padding: 6px 8px; }
  .nav-link-secondary, .sync-label { display: none; }
  .hero { padding: 16px; }
  .coo-hero h1 { font-size: 24px; }
  .coo-metrics-grid { grid-template-columns: 1fr; }
  .coo-metric-main strong { font-size: 21px; }
  .vitals-strip { grid-template-columns: repeat(2, 1fr); }
  .gauge { width: 140px; height: 140px; }
  .g-score { font-size: 36px; }
  .tbl-wrap { overflow-x: auto; }
  .task-controls { flex-wrap: wrap; }
  .tf-row-compact { grid-template-columns: 1fr; }
}

/* ─── TASK MANAGEMENT ─── */

.task-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-filters {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 3px;
}

.filter-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
}

.filter-pill:hover { color: var(--text); }

.filter-pill.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.btn-add {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}

.btn-add:hover { opacity: .88; }

/* ── Task Form ── */

.task-form {
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 3%, var(--surface));
  animation: fadeUp .25s ease both;
}

.tf-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.tf-row:last-child { margin-bottom: 0; }

.tf-row-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tf-field { display: flex; flex-direction: column; gap: 4px; }
.tf-title-wrap { flex: 1; }

.tf-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.tf-input-voice {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.tf-input-voice input {
  flex: 1;
  min-width: 0;
  border-radius: 8px 0 0 8px;
}

.tf-field input,
.tf-field select,
.tf-field textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.tf-field input:focus,
.tf-field select:focus,
.tf-field textarea:focus {
  border-color: var(--primary);
}

.tf-field textarea { resize: vertical; }

/* ── Voice Button ── */

.btn-voice {
  width: 38px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--surface-alt);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .2s;
}

.btn-voice:hover { color: var(--primary); background: var(--primary-soft); }

.btn-voice.listening {
  background: var(--risk-soft);
  color: var(--risk);
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.25); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,.08); }
}

.voice-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  transition: .2s;
}

.voice-status.active { color: var(--primary); }

/* ── Form Actions ── */

.tf-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-save {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: .15s;
}

.btn-save:hover { opacity: .88; }

.btn-cancel {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: .15s;
}

.btn-cancel:hover { border-color: var(--text-2); }

/* ── Task List ── */

.task-list { display: grid; gap: 6px; }

/* ── Meeting Inbox (pending_review) ── */
.inbox-hint {
  font-size: 12px;
  color: var(--text-2);
  margin: -4px 0 12px 0;
  line-height: 1.4;
}

.task-card.task-inbox {
  grid-template-columns: 1fr 68px;
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.task-card.task-inbox:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

.task-src-wrap {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 3px;
  flex-wrap: wrap;
}

.task-src {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.task-src:hover { text-decoration: underline; }

.task-owner {
  font-size: 12px;
  color: var(--text-2);
}

.task-quote {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inbox-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.inbox-actions .btn-check,
.inbox-actions .btn-edit {
  width: 28px;
  height: 28px;
}

.task-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.task-card {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  transition: border-color .2s, background .2s, opacity .3s;
}

.task-card:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary) 2%, var(--surface));
}

.task-card.task-done { opacity: .55; }
.task-card.task-done .task-title { text-decoration: line-through; }

.btn-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  transition: .2s;
  flex-shrink: 0;
}

.btn-check:hover {
  border-color: var(--ok);
  color: var(--ok);
}

.btn-check.checked {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.task-body { min-width: 0; }

.task-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.task-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.task-domain, .task-priority, .task-due {
  font-size: 11px;
  color: var(--muted);
}

.task-priority { font-weight: 600; color: var(--primary); }
.task-due { color: var(--text-2); }

.pill-primary { background: var(--primary-soft); color: var(--primary); }
.pill-muted { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }
.pill-done { background: var(--ok-soft); color: var(--ok); }

.btn-edit {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: .2s;
}

.btn-edit:hover { border-color: var(--primary); color: var(--primary); }

/* ─── ANIMATIONS ─── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeUp .35s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
.row-wide { animation: fadeUp .35s ease .06s both; }
.row-eq { animation: fadeUp .35s ease .12s both; }

/* ===================================================================
 * WHOOP Live — FAB + full-screen overlay (BLE 1 Hz HR + cloud metrics)
 * =================================================================== */

.whoop-live-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  box-shadow: 0 10px 28px rgba(239, 68, 68, .42), 0 2px 6px rgba(0, 0, 0, .12);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.whoop-live-fab:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 14px 36px rgba(239, 68, 68, .5); }
.whoop-live-fab:active { transform: translateY(0) scale(.98); }
.whoop-live-fab .fab-label { position: relative; z-index: 1; }
.whoop-live-fab .fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .55);
  pointer-events: none;
}
.whoop-live-fab[data-state="live"] .fab-pulse { animation: wlPulse 1.6s ease-out infinite; }
.whoop-live-fab[data-state="live"] {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

@keyframes wlPulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  70%  { box-shadow: 0 0 0 22px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.whoop-live-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: color-mix(in srgb, var(--bg) 92%, #000 30%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  animation: wlFade .25s ease both;
}
.whoop-live-overlay[data-open="1"] { display: grid; place-items: stretch; }

@keyframes wlFade {
  from { opacity: 0; } to { opacity: 1; }
}

.wl-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  width: min(1200px, 100%);
  height: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--sh-lg);
  padding: 22px 26px;
  overflow: hidden;
}

.wl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.wl-head-left { display: flex; align-items: center; gap: 12px; }
.wl-head-right { display: flex; align-items: center; gap: 12px; }

.wl-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--text);
}

.wl-ble-status {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-2);
}
.wl-ble-status[data-state="scanning"],
.wl-ble-status[data-state="connecting"] {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  background: var(--warn-soft);
}
.wl-ble-status[data-state="connected"] {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--border));
  background: var(--ok-soft);
}
.wl-ble-status[data-state="unavailable"],
.wl-ble-status[data-state="disconnected"],
.wl-ble-status[data-state="error"] {
  color: var(--risk);
  border-color: color-mix(in srgb, var(--risk) 40%, var(--border));
  background: var(--risk-soft);
}

.wl-session-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  padding: 5px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.wl-cloud-status {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.wl-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
}
.wl-close:hover { border-color: var(--risk); color: var(--risk); }

.wl-main {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto auto;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.wl-hr-hero {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg,
    color-mix(in srgb, #ef4444 8%, var(--surface)),
    var(--surface));
  padding: 18px 22px 8px;
  overflow: hidden;
}
.wl-hr-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.wl-hr-value {
  font-size: 88px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 2px 6px rgba(239, 68, 68, .10);
}
.wl-hr-unit { font-size: 20px; color: var(--text-2); font-weight: 600; }
.wl-hr-zone {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.wl-hr-zone[data-zone="1"] { color: #1d4ed8; background: color-mix(in srgb, #1d4ed8 12%, var(--surface)); border-color: color-mix(in srgb, #1d4ed8 30%, var(--border)); }
.wl-hr-zone[data-zone="2"] { color: #0891b2; background: color-mix(in srgb, #0891b2 12%, var(--surface)); border-color: color-mix(in srgb, #0891b2 30%, var(--border)); }
.wl-hr-zone[data-zone="3"] { color: #10b981; background: color-mix(in srgb, #10b981 14%, var(--surface)); border-color: color-mix(in srgb, #10b981 30%, var(--border)); }
.wl-hr-zone[data-zone="4"] { color: #f59e0b; background: color-mix(in srgb, #f59e0b 15%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 35%, var(--border)); }
.wl-hr-zone[data-zone="5"] { color: #ef4444; background: color-mix(in srgb, #ef4444 15%, var(--surface)); border-color: color-mix(in srgb, #ef4444 40%, var(--border)); }

.wl-hr-canvas {
  width: 100%;
  height: 260px;
  display: block;
  border-radius: 10px;
}

.wl-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.wl-tile {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}
.wl-tile-lbl { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; grid-column: 1 / -1; }
.wl-tile-val { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.wl-tile-unit { font-size: 12px; color: var(--text-2); align-self: end; padding-bottom: 4px; }

.wl-alerts {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 12px 14px;
}
.wl-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-2);
}
.wl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.wl-alerts-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.wl-alerts-list li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  animation: wlAlertIn .3s ease both;
}
.wl-alerts-list li.wl-alerts-empty {
  color: var(--text-2);
  background: transparent;
  border: 1px dashed var(--border);
  font-size: 12px;
  grid-template-columns: 1fr;
  justify-content: center;
  text-align: center;
}
.wl-alerts-list li[data-level="warn"] { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-soft); }
.wl-alerts-list li[data-level="alert"] { border-color: color-mix(in srgb, var(--risk) 50%, var(--border)); background: var(--risk-soft); }

@keyframes wlAlertIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wl-alert-level { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.wl-alert-level[data-level="warn"] { color: var(--warn); }
.wl-alert-level[data-level="alert"] { color: var(--risk); }
.wl-alert-time { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11px; }

.wl-foot {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wl-hint { opacity: 0.85; }

.nav-link .nav-ico{display:inline-block;vertical-align:-3px;margin-right:5px;opacity:.95}
