:root {
  --ink: #202225;
  --muted: #666b73;
  --line: #dcded8;
  --page: #f6f7f3;
  --panel: #ffffff;
  --dark: #242826;
  --teal: #0f766e;
  --teal-dark: #0a5f59;
  --blue: #3d5a80;
  --amber: #9b6500;
  --red: #ad343e;
  --green: #25764d;
  --purple: #6d214f;
  --shadow: 0 16px 42px rgba(32, 34, 37, 0.08);
  --radius: 12px;
  --sidebar: 270px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--page); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; min-height: 100vh; display: flex; flex-direction: column; padding: 22px 18px; background: var(--dark); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.16); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #e3f5ef; color: var(--teal-dark); font-weight: 900; }
.brand strong, .brand span { display: block; }
.brand span { color: rgba(255,255,255,.64); font-size: 12px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; margin-top: 24px; }
.nav-item { border: 0; border-radius: 10px; min-height: 42px; padding: 0 12px; text-align: left; background: transparent; color: rgba(255,255,255,.72); font-weight: 750; }
.nav-item.active, .nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); }
.sidebar-footer span, .sidebar-footer strong { display: block; }
.sidebar-footer span { color: rgba(255,255,255,.62); font-size: 12px; }
.sidebar-footer strong { margin-top: 4px; font-size: 14px; }
.main { min-width: 0; padding: 22px 26px 42px; }
.topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 0 18px; background: rgba(246,247,243,.94); backdrop-filter: blur(12px); }
.eyebrow { margin: 0 0 6px; color: var(--purple); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 28px; line-height: 1.12; }
h2 { margin: 0; font-size: 19px; }
h3 { margin: 0; font-size: 15px; }
.view { display: none; }
.view.active { display: block; }
.grid { display: grid; gap: 14px; }
.two-col { grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); }
.mt { margin-top: 14px; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.primary-button, .ghost-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 850; white-space: nowrap; }
.primary-button { border: 0; padding: 0 14px; background: var(--teal); color: white; }
.primary-button:hover { background: var(--teal-dark); }
.ghost-button { border: 1px solid var(--line); padding: 0 13px; background: white; color: var(--ink); }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 850; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: white; color: var(--ink); outline: none; }
textarea { min-height: 110px; resize: vertical; }
.full-span { grid-column: 1 / -1; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.empty-state { display: grid; place-content: center; min-height: 240px; color: var(--muted); text-align: center; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status-pill.green { background: #e3f4e9; color: var(--green); }
.status-pill.blue { background: #e8edf5; color: var(--blue); }
.status-pill.amber { background: #fff1d6; color: var(--amber); }
.status-pill.red { background: #fae2e4; color: var(--red); }
.result-card { display: grid; gap: 14px; }
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.score-ring { display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--score) * 1%), #e6e8e2 0); }
.score-ring span { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: white; font-size: 26px; font-weight: 950; }
.score-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.score-mini { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.score-mini span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.score-mini strong { display: block; margin-top: 4px; font-size: 18px; }
.reason-list, .signal-feed, .contact-list { display: grid; gap: 10px; }
.reason, .signal-item, .contact-card, .queue-card, .source-card, .pipeline-card { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.reason strong, .signal-item strong, .contact-card strong, .queue-card strong, .source-card strong, .pipeline-card strong { display: block; margin-bottom: 4px; }
.reason p, .signal-item p, .contact-card p, .queue-card p, .source-card p, .pipeline-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.42; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 920px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.table-search { max-width: 280px; }
.source-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #f0f2ed; color: #464b50; font-size: 11px; font-weight: 850; }
.code-block { overflow: auto; padding: 14px; border-radius: 10px; background: #1f2326; color: #e7f5ef; font-size: 12px; line-height: 1.5; }
.notice { margin-top: 14px; padding: 13px; border: 1px solid #f0d49c; border-radius: 10px; background: #fff8e8; color: #4f3a15; font-size: 13px; line-height: 1.45; }
.email-draft { min-height: 280px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; white-space: pre-wrap; line-height: 1.45; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban-column { display: grid; align-content: start; gap: 10px; min-height: 420px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f1f3ee; }
.kanban-column h3 { display: flex; justify-content: space-between; color: var(--muted); }
@media (max-width: 1080px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; min-height: auto; } .nav-list { display: flex; overflow-x: auto; } .sidebar-footer { display: none; } .two-col { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .main { padding: 16px; } .topbar, .panel-header { align-items: stretch; flex-direction: column; } .form-grid, .score-grid { grid-template-columns: 1fr; } .kanban { grid-template-columns: repeat(4, 260px); } h1 { font-size: 23px; } }
