/* ============================================================
   Evolute Project Management — shared stylesheet
   Design system: "Workbook" — light paper, deep-navy accents,
   numbered sidebar, eyebrow kickers, soft elevation. Hierarchy
   via weight + colour + crisp hairline borders on white.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* === DESIGN TOKENS === */
:root {
  --bg:          #ffffff;
  --bg-grad:     linear-gradient(180deg, #fbfbfa 0%, #f5f6f7 100%);
  --bg-nav:      rgba(255,255,255,.86);
  --panel:       #ffffff;
  --panel-hi:    #f4f6f8;
  --panel-hover: #f2f4f6;
  --border:      rgba(22,33,49,.10);
  --border-md:   rgba(22,33,49,.16);
  --border-hi:   rgba(22,33,49,.30);
  --text:        #18222f;            /* deep slate ink */
  --text-2:      #4c5765;
  --text-3:      #8a94a2;
  --accent:      #2a3a55;            /* deep navy */
  --accent-hi:   #35496b;
  --accent-ink:  #ffffff;
  --accent-dim:  rgba(42,58,85,.08);
  --todo:        #6c7787;
  --todo-dim:    rgba(108,119,135,.10);
  --active:      #2f6fb0;            /* in progress — blue */
  --active-dim:  rgba(47,111,176,.10);
  --done:        #2f8f63;            /* done — green */
  --done-dim:    rgba(47,143,99,.11);
  --blocked:     #c75b45;            /* blocked — coral */
  --blocked-dim: rgba(199,91,69,.10);
  --radius:      10px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --nav-w:       248px;
  --header-h:    56px;
  --shadow:      0 1px 2px rgba(16,24,40,.04), 0 12px 28px -20px rgba(16,24,40,.28);
  --font-head:   'Space Grotesk', system-ui, sans-serif;
  --font-body:   'Inter', system-ui, sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}
/* fixed light paper ground */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background: var(--bg-grad);
}
a { color: inherit; text-decoration: none; }

/* === TOPBAR === */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h); z-index: 100;
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--bg-nav);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar-brand {
  width: var(--nav-w); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  border-right: 1px solid var(--border);
  font-family: var(--font-head); font-size: 17px; font-weight: 600; letter-spacing: -.02em;
  text-transform: lowercase; color: var(--text);
}
.topbar-brand .mark, .pw-brand .mark, .landing .brand .mark {
  width: 15px; height: 15px; border-radius: 4px;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.topbar-meta {
  flex: 1; display: flex; align-items: center;
  padding: 0 30px; gap: 26px;
  font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3);
}
.topbar-meta span + span::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); opacity: .5; margin-right: 26px; vertical-align: middle; }
#nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: none; border: none; cursor: pointer; flex-shrink: 0;
}
#nav-toggle-bar, #nav-toggle-bar::before, #nav-toggle-bar::after {
  display: block; width: 20px; height: 1.5px; border-radius: 2px;
  background: var(--text); position: relative;
}
#nav-toggle-bar::before, #nav-toggle-bar::after { content: ''; position: absolute; left: 0; }
#nav-toggle-bar::before { top: -6px; }
#nav-toggle-bar::after  { top:  6px; }

/* === SIDEBAR === */
.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--nav-w); background: var(--bg-nav);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 90; overflow-y: auto;
}
.sidebar-head { padding: 32px 24px 26px; border-bottom: 1px solid var(--border); }
.sidebar-eyebrow {
  font-family: var(--font-head); font-size: 9px; font-weight: 500;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}
