:root {
    --ink: #172033;
    --muted: #667085;
    --faint: #98a2b3;
    --line: #e7eaf0;
    --surface: #ffffff;
    --canvas: #f5f6f8;
    --nav: #0e1728;
    --nav-soft: #182337;
    --accent: #635bff;
    --accent-soft: #efeeff;
    --success: #087a5b;
    --success-soft: #eaf8f3;
    --warning: #a15c00;
    --warning-soft: #fff4df;
    --danger: #c4324b;
    --danger-soft: #fff0f2;
    --shadow: 0 14px 45px rgba(24, 34, 55, 0.08);
    --radius: 14px;
    --sidebar: 252px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -0.035em; }
h2 { margin-bottom: 3px; font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; }
h3 { letter-spacing: -0.02em; }
small { color: var(--muted); }
code { padding: 3px 6px; border-radius: 5px; color: #4b44cc; background: var(--accent-soft); font-size: 12px; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar);
    flex-direction: column;
    padding: 22px 16px 16px;
    color: #dce3ef;
    background: var(--nav);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 7px; color: inherit; }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; color: white; background: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; box-shadow: 0 8px 25px rgba(99,91,255,.3); }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { color: #fff; font-size: 17px; letter-spacing: -.02em; }
.brand small { color: #8f9bb0; font-size: 11px; }
.nav-stack { display: flex; flex: 1; flex-direction: column; gap: 3px; margin-top: 30px; overflow-y: auto; }
.nav-label { margin: 19px 10px 6px; color: #68758a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; min-height: 39px; align-items: center; justify-content: space-between; padding: 0 11px; border-radius: 8px; color: #aeb8c8; font-weight: 590; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { color: white; background: var(--nav-soft); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item kbd { color: #637086; background: transparent; }
.sidebar-foot { display: grid; gap: 13px; }
.copilot-launch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid rgba(135,126,255,.26); border-radius: 11px; color: #fff; background: linear-gradient(145deg, rgba(99,91,255,.2), rgba(99,91,255,.06)); text-align: left; cursor: pointer; transition: border .2s, transform .2s; }
.copilot-launch:hover { border-color: rgba(135,126,255,.6); transform: translateY(-1px); }
.copilot-launch > span:last-child { display: flex; flex-direction: column; }
.copilot-launch small { color: #929db2; font-size: 10px; }
.spark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); }
.user-row { display: flex; align-items: center; gap: 9px; padding: 10px 7px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #fff; background: #344056; font-size: 12px; font-weight: 800; }
.user-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.user-copy strong { overflow: hidden; color: white; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #7f8ba0; font-size: 10px; }
.user-row .icon-button { color: #96a2b6; }

.app-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 68px; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(16px); }
.global-search { display: flex; max-width: 600px; flex: 1; align-items: center; gap: 10px; }
.search-submit { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.search-submit:hover { color: var(--ink); }
.global-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.global-search input::placeholder { color: #9aa3b2; }
kbd { padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); background: #fafafa; font-size: 10px; }
.topbar-ai { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid #dedcff; border-radius: 9px; color: #4b44cc; background: var(--accent-soft); font-weight: 700; cursor: pointer; }
.topbar-ai:hover { border-color: #bcb8ff; }
.mobile-menu { display: none; }
.workspace { width: 100%; max-width: 1700px; margin: 0 auto; padding: 30px 32px 70px; }

.page-head, .record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head p, .record-head p { margin: 0; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 7px; color: #7d8899; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.head-actions form { margin: 0; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--accent); box-shadow: 0 7px 18px rgba(99,91,255,.18); }
.button.primary:hover { background: #544ce2; }
.button.secondary { border-color: #dce0e8; color: #344054; background: white; }
.button.secondary:hover { background: #fafbfc; box-shadow: 0 5px 14px rgba(20,31,50,.06); }
.button.ai-button { border-color: #dedcff; color: #4b44cc; background: var(--accent-soft); }
.button.compact { min-height: 35px; padding-inline: 12px; font-size: 12px; }
.button.full { width: 100%; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 17px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: rgba(127,140,162,.1); }
.text-link, .section-head > a { color: #514ac9; font-size: 12px; font-weight: 700; }

.metric-ribbon { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 22px rgba(30,44,70,.04); }
.metric-ribbon > div { display: flex; min-height: 122px; flex-direction: column; justify-content: center; padding: 20px; border-right: 1px solid var(--line); }
.metric-ribbon > div:last-child { border-right: 0; }
.metric-ribbon > div.attention { background: linear-gradient(145deg, #fff, #fff6f7); }
.metric-ribbon span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.metric-ribbon strong { margin: 6px 0 1px; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.035em; }
.metric-ribbon small { font-size: 11px; }
.revenue-ribbon { grid-template-columns: repeat(3, 1fr); }
.report-ribbon { grid-template-columns: repeat(5, 1fr); }

.dashboard-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 22px; margin-bottom: 22px; }
.dashboard-grid.lower { grid-template-columns: 1fr 1fr; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.section-head h2 { margin: 0; }
.section-head > span, .section-head > small { color: var(--muted); font-size: 11px; }
.rows { border-top: 1px solid var(--line); }
.data-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto minmax(105px, auto) 22px; align-items: center; gap: 15px; min-height: 66px; padding: 10px 2px; border-bottom: 1px solid var(--line); transition: background .15s; }
.data-row:hover { background: #fafaff; }
.data-row:last-child { border-bottom: 0; }
.compact-rows .data-row { grid-template-columns: 14px minmax(150px, 1fr) auto; }
.row-main { display: flex; min-width: 0; flex-direction: column; }
.row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { display: flex; align-items: flex-end; flex-direction: column; text-align: right; }
.row-value strong { font-size: 12px; }
.row-value small { font-size: 10px; }
.check-dot { display: inline-block; width: 10px; height: 10px; border: 2px solid #adb7c5; border-radius: 50%; }
.check-dot.waiting { border-color: #f3a024; background: var(--warning-soft); }
.check-dot.complete { border-color: var(--success); background: var(--success); }
.mini-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.mini-metrics > div { display: flex; flex-direction: column; padding: 21px 12px 8px; border-right: 1px solid var(--line); }
.mini-metrics > div:last-child { border-right: 0; }
.mini-metrics strong { font-size: 26px; }
.mini-metrics span { color: var(--muted); font-size: 11px; }
.sales-metrics { grid-template-columns: repeat(5, 1fr); }
.plan-lines { border-top: 1px solid var(--line); }
.plan-lines > div { display: flex; align-items: center; justify-content: space-between; padding: 13px 3px; border-bottom: 1px solid var(--line); }
.plan-lines span { display: flex; flex-direction: column; }
.plan-lines small { font-size: 10px; }

.badge { display: inline-flex; width: max-content; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 999px; color: #596477; background: #eef1f5; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.accent { color: #514ac9; background: var(--accent-soft); }
.text-danger { color: var(--danger) !important; }
.empty-state { padding: 35px 15px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); }
.empty-state p { margin: 5px 0 0; }
.empty-state.large { padding-top: 16vh; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 12px 15px; border: 1px solid #d5eee6; border-radius: 10px; color: var(--success); background: var(--success-soft); }
.flash.warning { border-color: #f7dfb5; color: var(--warning); background: var(--warning-soft); }
.flash.danger { border-color: #f4cfd6; color: var(--danger); background: var(--danger-soft); }
.flash button { border: 0; color: inherit; background: transparent; font-size: 20px; cursor: pointer; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 17px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-bar input, .filter-bar select { min-width: 145px; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; }
.filter-bar .text-link { margin: 0 6px 9px; }
.table-shell, .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.panel .table-scroll { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 17px; border-bottom: 1px solid var(--line); color: #7b8697; background: #fafbfc; font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { height: 68px; padding: 10px 17px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbfe; }
td > small { display: block; }
.table-title { display: block; color: var(--ink); font-weight: 700; }

.kanban { display: grid; grid-auto-columns: 290px; grid-auto-flow: column; gap: 12px; margin-inline: -10px; padding: 0 10px 18px; overflow-x: auto; scroll-snap-type: x proximity; }
.kanban-column { min-height: 560px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #eef1f5; scroll-snap-align: start; }
.kanban-column > header { display: flex; align-items: flex-start; justify-content: space-between; min-height: 45px; padding: 2px 3px 10px; }
.kanban-column > header span { display: flex; flex-direction: column; }
.kanban-column > header > strong { color: var(--muted); font-size: 11px; }
.kanban-stack { display: grid; gap: 9px; }
.lead-card { padding: 14px; border: 1px solid #e2e5eb; border-radius: 10px; background: white; box-shadow: 0 4px 13px rgba(25,36,57,.035); transition: transform .16s, box-shadow .16s; }
.lead-card:hover { transform: translateY(-2px); box-shadow: 0 9px 23px rgba(25,36,57,.08); }
.lead-card > a { display: flex; flex-direction: column; }
.lead-values { display: flex; gap: 8px; margin: 14px 0; }
.lead-values span { padding: 4px 7px; border-radius: 6px; color: #566074; background: #f3f5f8; font-size: 10px; font-weight: 700; }
.lead-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.lead-meta .spacer { flex: 1; }
.priority-dot { width: 6px; height: 6px; border-radius: 50%; background: #a3adba; }
.priority-dot.high { background: #e69620; }.priority-dot.critical { background: var(--danger); }.priority-dot.medium { background: var(--accent); }
.stage-control { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.stage-control select { width: 100%; border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.kanban-empty { padding: 30px 10px; color: #9aa3b1; text-align: center; font-size: 11px; }

.record-form { display: grid; gap: 16px; }
.record-form > section { display: grid; grid-template-columns: minmax(180px, .35fr) 1fr; gap: 28px; padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.record-form.narrow-form { max-width: 1060px; }
.form-section-head { display: flex; align-items: flex-start; gap: 13px; }
.form-section-head > span { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #514ac9; background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.form-section-head p { color: var(--muted); font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-grid label, .auth-form label { display: flex; flex-direction: column; gap: 6px; color: #4d596c; font-size: 11px; font-weight: 720; }
.field-grid label > span, .auth-form label > span { color: var(--danger); }
.field-grid input, .field-grid select, .field-grid textarea, .record-ribbon select, .task-row select, .auth-form input, .note-compose textarea { width: 100%; border: 1px solid #dce1e9; border-radius: 8px; outline: 0; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
.field-grid input, .field-grid select, .auth-form input { height: 41px; padding: 0 11px; }
.field-grid textarea, .note-compose textarea { padding: 10px 11px; resize: vertical; }
.field-grid input:focus, .field-grid select:focus, .field-grid textarea:focus, .auth-form input:focus, .note-compose textarea:focus { border-color: #9c97ff; box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
.field-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.sensitive-warning { color: #9b5d08; }

.record-head { align-items: center; }
.record-identity { display: flex; align-items: center; gap: 15px; }
.company-monogram { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; border: 1px solid #dcd9ff; border-radius: 14px; color: #514ac9; background: var(--accent-soft); font-size: 14px; font-weight: 850; }
.record-ribbon { display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 22px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.record-ribbon > div { display: flex; min-height: 79px; flex-direction: column; justify-content: center; padding: 13px 15px; border-right: 1px solid var(--line); }
.record-ribbon > div:last-child { border-right: 0; }
.record-ribbon > div > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.record-ribbon > div > strong { margin-top: 5px; font-size: 15px; }
.record-ribbon form { margin-top: 3px; }
.record-ribbon select { height: 28px; padding: 0 5px; font-weight: 700; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 22px; }
.record-main, .record-side { display: grid; gap: 22px; }
.record-side { position: sticky; top: 90px; }
.ai-status { padding: 5px 8px; border-radius: 999px; color: #514ac9 !important; background: var(--accent-soft); font-weight: 700; }
.action-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #e4e2ff; border-radius: 10px; overflow: hidden; }
.action-strip button { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 15px; border: 0; border-right: 1px solid #e4e2ff; color: var(--ink); background: #fbfaff; text-align: left; cursor: pointer; }
.action-strip button:last-child { border-right: 0; }
.action-strip button:hover { background: var(--accent-soft); }
.action-strip strong, .action-strip small { grid-column: 1; }
.action-strip span { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent); }
.score-ring { display: flex; align-items: baseline; gap: 2px; color: var(--accent) !important; font-size: 22px !important; font-weight: 800; }
.score-ring small { font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.detail-grid > div { min-height: 85px; padding: 14px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid > div:nth-child(2n) { border-right: 0; }
dt { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
dd { margin: 0; overflow-wrap: anywhere; }
dd a { color: #514ac9; }
.side-details { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.side-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; padding: 11px 1px; border-bottom: 1px solid var(--line); }
.side-details dd { text-align: right; }
.side-details.horizontal { grid-template-columns: repeat(2, 1fr); }
.side-details.horizontal > div { display: block; }
.side-details.horizontal dd { margin-top: 5px; text-align: left; }
.finding-list { border-top: 1px solid var(--line); }
.finding-list article { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; padding: 15px 2px; border-bottom: 1px solid var(--line); }
.finding-list article > div > div { display: flex; gap: 8px; }
.finding-list p { margin: 4px 0; color: #4d596c; }
.finding-list time { color: var(--muted); font-size: 10px; }
.severity { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: #aab3c0; }
.severity.high { background: #e69620; }.severity.critical { background: var(--danger); }.severity.medium { background: var(--accent); }.severity.low { background: #4a9a82; }
.inline-create { margin-top: 15px; }
.inline-create summary { color: #514ac9; font-weight: 750; cursor: pointer; }
.inline-create form { margin-top: 17px; padding: 17px; border-radius: 10px; background: #f8f9fb; }
.note-compose { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.note-compose label { display: block; margin-bottom: 7px; font-weight: 700; }
.note-compose > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 9px; }
.timeline { display: grid; margin-top: 2px; }
.timeline article { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 9px 0; }
.timeline article > div { display: flex; flex-direction: column; }
.timeline-dot { width: 8px; height: 8px; margin-top: 6px; border: 2px solid #a7a1ff; border-radius: 50%; background: white; box-shadow: 0 0 0 3px var(--accent-soft); }
.notes-timeline { margin-top: 17px; }
.notes-timeline p { margin-bottom: 4px; }
.prose { color: #4f5b6c; font-size: 15px; line-height: 1.7; }
.progress-label { display: flex; min-width: 115px; align-items: center; gap: 7px; }
progress { height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: #e7e9ef; accent-color: var(--accent); }
progress::-webkit-progress-bar { border-radius: 99px; background: #e7e9ef; } progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
.large-progress { margin-top: 20px; }
.large-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; }
.large-progress progress { width: 100%; height: 10px; }

.view-tabs { display: flex; gap: 5px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.view-tabs a { padding: 10px 13px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.view-tabs a.active { border-bottom-color: var(--accent); color: #514ac9; }
.task-list { border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; }
.task-row { display: grid; grid-template-columns: 18px minmax(170px, 1fr) auto minmax(105px, auto) 145px; align-items: center; gap: 15px; min-height: 72px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row select { width: 100%; height: 34px; padding: 0 7px; }

.plan-showcase { margin: 33px 0 22px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; }
.plan { padding: 24px; background: white; }
.plan:nth-child(2) { position: relative; background: #fbfaff; }
.plan:nth-child(2)::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); content: ""; }
.plan-kicker { color: #514ac9; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.plan h3 { margin: 8px 0 2px; font-size: 19px; }
.plan-price { margin: 0; font-size: 27px; font-weight: 820; letter-spacing: -.035em; }
.plan-price small { font-size: 11px; font-weight: 500; }
.plan > p:not(.plan-price) { color: var(--muted); font-size: 11px; }
.plan ul { margin: 16px 0 0; padding: 0; list-style: none; }
.plan li { position: relative; padding: 4px 0 4px 17px; color: #4e5a6b; font-size: 11px; }
.plan li::before { position: absolute; left: 0; color: var(--success); content: "✓"; }
.create-panel { margin-top: 22px; }
.export-links { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.export-links a { display: flex; justify-content: space-between; padding: 15px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.export-links a:nth-child(2n) { border-right: 0; }
.export-links strong { color: #514ac9; font-size: 11px; }

.search-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.search-groups > section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.search-groups .data-row { grid-template-columns: minmax(0,1fr) 20px; }
.settings-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; }
.settings-feature { display: grid; grid-template-columns: 55px 1fr; gap: 20px; }
.settings-icon { display: grid; width: 55px; height: 55px; place-items: center; border-radius: 15px; color: white; background: var(--accent); font-size: 23px; box-shadow: 0 10px 25px rgba(99,91,255,.22); }
.setup-steps { padding-left: 22px; color: #4d596c; }
.setup-steps li { padding: 5px 0; }
.security-note { margin-top: 18px; padding: 14px; border-left: 3px solid #eba032; color: #80520f; background: var(--warning-soft); }
.security-note p { margin: 3px 0 0; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 59; visibility: hidden; opacity: 0; background: rgba(11,20,36,.28); backdrop-filter: blur(2px); transition: opacity .2s, visibility .2s; }
.copilot { position: fixed; inset: 0 0 0 auto; z-index: 60; display: grid; width: min(450px, 100vw); grid-template-rows: auto auto auto 1fr auto; border-left: 1px solid #dedcff; background: white; box-shadow: -20px 0 60px rgba(19,28,47,.14); transform: translateX(102%); transition: transform .24s ease; }
body.copilot-open { overflow: hidden; }
body.copilot-open .copilot { transform: translateX(0); }
body.copilot-open .drawer-backdrop { visibility: visible; opacity: 1; }
.copilot-head { display: flex; align-items: center; justify-content: space-between; padding: 23px 22px 17px; border-bottom: 1px solid var(--line); }
.copilot-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.copilot-head h2 span { color: var(--accent); }
.copilot-context { display: flex; align-items: center; gap: 8px; padding: 10px 22px; color: var(--muted); background: #fafaff; font-size: 11px; }
.context-dot { width: 7px; height: 7px; border-radius: 50%; background: #17a87e; box-shadow: 0 0 0 4px #dff7ef; }
.quick-prompts { display: flex; gap: 7px; padding: 13px 22px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.quick-prompts button { padding: 7px 10px; border: 1px solid #dedcff; border-radius: 999px; color: #514ac9; background: #fafaff; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.quick-prompts button:hover { background: var(--accent-soft); }
.copilot-thread { padding: 22px; overflow-y: auto; }
.ai-welcome { max-width: 280px; margin: 14vh auto 0; text-align: center; }
.spark-large { display: grid; width: 45px; height: 45px; margin: 0 auto 14px; place-items: center; border-radius: 14px; color: white; background: var(--accent); box-shadow: 0 9px 25px rgba(99,91,255,.25); }
.ai-welcome h3 { margin-bottom: 7px; font-size: 18px; }
.ai-welcome p { color: var(--muted); font-size: 12px; }
.ai-message { max-width: 93%; margin-bottom: 14px; padding: 13px 15px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-message.user { margin-left: auto; color: #fff; background: var(--accent); border-bottom-right-radius: 3px; }
.ai-message.assistant { border: 1px solid var(--line); color: #354052; background: #f8f9fb; border-bottom-left-radius: 3px; }
.ai-message.error { border-color: #f3c9d1; color: var(--danger); background: var(--danger-soft); }
.ai-message.loading { color: var(--muted); animation: pulse 1.2s ease infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.copilot-form { padding: 15px 18px 18px; border-top: 1px solid var(--line); background: white; }
.copilot-form > label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.copilot-form textarea { width: 100%; padding: 11px; border: 1px solid #dce1e9; border-radius: 9px; outline: 0; resize: none; }
.copilot-form textarea:focus { border-color: #9c97ff; box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
.copilot-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.copilot-form-foot small { font-size: 9px; }

.auth-page { min-height: 100vh; background: white; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: 1.05fr .95fr; }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 42px; color: white; background: radial-gradient(circle at 85% 15%, rgba(99,91,255,.37), transparent 32%), var(--nav); }
.auth-brand .brand { padding: 0; }
.auth-brand > div { max-width: 590px; }
.auth-brand h1 { max-width: 560px; font-size: clamp(40px, 5vw, 68px); line-height: 1.02; letter-spacing: -.055em; }
.auth-brand p { max-width: 500px; color: #a9b5c8; font-size: 16px; }
.auth-brand > small { color: #7e8a9f; }
.auth-form-wrap { display: grid; place-items: center; padding: 35px; }
.auth-form { width: min(420px, 100%); }
.auth-form h2 { margin-bottom: 6px; font-size: 28px; }
.auth-form > p { margin-bottom: 28px; color: var(--muted); }
.auth-form label { margin-bottom: 15px; }
.auth-form .button { margin-top: 7px; }
.auth-form > small { display: block; margin-top: 14px; text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 1260px) {
    .metric-ribbon { grid-template-columns: repeat(3, 1fr); }
    .metric-ribbon > div:nth-child(3) { border-right: 0; }
    .metric-ribbon > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .report-ribbon { grid-template-columns: repeat(5, 1fr); }
    .report-ribbon > div:nth-child(-n+3) { border-bottom: 0; }
    .record-ribbon { grid-template-columns: repeat(3, 1fr); }
    .record-ribbon > div:nth-child(3) { border-right: 0; }
    .record-ribbon > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 1020px) {
    .record-layout { grid-template-columns: 1fr; }
    .record-side { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
    .record-side .panel:last-child { grid-column: 1 / -1; }
    .settings-layout { grid-template-columns: 1fr; }
    .search-groups { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    :root { --sidebar: 264px; }
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(12,21,36,.22); }
    body.nav-open { overflow: hidden; }
    body.nav-open .sidebar { transform: translateX(0); }
    .app-shell { margin-left: 0; }
    .mobile-menu { display: grid; }
    .topbar { height: 61px; padding: 0 15px; }
    .global-search kbd, .topbar-ai { display: none; }
    .workspace { padding: 22px 16px 55px; }
    .page-head, .record-head { align-items: flex-start; flex-direction: column; }
    .head-actions { justify-content: flex-start; }
    .metric-ribbon, .report-ribbon { grid-template-columns: repeat(2, 1fr); }
    .metric-ribbon > div { min-height: 105px; padding: 15px; border-bottom: 1px solid var(--line); }
    .metric-ribbon > div:nth-child(odd) { border-right: 1px solid var(--line); }
    .metric-ribbon > div:nth-child(even) { border-right: 0; }
    .metric-ribbon > div:nth-last-child(-n+2) { border-bottom: 0; }
    .revenue-ribbon > div:last-child, .report-ribbon > div:last-child { border-bottom: 0; }
    .revenue-ribbon > div:nth-last-child(2), .report-ribbon > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
    .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
    .plan-grid { grid-template-columns: 1fr; }
    .record-form > section { grid-template-columns: 1fr; padding: 19px; }
    .record-side { grid-template-columns: 1fr; }
    .record-side .panel:last-child { grid-column: auto; }
    .record-ribbon { grid-template-columns: repeat(2, 1fr); }
    .record-ribbon > div:nth-child(odd) { border-right: 1px solid var(--line); }
    .record-ribbon > div:nth-child(even) { border-right: 0; }
    .record-ribbon > div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
    .action-strip { grid-template-columns: 1fr; }
    .action-strip button { border-right: 0; border-bottom: 1px solid #e4e2ff; }
    .action-strip button:last-child { border-bottom: 0; }
    .task-row { grid-template-columns: 18px minmax(140px, 1fr) auto; padding: 13px; }
    .task-row > .badge { grid-column: 3; grid-row: 1; }
    .task-row > .row-value { grid-column: 2; align-items: flex-start; }
    .task-row > form { grid-column: 3; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: 38vh; padding: 28px; }
    .auth-brand h1 { font-size: 39px; }
    .auth-brand > small { display: none; }
    .auth-form-wrap { padding: 38px 22px; }
}

@media (max-width: 540px) {
    h1 { font-size: 29px; }
    .record-identity { align-items: flex-start; }
    .company-monogram { width: 43px; height: 43px; border-radius: 12px; }
    .field-grid, .detail-grid, .side-details.horizontal, .export-links { grid-template-columns: 1fr; }
    .field-grid .span-2 { grid-column: auto; }
    .detail-grid > div, .detail-grid > div:nth-child(2n) { border-right: 0; }
    .mini-metrics, .sales-metrics { grid-template-columns: repeat(2, 1fr); }
    .mini-metrics > div:nth-child(2n) { border-right: 0; }
    .data-row { grid-template-columns: minmax(120px, 1fr) auto; }
    .data-row > *:nth-child(n+3) { display: none; }
    .record-ribbon { padding: 0; }
    .record-ribbon > div { padding: 11px; }
    .copilot { width: 100vw; }
    .note-compose > div { align-items: flex-start; flex-direction: column; }
}

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

@media print {
    .sidebar, .topbar, .head-actions, .filter-bar, .copilot, .drawer-backdrop { display: none !important; }
    .app-shell { margin: 0; }
    .workspace { max-width: none; padding: 0; }
    body { background: white; }
    .panel, .table-shell, .metric-ribbon { break-inside: avoid; box-shadow: none; }
}
