:root {
  /* Brand Buzzer palette (Brand Guidelines 2026) — balance: cream 60 · ink 25 · orange 15 */
  --orange: #FF6A13;      /* Brand Orange: buttons, highlights, active states (always Ink text on it) */
  --deep-orange: #C2410C; /* orange text on cream/white (links, labels) */
  --peach: #FF8A45;       /* soft orange accents */
  --ink: #121212;         /* headlines, body text, dark canvases */
  --cream: #F2ECE3;       /* default canvas */
  --stone: #6E6A64;       /* secondary text */
  --sand: #DED6CA;        /* hairlines and dividers */
  --white: #FFFFFF;       /* cards and tiles on cream */
  --signal-red: #D64228;  /* errors / overdue (campaign colour) */
  --electric-blue: #2E48E2;

  --bg: var(--cream); --panel: var(--white); --muted: var(--stone); --line: var(--sand); --soft: #F7F3EC;
  --brand: var(--orange); --brand-deep: var(--deep-orange); --charcoal: var(--ink);
  --accent: var(--deep-orange); --accent-ink: var(--ink); --accent-soft: #FFE6D6;
  --danger: var(--signal-red); --warn: var(--deep-orange); --ok: #15803d;
  --radius: 16px; --shadow: 0 1px 2px rgba(18,18,18,.04), 0 2px 6px rgba(18,18,18,.04);
  --s-new:#6E6A64; --s-contacted:#2E48E2; --s-interested:#7c3aed; --s-meeting:#0891b2;
  --s-proposal:#FF6A13; --s-negotiation:#C2410C; --s-won:#15803d; --s-lost:#A8A29A;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  font-family: var(--font);
  font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }

