/*!
 * Hivemind HQ — Team & Agents Dashboard · v1.0.0
 * Made by Vortaxis Studio · https://vortaxis.com
 * Sections: 1 fonts & tokens · 2 base · 3 shell & sidebar · 4 top bar · 5 components
 *           6 overview · 7 agents · 8 board · 9 chat · 10 approvals · 11 activity
 *           12 settings · 13 drawer, modal, toasts · 14 responsive
 */

/* ---------- 1. fonts & tokens ---------- */
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --accent: #8b7bff;
  --accent-2: #3ed6c5;
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 16px; --r-sm: 10px;
  --side-w: 248px;
  --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
  --gap: 20px; --pad: 20px;
}
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0b14; --bg-2: #100f1a; --card: #15141f; --card-2: #1b1a28; --hover: #22203175;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --ink: #edecf5; --ink-2: #c6c3d8; --muted: #9b98b0; --faint: #6f6c85;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --glow: radial-gradient(900px 400px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
          radial-gradient(700px 380px at 100% 0%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 60%);
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f4fa; --bg-2: #efedf7; --card: #ffffff; --card-2: #f6f5fb; --hover: #ecebf6;
  --line: rgba(20, 16, 50, .08); --line-2: rgba(20, 16, 50, .16);
  --ink: #17152a; --ink-2: #3a3754; --muted: #625e7c; --faint: #8e8aa6;
  --ok: #059669; --warn: #b45309; --bad: #e11d48; --info: #2563eb;
  --shadow: 0 16px 40px -22px rgba(40, 30, 90, .35);
  --glow: radial-gradient(900px 400px at 10% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}
