:root {
  --navy-950: #07111f;
  --navy-900: #0b1729;
  --navy-850: #102036;
  --navy-800: #172a43;
  --navy-700: #263d58;
  --red: #d9272e;
  --red-dark: #b51e25;
  --red-soft: #fff0f1;
  --ink: #142033;
  --muted: #687487;
  --muted-2: #929cab;
  --line: #e5e9ef;
  --line-strong: #d7dde6;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --green: #16845b;
  --green-soft: #eaf8f2;
  --amber: #a86708;
  --amber-soft: #fff6df;
  --blue: #2563a8;
  --blue-soft: #eaf2fb;
  --shadow-sm: 0 1px 2px rgba(7, 17, 31, .05), 0 8px 26px rgba(7, 17, 31, .035);
  --shadow-lg: 0 24px 60px rgba(7, 17, 31, .14);
  --radius: 12px;
  --sidebar: 248px;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { display: flex; background: var(--canvas); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); display: flex; flex-direction: column; color: #dce5f0; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); box-shadow: 6px 0 24px rgba(4, 11, 21, .1); }
.brand { height: 76px; display: flex; align-items: center; gap: 12px; padding: 0 21px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--red); font-size: 19px; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(217,39,46,.24); }
.brand-mark.large { width: 44px; height: 44px; border-radius: 10px; font-size: 24px; }
.brand > div:not(.brand-mark) { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { color: white; font-size: 18px; letter-spacing: -.025em; }
.brand span { margin-top: 6px; color: #8191a6; font-size: 8px; letter-spacing: .19em; font-weight: 700; }
.main-nav { flex: 1; overflow-y: auto; padding: 20px 12px; scrollbar-width: thin; }
.nav-label { display: block; padding: 13px 12px 7px; color: #596a80; font-size: 9px; letter-spacing: .18em; font-weight: 800; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 2px 0; padding: 0 12px; border-radius: 8px; color: #aebccd; font-size: 13px; font-weight: 560; transition: background .18s, color .18s, transform .18s; }
.nav-item svg { width: 18px; height: 18px; color: #7f90a5; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(255,255,255,.09); box-shadow: inset 3px 0 var(--red); }
.nav-item.active svg { color: #ff565c; }
.nav-item i { margin-left: auto; padding: 2px 5px; border: 1px solid rgba(255,255,255,.15); border-radius: 4px; color: #ff7378; font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: .1em; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 15px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.sidebar-user div { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong { overflow: hidden; color: #f6f9fc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span:not(.avatar) { color: #75869a; font-size: 10px; text-transform: capitalize; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: white; background: linear-gradient(145deg, #e5393f, #a81920); font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.avatar.small { width: 32px; height: 32px; }
.avatar.tiny { width: 27px; height: 27px; border-radius: 7px; font-size: 9px; }
.main-area { width: calc(100% - var(--sidebar)); min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; gap: 18px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.global-search { width: min(540px, 52vw); display: flex; align-items: center; gap: 10px; }
.global-search > svg { width: 18px; height: 18px; color: var(--muted-2); }
.global-search input { min-width: 0; flex: 1; padding: 10px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.global-search input::placeholder { color: #9da6b4; }
kbd { padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: #8a94a3; background: #fafbfc; font-size: 10px; font-family: inherit; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.top-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.top-user > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.top-user strong { font-size: 12px; }
.top-user small { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.icon-button { position: relative; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; transition: .18s ease; }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: #f8fafc; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.inverse { border-color: rgba(255,255,255,.08); color: #8495a9; background: rgba(255,255,255,.04); }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: var(--red); }
.content-wrap { max-width: 1600px; min-height: calc(100vh - 76px); margin: 0 auto; padding: 28px 32px 18px; }
.app-footer { display: flex; justify-content: space-between; margin-top: 34px; padding: 20px 2px 6px; border-top: 1px solid var(--line); color: #9aa3b0; font-size: 10px; letter-spacing: .04em; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-head h1 { margin: 0; color: var(--ink); font-size: 27px; line-height: 1.15; letter-spacing: -.035em; }
.page-head p { max-width: 700px; margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 9px; }
.eyebrow { margin-bottom: 7px; color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.muted { color: var(--muted); }
.quiet { color: var(--muted-2); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: white; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.button:hover { border-color: #bbc4d0; background: #fafbfc; transform: translateY(-1px); }
.button svg { width: 15px; height: 15px; }
.button.primary { border-color: var(--red); color: white; background: var(--red); box-shadow: 0 6px 16px rgba(217,39,46,.16); }
.button.primary:hover { border-color: var(--red-dark); background: var(--red-dark); }
.button.dark { border-color: var(--navy-900); color: white; background: var(--navy-900); }
.button.ghost { color: var(--muted); background: transparent; }
.button.danger { border-color: #f2c8ca; color: var(--red-dark); background: var(--red-soft); }
.button.small { min-height: 31px; padding: 0 10px; font-size: 10px; }
.button.wide { width: 100%; }
.button:disabled { opacity: .55; pointer-events: none; }
.button.disabled { opacity: .5; pointer-events: none; }

.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 19px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-size: 11px; font-weight: 700; }
.card-link svg { width: 13px; height: 13px; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 18px; }
.three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stack { display: grid; gap: 18px; }
.section-gap { margin-top: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi { position: relative; min-height: 123px; padding: 18px; overflow: hidden; }
.kpi::after { content: ""; position: absolute; top: -34px; right: -34px; width: 90px; height: 90px; border-radius: 50%; background: #f7f8fa; }
.kpi-icon { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 8px; color: var(--navy-700); background: #eff2f6; }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi.accent .kpi-icon { color: var(--red); background: var(--red-soft); }
.kpi.green .kpi-icon { color: var(--green); background: var(--green-soft); }
.kpi strong { position: relative; z-index: 1; display: block; font-size: 21px; line-height: 1.05; letter-spacing: -.035em; }
.kpi > span { position: relative; z-index: 1; display: block; margin-top: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.kpi small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 10px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.metric-strip > div { padding: 16px 19px; border-right: 1px solid var(--line); }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip strong { display: block; font-size: 17px; }
.metric-strip span { color: var(--muted); font-size: 10px; }

.bar-chart { height: 230px; display: flex; align-items: flex-end; gap: 9px; padding: 24px 19px 17px; }
.bar-column { min-width: 0; height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar-column meter { width: 100%; height: 100%; writing-mode: vertical-lr; direction: rtl; border: 0; background: transparent; }
.bar-column meter::-webkit-meter-bar { border: 0; border-radius: 4px 4px 2px 2px; background: #edf0f4; }
.bar-column meter::-webkit-meter-optimum-value { border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #e13a40, #bf2027); }
.bar-column meter::-moz-meter-bar { border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #e13a40, #bf2027); }
.bar-column span { color: var(--muted-2); font-size: 9px; white-space: nowrap; }

.leader-list { display: grid; gap: 16px; }
.leader-row { display: grid; grid-template-columns: 29px minmax(80px, 1fr) minmax(90px, 1.7fr) auto; align-items: center; gap: 10px; }
.rank { color: var(--muted-2); font-size: 10px; font-weight: 800; text-align: center; }
.leader-person { min-width: 0; display: flex; align-items: center; gap: 8px; }
.leader-person strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.leader-person small { color: var(--muted); font-size: 9px; }
progress { width: 100%; height: 6px; border: 0; border-radius: 10px; overflow: hidden; background: #edf0f4; }
progress::-webkit-progress-bar { border-radius: 10px; background: #edf0f4; }
progress::-webkit-progress-value { border-radius: 10px; background: linear-gradient(90deg, var(--navy-700), var(--red)); }
progress::-moz-progress-bar { border-radius: 10px; background: linear-gradient(90deg, var(--navy-700), var(--red)); }
.leader-value { min-width: 78px; font-size: 11px; font-weight: 750; text-align: right; }

.task-list, .opportunity-list, .activity-list { display: grid; }
.task-line, .opportunity-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 13px 19px; border-bottom: 1px solid #eef1f4; }
.task-line:last-child, .opportunity-line:last-child { border-bottom: 0; }
.status-dot { width: 8px; height: 8px; border: 2px solid #b9c2cd; border-radius: 50%; }
.status-dot.urgent { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.status-dot.high { border-color: #e59722; background: #e59722; }
.task-line strong, .opportunity-line strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-line small, .opportunity-line small { color: var(--muted); font-size: 9px; }
.task-date { color: var(--muted); font-size: 9px; white-space: nowrap; }
.score { min-width: 39px; padding: 4px 7px; border-radius: 6px; color: var(--red-dark); background: var(--red-soft); font-size: 10px; font-weight: 800; text-align: center; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.filters { flex: 1; display: flex; align-items: center; gap: 8px; }
.search-field { position: relative; min-width: 230px; flex: 1; max-width: 430px; }
.search-field svg { position: absolute; top: 11px; left: 12px; width: 16px; height: 16px; color: var(--muted-2); }
.search-field input { width: 100%; padding-left: 37px; }
.field { position: relative; display: grid; gap: 6px; }
.field > span, .field > label { color: #4b586a; font-size: 10px; font-weight: 750; letter-spacing: .025em; }
.field small { color: var(--muted); font-size: 9px; }
.field.inline { display: flex; align-items: center; }
.field.checkbox { display: flex; align-items: center; gap: 8px; }
.field.checkbox input { width: auto; }
input, select, textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8b99aa; box-shadow: 0 0 0 3px rgba(23,42,67,.08); }
input::placeholder, textarea::placeholder { color: #a3acb8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.autocomplete { position: relative; }
.autocomplete-results { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 60; max-height: 270px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 9px; background: white; box-shadow: var(--shadow-lg); }
.autocomplete-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid #eef1f4; background: white; text-align: left; cursor: pointer; }
.autocomplete-option:hover { background: #f7f9fb; }
.autocomplete-option strong { display: block; font-size: 11px; }
.autocomplete-option small { color: var(--muted); font-size: 9px; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 14px; border-bottom: 1px solid var(--line-strong); color: var(--muted); background: #fafbfc; font-size: 9px; font-weight: 800; letter-spacing: .075em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #eef1f4; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.table-title { max-width: 330px; }
.table-title a { font-weight: 750; }
.table-title small { display: block; margin-top: 2px; color: var(--muted); }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.table-empty, .empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 10px; color: #aeb7c3; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 17px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 10px; }
.page-buttons { display: flex; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: #536174; background: #edf1f5; font-size: 9px; font-weight: 750; white-space: nowrap; }
.badge.red, .badge.urgent { color: var(--red-dark); background: var(--red-soft); }
.badge.green, .badge.done, .badge.completed { color: var(--green); background: var(--green-soft); }
.badge.amber, .badge.high, .badge.waiting, .badge.review { color: var(--amber); background: var(--amber-soft); }
.badge.blue, .badge.in_progress, .badge.running { color: var(--blue); background: var(--blue-soft); }
.badge.failed { color: var(--red-dark); background: var(--red-soft); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8fa; }
.segmented a { padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.segmented a.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(7,17,31,.09); }

.detail-hero { position: relative; display: flex; align-items: flex-start; gap: 17px; padding: 22px; overflow: hidden; }
.detail-hero::after { content: ""; position: absolute; right: -65px; top: -95px; width: 240px; height: 240px; border: 1px solid #eff1f5; border-radius: 50%; box-shadow: 0 0 0 28px #fafbfc, 0 0 0 29px #f1f3f6; }
.company-avatar { position: relative; z-index: 1; width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--navy-900); font-size: 16px; font-weight: 800; }
.detail-hero-main { position: relative; z-index: 1; min-width: 0; flex: 1; }
.detail-hero h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.03em; }
.detail-hero p { margin: 0; color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta svg { width: 13px; height: 13px; }
.detail-actions { position: relative; z-index: 2; display: flex; gap: 7px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; }
.stat-box { padding: 17px 19px; border-right: 1px solid var(--line); }
.stat-box:last-child { border-right: 0; }
.stat-box strong { display: block; font-size: 18px; }
.stat-box span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.info-list { display: grid; }
.info-row { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); font-size: 10px; }
.info-row dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.contact-card { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid #eef1f4; }
.contact-card:last-child { border-bottom: 0; }
.contact-card strong { font-size: 11px; }
.contact-card a { color: var(--blue); font-size: 10px; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 5px; }
.kanban-column { min-width: 240px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #eef1f4; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.kanban-head strong { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.kanban-head span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: #dfe4e9; font-size: 9px; font-weight: 800; }
.task-card { display: block; margin-bottom: 8px; padding: 12px; border: 1px solid #e0e4e9; border-radius: 9px; background: white; box-shadow: 0 1px 2px rgba(7,17,31,.03); transition: transform .15s, box-shadow .15s; }
.task-card:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(7,17,31,.07); }
.task-card strong { display: block; margin: 7px 0 4px; font-size: 11px; line-height: 1.35; }
.task-card p { margin: 0; color: var(--muted); font-size: 9px; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 9px; border-top: 1px solid #eef1f4; color: var(--muted); font-size: 9px; }

.opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.opportunity-card { position: relative; overflow: hidden; }
.opportunity-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }
.opportunity-card .card-body { padding-left: 21px; }
.opportunity-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opportunity-card h3 { margin: 13px 0 6px; font-size: 14px; line-height: 1.35; }
.opportunity-card p { min-height: 42px; margin: 0; color: var(--muted); font-size: 10px; }
.next-action { margin-top: 13px; padding: 10px; border-radius: 7px; color: #3f4c5f; background: #f5f7f9; font-size: 9px; }
.opportunity-foot { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #eef1f4; }

.upload-zone { position: relative; display: grid; place-items: center; min-height: 195px; padding: 24px; border: 1px dashed #bec7d2; border-radius: 10px; color: var(--muted); background: #fafbfc; text-align: center; }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone svg { width: 31px; height: 31px; margin-bottom: 9px; color: var(--navy-700); }
.upload-zone strong { display: block; color: var(--ink); font-size: 12px; }
.upload-zone span { margin-top: 4px; font-size: 10px; }
.import-review { display: grid; gap: 12px; }
.review-card { padding: 16px; }
.review-source { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; padding: 11px; border-radius: 8px; background: #f6f8fa; }
.review-source span { color: var(--muted); font-size: 9px; }
.review-source strong { display: block; margin-top: 2px; color: var(--ink); font-size: 10px; }
.candidate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manual-match { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.manual-match summary { color: var(--blue); font-size: 10px; font-weight: 700; cursor: pointer; }

.assistant-shell { min-height: 660px; display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden; }
.conversation-list { padding: 13px; border-right: 1px solid var(--line); background: #fafbfc; }
.conversation-list .button { margin-bottom: 12px; }
.conversation-link { display: block; margin-bottom: 4px; padding: 10px; border-radius: 7px; }
.conversation-link:hover, .conversation-link.active { background: #edf1f5; }
.conversation-link strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-link span { color: var(--muted); font-size: 8px; }
.chat-panel { min-width: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.ai-orb { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(145deg, var(--navy-800), var(--navy-950)); }
.ai-orb svg { width: 18px; height: 18px; }
.chat-head strong { display: block; font-size: 12px; }
.chat-head span { color: var(--muted); font-size: 9px; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 24px; background: linear-gradient(180deg, #fff, #fafbfc); }
.message { max-width: min(690px, 82%); padding: 13px 15px; border-radius: 11px; white-space: pre-wrap; font-size: 11px; line-height: 1.65; }
.message.user { align-self: flex-end; color: white; background: var(--navy-900); border-bottom-right-radius: 3px; }
.message.assistant { align-self: flex-start; border: 1px solid var(--line); background: white; border-bottom-left-radius: 3px; box-shadow: var(--shadow-sm); }
.chat-welcome { max-width: 520px; margin: auto; text-align: center; }
.chat-welcome .ai-orb { width: 52px; height: 52px; margin: 0 auto 14px; }
.chat-welcome h2 { margin: 0 0 7px; font-size: 19px; }
.chat-welcome p { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.prompt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.prompt-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 9px; cursor: pointer; }
.chat-form { display: flex; align-items: flex-end; gap: 9px; padding: 15px 18px; border-top: 1px solid var(--line); background: white; }
.chat-form textarea { min-height: 44px; max-height: 130px; resize: none; }
.chat-form .button { flex: 0 0 auto; min-height: 44px; }

.flash { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 11px 13px; border: 1px solid; border-radius: 9px; font-size: 11px; box-shadow: var(--shadow-sm); }
.flash button { border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 18px; }
.flash-success { border-color: #c4eadb; color: #126947; background: var(--green-soft); }
.flash-error { border-color: #f0c4c6; color: #a91c22; background: var(--red-soft); }
.flash-warning { border-color: #f0dcae; color: #855408; background: var(--amber-soft); }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(7,17,31,.56); backdrop-filter: blur(4px); }
.modal.open { display: grid; }
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 14px; background: white; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px; border-top: 1px solid var(--line); background: #fafbfc; }

.auth-shell { background: var(--navy-950); }
.login-grid { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 1.05fr) minmax(430px, .95fr); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px 56px; color: white; background: linear-gradient(145deg, #06101d 0%, #10223a 100%); }
.login-brand-panel::after { content: ""; position: absolute; right: -270px; bottom: -300px; width: 690px; height: 690px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.018), 0 0 0 71px rgba(255,255,255,.05), 0 0 0 150px rgba(255,255,255,.01); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand > div:last-child { display: flex; flex-direction: column; }
.login-brand strong { font-size: 22px; }
.login-brand span { margin-top: 5px; color: #8595a9; font-size: 8px; font-weight: 800; letter-spacing: .2em; }
.login-statement { position: relative; z-index: 2; max-width: 530px; margin: auto 0; }
.login-statement p { margin: 0 0 15px; color: #ff5a61; font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.login-statement h1 { margin: 0; font-size: clamp(44px, 5vw, 72px); line-height: .98; letter-spacing: -.06em; }
.login-statement > span { display: block; max-width: 440px; margin-top: 24px; color: #9eacbd; font-size: 14px; }
.precision-lines { position: relative; z-index: 2; display: flex; gap: 5px; }
.precision-lines i { width: 36px; height: 3px; background: rgba(255,255,255,.15); }
.precision-lines i:first-child { background: var(--red); }
.login-form-panel { display: grid; place-items: center; padding: 40px; background: #f5f7f9; }
.login-card { width: min(390px, 100%); padding: 35px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 30px 80px rgba(7,17,31,.12); }
.login-card h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.login-card > p { margin: 7px 0 24px; color: var(--muted); font-size: 11px; }
.login-card .field { margin-bottom: 14px; }
.login-card .button { margin-top: 7px; min-height: 44px; }
.login-help { display: block; margin-top: 18px; color: var(--muted-2); font-size: 9px; text-align: center; }

.error-page { min-height: 58vh; display: grid; place-items: center; text-align: center; }
.error-code { color: var(--red); font-size: 72px; font-weight: 850; letter-spacing: -.07em; }
.error-page h1 { margin: -12px 0 8px; font-size: 24px; }
.error-page p { max-width: 500px; margin: 0 0 18px; color: var(--muted); }
.mobile-menu, .sidebar-close, .mobile-scrim { display: none; }

@media (max-width: 1250px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .opportunity-grid { grid-template-columns: repeat(2, 1fr); }
  .three-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 260px; transform: translateX(-105%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main-area { width: 100%; margin-left: 0; }
  .mobile-menu, .sidebar-close { display: grid; }
  .sidebar-close { margin-left: auto; border-color: rgba(255,255,255,.08); color: #8b9bad; background: transparent; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(7,17,31,.5); }
  body.sidebar-open .mobile-scrim { display: block; }
  .split-grid { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
}

@media (max-width: 720px) {
  .topbar { height: 66px; padding: 0 15px; }
  .content-wrap { padding: 20px 15px 14px; }
  .global-search { flex: 1; width: auto; }
  .global-search kbd, .top-user > span:last-child { display: none; }
  .top-user { padding-left: 0; border-left: 0; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 112px; }
  .three-grid, .opportunity-grid { grid-template-columns: 1fr; }
  .stat-row, .metric-strip { grid-template-columns: 1fr 1fr; }
  .stat-box:nth-child(2), .metric-strip > div:nth-child(2) { border-right: 0; }
  .stat-box:nth-child(-n+2), .metric-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .toolbar, .filters { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; max-width: none; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .detail-hero { flex-wrap: wrap; }
  .detail-actions { width: 100%; }
  .review-source, .candidate-grid { grid-template-columns: 1fr; }
  .assistant-shell { min-height: 620px; grid-template-columns: 1fr; }
  .conversation-list { display: none; }
  .message { max-width: 92%; }
  .login-form-panel { padding: 18px; }
  .login-card { padding: 25px; }
  .app-footer { flex-direction: column; gap: 4px; }
}

@media (max-width: 450px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { min-height: auto; }
  .top-actions .notification-button { display: none; }
  .leader-row { grid-template-columns: 24px minmax(90px, 1fr) auto; }
  .leader-row progress { display: none; }
}