/* boot + auth */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand-deep); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; background: var(--soft); padding: 3px; border-radius: 8px; margin: 16px 0; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 6px; cursor: pointer; color: var(--muted); font: inherit; }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 228px; flex-shrink: 0; background: var(--charcoal); color: #c9d3dd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 15px; }
.logo-dot { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: var(--charcoal); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--charcoal); background: var(--brand); border-radius: 4px; padding: 1px 5px; margin-left: -4px; }
#nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: inherit; text-decoration: none; margin-bottom: 1px; }
#nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
#nav a:hover { background: rgba(255,255,255,.06); }
#nav a.on { background: rgba(255,199,44,.14); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
#nav a.on i { color: var(--brand); opacity: 1; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .5; padding: 14px 10px 6px; }
.badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.me { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.me-name { color: #fff; margin-bottom: 4px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 60px; }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view { padding: 22px 24px 60px; max-width: 1400px; width: 100%; }
.mobile-only { display: none; }

/* controls */
button, .btn { font: inherit; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1.2; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand-deep); color: var(--charcoal); font-weight: 600; }
.btn.primary:hover { background: #ffd34f; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.icon-btn { border: 0; background: none; font-size: 20px; cursor: pointer; padding: 4px 8px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--brand-deep); }
input[type=checkbox] { width: auto; accent-color: var(--brand-deep); }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 240px; flex: 1; max-width: 360px; }

/* panels + tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-b { padding: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
tbody tr:hover { background: #fafcfc; }
tr.click { cursor: pointer; }
td .sub { font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--soft); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--soft); font-size: 11px; color: var(--muted); margin: 1px 2px 1px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.bulkbar select { width: auto; }
.overdue { color: var(--danger); font-weight: 600; } .today { color: var(--warn); font-weight: 600; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.dash { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.dash > *, .lead-grid > *, .grid2 > *, .grid3 > * { min-width: 0; }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 110px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.bar { height: 22px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 5px; min-width: 2px; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }

/* lead page */
.lead-grid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.lead-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.lead-head select { width: auto; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { position: relative; }
.tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); flex-shrink: 0; font-size: 14px; }
.tl-body { flex: 1; min-width: 0; }
.tl-meta { font-size: 12px; color: var(--muted); }
.tl-text { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .t { flex: 1; min-width: 0; }

/* pipeline */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { width: 260px; flex-shrink: 0; background: #eef1f4; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 170px); }
.col-h { padding: 10px 12px; font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; border-top: 3px solid; border-radius: var(--radius) var(--radius) 0 0; }
.col-b { padding: 6px 8px 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.col.drop .col-b { background: var(--accent-soft); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 7px; cursor: grab; box-shadow: var(--shadow); font-size: 13px; }
.card:active { cursor: grabbing; }
.card .n { font-weight: 600; margin-bottom: 3px; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--charcoal); color: var(--brand); font-size: 10px; font-weight: 700; }

/* quote editor */
.items td { padding: 6px; } .items input { padding: 6px 8px; }
.totals { margin-left: auto; width: 300px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* whatsapp runner */
.runner { max-width: 640px; }
.wa-bubble { background: #dcf8c6; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; }
.progress { height: 6px; background: var(--soft); border-radius: 9px; overflow: hidden; }
.progress > div { height: 100%; background: #1fa855; }

/* chips for placeholders */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px dashed var(--line); background: var(--soft); padding: 2px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.chip:hover { border-color: var(--accent); }
.note { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.note.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* modal + toasts */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal.wide { max-width: 860px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1c2330; color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); max-width: 380px; animation: fade .15s; }
.toast.error { background: var(--danger); } .toast.ok { background: var(--ok); }

@media (max-width: 1000px) {
  .dash, .lead-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-block; }
  .view { padding: 14px; } .topbar { padding: 10px 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
  .funnel-row { grid-template-columns: 92px 1fr auto; font-size: 12px; }
  .funnel-row .muted { display: none; }
  .hide-sm { display: none; }
}


/* ===================== Brand Buzzer identity ===================== */
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; }
.topbar h1 { font-size: 20px; }
.brand { padding: 22px 20px 18px; gap: 6px; align-items: baseline; }
.wordmark { font-family: var(--font); font-size: 21px; letter-spacing: -.03em; color: #fff; line-height: 1; white-space: nowrap; }
.wordmark b { font-weight: 700; } .wordmark span { font-weight: 300; }
.wordmark.ink { color: var(--ink); }
.brand-sub { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--ink); background: var(--orange); border-radius: 4px; padding: 2px 5px; margin-left: 4px; position: relative; top: -2px; }
.sidebar { background: var(--ink); color: #cfc9c0; }
#nav a { border-radius: 10px; }
#nav a.on { background: rgba(255,106,19,.14); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
#nav a.on i { color: var(--orange); }
.nav-sep, th, .kpi .l, label.f > span, .tl-meta, .col-h, .pager .small, .note b { font-family: var(--mono); }
.nav-sep { letter-spacing: .1em; opacity: .55; }
th { text-transform: uppercase; letter-spacing: .03em; font-size: 10.5px; background: var(--soft); color: var(--stone); }
.kpi .l { text-transform: uppercase; letter-spacing: .03em; font-size: 10.5px; }
.kpi .v { font-weight: 700; letter-spacing: -.03em; }
label.f > span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--stone); }
.topbar { background: var(--white); border-bottom: 1px solid var(--sand); }
.btn { border-radius: 10px; border-color: var(--sand); }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: var(--peach); border-color: var(--peach); }
.btn.sm { border-radius: 8px; }
input, select, textarea { border-color: var(--sand); border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--orange); }
input[type=checkbox] { accent-color: var(--orange); }
.panel { border-color: var(--sand); }
.modal { border-radius: 22px; } .auth-card { border-radius: 22px; }
.tabs { background: var(--soft); border: 1px solid var(--sand); border-radius: 12px; }
.tabs button.on { background: var(--ink); color: #fff; box-shadow: none; }
.bulkbar { background: var(--accent-soft); }
.col { background: #EAE3D8; }
.card { border-radius: 12px; border-color: var(--sand); }
.avatar { background: var(--ink); color: var(--orange); }
.tag { background: #EFE8DD; color: var(--stone); }
.chip { background: var(--soft); border-color: var(--sand); font-family: var(--mono); }
.note { background: #FFF1E6; border-color: #FFCFAE; color: #6B2A07; }
.note.info { background: var(--white); border-color: var(--sand); color: var(--ink); border-left: 4px solid var(--orange); }
.toast { background: var(--ink); border-radius: 12px; }
.toast.ok { background: var(--ink); box-shadow: inset 4px 0 0 var(--orange); }
.toast.error { background: var(--signal-red); }
.badge { background: var(--orange); color: var(--ink); }
.spinner { border-top-color: var(--orange); }
.progress > div { background: var(--orange); }
.auth { background: var(--cream); }
.auth-tagline { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--deep-orange); margin: 8px 0 0; }
.link { color: var(--orange); }
code { font-family: var(--mono); font-size: 12px; background: var(--soft); padding: 1px 4px; border-radius: 4px; }
