:root {
  --bg: #0b0e14;
  --panel: #12161f;
  --panel-alt: #171c28;
  --border: #232a3a;
  --text: #e8ecf5;
  --text-dim: #8b93a7;
  --blue: #3b82f6;
  --blue-dim: #1d3a63;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a, a:visited { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.app-shell { display:flex; min-height:100vh; }

.sidebar { width: 230px; background: var(--panel); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:20px 0; position:sticky; top:0; height:100vh; }
.brand { display:flex; align-items:center; gap:10px; padding: 0 20px 24px; }
.brand-mark { width:34px; height:34px; border-radius:8px; background:linear-gradient(135deg,#3b82f6,#22c55e); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.brand-text { font-weight:600; font-size:16px; }
.brand-text span { color: var(--blue); }
.nav-list { list-style:none; padding:0; margin:0; flex:1; }
.nav-list li { padding:11px 20px; cursor:pointer; color: var(--text-dim); font-size:14px; border-left:3px solid transparent; }
.nav-list li:hover { background: var(--panel-alt); color: var(--text); }
.nav-list li.active { background: var(--panel-alt); color: var(--text); border-left-color: var(--blue); font-weight:600; }
.sidebar-footer { padding: 12px 20px; font-size:11px; color: var(--text-dim); border-top:1px solid var(--border); line-height:1.6; }

.content { flex:1; padding: 28px 36px; max-width: 1400px; }
.topbar { margin-bottom: 24px; display:flex; justify-content:space-between; align-items:flex-start; }
.topbar h1 { margin:0 0 4px; font-size: 22px; }
.topbar-sub { color: var(--text-dim); font-size: 13px; }

.notif-wrap { position:relative; }
.notif-bell { position:relative; background:none; border:1px solid var(--border); color:var(--text); font-size:18px; width:40px; height:40px; border-radius:10px; cursor:pointer; }
.notif-bell:hover { background: var(--panel-alt); }
.notif-badge { position:absolute; top:-4px; right:-4px; background: var(--red); color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px; border-radius:8px; display:flex; align-items:center; justify-content:center; padding:0 3px; }
.notif-dropdown { display:none; position:absolute; top:48px; right:0; width:340px; max-height:420px; overflow-y:auto; background: var(--panel); border:1px solid var(--border); border-radius: var(--radius); box-shadow:0 8px 24px rgba(0,0,0,.35); z-index:60; }
.notif-dropdown.open { display:block; }
.notif-item { padding:12px 14px; border-bottom:1px solid var(--border); cursor:pointer; }
.notif-item.unread { border-left:3px solid var(--blue); }
.notif-item .ni-title { font-size:13px; font-weight:600; margin-bottom:5px; }
.notif-item .ni-body { font-size:11.5px; color: var(--text-dim); white-space:pre-line; }
.notif-item .ni-time { font-size:10.5px; color: var(--text-dim); margin-top:4px; }
.ni-leads { display:flex; flex-direction:column; gap:2px; }
.ni-lead { font-size:12px; padding:5px 6px; border-radius:6px; cursor:pointer; }
.ni-lead:hover { background: var(--panel-alt); }
.notif-empty { padding:24px; text-align:center; color: var(--text-dim); font-size:13px; }
.notif-footer { padding:8px 14px; text-align:center; border-top:1px solid var(--border); }
.notif-footer a { font-size:12px; cursor:pointer; }

.view { display:none; }
.view.active { display:block; }

.grid { display:grid; gap:16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }

.card { background: var(--panel); border:1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { margin:0 0 12px; font-size:14px; color: var(--text-dim); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.stat-value { font-size: 30px; font-weight:700; }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top:4px; }

table { width:100%; border-collapse: collapse; font-size: 13px; }
th { text-align:left; color: var(--text-dim); font-weight:600; padding: 10px 12px; border-bottom:1px solid var(--border); font-size:12px; text-transform:uppercase; letter-spacing:.03em; }
td { padding: 12px; border-bottom:1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--panel-alt); cursor:pointer; }

.score-ring { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:50%; font-weight:700; font-size:13px; border:3px solid; }
.score-high { border-color: var(--green); color: var(--green); }
.score-mid { border-color: var(--amber); color: var(--amber); }
.score-low { border-color: var(--red); color: var(--red); }

.badge { display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
.badge-verified { background: rgba(34,197,94,.15); color: var(--green); }
.badge-likely { background: rgba(245,158,11,.15); color: var(--amber); }
.badge-unconfirmed { background: rgba(239,68,68,.12); color: var(--red); }

.form-row { display:flex; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.form-row input, .form-row select { background: var(--panel-alt); border:1px solid var(--border); color: var(--text); padding:10px 12px; border-radius:8px; font-size:14px; flex:1; min-width:160px; }
button.primary { background: var(--blue); color:#fff; border:none; padding:10px 18px; border-radius:8px; font-weight:600; cursor:pointer; font-size:14px; }
button.primary:hover { background:#2f6fe0; }
button.secondary { background: var(--panel-alt); color: var(--text); border:1px solid var(--border); padding:9px 16px; border-radius:8px; cursor:pointer; font-size:13px; }

.kanban { display:flex; gap:14px; overflow-x:auto; padding-bottom: 12px; }
.kanban-col { min-width: 230px; background: var(--panel); border:1px solid var(--border); border-radius: var(--radius); padding:12px; flex-shrink:0; }
.kanban-col h4 { margin:0 0 10px; font-size:13px; color: var(--text-dim); display:flex; justify-content:space-between; }
.kanban-card { background: var(--panel-alt); border:1px solid var(--border); border-radius:8px; padding:10px; margin-bottom:8px; font-size:12.5px; cursor:grab; }
.kanban-card .kc-name { font-weight:600; margin-bottom:4px; }
.kanban-card .kc-meta { color: var(--text-dim); font-size:11px; }

.drawer { position:fixed; top:0; right:-560px; width:560px; height:100vh; background: var(--panel); border-left:1px solid var(--border); transition: right .25s ease; overflow-y:auto; padding:24px; z-index:50; }
.drawer.open { right:0; }
.drawer-close { position:absolute; top:18px; right:18px; cursor:pointer; color: var(--text-dim); font-size:20px; }
.drawer h2 { margin: 0 6px 4px 0; }
.drawer-section { margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.drawer-section h4 { color: var(--text-dim); font-size:12px; text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.pill { background: var(--panel-alt); border:1px solid var(--border); border-radius:20px; padding:6px 12px; font-size:12px; }
/* Data provenance — which directory each lead came from. Deliberately quiet
   next to the score rings; it's context for judging a lead, not the headline. */
.src-cell { display:flex; gap:4px; flex-wrap:wrap; align-items:center; }
.src-pill { background: var(--panel-alt); border:1px solid var(--border); border-radius:4px; padding:2px 7px; font-size:11px; color: var(--text-dim); white-space:nowrap; }
.src-verified { font-size:10.5px; color:#4ade80; white-space:nowrap; }

pre.draft { white-space:pre-wrap; background: var(--panel-alt); border:1px solid var(--border); border-radius:8px; padding:12px; font-size:12.5px; line-height:1.5; }

.toast { position:fixed; bottom:24px; right:24px; background: var(--panel-alt); border:1px solid var(--border); padding:12px 18px; border-radius:8px; opacity:0; transform:translateY(10px); transition:.2s; pointer-events:none; z-index:100; font-size:13px; }
.toast.show { opacity:1; transform:translateY(0); }

.empty-state { color: var(--text-dim); padding: 40px 20px; text-align:center; font-size:14px; }
.small-note { color: var(--text-dim); font-size:11.5px; margin-top:6px; }
