:root {
  --canvas: #f3f0e8;
  --surface: #fbfaf6;
  --surface-2: #ebe7de;
  --surface-3: #ded9ce;
  --ink: #17161b;
  --ink-2: #5e5a63;
  --ink-3: #89848d;
  --line: #d9d4ca;
  --line-strong: #bdb6aa;
  --signal: #ff5d3b;
  --signal-dark: #d64024;
  --lime: #c9f36a;
  --lime-ink: #39480d;
  --blue: #6f8cff;
  --blue-soft: #dfe5ff;
  --violet: #9c75e8;
  --yellow: #f3c856;
  --green: #3d9a73;
  --red: #d94f4f;
  --sidebar: #1a191e;
  --sidebar-text: #f3f0e8;
  --shadow-sm: 0 8px 24px rgba(23,22,27,.08);
  --shadow-lg: 0 28px 80px rgba(23,22,27,.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-w: 230px;
  --topbar-h: 72px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

body.dark {
  --canvas: #111116;
  --surface: #1a191f;
  --surface-2: #24232b;
  --surface-3: #32303a;
  --ink: #f6f3ec;
  --ink-2: #b6b0bc;
  --ink-3: #89838f;
  --line: #34323b;
  --line-strong: #504d58;
  --blue-soft: #293250;
  --sidebar: #09090c;
  --shadow-sm: 0 8px 24px rgba(0,0,0,.22);
  --shadow-lg: 0 28px 80px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 2000; top: -50px; left: 14px; padding: 9px 14px; border-radius: 8px; background: var(--signal); color: white; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
.sidebar { position: fixed; z-index: 700; inset: 0 auto 0 0; width: var(--sidebar-w); display: flex; flex-direction: column; padding: 20px 14px 14px; background: var(--sidebar); color: var(--sidebar-text); transition: width .25s ease; }
.brand { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 8px; font-weight: 900; letter-spacing: .14em; }
.brand small { margin-left: -4px; color: #77717d; font-size: 9px; letter-spacing: .1em; }
.brand-symbol { width: 30px; height: 28px; display: flex; align-items: end; gap: 3px; flex: 0 0 auto; }
.brand-symbol i { width: 7px; border-radius: 999px; background: var(--signal); }
.brand-symbol i:nth-child(1) { height: 22px; }
.brand-symbol i:nth-child(2) { height: 17px; background: var(--lime); }
.brand-symbol i:nth-child(3) { height: 12px; background: var(--blue); }
.side-nav { display: grid; gap: 4px; margin-top: 28px; }
.side-nav p { margin: 20px 10px 7px; color: #6f6a75; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.side-nav a { position: relative; min-height: 42px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 7px; padding: 0 10px; border-radius: 10px; color: #aaa5ae; font-size: 12px; transition: background .16s ease, color .16s ease, transform .16s ease; }
.side-nav a:hover { background: #25242b; color: white; transform: translateX(2px); }
.side-nav a.active { background: #f3f0e8; color: #17161b; }
.side-nav a > span { font-size: 18px; text-align: center; }
.side-nav a b { font-weight: 680; }
.side-nav a em { min-width: 22px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: #323039; color: #bab5bf; font-size: 9px; font-style: normal; font-weight: 800; }
.side-nav a.active em { background: var(--signal); color: white; }
.side-nav a .danger-count { background: #552723; color: #ff9a83; }
.workspace-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; margin-top: auto; padding: 12px 9px; border: 1px solid #302f36; border-radius: 12px; background: #212027; }
.workspace-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--lime); color: #17161b; font-size: 13px; font-weight: 900; }
.workspace-card b, .workspace-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-card b { font-size: 10px; }
.workspace-card small { color: #85808b; font-size: 8px; }
.workspace-card button { padding: 5px; border: 0; background: transparent; color: #77717d; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 0; }
.team-stack { display: flex; align-items: center; }
.team-stack span, .team-stack i { width: 26px; height: 26px; display: grid; place-items: center; margin-left: -5px; border: 2px solid var(--sidebar); border-radius: 50%; background: var(--blue); color: white; font-size: 7px; font-style: normal; font-weight: 850; }
.team-stack span:first-child { margin-left: 0; background: var(--signal); }
.team-stack span:nth-child(2) { background: var(--violet); }
.team-stack span:nth-child(3) { background: var(--green); }
.team-stack i { background: #35333c; color: #aaa5ae; }
#collapse-sidebar { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #34323a; border-radius: 8px; background: transparent; color: #918c96; font-size: 20px; }

body.sidebar-collapsed { --sidebar-w: 78px; }
body.sidebar-collapsed .sidebar { width: 78px; }
body.sidebar-collapsed .brand-word, body.sidebar-collapsed .brand small, body.sidebar-collapsed .side-nav p, body.sidebar-collapsed .side-nav b, body.sidebar-collapsed .side-nav em, body.sidebar-collapsed .workspace-card div:not(.workspace-icon), body.sidebar-collapsed .workspace-card button, body.sidebar-collapsed .team-stack { display: none; }
body.sidebar-collapsed .side-nav a { grid-template-columns: 1fr; padding: 0; }
body.sidebar-collapsed .workspace-card { grid-template-columns: 1fr; }
body.sidebar-collapsed .workspace-icon { margin: auto; }

.main-shell { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar { position: sticky; z-index: 600; top: 0; height: var(--topbar-h); display: grid; grid-template-columns: minmax(160px,1fr) minmax(280px,500px) 1fr; align-items: center; gap: 22px; padding: 0 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(16px); }
.page-context small, .page-context strong { display: block; }
.page-context small { color: var(--ink-3); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-context strong { margin-top: 2px; font-size: 16px; }
.command-trigger { min-width: 0; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-3); box-shadow: 0 2px 0 rgba(23,22,27,.03); font-size: 11px; text-align: left; }
.command-trigger span:nth-child(2) { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { padding: 4px 6px; border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-family: var(--sans); font-size: 8px; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 7px; }
.round-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); }
.round-button:hover { border-color: var(--ink); color: var(--ink); }
.notification-button { position: relative; }
.notification-button i { position: absolute; right: 5px; top: 4px; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--signal); }
.user-button { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border: 0; border-radius: 999px; background: transparent; text-align: left; }
.user-button > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--canvas); font-size: 9px; font-weight: 850; }
.user-button b, .user-button small { display: block; line-height: 1.2; }
.user-button b { font-size: 10px; }
.user-button small { color: var(--ink-3); font-size: 8px; }
.mobile-brand { display: none; }

#view { min-height: calc(100vh - var(--topbar-h)); outline: none; }
.view-page { min-height: calc(100vh - var(--topbar-h)); }
.page-shell { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 60px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.title-block .eyebrow, .mini-label { color: var(--signal-dark); font-size: 8px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.title-block h1 { margin: 5px 0 3px; font-size: clamp(26px, 3vw, 40px); line-height: 1; letter-spacing: -.04em; }
.title-block p { margin: 0; color: var(--ink-2); font-size: 11px; }
.head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.primary-button, .secondary-button, .text-button, .chip-button { border: 0; cursor: pointer; font-weight: 760; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.primary-button { padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--canvas); font-size: 10px; box-shadow: var(--shadow-sm); }
.primary-button.signal { background: var(--signal); color: white; }
.primary-button:hover { transform: translateY(-2px); }
.secondary-button { padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 10px; }
.secondary-button:hover { border-color: var(--ink); transform: translateY(-1px); }
.text-button { padding: 6px 0; background: transparent; color: var(--signal-dark); font-size: 10px; }
.text-button:hover { text-decoration: underline; }

.pipeline-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.metric-card { position: relative; min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -18px; bottom: -20px; width: 60px; height: 60px; border-radius: 50%; background: var(--metric-color,var(--blue)); opacity: .12; }
.metric-card small { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 8px; font-weight: 750; }
.metric-card small i { width: 7px; height: 7px; border-radius: 50%; background: var(--metric-color,var(--blue)); }
.metric-card strong { display: block; margin: 5px 0 1px; font-size: 20px; letter-spacing: -.03em; }
.metric-card span { color: var(--ink-2); font-size: 8px; }
.metric-card span.up { color: var(--green); }
.metric-card span.down { color: var(--red); }

.pipeline-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.pipeline-search { min-width: 220px; flex: 0 1 340px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pipeline-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 10px; }
.filter-select { height: 38px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 9px; }
.view-switch { margin-left: auto; display: flex; padding: 3px; border-radius: 9px; background: var(--surface-2); }
.view-switch button { min-width: 34px; height: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 10px; }
.view-switch button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.kanban-wrap { position: relative; overflow-x: auto; overflow-y: hidden; padding: 1px 0 16px; scrollbar-color: var(--line-strong) transparent; }
.kanban-board { min-width: max-content; display: grid; grid-template-columns: repeat(5, 282px); gap: 11px; align-items: start; }
.kanban-column { min-height: 540px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--surface-2) 56%, transparent); transition: background .15s ease, border-color .15s ease; }
.kanban-column.drag-over { border-color: var(--blue); background: var(--blue-soft); }
.column-head { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; align-items: center; min-height: 35px; padding: 0 3px 9px; }
.stage-dot { width: 9px; height: 9px; border: 3px solid color-mix(in srgb, var(--stage) 35%, transparent); border-radius: 50%; background: var(--stage); box-sizing: content-box; }
.column-head h2 { margin: 0; font-size: 10px; }
.column-head h2 span { margin-left: 5px; color: var(--ink-3); font-weight: 600; }
.column-head strong { color: var(--ink-2); font-family: var(--mono); font-size: 8px; font-weight: 650; }
.column-progress { height: 3px; margin: 0 2px 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.column-progress i { display: block; height: 100%; border-radius: inherit; background: var(--stage); }
.deal-list { display: grid; gap: 8px; min-height: 470px; }
.deal-card { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 0 rgba(23,22,27,.03); cursor: grab; transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease; }
.deal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.deal-card.dragging { opacity: .42; transform: rotate(2deg); }
.deal-card.risk { border-left: 3px solid var(--red); }
.deal-card.warm { border-left: 3px solid var(--yellow); }
.deal-company { display: flex; align-items: center; gap: 8px; min-width: 0; }
.company-logo { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--logo-bg,var(--blue-soft)); color: var(--logo-ink,var(--ink)); font-size: 9px; font-weight: 900; }
.deal-company > div { min-width: 0; }
.deal-company b, .deal-company small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-company b { font-size: 10px; }
.deal-company small { margin-top: 1px; color: var(--ink-3); font-size: 8px; }
.deal-menu { position: absolute; top: 9px; right: 9px; padding: 3px; border: 0; background: transparent; color: var(--ink-3); }
.deal-name { margin: 10px 0 9px; font-size: 11px; font-weight: 750; }
.deal-value { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.deal-value strong { font-size: 15px; letter-spacing: -.02em; }
.deal-value span { color: var(--ink-3); font-size: 8px; }
.deal-meta { display: flex; align-items: center; gap: 5px; margin-top: 10px; }
.deal-tag { padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 7px; font-weight: 750; }
.deal-tag.hot { background: #ffe2d9; color: #96351f; }
.deal-score { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--green); font-size: 8px; font-weight: 850; }
.deal-score i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.deal-score.low { color: var(--red); }
.deal-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 7px; }
.owner-avatar { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--avatar,var(--violet)); color: white; font-size: 6px; font-weight: 900; }
.deal-footer span:nth-child(2) { flex: 1; }
.card-move { display: flex; gap: 2px; }
.card-move button { width: 22px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink-3); font-size: 9px; }
.card-move button:hover { border-color: var(--ink); color: var(--ink); }
.column-add { width: 100%; margin-top: 8px; padding: 9px; border: 1px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--ink-3); font-size: 8px; }
.column-add:hover { border-color: var(--signal); color: var(--signal-dark); }

.list-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.list-table th, .list-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; }
.list-table th { background: var(--surface-2); color: var(--ink-3); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover { background: color-mix(in srgb, var(--blue-soft) 35%, transparent); }
.stage-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; background: var(--surface-2); font-size: 7px; font-weight: 800; }
.stage-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--stage); }

.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.panel-head h2 { margin: 2px 0 0; font-size: 13px; }
.panel-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 8px; }
.panel-head button { padding: 5px; border: 0; background: transparent; color: var(--ink-3); }
.chart-area { position: relative; height: 220px; display: flex; align-items: end; gap: 10px; padding: 20px 8px 22px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, var(--line) 54px); }
.chart-bar-group { height: 100%; flex: 1; display: flex; align-items: end; justify-content: center; gap: 3px; position: relative; }
.chart-bar { width: min(22px,42%); min-height: 4px; border-radius: 5px 5px 0 0; background: var(--ink); }
.chart-bar.secondary { background: var(--blue); opacity: .5; }
.chart-bar-group label { position: absolute; bottom: -18px; color: var(--ink-3); font-size: 7px; }
.chart-legend { display: flex; gap: 14px; margin-top: 12px; color: var(--ink-3); font-size: 7px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.chart-legend span:nth-child(2) i { background: var(--blue); opacity: .5; }
.insight-card { padding: 16px; border-radius: 14px; background: var(--ink); color: var(--canvas); }
.insight-card .mini-label { color: var(--lime); }
.insight-card h3 { margin: 7px 0; font-size: 17px; letter-spacing: -.03em; }
.insight-card p { margin: 0 0 12px; color: #b9b5bf; font-size: 9px; }
.insight-card button { color: var(--lime); }
.task-list, .activity-feed { display: grid; gap: 8px; }
.task-item { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: 0; }
.task-check { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; }
.task-check.done { border-color: var(--green); background: var(--green); color: white; }
.task-item b, .task-item small { display: block; }
.task-item b { font-size: 9px; }
.task-item small { margin-top: 2px; color: var(--ink-3); font-size: 7px; }
.task-item time { color: var(--red); font-size: 7px; }
.activity-item { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
.activity-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.activity-item p { margin: 0; font-size: 8px; }
.activity-item small { color: var(--ink-3); font-size: 7px; }

.contacts-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.contacts-search { flex: 1; max-width: 380px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.contacts-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 10px; }
.contact-name { display: flex; align-items: center; gap: 8px; }
.contact-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--avatar,var(--blue)); color: white; font-size: 7px; font-weight: 900; }
.contact-name b, .contact-name small { display: block; }
.contact-name b { font-size: 9px; }
.contact-name small { color: var(--ink-3); font-size: 7px; }
.health-ring { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--health) calc(var(--score)*1%), var(--surface-3) 0); }
.health-ring::after { content: attr(data-score); width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-size: 6px; font-weight: 900; }

