:root {
  color-scheme: light;
  --midnight: #11162f;
  --midnight-soft: #1a2040;
  --violet: #6c5ce7;
  --violet-soft: #eeebff;
  --cyan: #20c7b7;
  --cyan-soft: #e8faf7;
  --coral: #ff6b6b;
  --cloud: #f5f7fb;
  --paper: #ffffff;
  --ink: #20263a;
  --muted: #6b7285;
  --line: #e5e8f0;
  --success: #168a67;
  --warning: #d58a14;
  --danger: #d64b5f;
  --shadow: 0 14px 40px rgba(17, 22, 47, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cloud); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(32, 199, 183, 0.45);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--violet); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(135deg, var(--violet), var(--cyan)); font-weight: 900; box-shadow: 0 12px 25px rgba(108, 92, 231, .28); }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 520px) 1fr; background: var(--paper); }
.login-panel { display: grid; align-content: center; padding: clamp(32px, 8vw, 96px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.login-brand strong { font-size: 21px; letter-spacing: -.02em; }
.login-panel h1 { margin: 0; max-width: 440px; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; letter-spacing: -.045em; }
.login-panel > p { max-width: 430px; margin: 18px 0 34px; color: var(--muted); line-height: 1.65; }
.login-form { display: grid; gap: 16px; max-width: 430px; }
.field { display: grid; gap: 7px; color: #3b4257; font-size: 13px; font-weight: 750; }
.field input, .field select, .search-box input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 13px 14px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .search-box input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(108, 92, 231, .1); outline: none; }
.primary-button { border: 0; border-radius: 10px; padding: 13px 18px; background: var(--violet); color: white; font-weight: 800; box-shadow: 0 10px 24px rgba(108, 92, 231, .22); }
.primary-button:hover { background: #5d4ed6; }
.form-message { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }
.login-visual { position: relative; overflow: hidden; display: grid; align-content: center; padding: clamp(48px, 7vw, 110px); color: white; background: var(--midnight); }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; filter: blur(1px); }
.login-visual::before { width: 420px; height: 420px; right: -120px; top: -90px; background: radial-gradient(circle, rgba(108,92,231,.58), rgba(108,92,231,0)); }
.login-visual::after { width: 360px; height: 360px; left: -160px; bottom: -140px; background: radial-gradient(circle, rgba(32,199,183,.45), rgba(32,199,183,0)); }
.visual-content { position: relative; z-index: 1; max-width: 650px; }
.visual-content h2 { margin: 14px 0; font-size: clamp(32px, 4vw, 58px); letter-spacing: -.045em; line-height: 1.04; }
.visual-content p { color: #bfc6df; font-size: 18px; line-height: 1.6; }
.signal-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 38px; }
.signal-chip { padding: 10px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.06); color: #e7eafb; font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--midnight); color: white; padding: 22px 16px; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; }
.sidebar-brand strong { font-size: 20px; letter-spacing: -.02em; }
.workspace-pill { margin-left: auto; padding: 3px 7px; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; color: #aeb6d4; font-size: 9px; font-weight: 800; }
.nav-section-label { margin: 15px 10px 7px; color: #737d9f; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: 0; border-radius: 9px; background: transparent; color: #aeb6d4; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: rgba(108,92,231,.25); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 850; }
.nav-item.active .nav-icon { background: var(--violet); }
.nav-badge { margin-left: auto; padding: 2px 6px; border-radius: 99px; color: var(--cyan); background: rgba(32,199,183,.12); font-size: 9px; font-weight: 850; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-avatar, .lead-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-weight: 850; }
.user-avatar { width: 34px; height: 34px; background: rgba(32,199,183,.18); color: var(--cyan); font-size: 12px; }
.sidebar-user { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user span { margin-top: 2px; color: #818bad; font-size: 10px; }
.logout-button { margin-left: auto; border: 0; background: transparent; color: #818bad; font-size: 18px; }

.main { min-width: 0; padding: 28px clamp(20px, 3vw, 44px) 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .secondary-button { border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.icon-button { width: 40px; height: 40px; }
.secondary-button { padding: 10px 14px; font-weight: 750; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,138,103,.1); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--violet-soft); color: var(--violet); font-weight: 850; }
.stat-value { display: block; margin-top: 15px; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.stat-note { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.stat-card:nth-child(2) .stat-icon { color: var(--cyan); background: var(--cyan-soft); }
.stat-card:nth-child(3) .stat-icon { color: var(--warning); background: #fff7e7; }
.stat-card:nth-child(4) .stat-icon { color: var(--coral); background: #fff0f0; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 1px 2px rgba(17,22,47,.02); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.filters { display: flex; gap: 8px; }
.search-box { position: relative; width: min(290px, 34vw); }
.search-box input { padding: 10px 12px 10px 35px; font-size: 12px; }
.search-symbol { position: absolute; top: 8px; left: 12px; color: var(--muted); }
.filters select { border: 1px solid var(--line); border-radius: 9px; padding: 9px 30px 9px 11px; background: white; color: var(--ink); font-size: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: var(--muted); background: #fafbfe; font-size: 10px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-top: 1px solid #edf0f5; font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover, tbody tr.selected { background: #f8f7ff; }
.lead-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.lead-avatar { width: 34px; height: 34px; color: var(--violet); background: var(--violet-soft); font-size: 11px; }
.lead-cell strong, .lead-cell span { display: block; }
.lead-cell strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.lead-cell span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.score { min-width: 84px; }
.score strong { font-size: 12px; }
progress { display: block; width: 62px; height: 5px; margin-top: 5px; border: 0; border-radius: 99px; overflow: hidden; background: #ececf5; }
progress::-webkit-progress-bar { background: #ececf5; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--violet); }
.tag { display: inline-flex; padding: 4px 7px; border-radius: 99px; color: var(--success); background: #eaf8f3; font-size: 9px; font-weight: 800; text-transform: capitalize; }
.source { color: var(--muted); }
.empty-state { padding: 58px 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }
.loading-row { padding: 50px; color: var(--muted); text-align: center; }

.detail-panel { position: sticky; top: 20px; overflow: hidden; }
.detail-empty { min-height: 500px; display: grid; place-content: center; padding: 30px; text-align: center; color: var(--muted); }
.detail-empty .detail-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; background: var(--violet-soft); color: var(--violet); font-weight: 900; }
.detail-hero { padding: 20px; border-bottom: 1px solid var(--line); background: linear-gradient(150deg, #fbfaff, white 70%); }
.detail-person { display: flex; align-items: center; gap: 12px; }
.detail-person .lead-avatar { width: 48px; height: 48px; font-size: 14px; }
.detail-person h3 { margin: 0; font-size: 17px; }
.detail-person p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.detail-score { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 18px; padding: 13px; border-radius: 10px; background: var(--midnight); color: white; }
.score-number { width: 50px; height: 50px; display: grid; place-items: center; border: 4px solid var(--cyan); border-radius: 50%; font-size: 18px; font-weight: 900; }
.detail-score strong { font-size: 12px; }
.detail-score span { display: block; margin-top: 4px; color: #9da7c7; font-size: 10px; }
.detail-tabs { display: flex; gap: 5px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); }
.detail-tab { padding: 9px 10px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; }
.detail-tab.active { border-bottom-color: var(--violet); color: var(--violet); }
.detail-body { max-height: 560px; overflow: auto; padding: 16px 18px 22px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 19px; }
.info-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.info-card span { display: block; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.info-card strong { display: block; overflow: hidden; margin-top: 5px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.section-title { margin: 18px 0 10px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: 7px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding-bottom: 16px; }
.timeline-dot { z-index: 1; width: 15px; height: 15px; margin-top: 2px; border: 4px solid white; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.timeline-content strong { display: block; font-size: 11px; }
.timeline-content span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.score-breakdown { display: grid; gap: 8px; }
.breakdown-row { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 8px; background: var(--cloud); font-size: 10px; }
.breakdown-row strong.negative { color: var(--danger); }

.mobile-menu { display: none; }
@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .detail-empty { min-height: 220px; }
  .detail-body { max-height: none; }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar-brand strong, .workspace-pill, .nav-item > span:not(.nav-icon), .nav-badge, .nav-section-label, .sidebar-user, .logout-button { display: none; }
  .sidebar-brand, .nav-item { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; }
  .sidebar-brand { padding: 0; }
  .nav, .sidebar-footer, .nav-section-label { display: none; }
  .main { padding: 20px 14px 36px; }
  .topbar { align-items: flex-start; }
  .top-actions .secondary-button { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 23px; }
  .panel-header { align-items: stretch; flex-direction: column; }
  .filters { flex-direction: column; }
  .search-box { width: 100%; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { display: none; }
}
