/* =====================================================================
   LeadFlow CRM — real-estate sales pipeline (front-end demo)
   Palette: warm stone, deep forest green, brass, stage hues
   Type: Instrument Serif (headings & figures) + Instrument Sans (UI)
   ===================================================================== */
:root {
  --bg: #F1EEE7;
  --surface: #FFFFFF;
  --surface-2: #F8F6F1;
  --line: #E0DBD0;
  --line-2: #ECE8DF;
  --ink: #16201C;
  --ink-2: #47534D;
  --mute: #5B6761;
  --forest: #0F3B2E;
  --forest-2: #0A2C22;
  --emerald: #127A55;
  --emerald-d: #0D5F42;
  --emerald-50: #E1F1E9;
  --brass: #E7C27D;
  --brass-ink: #7A5413;
  --brass-50: #F8EEDB;
  --red: #B23A3A; --red-50: #FBE7E6;
  --amber: #8F5A00; --amber-50: #FDF0D8;
  /* stage hues (identity, always shown with a text label) */
  --s-new: #3A62B0; --s-contacted: #0E7F89; --s-visit: #A0650A; --s-nego: #6D47B4; --s-won: #177A4B; --s-lost: #6B6F72;
  --f-ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-disp: 'Instrument Serif', Georgia, serif;
  --r: 18px;
  --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2.5px solid var(--emerald); outline-offset: 2px; border-radius: 8px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--forest); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; padding: 4px 30px 40px; outline: none; min-width: 0; }
.view { scroll-margin-top: 600px; }

/* ---------- sidebar ---------- */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 22px 16px 18px; background: var(--forest); color: #EAF2EE;
  background-image: radial-gradient(400px 260px at 0% 0%, rgba(231, 194, 125, .12), transparent 70%); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.brand svg { display: block; flex: none; }
