:root {
  color: #19251f;
  background: #f7f8f6;
  font: 14px/1.48 system-ui, "Segoe UI", sans-serif;
  --ink: #19251f;
  --muted: #526158;
  --accent: #2c6049;
  --tint: #eaf1eb;
  --line: #dfe5df;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 5; background: var(--paper); padding: 10px; }
.sidebar { background: #f0f3ee; border-right: 1px solid var(--line); padding: 28px 16px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 22px; font-weight: 670; line-height: 1.1; letter-spacing: -.6px; margin: 0 8px 34px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .1px; font-weight: 520; margin-top: 5px; }
.brand-icon { display: grid; align-content: center; gap: 3px; background: var(--accent); width: 35px; height: 35px; padding-left: 9px; border-radius: 8px; flex-shrink: 0; }
.brand-icon i { height: 2px; background: white; border-radius: 1px; width: 17px; }
.brand-icon i:nth-child(2) { width: 13px; }
.brand-icon i:nth-child(3) { width: 8px; }
.sidebar nav, .sidebar-bottom { display: grid; gap: 4px; }
.sidebar nav a, .sidebar-bottom a, .nav-button { display: block; color: var(--muted); border: 0; background: transparent; padding: 10px 12px; border-radius: 6px; text-align: left; }
.sidebar a.active { background: #e1ebe2; color: #214d39; font-weight: 670; }
.sidebar a:hover, .nav-button:hover { background: #e7ede7; text-decoration: none; }
.nav-symbol { display: inline-block; width: 21px; color: var(--accent); font-size: 17px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom form { margin-top: 5px; }
.nav-button { font-size: 12px; }
main { width: 100%; max-width: 1600px; margin-inline: auto; padding: 43px clamp(20px, 4vw, 64px) 46px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 26px; }
.page-head p { margin: 5px 0 0; }
.page-head .kicker { margin: 0 0 7px; }
.kicker { color: var(--accent); font-size: 11px; font-weight: 730; letter-spacing: .10em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--ink); }
h1 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.042em; font-weight: 640; }
h2 { font-size: 16px; letter-spacing: -.015em; font-weight: 675; }
h3 { font-size: 14px; font-weight: 680; }
.muted, small { color: var(--muted); }
small { font-size: 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline.end { justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cfd9d0; border-radius: 6px; background: var(--paper); color: var(--ink); padding: 8px 13px; min-height: 36px; font-weight: 620; white-space: nowrap; }
.button:hover { background: #f4f7f3; text-decoration: none; }
.primary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover { color: white; background: #224d3a; }
.small { min-height: 30px; font-size: 12px; padding: 4px 9px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.padded { padding: 20px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 24px; }
.metric { min-height: 102px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric strong { color: var(--ink); font-size: 28px; font-weight: 630; line-height: 1; }
.metric:hover { background: #f5f8f4; text-decoration: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.panel-head p { margin: 5px 0 0; font-size: 13px; }
.empty { text-align: center; color: var(--muted); border-top: 1px solid var(--line); padding: 44px 15px; }
.status-strip { display: flex; justify-content: space-between; gap: 12px; margin-top: 17px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 100%; background: #7d857e; }
.dot.connected { background: var(--accent); }
.filter-panel { display: grid; grid-template-columns: minmax(138px, 1.3fr) repeat(6, minmax(90px, 1fr)) auto; align-items: end; gap: 8px; margin-bottom: 18px; }
label, .field { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { width: 100%; min-height: 36px; color: var(--ink); background: white; border: 1px solid #cfd9d0; border-radius: 6px; padding: 7px 9px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
input[type=file] { padding: 12px !important; }
.tabs { display: flex; gap: 7px; margin-bottom: 15px; flex-wrap: wrap; }
.tabs a { color: var(--muted); padding: 7px 11px; border: 1px solid transparent; border-radius: 6px; font-weight: 610; }
.tabs a:hover { background: var(--tint); text-decoration: none; }
.tabs a.selected { color: #214d39; background: var(--tint); border-color: #d9e7db; }
.tabs a span, .board-col h2 span { font-variant-numeric: tabular-nums; color: var(--muted); margin-left: 3px; font-size: 11px; }
.table-scroll, .board { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 13px; border-top: 1px solid var(--line); }
th { font-size: 11px; font-weight: 700; color: var(--muted); background: #f4f6f3; white-space: nowrap; }
td small { display: block; margin-top: 2px; }
td.right { text-align: right; }
.company { color: var(--ink); font-weight: 690; }
.company:hover { color: var(--accent); }
.bulk-bar, .pagination { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; gap: 10px; font-size: 12px; }
.pagination { border-top: 1px solid var(--line); }
.bulk-bar select { width: auto; min-height: 30px; padding-block: 3px; }
.check { display: flex; align-items: center; gap: 7px; }
.badge { display: inline-flex; align-items: center; border-radius: 5px; padding: 3px 7px; background: #edf0ec; color: #3b5144; font-size: 11px; font-weight: 620; }
.badge.interested, .badge.call { background: #e6efe7; color: #28553f; }
.badge.review, .notice { background: #f5efe0; color: #645020; }
.badge.rejected, .badge.opt_out, .error-text { color: #7b3d34; }
.board { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 10px; padding-bottom: 10px; }
.board-col { background: #eef1ed; border: 1px solid var(--line); border-radius: 8px; min-height: 240px; padding: 10px; }
.board-col h2 { font-size: 13px; margin: 1px 0 10px; min-height: 32px; }
.board-col.dragover { border-color: var(--accent); background: var(--tint); }
.lead-card { display: grid; justify-items: start; gap: 5px; background: var(--paper); border: 1px solid var(--line); padding: 10px; border-radius: 6px; margin-bottom: 7px; cursor: grab; }
.back { display: inline-block; margin-bottom: 14px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 18px; align-items: start; }
.detail-grid p { margin: 8px 0 12px; }
.facts { display: grid; gap: 7px; margin: 13px 0; }
.facts div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { margin: 12px 0; }
details { border-top: 1px solid var(--line); padding: 9px 0; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details form { margin: 10px 0 4px; }
.stack { display: grid; gap: 11px; justify-items: start; }
.stack label:not(.check), .stack .fields { width: 100%; }
.contacts { padding-left: 15px; margin: 12px 0; }
.contacts li { margin-bottom: 3px; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline article { border-top: 1px solid var(--line); display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: start; padding: 12px 20px; }
.timeline p { white-space: pre-wrap; margin: 4px 0 0; }
.timeline time { color: var(--muted); font-size: 12px; }
.editor { max-width: 720px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .wide { grid-column: 1 / -1; }
.notifications { display: grid; gap: 7px; margin-bottom: 14px; }
.notice { padding: 10px 12px; border-radius: 6px; }
.notice.success { background: var(--tint); color: #214d39; }
.notice.error, .errorlist { color: #7b3d34; }
.errorlist { margin: 0; padding-left: 20px; }
.import-config { margin-bottom: 15px; }
.import-config > form { align-items: end; margin-bottom: 12px; }
.review-row { padding: 17px 20px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; border-bottom: 1px solid var(--line); }
.review-row p { margin: 6px 0; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 9px; }
fieldset label { margin: 4px 0; }
.signed-out { display: block; }
.signed-out main { min-height: 100vh; display: grid; place-items: center; }
.login-panel { width: min(100%, 420px); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.login-panel .brand { margin: 0 0 20px; }
.login-panel h1 { font-size: 26px; }
.login-panel form > div { width: 100%; }
.login-panel form button { width: 100%; }
@media (max-width: 1200px) {
  .filter-panel { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric:nth-child(3) { border-right: none; }
}
@media (max-width: 750px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 8px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 5px 0 0; }
  .sidebar nav, .sidebar-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
  .sidebar-bottom form { margin-top: 0; }
  main { padding: 22px 12px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .filter-panel, .detail-grid, .review-row, .timeline article { grid-template-columns: 1fr 1fr; }
  th, td { padding: 8px; }
}
@media (max-width: 480px) {
  .detail-grid, .review-row, .timeline article, .fields { grid-template-columns: 1fr; }
  .metric { padding: 9px; min-height: 86px; }
}
