:root {
  --ink: #17213d;
  --ink-2: #273250;
  --muted: #6f7891;
  --muted-2: #9ba3b7;
  --line: #e5e8f0;
  --line-strong: #d7dce8;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --canvas-2: #f0f2f8;
  --primary: #5b51d8;
  --primary-dark: #4438bc;
  --primary-soft: #eeedff;
  --green: #199b6f;
  --green-soft: #e8f7f1;
  --blue: #3186d9;
  --blue-soft: #eaf4ff;
  --amber: #d28b24;
  --amber-soft: #fff5df;
  --red: #d45361;
  --red-soft: #fff0f1;
  --shadow: 0 12px 36px rgba(30, 40, 76, .07);
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.muted-copy { margin: 4px 0; color: var(--muted); font-size: 13px; }
.mobile-only { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); padding: 24px 18px 18px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 24px; }
.brand { display: inline-flex; align-items: baseline; text-decoration: none; white-space: nowrap; letter-spacing: -.7px; }
.brand-123 { padding: 4px 5px 3px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.8px; line-height: 1; }
.brand-name { margin-left: 4px; color: #273052; font-size: 18px; font-weight: 750; }
.brand-dot { color: #f1a526; font-size: 22px; font-weight: 800; }
.workspace-chip { display: flex; align-items: center; gap: 10px; margin: 4px 0 28px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfe; }
.workspace-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-weight: 750; }
.workspace-chip div { display: grid; min-width: 0; }
.workspace-chip strong { font-size: 12px; font-weight: 700; }
.workspace-chip small { color: var(--muted); font-size: 10px; }
.nav-caption { margin: 0 12px 9px; color: var(--muted-2); font-size: 10px; font-weight: 750; letter-spacing: 1.2px; }
.main-nav { display: grid; gap: 4px; }
.main-nav a { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 12px; border-radius: 9px; color: #66708b; text-decoration: none; font-size: 13px; font-weight: 550; transition: .16s ease; }
.main-nav a:hover { color: var(--ink); background: #f5f6fa; }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 680; }
.sidebar-spacer { flex: 1; }
.sidebar-profile { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.sidebar-profile > div:not(.profile-dropdown) { min-width: 0; display: grid; }
.sidebar-profile strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: var(--muted); font-size: 10px; }
.profile-menu-trigger { width: 25px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.profile-dropdown { position: absolute; right: 0; bottom: 51px; z-index: 5; width: 205px; display: none; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.profile-dropdown.open { display: grid; }
.profile-dropdown a, .profile-dropdown button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 7px; color: var(--ink-2); background: transparent; text-align: left; text-decoration: none; font-size: 12px; cursor: pointer; }
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--canvas); }
.profile-dropdown form { margin: 0; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 18px clamp(24px, 4vw, 58px); border-bottom: 1px solid rgba(229,232,240,.9); background: rgba(246,247,251,.94); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.55px; font-weight: 680; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 9px; font-weight: 780; letter-spacing: 1.25px; text-transform: uppercase; }
.menu-button { display: none; }
.global-search { width: min(390px, 34vw); display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; }
.global-search input { min-width: 0; flex: 1; height: 42px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.global-search kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted-2); background: var(--canvas); font-family: inherit; font-size: 9px; }
.page-content { max-width: 1580px; margin: 0 auto; padding: 31px clamp(24px, 4vw, 58px) 60px; }

.welcome-row, .list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 25px; }
.welcome-row h2, .list-toolbar h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.35px; }
.welcome-row p, .list-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 680; text-decoration: none; cursor: pointer; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 6px 14px rgba(91,81,216,.19); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border-color: var(--line-strong); color: var(--ink-2); background: #fff; }
.button-secondary:hover { border-color: #c8cde0; background: #fafbfe; }
.button-large { width: 100%; min-height: 47px; margin-top: 6px; }
.button-small { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.icon-button { display: inline-grid; width: 35px; height: 35px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--canvas-2); }
.icon-button.bordered { width: 31px; height: 31px; border: 1px solid var(--line); background: #fff; }
.text-button { display: inline-flex; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 680; cursor: pointer; }
.inline-form { display: inline-flex; margin: 0; }

.alert { display: flex; align-items: center; gap: 9px; margin: 0 0 19px; padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; }
.alert > span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; font-weight: 800; }
.alert-success { border-color: #cbeadd; color: #147956; background: var(--green-soft); }
.alert-success > span { color: #fff; background: var(--green); }
.alert-error { border-color: #f0ccd0; color: #a53d49; background: var(--red-soft); }
.alert-error > span { color: #fff; background: var(--red); }

.panel { border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 18px rgba(27,37,70,.025); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 23px 18px; }
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 670; letter-spacing: -.2px; }
.panel-header > a { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 11px; font-weight: 680; text-decoration: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.metric-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 11px; }
.metric-icon.purple { color: var(--primary); background: var(--primary-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-card > div:last-child { min-width: 0; display: grid; }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 620; text-transform: uppercase; letter-spacing: .45px; }
.metric-card strong { overflow: hidden; margin: 3px 0 1px; font-size: 21px; line-height: 1.25; letter-spacing: -.5px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { color: var(--muted-2); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 18px; }
.recent-panel { grid-column: 1 / -1; }
.funnel-list { padding: 2px 23px 23px; }
.funnel-row { display: grid; grid-template-columns: 9px 112px minmax(80px, 1fr) 28px 95px; align-items: center; gap: 10px; min-height: 42px; border-top: 1px solid #f1f2f6; }
.funnel-row:first-child { border-top: 0; }
.stage-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--stage-color, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color, var(--primary)) 13%, transparent); }
.funnel-row strong { overflow: hidden; font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.funnel-row b { text-align: right; font-size: 12px; }
.funnel-row small { color: var(--muted); text-align: right; font-size: 10px; }
.funnel-track { height: 6px; overflow: hidden; border-radius: 99px; background: #f0f1f6; }
.funnel-track span { display: block; height: 100%; border-radius: inherit; background: var(--stage-color); opacity: .78; }
.task-list { padding: 1px 20px 18px; }
.task-row { display: flex; align-items: center; gap: 11px; padding: 11px 3px; border-top: 1px solid #f0f1f5; text-decoration: none; }
.task-row:first-child { border-top: 0; }
.task-row > div { min-width: 0; flex: 1; display: grid; }
.task-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-row small { color: var(--muted); font-size: 10px; }
.task-row time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.activity-symbol, .timeline-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 9px; }
.activity-symbol.call, .timeline-icon.call { color: var(--blue); background: var(--blue-soft); }
.activity-symbol.email, .timeline-icon.email { color: var(--primary); background: var(--primary-soft); }
.activity-symbol.meeting, .timeline-icon.meeting { color: var(--amber); background: var(--amber-soft); }
.activity-symbol.note, .timeline-icon.note { color: #7d6f91; background: #f3eff7; }
.activity-symbol.task, .timeline-icon.task { color: var(--green); background: var(--green-soft); }
.activity-stream { padding: 0 23px 22px; }
.stream-row { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid #f0f1f5; }
.stream-row:first-child { border-top: 0; }
.stream-row > div { min-width: 0; }
.stream-row p { margin: 0 0 3px; color: var(--ink-2); font-size: 11px; }
.stream-row p strong { font-weight: 680; }
.stream-row p a { color: var(--primary); font-weight: 650; text-decoration: none; }
.stream-row small { color: var(--muted); font-size: 10px; }
.empty-compact { display: grid; justify-items: center; padding: 24px 12px; color: var(--muted); text-align: center; }
.empty-compact > span { color: var(--primary); }
.empty-compact p { max-width: 320px; margin: 9px 0 0; font-size: 11px; }

.table-panel { overflow: hidden; }
.filter-bar { display: flex; align-items: center; gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.filter-search { min-width: 240px; max-width: 470px; flex: 1; display: flex; align-items: center; gap: 8px; height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; }
.filter-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filter-bar select, .compact-filter select { min-width: 150px; height: 39px; padding: 0 31px 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; font-size: 11px; }
.compact-filter { justify-content: flex-end; }
.data-table-wrap { overflow: auto; }
.data-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.data-table th { padding: 11px 17px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; font-weight: 720; letter-spacing: .55px; text-transform: uppercase; }
.data-table td { padding: 13px 17px; border-bottom: 1px solid #eef0f4; color: var(--ink-2); font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfe; }
.data-table td > strong { font-size: 11px; }
.account-cell { display: flex; min-width: 210px; align-items: center; gap: 10px; text-decoration: none; }
.account-cell > span:last-child { min-width: 0; display: grid; }
.account-cell strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-cell small { color: var(--muted); font-size: 10px; }
.company-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; color: var(--primary); background: linear-gradient(135deg, #efeeff, #e6eaff); font-size: 11px; font-weight: 780; }
.company-avatar-xl { width: 60px; height: 60px; flex-basis: 60px; border-radius: 15px; font-size: 17px; }
.avatar { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; color: #50469f; background: #eae8fb; font-size: 9px; font-weight: 760; }
.avatar-dark { color: #fff; background: #344064; }
.avatar-xs { width: 24px; height: 24px; flex-basis: 24px; font-size: 7px; }
.owner-cell, .owner-stat { display: flex; align-items: center; gap: 7px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-lead, .status-planned { color: var(--blue); background: var(--blue-soft); }
.status-prospect { color: #8b64b1; background: #f3ebfa; }
.status-customer, .status-completed, .status-active { color: var(--green); background: var(--green-soft); }
.status-inactive, .status-cancelled { color: var(--muted); background: #eef0f4; }
.row-arrow { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: var(--muted); text-decoration: none; }
.row-arrow:hover { color: var(--primary); background: var(--primary-soft); }
.empty-state { display: grid; justify-items: center; padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.empty-state h3 { margin: 13px 0 4px; color: var(--ink); font-size: 14px; }
.empty-state p { max-width: 410px; margin: 0; font-size: 11px; }

.breadcrumb { display: flex; align-items: center; gap: 5px; margin: -8px 0 18px; color: var(--muted); font-size: 10px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.company-hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; margin-bottom: 18px; padding: 22px 24px 0; }
.company-heading { display: flex; align-items: center; gap: 15px; }
.company-title-row { display: flex; align-items: center; gap: 9px; }
.company-title-row h2 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.company-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.company-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin: 2px -24px 0; border-top: 1px solid var(--line); }
.company-stats > div { display: grid; gap: 4px; padding: 14px 24px; border-right: 1px solid var(--line); }
.company-stats > div:last-child { border-right: 0; }
.company-stats span { color: var(--muted); font-size: 9px; font-weight: 620; text-transform: uppercase; letter-spacing: .45px; }
.company-stats strong { font-size: 13px; font-weight: 680; }
.company-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(315px, .65fr); gap: 18px; align-items: start; }
.company-sidebar { display: grid; gap: 18px; }
.timeline { padding: 0 23px 24px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 13px; padding-bottom: 17px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 34px; bottom: 0; left: 16px; width: 1px; content: ''; background: var(--line); }
.timeline-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfe; }
.timeline-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timeline-card header > div { display: flex; align-items: center; gap: 7px; }
.timeline-card header strong { font-size: 12px; }
.timeline-card time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.activity-type-label { padding: 3px 6px; border-radius: 5px; color: var(--muted); background: #eef0f5; font-size: 8px; font-weight: 680; text-transform: uppercase; }
.timeline-card > p { margin: 9px 0; color: #566079; font-size: 11px; line-height: 1.55; }
.timeline-card footer { display: flex; align-items: center; gap: 6px; padding-top: 9px; border-top: 1px solid #ebedf3; color: var(--muted); font-size: 9px; }
.timeline-card footer .inline-form { margin-left: auto; }
.detail-list { margin: 0; padding: 0 23px 21px; }
.detail-list > div { display: grid; grid-template-columns: 105px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f1f5; font-size: 10px; }
.detail-list > div:first-child { border-top: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; color: var(--ink-2); font-weight: 550; overflow-wrap: anywhere; }
.detail-list a, .contact-row a { color: var(--primary); text-decoration: none; }
.contact-list, .mini-deal-list { display: grid; padding: 0 20px 20px; }
.contact-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 3px; border-top: 1px solid #f0f1f5; }
.contact-row:first-child { border-top: 0; }
.contact-row > div { min-width: 0; display: grid; }
.contact-row strong { font-size: 11px; }
.contact-row small, .contact-row div > span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.primary-star { margin-left: 3px; color: #e8a329; font-size: 9px; }
.mini-deal-list article { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 3px; border-top: 1px solid #f0f1f5; }
.mini-deal-list article:first-child { border-top: 0; }
.mini-deal-list article > div { min-width: 0; display: grid; }
.mini-deal-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mini-deal-list small { color: var(--muted); font-size: 8px; }
.mini-deal-list b { font-size: 10px; }

.pipeline-toolbar { margin-bottom: 18px; }
.kanban { display: flex; gap: 13px; padding: 1px 1px 18px; overflow: auto; scroll-snap-type: x proximity; }
.kanban-column { width: 278px; min-width: 278px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; background: #f1f3f8; }
.kanban-column > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 12px 12px 10px; }
.kanban-column > header > div { display: flex; align-items: center; gap: 8px; }
.kanban-column > header strong { font-size: 10px; font-weight: 720; text-transform: uppercase; letter-spacing: .3px; }
.kanban-column > header small { color: var(--muted); font-size: 9px; }
.count-badge { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 99px; color: var(--muted); background: #e5e8ef; font-size: 9px; font-weight: 700; }
.kanban-dropzone { min-height: 530px; padding: 0 9px 10px; transition: background .15s; }
.kanban-column.drag-over .kanban-dropzone { background: #e7e7fa; }
.deal-card { position: relative; margin: 0 0 9px; padding: 13px; border: 1px solid #e1e4ed; border-radius: 10px; background: #fff; box-shadow: 0 3px 9px rgba(31,42,76,.045); cursor: grab; }
.deal-card.dragging { opacity: .42; transform: rotate(1deg); }
.deal-grip { position: absolute; top: 7px; right: 10px; color: #c3c8d5; font-size: 11px; letter-spacing: 1px; }
.deal-card a { display: grid; padding-right: 18px; text-decoration: none; }
.deal-card a small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.deal-card h3 { margin: 5px 0 9px; font-size: 12px; line-height: 1.4; }
.deal-amount { display: block; margin-bottom: 13px; font-size: 14px; letter-spacing: -.2px; }
.deal-meta { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.deal-meta > span:first-child { display: flex; align-items: center; gap: 4px; font-size: 9px; }
.deal-meta .overdue { color: var(--red); }
.kanban-empty { display: none; padding: 17px; border: 1px dashed #a9a5e6; border-radius: 9px; color: var(--primary); text-align: center; font-size: 9px; text-transform: uppercase; }
.kanban-column.drag-over .kanban-empty { display: block; }

.activity-list-full { display: grid; }
.activity-full-row { display: grid; grid-template-columns: 34px minmax(220px, 1.5fr) 82px minmax(120px, .6fr) 82px 18px; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid #eef0f4; text-decoration: none; }
.activity-full-row:hover { background: #fcfcfe; }
.activity-full-main { min-width: 0; display: grid; }
.activity-full-main strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.activity-full-main span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-owner { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 9px; }
.activity-full-row time { color: var(--muted); font-size: 9px; text-align: right; }

.permission-explainer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.permission-explainer article { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.permission-explainer strong { font-size: 11px; }
.permission-explainer p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.role-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 800; }
.role-icon.admin, .role-badge.role-admin { color: var(--primary); background: var(--primary-soft); }
.role-icon.manager, .role-badge.role-manager { color: var(--blue); background: var(--blue-soft); }
.role-icon.seller, .role-badge.role-seller { color: var(--green); background: var(--green-soft); }
.role-badge { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 700; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20,27,50,.5); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(670px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(18,25,48,.25); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 25px 19px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.modal-header p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal-form { padding: 21px 25px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 14px; }
.form-grid label, .stack-form label { display: grid; align-content: start; gap: 6px; margin: 0; color: var(--ink-2); font-size: 10px; font-weight: 670; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea, .stack-form input, .stack-form select, .stack-form textarea { width: 100%; min-height: 41px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; font-weight: 450; transition: .15s; }
.form-grid textarea, .stack-form textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: #9d96ee; box-shadow: 0 0 0 3px rgba(91,81,216,.10); }
.form-grid label > small, .stack-form label > small { color: var(--muted); font-size: 9px; font-weight: 450; }
.form-grid .checkbox-label { display: flex; align-items: center; align-self: end; min-height: 41px; flex-direction: row; gap: 8px; }
.checkbox-label input { width: 16px; min-height: 16px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.activity-type-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 18px; }
.activity-type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.activity-type-picker span { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; cursor: pointer; }
.activity-type-picker input:checked + span { border-color: #aaa4ef; color: var(--primary); background: var(--primary-soft); font-weight: 700; }
body.modal-open { overflow: hidden; }

.settings-card { max-width: 680px; margin: 20px auto; padding: 27px; }
.settings-intro { display: flex; align-items: center; gap: 14px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.settings-intro h2 { margin: 0 0 4px; font-size: 18px; }
.settings-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.stack-form { display: grid; gap: 17px; }
.narrow-form { max-width: 470px; margin-top: 22px; }

.login-page { overflow-x: hidden; background: #fff; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, .96fr) minmax(440px, 1.04fr); }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100vh; padding: 44px clamp(38px, 5vw, 76px); color: #fff; background: radial-gradient(circle at 80% 20%, #6d65df 0, transparent 35%), linear-gradient(145deg, #25285b 0%, #3f389e 57%, #5447c6 100%); }
.brand-login { position: relative; z-index: 2; align-self: flex-start; }
.brand-login .brand-123 { color: #39358f; background: #fff; }
.brand-login .brand-name { color: #fff; }
.login-visual { position: relative; flex: 1; display: grid; place-items: center; min-height: 420px; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.orbit-one { width: 560px; height: 560px; }
.orbit-two { width: 380px; height: 380px; }
.pipeline-preview { position: relative; z-index: 2; width: min(590px, 97%); padding: 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(255,255,255,.12); box-shadow: 0 32px 70px rgba(12,12,46,.28); backdrop-filter: blur(14px); transform: perspective(900px) rotateY(-4deg) rotateX(2deg); }
.preview-top { display: flex; gap: 5px; padding: 0 2px 11px; }
.preview-top span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); }
.preview-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-columns > div { min-height: 220px; padding: 10px; border-radius: 10px; background: rgba(22,23,68,.25); }
.preview-columns small { display: block; margin: 0 0 9px; color: rgba(255,255,255,.6); font-size: 7px; letter-spacing: .7px; }
.preview-columns article { display: grid; gap: 16px; margin-bottom: 8px; padding: 13px 11px; border-radius: 8px; color: #303458; background: rgba(255,255,255,.94); }
.preview-columns article b { font-size: 9px; }
.preview-columns article span { font-size: 11px; font-weight: 750; }
.preview-columns article.short { min-height: 68px; }
.preview-columns article.accent { background: #fff5d8; }
.login-quote { position: relative; z-index: 2; max-width: 520px; }
.login-quote p { margin: 0 0 7px; font-family: Georgia, serif; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.3; letter-spacing: -.3px; }
.login-quote span { color: rgba(255,255,255,.65); font-size: 11px; }
.login-form-panel { display: grid; place-items: center; padding: 48px clamp(32px, 7vw, 105px); background: #fff; }
.login-form-wrap { width: min(410px, 100%); }
.login-form-wrap h1 { margin: 0 0 8px; font-size: 31px; line-height: 1.15; letter-spacing: -.8px; }
.login-subtitle { margin: 0 0 31px; color: var(--muted); font-size: 13px; }
.login-form-wrap .stack-form { gap: 18px; }
.login-security { margin: 24px 0 0; color: var(--muted-2); text-align: center; font-size: 9px; }

.error-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.error-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.brand-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 20px; place-items: center; border-radius: 14px; color: #fff; background: var(--primary); font-size: 18px; font-weight: 800; }
.error-card h1 { margin: 0 0 8px; font-size: 23px; }
.error-card p { margin: 0 0 22px; color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; max-width: 340px; padding: 12px 15px; border-radius: 9px; color: #fff; background: #222b48; box-shadow: var(--shadow); font-size: 11px; }
.sidebar-overlay { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .company-layout { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
  .activity-full-row { grid-template-columns: 34px minmax(210px, 1fr) 80px 80px 18px; }
  .activity-owner { display: none; }
}

@media (max-width: 920px) {
  :root { --sidebar: 236px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(20,27,50,.15); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; border: 0; background: rgba(20,27,50,.35); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .mobile-only { display: inline-grid !important; }
  .dashboard-grid, .company-layout { grid-template-columns: 1fr; }
  .company-sidebar { grid-template-columns: repeat(2, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; }
}

@media (max-width: 680px) {
  .topbar { height: auto; min-height: 78px; padding: 15px 18px; }
  .topbar h1 { font-size: 19px; }
  .global-search { display: none; }
  .page-content { padding: 22px 16px 45px; }
  .welcome-row, .list-toolbar { align-items: flex-start; flex-direction: column; }
  .welcome-row .header-actions, .list-toolbar .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { align-items: flex-start; gap: 9px; padding: 13px; }
  .metric-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .metric-card strong { font-size: 16px; }
  .metric-card small { display: none; }
  .metric-card span { font-size: 8px; }
  .funnel-row { grid-template-columns: 9px 95px minmax(60px, 1fr) 22px; }
  .funnel-row small { display: none; }
  .company-hero { grid-template-columns: 1fr; padding: 18px 18px 0; }
  .company-hero > .header-actions { width: 100%; }
  .company-stats { grid-template-columns: 1fr 1fr; margin: 0 -18px; }
  .company-stats > div:nth-child(2) { border-right: 0; }
  .company-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .company-sidebar { grid-template-columns: 1fr; }
  .detail-panel { grid-column: auto; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-search, .filter-bar select { width: 100%; max-width: none; }
  .activity-full-row { grid-template-columns: 34px minmax(0, 1fr) 18px; }
  .activity-full-row > .status-pill, .activity-full-row > time { display: none; }
  .permission-explainer { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .activity-type-picker { grid-template-columns: repeat(3, 1fr); }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .modal-header, .modal-form { padding-left: 18px; padding-right: 18px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .company-title-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .timeline-card header { flex-direction: column; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card small { display: block; }
  .company-heading { align-items: flex-start; }
  .company-avatar-xl { width: 48px; height: 48px; flex-basis: 48px; }
  .login-form-panel { padding: 35px 22px; }
  .login-form-wrap h1 { font-size: 27px; }
}

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