.sidebar-title { font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--text); }
.sidebar-title small { display: block; color: var(--text-3); font-size: 12px; font-family: var(--font-body); margin-top: 4px; line-height: 1.5; }
nav { flex: 1; padding: 12px 12px; }
nav a {
  display: grid; grid-template-columns: 26px 1fr auto;
  align-items: center; gap: 9px;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-3);
  transition: background .14s, color .14s, transform .14s;
}
nav a:hover { background: var(--panel-hover); color: var(--text-2); }
nav a.active { background: var(--panel-hi); color: var(--text); }
nav a .nr { font-family: var(--font-head); font-size: 10px; font-weight: 500; letter-spacing: .04em; color: var(--text-3); }
nav a.active .nr { color: var(--accent); }
nav a .pill {
  font-family: var(--font-head); font-size: 8.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 7px; border-radius: 20px;
}
nav a .pill.local { color: var(--text-3); background: var(--todo-dim); }
.sidebar-foot {
  padding: 18px 24px 22px; border-top: 1px solid var(--border);
  font-size: 10.5px; color: var(--text-3); line-height: 1.55;
}
.prog-line { height: 3px; border-radius: 3px; background: var(--border); margin-bottom: 14px; position: relative; overflow: hidden; }
.prog-line span { position: absolute; left: 0; top: 0; height: 3px; width: 4%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* === MAIN === */
main { margin-left: var(--nav-w); padding-top: var(--header-h); }
.section { padding: 78px 76px 84px; display: none; }
.section.active { display: block; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.kicker {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--font-head); font-size: 9.5px; font-weight: 500;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 44px;
}
.kicker::after { content: ''; flex: 1; height: 1px; background: var(--border-md); }

h1, h2, h3, h4 {
  font-family: var(--font-head); font-weight: 500;
  letter-spacing: -.02em; line-height: 1.12; color: var(--text);
}
h1 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 600; max-width: 660px; }
h2 { font-size: clamp(23px, 2.5vw, 31px); max-width: 700px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
p  { color: var(--text-2); line-height: 1.72; }
.lead { font-size: 15px; max-width: 680px; color: var(--text-2); margin-top: 22px; line-height: 1.76; }

/* === KPI ROW === */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; max-width: 880px; }
.kpi { padding: 24px 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.kpi-val { font-family: var(--font-head); font-size: 30px; font-weight: 600; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.kpi-lbl { font-size: 12px; color: var(--text-3); margin-top: 11px; }

/* === OVERVIEW: FACTS ROW === */
.facts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 26px; max-width: 880px; }
.facts .fact { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: baseline; }
.facts .fact b { font-family: var(--font-head); font-weight: 500; font-size: 12.5px; color: var(--text); }
.facts .fact span::before { content: '·'; color: var(--text-3); margin: 0 8px; }

/* === OVERVIEW: PROGRESS BANNER === */
.hero-banner {
  margin-top: 30px; max-width: 880px;
  background: linear-gradient(135deg, #20304a 0%, #131d2c 100%);
  border-radius: var(--radius-lg); padding: 26px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  box-shadow: 0 20px 44px -28px rgba(16,24,40,.55);
}
.hb-label { font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.52); margin-bottom: 13px; }
.hb-figure { font-family: var(--font-head); font-size: 40px; font-weight: 600; letter-spacing: -.03em; color: #fff; line-height: 1; }
.hb-of { color: rgba(255,255,255,.38); font-size: 23px; font-weight: 500; }
.hb-bar { margin-top: 18px; height: 6px; width: min(440px, 46vw); border-radius: 6px; background: rgba(255,255,255,.13); overflow: hidden; }
.hb-bar span { display: block; height: 100%; background: var(--active); border-radius: 6px; transition: width .5s ease; }
.hb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; flex-shrink: 0; }
.hb-due { font-family: var(--font-head); font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); text-align: right; }
.hb-due span { display: block; font-size: 9px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.42); margin-bottom: 4px; }
.hero-banner .status { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.07); }
.hero-banner .status.todo { color: #aeb8c6; }

/* === OVERVIEW: UPCOMING === */
.up-head { font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin: 40px 0 10px; }
.upcoming { max-width: 880px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.up-row { display: grid; grid-template-columns: 156px 1fr auto; align-items: center; gap: 16px; padding: 15px 20px; border-top: 1px solid var(--border); }
.up-row:first-child { border-top: none; }
.up-when { font-family: var(--font-head); font-size: 12.5px; font-weight: 500; color: var(--text); }
.up-title { font-size: 13.5px; color: var(--text-2); }
.up-owner { font-size: 11px; color: var(--text-3); font-family: var(--font-head); font-weight: 500; letter-spacing: .02em; }

/* === OVERVIEW BLOCKS (scope / teams / deal) === */
.ov-root { max-width: 920px; }
.ov-block { margin-top: 46px; }
.ov-block:first-child { margin-top: 30px; }
.ov-head { font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }

/* inline editing */
.editable { border-radius: 4px; padding: 0 2px; margin: 0 -2px; outline: none; cursor: text; transition: background .12s, box-shadow .12s; }
.editable:hover { background: var(--accent-dim); }
.editable:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.editable.block { display: block; }
.editable:empty::before { content: 'Add…'; color: var(--text-3); }

.ov-scope-text { font-size: 15px; line-height: 1.76; color: var(--text-2); max-width: 720px; }

/* phase cards */
.phase-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.phase-card { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: border-color .16s, transform .16s; }
.phase-card.active { background: linear-gradient(150deg, #20304a 0%, #131d2c 100%); border-color: transparent; box-shadow: 0 18px 40px -26px rgba(16,24,40,.5); }
.ph-step { font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.phase-card.active .ph-step { color: rgba(255,255,255,.5); }
.ph-name { font-family: var(--font-head); font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--text); }
.phase-card.active .ph-name { color: #fff; }
.ph-desc { font-size: 12.5px; line-height: 1.55; color: var(--text-2); margin-top: 8px; flex: 1; }
.phase-card.active .ph-desc { color: rgba(255,255,255,.7); }
.ph-current { margin-top: 16px; font-family: var(--font-head); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #fff; display: flex; align-items: center; gap: 7px; }
.ph-current::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--active); box-shadow: 0 0 0 3px rgba(127,176,224,.25); }
.ph-set { margin-top: 16px; align-self: flex-start; appearance: none; background: transparent; border: 1px solid var(--border-md); color: var(--text-2); font-family: var(--font-head); font-size: 11px; font-weight: 500; padding: 7px 12px; border-radius: 20px; cursor: pointer; transition: background .14s, color .14s, border-color .14s; }
.ph-set:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.editable.block:hover, .phase-card.active .editable:hover { background: rgba(255,255,255,.12); }
.phase-card.active .editable:focus { background: #fff; color: var(--text); }

/* teams (both sides) */
.teams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.team-side { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.ts-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ts-label { font-family: var(--font-head); font-size: 16px; font-weight: 500; color: var(--text); }
.ts-sub { font-size: 10px; font-family: var(--font-head); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.team-list { list-style: none; }
.tm { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 13px 0; border-top: 1px solid var(--border); }
.tm:first-child { border-top: none; }
.tm-name { font-family: var(--font-head); font-size: 13.5px; font-weight: 500; color: var(--text); }
.tm-role { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.tm-del { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 6px; opacity: 0; transition: opacity .14s, color .14s, background .14s; }
.tm:hover .tm-del { opacity: 1; }
.tm-del:hover { color: var(--blocked); background: var(--blocked-dim); }
.tm-add { margin-top: 14px; appearance: none; background: transparent; border: 1px dashed var(--border-md); color: var(--text-2); font-family: var(--font-head); font-size: 11.5px; font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; width: 100%; transition: background .14s, border-color .14s, color .14s; }
.tm-add:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* deal terms */
.deal-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.deal-logo { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border-md); background: var(--panel-hi); overflow: hidden; cursor: pointer; flex-shrink: 0; padding: 0; display: flex; align-items: center; justify-content: center; transition: border-color .14s; }
.deal-logo:hover { border-color: var(--accent); }
.deal-logo-img { width: 100%; height: 100%; object-fit: cover; }
.deal-logo-init { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--accent); }
.deal-co-name { font-family: var(--font-head); font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.deal-co-sub { font-size: 10px; font-family: var(--font-head); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.deal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.deal-stat { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.ds-lbl { font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.ds-val { font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.deal-terms { margin-top: 14px; border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.deal-terms p { font-size: 13px; color: var(--text-2); line-height: 1.65; }

/* save indicator */
.save-pill { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(8px); z-index: 300; opacity: 0; pointer-events: none; font-family: var(--font-head); font-size: 11px; font-weight: 500; letter-spacing: .04em; padding: 8px 16px; border-radius: 20px; background: var(--text); color: #fff; box-shadow: 0 12px 30px -12px rgba(16,24,40,.5); transition: opacity .2s, transform .2s; }
.save-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.save-pill.saved { background: var(--done); }
.save-pill.err { background: var(--blocked); }

/* === CARDS === */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 44px; max-width: 920px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; max-width: 880px; }
.card { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: transform .16s, border-color .16s; }
.card:hover { transform: translateY(-2px); border-color: var(--border-md); }
.card.hi { background: var(--panel-hi); border-color: var(--border-md); }
.card-lbl { font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.card-name { font-family: var(--font-head); font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: var(--text); }
.card-role { font-size: 12px; color: var(--text-2); margin-top: 6px; margin-bottom: 16px; }
ul.clean { list-style: none; }
ul.clean li { border-top: 1px solid var(--border); padding: 9px 0; font-size: 12.5px; color: var(--text-2); }
ul.clean li:first-child { border-top: none; }

/* === TABS === */
.tabs { margin-top: 36px; max-width: 940px; }
.tab-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.tab-btns button {
  appearance: none; background: var(--panel); border: 1px solid var(--border);
  color: var(--text-3); font-family: var(--font-head); font-weight: 500; font-size: 12px;
  padding: 9px 16px; cursor: pointer; border-radius: 20px;
  transition: color .14s, background .14s, border-color .14s;
}
.tab-btns button:hover { color: var(--text-2); }
.tab-btns button.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise .35s ease both; }

/* === MATRIX TABLE === */
.matrix-wrap { margin-top: 8px; max-width: 940px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
table.matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.matrix th {
  font-family: var(--font-head); font-weight: 500; text-align: left;
  color: var(--text-3); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 16px; border-bottom: 1px solid var(--border-md); background: var(--panel);
}
table.matrix td { padding: 15px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; color: var(--text-2); }
table.matrix tr:last-child td { border-bottom: none; }
table.matrix td:first-child { color: var(--text); font-family: var(--font-head); font-weight: 500; font-size: 13.5px; }
table.matrix td strong { display: block; color: var(--text); font-weight: 500; font-family: var(--font-head); margin-bottom: 3px; }
table.matrix td small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* === ROADMAP === */
.roadmap-wrap { margin-top: 36px; max-width: 1000px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.roadmap { width: 100%; border-collapse: separate; border-spacing: 6px; }
table.roadmap th {
  font-family: var(--font-head); font-weight: 500; text-align: left;
  color: var(--text-3); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  padding: 4px 10px 10px;
}
table.roadmap td { padding: 0; vertical-align: top; }
table.roadmap td:first-child { color: var(--text); font-family: var(--font-head); font-weight: 500; font-size: 13px; white-space: nowrap; padding-right: 16px; vertical-align: middle; }
.plan-block { padding: 11px 12px; font-size: 11.5px; line-height: 1.4; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text-2); }
.plan-block.active  { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.plan-block.accent  { border-color: rgba(200,195,181,.4); background: var(--accent-dim); color: var(--accent); }
.plan-block.info    { border-color: rgba(127,176,224,.4); background: var(--active-dim); color: var(--active); }
.plan-block.good    { border-color: rgba(134,201,168,.4); background: var(--done-dim); color: var(--done); }
.plan-block.warn    { border-color: rgba(231,155,138,.4); background: var(--blocked-dim); color: var(--blocked); }
.plan-block.neutral { border-color: var(--border); background: var(--panel-hi); color: var(--text-3); }

/* === STATUS BADGES === */
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 20px; border: 1px solid; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.todo    { color: var(--todo);    border-color: rgba(148,160,173,.35); background: var(--todo-dim); }
.status.active  { color: var(--active);  border-color: rgba(127,176,224,.4);  background: var(--active-dim); }
.status.done    { color: var(--done);    border-color: rgba(134,201,168,.4);  background: var(--done-dim); }
.status.blocked { color: var(--blocked); border-color: rgba(231,155,138,.4);  background: var(--blocked-dim); }
/* priority chips */
.prio { display: inline-block; font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-3); white-space: nowrap; }
.prio.high   { color: var(--accent);  border-color: rgba(200,195,181,.4); }
.prio.normal { color: var(--text-2); }
.prio.low    { color: var(--text-3); }

/* === INPUTS === */
input, textarea, select {
  width: 100%; background: #fff; border: 1px solid var(--border-md);
  color: var(--text); padding: 12px 14px; border-radius: var(--radius);
  font: 400 14px var(--font-body); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 92px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237E8A98' stroke-width='1.4' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.btn {
  appearance: none; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 18px; cursor: pointer; border-radius: var(--radius);
  font-family: var(--font-head); font-size: 13px; font-weight: 500;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-hi); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border-md); }
.btn.ghost:hover { background: var(--panel-hover); color: var(--text); }

/* === TASK BOARD (live) === */
.board-status { font-family: var(--font-head); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-top: 22px; display: flex; align-items: center; gap: 9px; }
.board-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.board-status.live::before { background: var(--done); box-shadow: 0 0 0 3px var(--done-dim); }
.board-status b { color: var(--text); font-weight: 500; }
.board-form { max-width: 680px; margin-top: 22px; display: grid; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); padding: 22px; box-shadow: var(--shadow); }
.board-form .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.board-form .btn { justify-self: start; }

/* board bar: summary + view toggle */
.board-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.view-toggle { display: inline-flex; border: 1px solid var(--border-md); border-radius: 20px; padding: 3px; background: var(--panel); }
.view-toggle button { appearance: none; border: none; background: none; cursor: pointer; font-family: var(--font-head); font-size: 12px; font-weight: 500; color: var(--text-3); padding: 6px 16px; border-radius: 16px; transition: background .14s, color .14s; }
.view-toggle button.active { background: var(--accent); color: #fff; }

/* status summary counters */
.board-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0; }
.summary-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel); font-size: 12px; color: var(--text-2); }
.summary-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.summary-pill b { font-family: var(--font-head); color: var(--text); font-weight: 600; }
.dot.todo { background: var(--todo); } .dot.active { background: var(--active); } .dot.done { background: var(--done); } .dot.blocked { background: var(--blocked); }

.board-list { max-width: 820px; margin-top: 16px; display: grid; gap: 10px; }
.task-item { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 16px 18px; position: relative; box-shadow: var(--shadow); transition: border-color .16s; }
.task-item:hover { border-color: var(--border-md); }
.task-item.s-done { opacity: .72; }
.task-item .ti-title { font-family: var(--font-head); font-size: 14.5px; font-weight: 500; color: var(--text); margin-bottom: 6px; padding-right: 28px; }
.task-item.s-done .ti-title { text-decoration: line-through; text-decoration-color: var(--text-3); }
.task-item .ti-note { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 11px; white-space: pre-wrap; }
.task-item .ti-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.task-item .ti-meta .sep { opacity: .4; }
.task-item .ti-status-btn { background: none; border: none; padding: 0; cursor: pointer; }
.task-item .ti-del {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 3px; border-radius: 6px; transition: color .15s, background .15s;
}
.task-item .ti-del:hover { color: var(--blocked); background: var(--blocked-dim); }
.board-empty { font-size: 13px; color: var(--text-3); padding: 18px 0; }

/* === KANBAN === */
.board-kanban { margin-top: 16px; }
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kan-col { background: var(--panel-hi); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 80px; }
.kan-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--text-2); padding: 4px 6px 12px; text-transform: uppercase; }
.kan-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kan-head b { margin-left: auto; font-weight: 600; color: var(--text-3); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; font-size: 10.5px; }
.kan-cards { display: grid; gap: 10px; }
.kan-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--todo); border-radius: var(--radius-sm); padding: 13px 14px; box-shadow: var(--shadow); transition: border-color .14s, transform .14s; }
.kan-card:hover { transform: translateY(-1px); }
.kan-card.s-todo    { border-left-color: var(--todo); }
.kan-card.s-active  { border-left-color: var(--active); }
.kan-card.s-done    { border-left-color: var(--done); opacity: .78; }
.kan-card.s-blocked { border-left-color: var(--blocked); }
.kan-card.high { box-shadow: var(--shadow), 0 0 0 1px var(--accent-dim); }
.kan-title { font-family: var(--font-head); font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35; padding-right: 20px; }
.kan-card.s-done .kan-title { text-decoration: line-through; text-decoration-color: var(--text-3); }
.kan-note { font-size: 11.5px; color: var(--text-2); line-height: 1.5; margin-top: 6px; white-space: pre-wrap; }
.kan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 11px; font-size: 10.5px; color: var(--text-3); }
.kan-meta .ti-status-btn { background: none; border: none; padding: 0; cursor: pointer; }
.kan-card .ti-del { position: absolute; top: 9px; right: 9px; background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 12px; line-height: 1; padding: 2px; border-radius: 5px; opacity: 0; transition: opacity .14s, color .14s, background .14s; }
.kan-card:hover .ti-del { opacity: 1; }
.kan-card .ti-del:hover { color: var(--blocked); background: var(--blocked-dim); }
.kan-empty { font-size: 11.5px; color: var(--text-3); padding: 10px 6px; }

/* === PASSWORD GATE === */
#pw-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-grad);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 32px;
}
#pw-gate::before {
  content: ''; position: absolute; left: 50%; top: 22%; width: 860px; height: 860px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(42,58,85,.05) 0%, rgba(42,58,85,0) 62%); pointer-events: none;
}
#pw-gate .pw-brand { font-family: var(--font-head); font-size: 24px; font-weight: 600; letter-spacing: -.02em; text-transform: lowercase; color: var(--text); margin-bottom: 44px; display: flex; align-items: center; gap: 12px; z-index: 1; }
#pw-box {
  position: relative; z-index: 1;
  border: 1px solid var(--border-md); background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 34px 38px 30px; display: flex; flex-direction: column; gap: 14px; width: 320px;
  box-shadow: 0 30px 80px -34px rgba(16,24,40,.35);
  animation: rise .6s ease both;
}
#pw-label { font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--text-3); }
#pw-input {
  background: #fff; border: 1px solid var(--border-md);
  color: var(--text); padding: 13px 15px; border-radius: var(--radius);
  font: 400 15px var(--font-body); letter-spacing: .04em; outline: none; width: 100%;
}
#pw-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
#pw-input.shake { animation: shake .35s ease; border-color: var(--blocked); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
#pw-submit {
  appearance: none; background: var(--accent); border: none; color: var(--accent-ink);
  padding: 13px; font: 500 13px var(--font-head); border-radius: var(--radius);
  cursor: pointer; letter-spacing: .04em; transition: background .15s, transform .15s;
}
#pw-submit:hover { background: var(--accent-hi); transform: translateY(-1px); }
#pw-error { font-size: 11.5px; color: var(--blocked); min-height: 14px; }