.compact { --gap: 14px; --pad: 14px; }

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); background-image: var(--glow); background-attachment: fixed; color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
kbd { font: 11px var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--muted); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .sm { font-size: 13px; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- 3. shell & sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100%; transition: grid-template-columns .25s ease; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 85%, transparent); backdrop-filter: blur(14px); overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 8px; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.nav a.on svg { color: var(--accent); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count, .nav .badge { margin-left: auto; font-style: normal; font: 600 11px var(--mono); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; }
.nav .count { color: var(--muted); background: var(--card-2); }
.badge { background: var(--bad); color: #fff; font-style: normal; }
.badge:empty { display: none; }
.nav .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.side-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 600; padding: 0 12px 8px; }
.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-list li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.proj-list i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.proj-list span { margin-left: auto; font: 12px var(--mono); color: var(--faint); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; }
.me { display: flex; align-items: center; gap: 10px; }
.me b { display: block; font-size: 14px; white-space: nowrap; } .me small { color: var(--muted); font-size: 12px; }
.credit { margin-top: 12px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.scrim { position: fixed; inset: 0; background: rgba(5, 4, 12, .55); z-index: 35; backdrop-filter: blur(2px); }

/* collapsed sidebar (desktop) */
.collapsed .shell { grid-template-columns: 76px 1fr; }
.collapsed .side { padding-inline: 12px; }
.collapsed .brand > div, .collapsed .nav span, .collapsed .nav .count, .collapsed .side-sec, .collapsed .me > div, .collapsed .credit { display: none; }
.collapsed .nav a { justify-content: center; padding: 11px; }
.collapsed .nav .badge, .collapsed .nav .dot { position: absolute; top: 4px; right: 4px; margin: 0; min-width: 18px; height: 18px; }
.collapsed .brand, .collapsed .me { justify-content: center; padding-inline: 0; }

/* ---------- 4. top bar ---------- */
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-title { font-size: 19px; font-weight: 650; margin-right: auto; white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; width: min(340px, 34vw); padding: 0 10px 0 12px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; outline: none; color: var(--ink); height: 38px !important; padding: 0 !important; }
.search svg { width: 18px; height: 18px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); flex-shrink: 0; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; font: 600 10px var(--mono); min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
[data-theme='dark'] .ico-moon, [data-theme='light'] .ico-sun { display: none; }
.top-av { width: 40px; height: 40px; }
.only-mobile { display: none; }
main { padding: 26px 28px 60px; outline: none; }
.view { max-width: 1440px; margin: 0 auto; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 5. components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); box-shadow: var(--shadow); min-width: 0; }
.card > h3 { margin-bottom: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .1s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--hover); }
.btn.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.btn.ok:hover { background: var(--ok); color: #05150e; }
.btn.no { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn.no:hover { color: var(--bad); border-color: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar > .btn:last-child, .toolbar > .switch:last-child { margin-left: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.chip i { font: 11px var(--mono); font-style: normal; color: var(--faint); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed='true'] i { color: inherit; opacity: .7; }
.tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tabs button i { font: 11px var(--mono); font-style: normal; padding: 1px 7px; border-radius: 99px; background: var(--card-2); }
.tabs button[aria-selected='true'] { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs button[aria-selected='true'] i { background: var(--accent); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-working { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 13%, transparent); }
.st-online { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.st-idle { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.st-offline { color: var(--faint); background: color-mix(in srgb, var(--faint) 15%, transparent); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.bar { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease; }
.bar.hot > i { background: linear-gradient(90deg, var(--warn), var(--bad)); }

/* avatars (initials on a per-agent hue gradient) */
.av { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; font: 700 13px var(--font); color: #fff; letter-spacing: .02em; flex-shrink: 0;
  background: linear-gradient(135deg, hsl(var(--h, 262) 80% 66%), hsl(calc(var(--h, 262) + 40) 75% 48%)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.av-me { --h: 220; border-radius: 50%; }
.av.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.av.xl { width: 76px; height: 76px; border-radius: 24px; font-size: 24px; }
.av.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.av .sd { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--card); background: var(--faint); }
.av.lg .sd, .av.xl .sd { width: 16px; height: 16px; }
.av.sm .sd { width: 10px; height: 10px; border-width: 2px; right: -3px; bottom: -3px; }
.chat-side .av .sd { border-color: var(--bg-2); }
.sd.working { background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: ping 2s infinite; }
.sd.online { background: var(--ok); } .sd.idle { background: var(--warn); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.stack { display: flex; }
.stack { gap: 4px; }
.stack .av { font-size: 10px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; border: 0; padding: 0; }
.field label, .field legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; }
.field legend { margin-bottom: 8px; }
input:not([type='checkbox']):not([type='radio']), select, textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: none; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b98b0' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input[aria-invalid='true'] { border-color: var(--bad); }
.err { color: var(--bad); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.row2 { display: flex; align-items: center; gap: 10px; }
.row2 input { flex: 1; min-width: 0; }
.input-pre { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-2); padding-left: 12px; }
.input-pre:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input-pre span { color: var(--muted); }
.input-pre input { border: 0 !important; box-shadow: none !important; background: none !important; }
.narrow { max-width: 260px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 40px; height: 24px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line-2); flex-shrink: 0; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.empty.big { display: grid; place-items: center; gap: 6px; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty.big svg { width: 44px; height: 44px; padding: 10px; border-radius: 14px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); margin-bottom: 6px; }
.empty.big b { color: var(--ink); font-size: 17px; }

/* ---------- 6. overview ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.hello { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.03em; margin-bottom: 4px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent); }
.kpi .k-val { font: 700 30px/1.1 var(--font); letter-spacing: -.03em; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi .k-sub { font-size: 13px; color: var(--muted); }
.up { color: var(--ok); font-weight: 600; } .down { color: var(--bad); font-weight: 600; }
.kpi svg.spark { position: absolute; right: 16px; bottom: 14px; width: 92px; height: 34px; stroke-width: 2; opacity: .9; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--gap); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-a { background: var(--accent); } .sw-b { background: var(--accent-2); height: 3px; border-radius: 2px; }
.chart { height: 250px; position: relative; }
.chart svg { width: 100%; height: 100%; stroke: none; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--faint); font: 11px var(--mono); }
.chart rect.b { fill: color-mix(in srgb, var(--accent) 70%, transparent); transition: fill .15s; }
.chart rect.b.today { fill: var(--accent); }
.chart rect.b:hover { fill: var(--accent); }
.chart .avg { stroke: var(--accent-2); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.mini-approvals, .team-now { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-approvals li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.mini-approvals li:first-child { border-top: 0; padding-top: 0; }
.mini-approvals .k-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.mini-approvals .t { flex: 1; min-width: 0; }
.mini-approvals .t b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-approvals .t small { color: var(--muted); font-size: 12.5px; }
.mini-approvals .acts { display: flex; gap: 6px; }
.mini-approvals .acts .btn { width: 34px; padding: 0; }
.team-now li { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.team-now li:first-child { border-top: 0; padding-top: 0; }
.team-now b { font-size: 14px; font-weight: 600; }
.team-now .t small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-now .ld { font: 11px var(--mono); color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 5px; }

/* kind colours (approvals) */
.kd-publish { --c: #ff6f91; } .kd-email { --c: #60a5fa; } .kd-deploy { --c: #8b7bff; } .kd-spend { --c: #fbbf24; } .kd-access { --c: #3ed6c5; }
[class*='kd-'] .k-ico, .k-ico[class*='kd-'] { color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }

/* ---------- 7. agents ---------- */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.agent { display: flex; flex-direction: column; gap: 14px; transition: transform .2s, border-color .2s; }
.agent:hover { transform: translateY(-2px); border-color: var(--line-2); }
.agent .a-top { display: flex; gap: 14px; align-items: center; }
.agent .a-top > div { min-width: 0; flex: 1; }
.agent h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent .role { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent .now { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; min-height: 62px; }
.agent .now svg { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; }
.agent .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.agent .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; border-top: 1px solid var(--line); padding-top: 12px; }
.agent .stats b { display: block; font: 600 15px var(--mono); }
.agent .stats small { color: var(--muted); font-size: 11.5px; }
.agent .a-acts { display: flex; gap: 8px; }
.agent .a-acts .btn { flex: 1; }

/* ---------- 8. board ---------- */
.select-wrap select { width: 200px; height: 40px; }
.hint { flex: 1; min-width: 220px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: var(--gap); align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: color-mix(in srgb, var(--card) 60%, transparent); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-height: 200px; transition: background .15s, border-color .15s; }
.col.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.col-head h3 { font-size: 14px; }
.col-head i { font: 600 11px var(--mono); font-style: normal; color: var(--muted); background: var(--card-2); padding: 2px 8px; border-radius: 99px; }
.col-head .cdot { width: 8px; height: 8px; border-radius: 50%; padding: 0; }
.col-head .add { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.col-head .add:hover { background: var(--hover); color: var(--ink); }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.task { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 13px 13px 12px; cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 6px 18px -14px rgba(0, 0, 0, .6); transition: border-color .15s, box-shadow .15s; }
.task:hover { border-color: var(--line-2); }
.task:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task.lifted { outline: 2px dashed var(--accent); outline-offset: 2px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, transparent); }
.task.placeholder { opacity: .35; border-style: dashed; }
.task.ghost { position: fixed; z-index: 200; pointer-events: none; cursor: grabbing; transform: rotate(2.5deg) scale(1.03); box-shadow: var(--shadow), 0 30px 60px -20px rgba(0, 0, 0, .6); border-color: var(--accent); }
.task .t-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.task .proj { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.task .proj::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--pc); }
.prio { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; }
.prio.high { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.prio.med { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.prio.low { color: var(--muted); background: var(--card-2); }
.task h4 { font-size: 14px; font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.task .bar { margin-bottom: 10px; }
.task .t-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.task .t-foot span:not(.av) { display: inline-flex; align-items: center; gap: 4px; }
.task .t-foot svg { width: 14px; height: 14px; }
.task .t-foot .av { margin-left: auto; }
.task .late { color: var(--bad); }

/* ---------- 9. chat ---------- */
.view-chat { max-width: none; }
.chat { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: calc(100vh - 69px - 26px - 40px); min-height: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.chat-side { border-right: 1px solid var(--line); padding: 16px 10px; overflow-y: auto; background: var(--bg-2); }
.chat-side ul { list-style: none; margin: 0 0 16px; padding: 0; }
.chat-side button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); text-align: left; font-size: 14px; }
.chat-side button:hover { background: var(--hover); }
.chat-side button[aria-current='true'] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 600; }
.chat-side .hash { width: 28px; text-align: center; color: var(--faint); font-weight: 700; }
.chat-side .unread { margin-left: auto; font: 600 10px var(--mono); background: var(--accent); color: #fff; padding: 1px 7px; border-radius: 99px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { display: flex; gap: 12px; max-width: 760px; animation: fade .25s ease; }
.msg .body { min-width: 0; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.msg .meta b { font-size: 14px; }
.msg .meta small { color: var(--faint); font-size: 12px; }
.msg .meta .role { color: var(--muted); font-size: 12px; }
.msg .text { color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); padding: 9px 13px; border-radius: 4px 14px 14px 14px; overflow-wrap: anywhere; }
.msg .text .mention { color: var(--accent); font-weight: 600; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg.me .meta { justify-content: flex-end; }
.msg.me .text { background: var(--accent); border-color: transparent; color: #fff; border-radius: 14px 4px 14px 14px; }
.msg.me .text .mention { color: #fff; text-decoration: underline; }
.day-sep { text-align: center; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 12px; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.typing { display: flex; align-items: center; gap: 10px; padding: 0 20px 8px; font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.composer { display: flex; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.composer textarea { max-height: 140px; min-height: 44px; }
.composer .send { width: 46px; height: 44px; padding: 0; flex-shrink: 0; }

/* ---------- 10. approvals ---------- */
.appr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: var(--gap); }
.appr { display: flex; flex-direction: column; gap: 14px; transition: opacity .3s, transform .3s; }
.appr.leaving { opacity: 0; transform: scale(.97) translateY(6px); }
.appr .ap-top { display: flex; gap: 12px; align-items: flex-start; }
.appr .k-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.appr .ap-top > div { flex: 1; min-width: 0; }
.appr h3 { font-size: 15.5px; line-height: 1.35; }
.appr .by { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.risk { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.risk.low { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.risk.med { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.risk.high { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.appr .preview { font-size: 14px; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 11px; padding: 12px 14px; }
.appr .metas { display: flex; gap: 8px; flex-wrap: wrap; }
.appr .ap-acts { display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.appr .ap-acts .btn.ok { flex: 1; }
.appr .result { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 14px; }
.appr .result.approved { color: var(--ok); } .appr .result.rejected { color: var(--bad); }
.appr .result svg { width: 18px; height: 18px; }

/* ---------- 11. activity / timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 6px 0 12px; }
.tl-day:not(:first-child) { margin-top: 26px; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.timeline li::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tl-body { flex: 1; min-width: 0; padding-top: 2px; font-size: 14px; color: var(--ink-2); }
.timeline .tl-body b { color: var(--ink); font-weight: 600; }
.timeline .tl-body .who { color: var(--ink); font-weight: 650; }
.timeline .tl-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--faint); }
.tl-type { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); text-transform: capitalize; }
.timeline li.new { animation: flash 1.6s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 18%, transparent); } 100% { background: transparent; } }
.compact-tl li { padding-bottom: 14px; }
.compact-tl .av { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.compact-tl li::before { left: 14px; top: 34px; }

/* ---------- 12. settings ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.settings .card:first-child { grid-column: 1 / -1; }
.settings .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toggles { display: flex; flex-direction: column; gap: 14px; margin: 14px 0 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); gap: 2px; width: max-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 11px; background: var(--s); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); transition: transform .15s; }
.swatches input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--s); transform: scale(.92); }
.swatches input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 4px; }
.danger { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.danger .btn { margin-top: 14px; color: var(--bad); }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 12px 14px 12px 20px; border-radius: var(--r); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.save-bar.dirty #saveState { color: var(--warn); }

/* ---------- 13. drawer, modal, toasts ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 12, .55); backdrop-filter: blur(3px); display: flex; justify-content: flex-end; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer-in { width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--card); border-left: 1px solid var(--line-2); padding: 24px; display: flex; flex-direction: column; gap: 20px; animation: slideIn .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer .d-head { display: flex; gap: 16px; align-items: center; }
.drawer .d-head > div { flex: 1; min-width: 0; }
.drawer h2 { font-size: 22px; }
.drawer .d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.drawer .d-stats div { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.drawer .d-stats b { display: block; font: 600 18px var(--mono); }
.drawer .d-stats small { color: var(--muted); font-size: 12px; }
.drawer h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.drawer ul.d-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.drawer ul.d-tasks li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); }
.drawer .d-acts { display: flex; gap: 10px; margin-top: auto; }
.drawer .d-acts .btn { flex: 1; }
.modal { width: min(560px, calc(100% - 24px)); border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(5, 4, 12, .6); backdrop-filter: blur(3px); }
.modal form { padding: 22px; }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal header h3 { font-size: 19px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 13px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: toastIn .3s cubic-bezier(.2, .8, .2, 1); max-width: min(380px, calc(100vw - 40px)); }
.toast svg { width: 18px; height: 18px; color: var(--ok); }
.toast.bad svg { color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- 14. responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell, .collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); background: var(--bg-2); box-shadow: var(--shadow); }
  .menu-open .side { transform: none; }
  .collapsed .side .brand > div, .collapsed .side .nav span, .collapsed .side .side-sec, .collapsed .side .me > div, .collapsed .side .credit { display: revert; }
  .only-mobile { display: inline-grid; } .only-desktop { display: none; }
  .top { padding: 12px 16px; }
  main { padding: 18px 16px 50px; }
  .search { width: auto; flex: 1; max-width: 300px; }
  .top-title { font-size: 16px; margin-right: 0; }
  .search { min-width: 0; margin-left: auto; }
  .search kbd { display: none; }
  .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .chat { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 65px - 18px - 24px); height: calc(100dvh - 65px - 18px - 24px); }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .chat-side .side-label { display: none; }
  .chat-side ul { display: contents; }
  .chat-side button { width: auto; white-space: nowrap; padding: 6px 12px 6px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; }
  .chat-side .hash { width: 22px; }
  .chat-head .stack { display: none; }
}
@media (max-width: 600px) {
  .kpis { gap: 12px; }
  .kpi .k-val { font-size: 25px; }
  .kpi svg.spark { display: none; }
  .form-grid, .settings .form-grid { grid-template-columns: minmax(0, 1fr); }
  .team-now li { grid-template-columns: auto minmax(0, 1fr); }
  .team-now .ldw { grid-column: 2; }
  .hero-actions { width: 100%; } .hero-actions .btn { flex: 1; }
  .toolbar > .btn:last-child { margin-left: 0; }
  .hint { display: none; }
  .select-wrap { flex: 1; } .select-wrap select { width: 100%; }
  .tabs { width: 100%; } .tabs button { flex: 1; justify-content: center; padding: 7px 8px; }
  .msgs, .composer { padding-left: 14px; padding-right: 14px; }
  .chart { height: 200px; }
  .legend { display: none; }
  .top-av { display: none; }
  .appr .ap-acts .btn { padding: 0 12px; }
  .toasts { left: 16px; right: 16px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