.brand span { display: grid; line-height: 1.1; }
.brand strong { font: 400 27px var(--f-disp); letter-spacing: -.01em; color: #fff; }
.brand small { font-size: 12px; color: #A9C4B8; margin-top: 2px; }
.nav { display: grid; gap: 3px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #C3D6CD; text-decoration: none; font-weight: 500; transition: background .2s, color .2s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(231, 194, 125, .16); color: var(--brass); }
.nav a[aria-current="page"] .ic { color: var(--brass); }
.nav__count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--brass); color: var(--forest-2); font-size: 12px; font-weight: 700; text-align: center; }
.nav__count:empty { display: none; }
.side__team { margin-top: auto; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.side__k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #A9C4B8; margin-bottom: 10px; }
.side__team ul { display: grid; gap: 9px; }
.side__team li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.side__team li small { margin-left: auto; color: #A9C4B8; font-size: 12px; }
.side__foot { display: grid; gap: 10px; }
.btn-reset { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: 11px; border: 1px dashed rgba(231, 194, 125, .5); background: none; color: var(--brass); font-size: 13px; font-weight: 600; }
.btn-reset:hover { background: rgba(231, 194, 125, .1); }
.btn-reset[data-armed] { border-style: solid; background: rgba(231, 194, 125, .18); }
.btn-reset .ic { width: 16px; height: 16px; }
.credit { font-size: 12px; text-align: center; color: #A9C4B8; }

/* avatars */
.ag { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.ag--lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 30px; background: rgba(241, 238, 231, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top__brand { display: none; align-items: center; gap: 8px; text-decoration: none; font: 400 22px var(--f-disp); color: var(--forest); }
.top__search { position: relative; flex: 1; max-width: 440px; }
.top__search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--mute); }
.top__search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.top__search input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-50); }
.top__end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge-demo { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: var(--brass-50); color: var(--brass-ink); border: 1px solid #EBD3A4; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-demo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C8963E; }
.me { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: var(--brass); font-weight: 700; font-size: 13px; flex: none; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .12s; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn--primary { background: var(--emerald); color: #fff; }
.btn--primary:hover { background: var(--emerald-d); }
.btn--line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--line:hover { border-color: var(--emerald); color: var(--emerald-d); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn--sm .ic { width: 15px; height: 15px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; color: var(--ink-2); flex: none; text-decoration: none; }
.icon-btn:hover { border-color: var(--emerald); color: var(--emerald-d); }
.icon-btn .ic { width: 17px; height: 17px; }
.link { color: var(--emerald-d); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .prefix { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .prefix:focus-within { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-50); }
.prefix { display: flex; align-items: center; gap: 8px; padding: 0 0 0 12px; }
.prefix span { color: var(--mute); font-weight: 600; }
.prefix input { border: 0; min-height: 40px; padding-left: 0; box-shadow: none !important; }
.field.has-err input, .field.has-err select, .field.has-err .prefix { border-color: var(--red); background: #FFFAFA; }
.err { color: var(--red); font-size: 12.5px; font-weight: 600; }
.err:empty { display: none; }
.opt { color: var(--mute); font-weight: 400; }
.sel { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sel select { height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; font-weight: 500; color: var(--ink); }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--mute); }
.search input { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px 0 38px; }
.search input:focus, .sel select:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-50); }

/* ---------- heads & cards ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 14px 0 22px; }
.head--tight { margin-bottom: 16px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--emerald-d); margin-bottom: 4px; }
h1 { font: 400 clamp(34px, 3.6vw, 48px)/1 var(--f-disp); letter-spacing: -.01em; }
.lede { color: var(--ink-2); margin-top: 8px; max-width: 66ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h2 { font: 400 24px/1.1 var(--f-disp); }
.card__sub { color: var(--mute); font-size: 12.5px; margin-top: 3px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; position: relative; overflow: hidden; }
.kpi--dark { background: var(--forest); border-color: var(--forest); color: #EAF2EE; }
.kpi--dark .kpi__lab, .kpi--dark .kpi__note { color: #B5CCC1; }
.kpi--dark .kpi__num { color: var(--brass); }
.kpi__lab { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.kpi__num { font: 400 46px/1 var(--f-disp); margin-top: 10px; letter-spacing: -.01em; }
.kpi__num small { font-size: 22px; }
.kpi__note { color: var(--mute); font-size: 12.5px; margin-top: 6px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }

/* stage chip */
.stage { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.stage::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.due .ic { width: 14px; height: 14px; }
.due--today { color: var(--amber); }
.due--over { color: var(--red); }

/* follow-ups (dashboard) */
.fu-list { display: grid; }
.fu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.fu:last-child { border-bottom: 0; }
.fu__time { font: 400 21px/1 var(--f-disp); min-width: 64px; }
.fu__time small { display: block; font: 600 11px var(--f-ui); color: var(--mute); margin-top: 3px; }
.fu__who button { all: unset; cursor: pointer; font-weight: 600; }
.fu__who button:hover { color: var(--emerald-d); text-decoration: underline; }
.fu__who button:focus-visible { outline: 2.5px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }
.fu__task { color: var(--mute); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu__acts { display: flex; gap: 6px; }
.done-btn[aria-pressed="true"] { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.fu.is-done .fu__who, .fu.is-done .fu__time { color: var(--mute); text-decoration: line-through; }
.empty { text-align: center; color: var(--mute); padding: 26px 10px; }

/* source chart */
.key { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.key li { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 11px; height: 11px; border-radius: 3px; }
.k-all { background: #B9DCCB; } .k-won { background: var(--emerald-d); }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line-2); }
.chart .tick { fill: var(--mute); font: 500 11px var(--f-ui); }
.chart .ylab { fill: var(--ink); font: 600 12.5px var(--f-ui); }
.chart .b-all { fill: #B9DCCB; }
.chart .b-won { fill: var(--emerald-d); }
.chart .vlab { fill: var(--ink-2); font: 600 12px var(--f-ui); }
.chart .row:hover .b-all, .chart .row:focus .b-all { fill: #9CCDB5; }
.chart .row:focus { outline: none; }
.chart .row .hit { fill: transparent; }
.chart .row:focus .ylab { text-decoration: underline; }
.tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 8px)); background: var(--forest); color: #fff; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(15, 59, 46, .6); }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--emerald-d); font-weight: 600; }
.chart-table table { margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line-2); }

/* funnel */
.funnel { display: grid; gap: 12px; }
.fn { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.fn__lab { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fn__lab::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.fn__bar { height: 26px; border-radius: 0 6px 6px 0; background: var(--line-2); overflow: hidden; }
.fn__bar i { display: block; height: 100%; border-radius: 0 6px 6px 0; background: var(--c); opacity: .9; }
.fn__v { font-size: 12.5px; color: var(--ink-2); text-align: right; min-width: 96px; }
.fn__v b { font: 400 20px var(--f-disp); color: var(--ink); margin-right: 4px; }

/* feed */
.feed { display: grid; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 9px 0; position: relative; }
.feed li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 38px; bottom: -4px; width: 2px; background: var(--line-2); }
.feed__ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--emerald-50); color: var(--emerald-d); }
.feed__ic .ic { width: 15px; height: 15px; }
.feed__t { font-size: 13.5px; }
.feed__t b { font-weight: 600; }
.feed__m { color: var(--mute); font-size: 12px; }

/* ---------- toolbar & board ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar__note { margin-left: auto; color: var(--mute); font-size: 13px; }
.board-wrap { position: relative; overflow-x: auto; padding-bottom: 10px; margin: 0 -30px; padding-left: 30px; padding-right: 30px; scroll-snap-type: x proximity; }
.board { display: grid; grid-template-columns: repeat(6, minmax(236px, 1fr)); gap: 14px; min-width: 1500px; align-items: start; }
.col { min-width: 0; background: rgba(255, 255, 255, .5); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-height: 320px; scroll-snap-align: start; border-top: 4px solid var(--c); }
.col__head { padding: 12px 14px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.col__head h2 { font: 600 14px var(--f-ui); display: flex; align-items: center; gap: 8px; }
.col__head h2 span { font-size: 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; color: var(--ink-2); }
.col__val { font: 400 17px var(--f-disp); color: var(--ink-2); }
.col__list { flex: 1; display: grid; gap: 10px; align-content: start; padding: 4px 10px 12px; min-height: 120px; border-radius: 0 0 16px 16px; transition: background .15s; }
.col__list.is-over { background: rgba(18, 122, 85, .08); box-shadow: inset 0 0 0 2px var(--emerald); }
.col__empty { color: var(--mute); font-size: 12.5px; text-align: center; padding: 18px 6px; border: 1.5px dashed var(--line); border-radius: 12px; }
.kc { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(22, 32, 28, .04); cursor: grab; transition: box-shadow .2s, border-color .2s, transform .15s; }
.kc:hover { border-color: #C9D9D0; box-shadow: 0 12px 24px -18px rgba(15, 59, 46, .5); }
.kc.is-dragging { opacity: .45; transform: rotate(-1.5deg); }
.kc.is-moved { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--brass); } 100% { box-shadow: 0 0 0 0 transparent; } }
.kc__open { all: unset; cursor: pointer; display: grid; gap: 2px; }
.kc__open:focus-visible { outline: 2.5px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }
.kc__name { font-weight: 600; font-size: 14px; }
.kc__proj { color: var(--mute); font-size: 12.5px; }
.kc__mid { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kc__budget { font: 400 20px var(--f-disp); }
.kc { min-width: 0; }
.kc__mid .tag { overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.kc__due { min-height: 18px; }
.kc__due .due { white-space: normal; }
.kc__foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; border-top: 1px dashed var(--line-2); padding-top: 8px; }
.kc__agent { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.d-facts .d-wide { grid-column: 1 / -1; }
.side__team li span:not(.ag) { min-width: 0; }
.side__team li small { white-space: nowrap; }
.move-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.move-btn:hover, .move-btn[aria-expanded="true"] { border-color: var(--emerald); color: var(--emerald-d); background: var(--emerald-50); }
.move-btn .ic { width: 14px; height: 14px; }

/* move menu */
.menu { position: absolute; z-index: 60; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 24px 50px -20px rgba(15, 59, 46, .45); display: grid; }
.menu button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; }
.menu button::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.menu button:hover, .menu button:focus { background: var(--emerald-50); outline: none; }
.menu button[aria-disabled="true"] { color: var(--mute); cursor: default; }
.menu button[aria-disabled="true"]::after { content: "current"; margin-left: auto; font-size: 11px; }
.menu p { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding: 6px 10px 4px; }

/* ---------- leads table ---------- */
.table-wrap { position: relative; overflow-x: auto; }
.table { min-width: 900px; }
.table th { text-align: left; padding: 12px 16px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFBF8; }
.l-link { all: unset; cursor: pointer; font-weight: 600; }
.l-link:hover { color: var(--emerald-d); text-decoration: underline; }
.l-link:focus-visible { outline: 2.5px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }
.cell-sub { display: block; color: var(--mute); font-size: 12px; }

/* follow-up columns */
.fu-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.fu-col h2 { font: 400 24px var(--f-disp); display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.fu-col h2 span { font: 600 12px var(--f-ui); color: var(--mute); }
.fu-col--over h2 { color: var(--red); }
.fu-col--today h2 { color: var(--amber); }
.fu-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; margin-top: 10px; }
.fu-card__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fu-card__acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- drawer ---------- */
.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border-radius: 22px 0 0 22px; background: var(--surface); color: var(--ink); box-shadow: -30px 0 80px -30px rgba(15, 59, 46, .5); }
.drawer::backdrop { background: rgba(10, 44, 34, .4); backdrop-filter: blur(2px); }
.drawer[open] { animation: slide .26s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer__body { padding: 22px; display: grid; gap: 18px; }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.d-head h2 { font: 400 34px/1.05 var(--f-disp); }
.d-head p { color: var(--mute); font-size: 13px; margin-top: 4px; }
.d-stage { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-stage select { height: 40px; border-radius: 11px; border: 1px solid var(--line); padding: 0 10px; font-weight: 600; background: var(--surface); }
.d-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.d-facts div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.d-facts dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.d-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.d-sec { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.d-sec h3 { font: 400 22px var(--f-disp); }
.d-fu { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.d-fu .field--wide { grid-column: 1 / -1; }
.d-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline { display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.timeline .feed__t { white-space: pre-wrap; }

/* ---------- dialog ---------- */
.dlg { border: 0; padding: 0; border-radius: 22px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(15, 59, 46, .5); }
.dlg::backdrop { background: rgba(10, 44, 34, .45); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg__body { padding: 22px; display: grid; gap: 16px; }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg__head h2 { font: 400 32px/1.05 var(--f-disp); }
.dlg__foot { display: flex; justify-content: flex-end; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 13px; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(10, 44, 34, .6); max-width: calc(100vw - 32px); animation: pop .2s ease; }
.m-foot { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fu-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1060px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .brand, .side__team, .side__foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11px; }
  .nav__count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
  .top { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .top__brand { display: inline-flex; }
  .top__search { order: 3; flex-basis: 100%; max-width: none; }
  .top .btn--primary span { display: none; }
  .top .btn--primary { width: 42px; padding: 0; }
  .me { display: none; }
  main { padding: 4px 16px 24px; }
  .board-wrap { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .board { grid-template-columns: repeat(6, 80vw); min-width: 0; }
  .m-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 16px 96px; }
  .m-foot .btn-reset { color: var(--forest); border-color: #B9CBC2; }
  .m-foot .credit { color: var(--mute); }
  .fu-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .card { padding: 16px; }
  .card--flush { padding: 0; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__num { font-size: 36px; }
  .grid-2, .d-facts { grid-template-columns: 1fr; }
  .fu { grid-template-columns: auto minmax(0, 1fr); }
  .fu__acts { grid-column: 1 / -1; justify-content: flex-end; }
  .fn { grid-template-columns: 92px minmax(0, 1fr); }
  .fn__v { grid-column: 2; text-align: left; }
  .toolbar__note { margin-left: 0; width: 100%; }
  .search { max-width: none; }
  .drawer { border-radius: 0; }
  .drawer__body, .dlg__body { padding: 18px; }
}
@media (max-width: 420px) {
  .top__brand span { display: none; }
  .badge-demo { font-size: 11px; padding: 4px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