/* === GENERIC BLOCKS (cfg.sections) === */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-top: 44px; max-width: 1000px; }
.card-text { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 4px 0 14px; }
.cards-grid .card-lbl  { min-height: 2.4em; }
.cards-grid .card-name { min-height: 2.2em; }
.cards-grid .card-role { min-height: 2.6em; }

/* versus */
.versus { margin-top: 44px; max-width: 940px; border: 1px solid var(--border-md); border-radius: var(--radius); overflow: hidden; }
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; border-bottom: 1px solid var(--border-md); }
.vs-pole { padding: 20px 24px; font-family: var(--font-head); font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.vs-pole small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 300; letter-spacing: 0; color: var(--text-3); margin-top: 5px; }
.vs-pole-l { color: var(--active); background: var(--active-dim); }
.vs-pole-r { color: var(--accent); background: var(--accent-dim); text-align: right; }
.vs-axis-lbl { display: flex; align-items: center; padding: 0 16px; font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; border-bottom: 1px solid var(--border); }
.vs-row:last-child { border-bottom: none; }
.vs-side { padding: 15px 24px; font-size: 12.5px; line-height: 1.5; display: flex; align-items: center; }
.vs-l { color: var(--active); justify-content: flex-end; text-align: right; }
.vs-r { color: var(--accent); }
.vs-attr { min-width: 168px; padding: 12px 16px; text-align: center; font-family: var(--font-head); font-size: 9.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); border-left: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }

/* prose */
.prose { max-width: 700px; margin-top: 40px; }
.prose-p { font-size: 15px; line-height: 1.8; color: var(--text-2); }
.prose-p + .prose-p { margin-top: 18px; }

/* statement */
.statement { list-style: none; max-width: 780px; margin-top: 44px; }
.statement li { border-top: 1px solid var(--border); padding: 26px 0; }
.statement li:first-child { border-top: none; }
.statement li strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: clamp(18px,1.9vw,23px); letter-spacing: -.02em; line-height: 1.25; color: var(--text); }
.statement li span { display: block; margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--text-2); }

/* timeline */
.timeline { margin-top: 44px; max-width: 780px; }
.tl-item { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); position: relative; }
.tl-item:last-child { border-bottom: none; }
.tl-when { font-family: var(--font-head); font-size: 13px; font-weight: 500; letter-spacing: .01em; color: var(--accent); }
.tl-title { font-family: var(--font-head); font-size: 16px; font-weight: 500; letter-spacing: -.01em; color: var(--text); }
.tl-text { font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 6px; }

/* tags / chips */
.tags { margin-top: 40px; max-width: 840px; }
.tag-group { margin-bottom: 24px; }
.tag-group-lbl { font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { font-family: var(--font-head); font-size: 12px; font-weight: 400; letter-spacing: -.01em; color: var(--text-2); border: 1px solid var(--border-md); background: var(--panel); padding: 8px 14px; border-radius: 20px; }

/* numbered list */
.num-list { list-style: none; margin-top: 40px; max-width: 740px; }
.num-item { display: grid; grid-template-columns: 42px 1fr; gap: 18px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--border); }
.num-item:last-child { border-bottom: none; }
.num-item .num { font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--accent); }
.num-title { font-family: var(--font-head); font-size: 16px; font-weight: 500; letter-spacing: -.01em; color: var(--text); }
.num-text { font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 5px; }