.account-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.account-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.account-top { display: flex; justify-content: space-between; gap: 12px; }
.account-top .company-logo { width: 38px; height: 38px; }
.account-top button { border: 0; background: transparent; color: var(--ink-3); }
.account-card h3 { margin: 12px 0 2px; font-size: 12px; }
.account-card > p { margin: 0; color: var(--ink-3); font-size: 8px; }
.account-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 14px; }
.account-stats div { padding: 8px; border-radius: 9px; background: var(--surface-2); }
.account-stats b, .account-stats small { display: block; }
.account-stats b { font-size: 10px; }
.account-stats small { color: var(--ink-3); font-size: 6px; }

.forecast-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; }
.forecast-number { font-size: clamp(36px,5vw,64px); font-weight: 850; letter-spacing: -.06em; }
.forecast-number small { color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.funnel { display: grid; gap: 7px; margin-top: 22px; }
.funnel-row { display: grid; grid-template-columns: 100px 1fr 70px; gap: 9px; align-items: center; font-size: 8px; }
.funnel-track { height: 18px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.funnel-track i { display: block; height: 100%; border-radius: inherit; background: var(--stage); }
.funnel-row strong { text-align: right; }

.automation-list { display: grid; gap: 10px; }
.automation-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.automation-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 18px; }
.automation-card h3 { margin: 0 0 3px; font-size: 11px; }
.automation-card p { margin: 0; color: var(--ink-3); font-size: 8px; }
.toggle { position: relative; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: left .18s ease; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 19px; }

.detail-drawer { position: fixed; z-index: 1000; top: 0; right: 0; width: min(480px,100%); height: 100dvh; overflow-y: auto; background: var(--surface); box-shadow: -30px 0 80px rgba(23,22,27,.22); transform: translateX(104%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.detail-drawer.open { transform: translateX(0); }
.drawer-cover { height: 112px; padding: 18px; background: var(--ink); color: var(--canvas); }
.drawer-cover .round-button { float: right; border-color: #3c3943; background: #27262c; color: white; }
.drawer-body { padding: 22px; }
.drawer-company { display: flex; align-items: center; gap: 10px; margin-top: -48px; }
.drawer-company .company-logo { width: 54px; height: 54px; border: 5px solid var(--surface); border-radius: 15px; font-size: 15px; }
.drawer-body h2 { margin: 16px 0 3px; font-size: 24px; letter-spacing: -.04em; }
.drawer-body > p { margin: 0; color: var(--ink-3); font-size: 9px; }
.drawer-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 18px 0; }
.drawer-stats div { padding: 10px; border-radius: 10px; background: var(--surface-2); }
.drawer-stats b, .drawer-stats small { display: block; }
.drawer-stats b { font-size: 11px; }
.drawer-stats small { color: var(--ink-3); font-size: 6px; }
.next-action { padding: 14px; border: 1px solid #bbd46f; border-radius: 12px; background: color-mix(in srgb,var(--lime) 27%,var(--surface)); }
.next-action h3 { margin: 5px 0; font-size: 12px; }
.next-action p { margin: 0 0 10px; color: var(--ink-2); font-size: 8px; }
.drawer-tabs { display: flex; gap: 18px; margin: 20px 0 12px; border-bottom: 1px solid var(--line); }
.drawer-tabs button { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3); font-size: 8px; font-weight: 800; }
.drawer-tabs button.active { border-color: var(--signal); color: var(--ink); }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 16px; }
.timeline-item::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 28px; height: 28px; z-index: 1; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 10px; }
.timeline-item b { display: block; font-size: 8px; }
.timeline-item p { margin: 2px 0; color: var(--ink-2); font-size: 8px; }
.timeline-item time { color: var(--ink-3); font-size: 6px; }

.assistant-fab { position: fixed; z-index: 800; right: 20px; bottom: 18px; display: flex; align-items: center; gap: 7px; padding: 8px 13px 8px 8px; border: 0; border-radius: 999px; background: var(--ink); color: var(--canvas); box-shadow: var(--shadow-lg); font-size: 9px; }
.assistant-fab span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--lime-ink); }
.assistant-drawer { position: fixed; z-index: 1100; top: 0; right: 0; width: min(420px,100%); height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto auto auto; padding: 20px; background: var(--surface); box-shadow: -30px 0 80px rgba(23,22,27,.25); transform: translateX(104%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.assistant-drawer.open { transform: translateX(0); }
.assistant-head { display: flex; justify-content: space-between; gap: 20px; }
.assistant-head > div:last-child { display: flex; gap: 6px; }
.assistant-head h2 { margin: 3px 0 0; font-size: 24px; letter-spacing: -.04em; }
.assistant-mode { width: max-content; display: flex; align-items: center; gap: 6px; margin: 12px 0; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb,var(--lime) 30%,var(--surface)); color: var(--lime-ink); font-size: 7px; font-weight: 850; }
body.dark .assistant-mode { color: var(--lime); }
.assistant-mode i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.assistant-mode.remote { background: var(--blue-soft); color: var(--blue); }
.chat-log { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 8px 0; }
.chat-message { max-width: 88%; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 9px; white-space: pre-line; }
.chat-message.user { align-self: end; border-bottom-right-radius: 3px; background: var(--ink); color: var(--canvas); }
.chat-message.assistant { align-self: start; border-bottom-left-radius: 3px; }
.chat-message.loading { color: var(--ink-3); font-style: italic; }
.prompt-row { display: flex; gap: 5px; overflow-x: auto; padding: 7px 0; scrollbar-width: none; }
.prompt-row::-webkit-scrollbar { display: none; }
.prompt-row button { flex: 0 0 auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 7px; }
.chat-form { display: flex; align-items: end; gap: 7px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); }
.chat-form textarea { flex: 1; max-height: 100px; resize: none; border: 0; outline: 0; background: transparent; font-size: 9px; }
.chat-form button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--signal); color: white; }
.assistant-disclaimer { margin-top: 7px; color: var(--ink-3); font-size: 6px; text-align: center; }

