/* LeadFinder — Enterprise design system (warm amber/gold identity)
   Typography: Inter · Surfaces: warm cream/white · Accent: deep amber */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #fdfaf4;
  --ink: #221b11;
  --ink-2: #57493a;
  --ink-3: #8d7a63;
  --line: #eae0cd;
  --line-2: #f2ead9;
  --gold: #b97708;
  --gold-2: #d98f0c;
  --gold-soft: #fdf3dc;
  --gold-border: #ecd9a8;
  --green: #1e6b3a;  --green-soft: #e3f2e6;
  --red: #a63a22;    --red-soft: #fbe9e2;
  --blue: #27518c;   --blue-soft: #e7eef9;
  --purple: #6b3fa0; --purple-soft: #efe8fa;
  --shadow-sm: 0 1px 2px rgba(34,27,17,.05);
  --shadow-md: 0 2px 8px rgba(34,27,17,.07);
  --shadow-lg: 0 12px 32px rgba(34,27,17,.10);
  --radius: 12px;
}
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
h1,h2,h3,h4 { letter-spacing: -.015em; }
.layout { display: flex; min-height: 100vh; }

/* ============ Sidebar ============ */
.sidebar { width: 248px; background: #241c10; color: #e9dcc2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; min-height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 18px; }
.brand-icon { width: 38px; height: 38px; background: linear-gradient(135deg, #e8a838, #c9870c); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #241c10; font-size: 14px; box-shadow: 0 2px 10px rgba(232,168,56,.35); }
.brand-name { font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; color: #fdf6e8; }
.brand-sub { font-size: 10.5px; color: #a08b6c; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
nav { padding: 10px 12px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #cbb99a; text-decoration: none; font-weight: 600; font-size: 13px; border-radius: 9px; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(232,168,56,.10); color: #f4e6c8; }
.nav-item.active { background: rgba(232,168,56,.16); color: #ffd98a; box-shadow: inset 0 0 0 1px rgba(232,168,56,.22); }
.ni { width: 18px; text-align: center; font-size: 13px; }
.side-foot { padding: 14px 18px; font-size: 10px; color: #8d7a5f; border-top: 1px solid rgba(233,220,194,.10); line-height: 1.6; }

/* ============ Main / Topbar ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; background: rgba(255,255,255,.75); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.page-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.top-actions { display: flex; gap: 10px; }
.content { padding: 26px 32px 40px; max-width: 1500px; width: 100%; }

/* ============ Buttons — labeled, always ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 650; font-size: 13px; cursor: pointer; text-decoration: none; transition: all .15s; box-shadow: var(--shadow-sm); font-family: inherit; }
.btn:hover { border-color: var(--gold-border); color: var(--ink); background: var(--surface-2); box-shadow: var(--shadow-md); }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn-primary { background: linear-gradient(180deg, #d99414, #c07f09); border-color: #a96e07; color: #fffdf6; box-shadow: 0 1px 3px rgba(185,119,8,.35); }
.btn-primary:hover { background: linear-gradient(180deg, #e3a024, #c9870c); color: #fff; filter: brightness(1.03); }
.btn-danger { background: var(--red); border-color: #8c2f1c; color: #fff; }
.btn-danger:hover { background: #b64328; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ Cards ============ */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-3); margin-bottom: 14px; font-weight: 750; }

/* Stat boxes */
.stat-box { border-top: 3px solid var(--gold-2); }
.stat-num { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-top: 5px; text-transform: uppercase; letter-spacing: .8px; }

/* Pipeline status chips */
.status-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.status-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; min-width: 0; text-decoration: none; transition: all .15s; box-shadow: var(--shadow-sm); }
.status-chip:hover { border-color: var(--gold-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.status-chip .n { font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.status-chip .t { font-size: 10px; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.status-chip.dnc { background: var(--red-soft); border-color: #eac4b5; }
.status-chip.dnc .n { color: var(--red); }

/* ============ Tables ============ */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th { background: var(--surface-2); color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); font-weight: 750; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--gold); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.clickable-row { cursor: pointer; }

/* ============ Badges ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 750; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.b-new { background: var(--blue-soft); color: var(--blue); }
.b-contacted { background: var(--gold-soft); color: #9c6b0c; }
.b-replied { background: var(--green-soft); color: var(--green); }
.b-meeting { background: var(--purple-soft); color: var(--purple); }
.b-won { background: var(--green); color: #fff; }
.b-lost { background: #efe9df; color: var(--ink-3); }
.b-dnc { background: var(--red-soft); color: var(--red); }
.b-high { background: var(--green-soft); color: var(--green); }
.b-medium { background: var(--gold-soft); color: #9c6b0c; }
.b-low { background: #efe9df; color: var(--ink-3); }
.b-none { background: var(--green-soft); color: var(--green); }
.b-social { background: var(--purple-soft); color: var(--purple); }
.b-real { background: var(--red-soft); color: var(--red); }
.b-walkin { background: var(--blue-soft); color: var(--blue); }

/* ============ Forms ============ */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11px; font-weight: 750; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .8px; }
input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-family: inherit; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(217,143,12,.15); }
textarea { min-height: 110px; resize: vertical; }
.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 9px; }
.checkbox-list label { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); text-transform: none; letter-spacing: 0; transition: all .15s; }
.checkbox-list label:hover { border-color: var(--gold-border); background: var(--surface-2); }
.checkbox-list input:checked + span { color: var(--gold); font-weight: 750; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filter-bar .field { margin-bottom: 0; min-width: 150px; }
.filter-bar .field.grow { flex: 1; min-width: 230px; }

/* ============ Combobox ============ */
.combo { position: relative; }
.combo-list { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-top: 5px; max-height: 250px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.combo-item { padding: 10px 13px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.combo-item:hover { background: var(--gold-soft); }
.combo-item.selected { background: var(--gold-2); color: #fff; font-weight: 700; }
.combo-item.muted { cursor: default; color: var(--ink-3); }

/* ============ Misc ============ */
.flash { padding: 12px 18px; border-radius: 10px; margin: 14px 32px 0; font-weight: 600; font-size: 13px; border: 1px solid; }
.flash.ok { background: var(--green-soft); color: var(--green); border-color: #b9dcc0; }
.flash.error { background: var(--red-soft); color: var(--red); border-color: #eac4b5; }
.muted { color: var(--ink-3); font-size: 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { font-weight: 750; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding-top: 2px; }
.kv dd { color: var(--ink); }
.progress-wrap { background: var(--line-2); border-radius: 999px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-bar { background: linear-gradient(90deg, var(--gold-2), var(--gold)); height: 100%; border-radius: 999px; transition: width .4s; }
.compliance { background: var(--gold-soft); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 16px 20px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.compliance b { color: var(--gold); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #e8a838, #c9870c); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 2px 8px rgba(201,135,12,.3); font-variant-numeric: tabular-nums; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; align-items: center; }
/* City tab bar — single scrollable row */
.city-tabs { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 12px; scrollbar-width: thin; }
.city-tabs .btn { flex-shrink: 0; }
td.nowrap { white-space: nowrap; }

@media (max-width: 960px) {
  .two-col, .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 72px; }
  .brand-name, .brand-sub, .nav-item span:not(.ni), .side-foot { display: none; }
  .content { padding: 18px; }
}