/* columns */
.cols { display: grid; gap: 16px; margin-top: 44px; max-width: 1000px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.cols-4 { grid-template-columns: repeat(4,1fr); }
.col { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.col.hi { background: var(--panel-hi); border-color: var(--border-md); }
.col-lbl { font-family: var(--font-head); font-size: 9px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.col-title { font-family: var(--font-head); font-size: 18px; font-weight: 500; letter-spacing: -.02em; color: var(--text); }
.col-sub { font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.col-list { list-style: none; margin-top: 16px; }
.col-list li { border-top: 1px solid var(--border); padding: 10px 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.col-list li:first-child { border-top: none; }
.col-list li strong { color: var(--text); font-weight: 500; font-family: var(--font-head); }

/* matrix cell variants + note */
table.matrix td.cell-info   { color: var(--active); }
table.matrix td.cell-good   { color: var(--done); }
table.matrix td.cell-warn   { color: var(--blocked); }
table.matrix td.cell-accent { color: var(--accent); }
table.matrix td.cell-mute   { color: var(--text-3); }
.matrix-note { font-size: 12px; color: var(--text-3); line-height: 1.65; margin-top: 16px; max-width: 780px; font-style: italic; }

/* === AI ASSISTANT === */
.ai-fab { position: fixed; right: 22px; bottom: 78px; z-index: 240; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 19px; cursor: pointer; box-shadow: 0 14px 32px -10px rgba(16,24,40,.5); transition: transform .15s, background .15s; }
.ai-fab:hover { transform: translateY(-2px); background: var(--accent-hi); }
.ai-panel { position: fixed; right: 22px; bottom: 140px; z-index: 240; width: 344px; max-width: calc(100vw - 44px); height: 60vh; max-height: 560px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border-md); border-radius: var(--radius-lg); box-shadow: 0 30px 70px -28px rgba(16,24,40,.45); overflow: hidden; animation: rise .24s ease both; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-family: var(--font-head); font-weight: 500; font-size: 13px; color: var(--text); }
.ai-head button { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 4px; border-radius: 6px; }
.ai-head button:hover { color: var(--text); background: var(--panel-hover); }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { font-size: 13px; line-height: 1.5; padding: 9px 13px; border-radius: 13px; max-width: 88%; white-space: pre-wrap; }
.ai-msg.bot { background: var(--panel-hi); color: var(--text-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-form input { flex: 1; }
.ai-form .btn { padding: 10px 14px; }

/* === PRINT === */
.print-btn { position: fixed; right: 22px; bottom: 22px; z-index: 200; }
@media print {
  .sidebar, .topbar, .print-btn, .tab-btns, .board-form, .board-status, .ti-del, .ai-chat, .save-pill { display: none !important; }
  main { margin-left: 0; padding-top: 0; }
  .tab-panel { display: block !important; }
  .section { display: block !important; break-inside: avoid; padding: 32px 20px; border-bottom: 1px solid #ccc; animation: none; }
  body { background: #fff; color: #111; }
  body::before, body::after { display: none; }
}

/* === RESPONSIVE <= 1000px === */
@media(max-width:1000px){
  :root { --nav-w: 210px; }
  .section { padding: 60px 40px 68px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
  .cards-grid .card-lbl, .cards-grid .card-name, .cards-grid .card-role { min-height: 0; }
  .kpi-row { grid-template-columns: 1fr; }
  .board-form .row3 { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 1fr; }
  .teams-grid { grid-template-columns: 1fr; }
  .deal-grid { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
}

/* === RESPONSIVE <= 720px (MOBILE) === */
@media(max-width:720px){
  .topbar { position: sticky !important; top: 0; height: auto !important; min-height: 56px; }
  .topbar-brand { width: auto !important; border-right: none !important; padding: 0 18px !important; height: 56px; flex: 1; }
  .topbar-meta { display: none !important; }
  #nav-toggle { display: flex !important; }
  .sidebar {
    position: fixed !important; top: 56px !important; left: 0 !important; right: 0 !important;
    bottom: auto !important; width: 100% !important;
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
    border-right: none !important; border-bottom: 1px solid var(--border);
  }
  .sidebar.open { max-height: 76vh; overflow-y: auto; }
  main { margin-left: 0 !important; padding-top: 56px !important; }
  .section { padding: 40px 18px 52px !important; }
  h1 { font-size: clamp(24px, 7.5vw, 34px) !important; }
  h2 { font-size: clamp(20px, 5.5vw, 27px) !important; }
  .grid-4, .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 70px 1fr; gap: 16px; }
  .vs-head, .vs-row { grid-template-columns: 1fr; }
  .vs-pole-r, .vs-l, .vs-r { text-align: left; justify-content: flex-start; }
  .vs-attr { min-width: 0; border-left: none; border-right: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); justify-content: flex-start; }
  .matrix-wrap, .roadmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.matrix { min-width: 560px; }
  table.roadmap { min-width: 720px; }
  .hero-banner { flex-direction: column; align-items: flex-start; gap: 20px; padding: 22px; }
  .hb-side { align-items: flex-start; flex-direction: row; gap: 16px; }
  .hb-due { text-align: left; }
  .hb-bar { width: 100%; }
  .up-row { grid-template-columns: 1fr auto; gap: 4px 14px; }
  .up-when { grid-column: 1 / -1; color: var(--accent); }
  .deal-grid { grid-template-columns: 1fr 1fr; }
  .deal-stat .ds-val { font-size: 19px; }
  .kanban { grid-template-columns: 1fr; }
}