.scrim { position: fixed; z-index: 900; inset: 0; background: rgba(17,16,21,.35); backdrop-filter: blur(2px); }
.scrim[hidden] { display: none; }
.command-palette { position: fixed; z-index: 1300; inset: 0; display: grid; place-items: start center; padding: 11vh 18px; background: rgba(17,16,21,.45); backdrop-filter: blur(7px); }
.command-palette[hidden] { display: none; }
.command-box { width: min(620px,100%); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.command-input { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.command-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.command-results { max-height: 410px; overflow-y: auto; padding: 8px; }
.command-section { padding: 8px 8px 4px; color: var(--ink-3); font-size: 7px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.command-item { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.command-item:hover, .command-item.selected { background: var(--surface-2); }
.command-item > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); }
.command-item b, .command-item small { display: block; }
.command-item b { font-size: 9px; }
.command-item small { color: var(--ink-3); font-size: 7px; }
.command-item em { color: var(--ink-3); font-size: 7px; font-style: normal; }
.command-help { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 6px; }

.modal { position: fixed; z-index: 1400; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(17,16,21,.42); backdrop-filter: blur(5px); }
.modal[hidden] { display: none; }
.modal-card { width: min(540px,100%); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 22px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.modal-head h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.035em; }
.modal-form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 8px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font-size: 9px; }
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-hint { color: var(--ink-3); font-size: 7px; }
.modal-actions { display: flex; justify-content: end; gap: 7px; margin-top: 4px; }
.warning { padding: 10px; border-radius: 9px; background: color-mix(in srgb,var(--yellow) 30%,var(--surface)); color: var(--ink-2); font-size: 8px; }

.toast-region { position: fixed; z-index: 1600; right: 18px; top: 84px; display: grid; gap: 7px; }
.toast { min-width: 220px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--canvas); box-shadow: var(--shadow-lg); font-size: 8px; animation: toast-in .2s ease; }
.toast button { padding: 2px; border: 0; background: transparent; color: var(--lime); font-size: 7px; font-weight: 850; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.empty-state { min-height: 320px; display: grid; place-items: center; padding: 45px; border: 1px dashed var(--line-strong); border-radius: 15px; text-align: center; }
.empty-state span { font-size: 36px; color: var(--signal); }
.empty-state h2 { margin: 7px 0 3px; font-size: 18px; }
.empty-state p { max-width: 380px; margin: 0 auto 14px; color: var(--ink-3); font-size: 9px; }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar-w: 78px; }
  .sidebar { width: 78px; }
  .brand-word, .brand small, .side-nav p, .side-nav b, .side-nav em, .workspace-card div:not(.workspace-icon), .workspace-card button, .team-stack { display: none; }
  .side-nav a { grid-template-columns: 1fr; padding: 0; }
  .workspace-card { grid-template-columns: 1fr; }
  .workspace-icon { margin: auto; }
  .topbar { grid-template-columns: 170px minmax(260px,1fr) auto; }
  .kanban-board { grid-template-columns: repeat(5,270px); }
  .account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 780px) {
  :root { --topbar-h: 64px; }
  body { padding-bottom: 64px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-shell { min-height: calc(100vh - 64px); }
  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; height: 64px; padding: 0 13px; }
  .mobile-brand { display: flex; align-items: center; gap: 5px; font-size: 11px; letter-spacing: .1em; }
  .mobile-brand .brand-symbol { width: 24px; height: 23px; }
  .mobile-brand .brand-symbol i { width: 5px; }
  .mobile-brand .brand-symbol i:nth-child(1) { height: 18px; }
  .mobile-brand .brand-symbol i:nth-child(2) { height: 14px; }
  .mobile-brand .brand-symbol i:nth-child(3) { height: 10px; }
  .page-context { display: none; }
  .command-trigger { min-width: 0; width: 100%; }
  .command-trigger span:nth-child(2) { font-size: 9px; }
  .command-trigger kbd, #notifications-button, .user-button div { display: none; }
  .user-button { padding: 0; }
  .user-button > span { width: 36px; height: 36px; }
  .page-shell { width: min(100% - 24px,1500px); padding: 22px 0 40px; }
  .page-head { align-items: start; flex-direction: column; gap: 13px; }
  .pipeline-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pipeline-toolbar { overflow-x: auto; padding-bottom: 3px; }
  .pipeline-search { min-width: 220px; }
  .filter-select { display: none; }
  .kanban-board { grid-template-columns: repeat(5,82vw); }
  .kanban-column { min-height: 510px; }
  .dashboard-grid, .forecast-layout { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .list-table { min-width: 760px; }
  .table-wrap { overflow-x: auto; }
  .assistant-fab { display: none; }
  .mobile-nav { position: fixed; z-index: 850; left: 0; right: 0; bottom: 0; height: 64px; display: grid; grid-template-columns: repeat(5,1fr); border-top: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter: blur(15px); }
  .mobile-nav a, .mobile-nav button { display: grid; place-items: center; align-content: center; gap: 1px; border: 0; background: transparent; color: var(--ink-3); font-size: 7px; font-weight: 800; }
  .mobile-nav span { font-size: 17px; line-height: 1; }
  .mobile-nav .active { color: var(--signal); }
  .mobile-nav #mobile-create span { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--canvas); }
  .toast-region { top: 72px; right: 10px; left: 10px; }
  .toast { min-width: 0; }
}

@media (max-width: 480px) {
  .pipeline-summary { gap: 7px; }
  .metric-card { padding: 11px; }
  .metric-card strong { font-size: 17px; }
  .view-switch { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .drawer-body { padding: 18px; }
  .assistant-drawer { padding: 16px; }
  .modal-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
