/* ELO HUB — identidade Elo Jurídico (marca/design-guide.md) com linguagem de app moderno (ref. LíderHub).
   Títulos: Libre Caslon Text. Interface: Inter. Modo claro e escuro (navy da marca). */
@font-face { font-family: 'Libre Caslon Text'; src: url('/fonts/libre-caslon-text-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; size-adjust: 94%; }
@font-face { font-family: 'Libre Caslon Text'; src: url('/fonts/libre-caslon-text-700.woff2') format('woff2'); font-weight: 500 900; font-style: normal; font-display: swap; size-adjust: 88%; }

:root {
  color-scheme: light;
  --navy: #0C1428;
  --navy-mid: #152035;
  --brand: #8D9DB3;
  --brand-light: #A8B9CA;

  --bg: #F5F8FB;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E8EEF4;
  --line: #E1E8EF;
  --line-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #475569;
  --muted: #64748B;
  --primary: #0C1428;
  --primary-text: #FFFFFF;
  --focus: rgba(141, 157, 179, .35);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --bubble-in: #FFFFFF;
  --bubble-out: #0C1428;
  --bubble-out-text: #EDF3F8;
  --bubble-ia: #E3EAF2;
  --chat-bg: #EEF3F8;

  /* etapas do funil — paleta validada (CVD, contraste) para claro/escuro */
  --novo: #8A9AAA;
  --em_andamento: #2A78D6;
  --qualificado: #12A27A;
  --contrato: #6250D6;
  --cliente: #B97A00;
  --descartado: #D0457E;
  --danger: #C2364B;
  --ok: #12A27A;

  --font-serif: 'Libre Caslon Text', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1122;
  --surface: #101A30;
  --surface-2: #152035;
  --surface-3: #1B2843;
  --line: #1F2C46;
  --line-strong: #2B3B5A;
  --text: #EDF3F8;
  --text-2: #C1CCD8;
  --muted: #8D9DB3;
  --primary: #EDF3F8;
  --primary-text: #0C1428;
  --focus: rgba(141, 157, 179, .3);
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --bubble-in: #152035;
  --bubble-out: #2A3A5C;
  --bubble-out-text: #EDF3F8;
  --bubble-ia: #1B2843;
  --chat-bg: #0C1428;
  --em_andamento: #3987E5;
  --qualificado: #199E70;
  --contrato: #9085E9;
  --cliente: #C98500;
  --descartado: #E0609A;
  --danger: #E0606A;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font-sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 0; font-size: 13px; min-height: 0; }
h1 { font-family: var(--font-serif); font-weight: 700; font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.2px; text-wrap: balance; }
h2 { font-family: var(--font-serif); font-weight: 700; font-size: 22px; margin: 0 0 4px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { margin: 4px 0; }
[data-icon] svg, i svg { width: 18px; height: 18px; display: block; }
i[data-icon] { display: inline-flex; font-style: normal; }

:root[data-theme="dark"] .logo-light, :root:not([data-theme="dark"]) .logo-dark { display: none; }

input, select, textarea {
  font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 12px; background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }

.btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--r-sm);
  padding: 9px 16px; cursor: pointer; transition: background .15s, transform .05s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* switch */
input.switch { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; border: 0; padding: 0; flex-shrink: 0; transition: background .2s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:focus { box-shadow: 0 0 0 3px var(--focus); }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(1200px 600px at 80% 110%, var(--surface-3), transparent 60%), var(--bg); }
.login-theme { position: absolute; top: 20px; right: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); padding: 36px 32px 28px; border-radius: var(--r-lg); width: 420px; max-width: 92vw; box-shadow: var(--shadow-lg); }
.login-card > div { text-align: center; margin: 14px 0 6px; }
.login-card .btn.primary { margin-top: 22px; padding: 12px; }
.login-logo { display: block; width: 168px; margin: 0 auto; }
.login-foot { color: var(--muted); font-size: 12px; }
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; }
.sidebar { width: 248px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; flex-shrink: 0; }
.brand { display: flex; align-items: flex-end; gap: 10px; padding: 2px 10px 22px; }
.brand img { width: 112px; }
.brand span { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px 1px 8px; margin-bottom: 6px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.sidebar nav a.active i svg { color: var(--em_andamento); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.ai-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.ai-switch span { display: grid; min-width: 0; }
.ai-switch b { color: var(--text); font-size: 13px; white-space: nowrap; }
.ai-switch small { color: var(--muted); font-weight: 500; font-size: 12px; }
.pill { background: var(--em_andamento); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; margin-left: auto; line-height: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: auto; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.wait { background: var(--cliente); }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hello { display: flex; align-items: center; gap: 12px; }
.hello b { display: block; font-size: 15px; }
.hello span { font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.views { flex: 1; min-height: 0; display: flex; }
.view { flex: 1; overflow: auto; padding: 26px 28px 40px; }
.view.flush { padding: 0; overflow: hidden; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head p { margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; letter-spacing: .3px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.brand-avatar { background: var(--navy); color: #EDF3F8; border: 2px solid var(--brand); }
:root[data-theme="dark"] .brand-avatar { background: #EDF3F8; color: var(--navy); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 4px 10px; border: 1px solid; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.chip.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.chip.wait { color: var(--cliente); background: color-mix(in srgb, var(--cliente) 10%, transparent); border-color: color-mix(in srgb, var(--cliente) 30%, transparent); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; }
.tabs button { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid transparent; background: transparent; color: var(--text-2); padding: 6px 14px; border-radius: 99px; cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); font-weight: 600; }

.search-box { position: relative; min-width: 280px; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box i svg { width: 16px; height: 16px; }
.search-box input { padding-left: 36px; }

/* ---------- início ---------- */
.stage-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stage-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 10px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, transform .15s; }
.stage-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stage-card .top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; min-width: 0; }
.ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ico svg { width: 16px; height: 16px; }
.stage-card .num { font-family: var(--font-serif); font-size: 30px; font-weight: 700; margin: 10px 0 0; line-height: 1.1; color: var(--text); }
.stage-card .pct { font-size: 12px; color: var(--muted); }
.spark { display: block; width: 100%; height: 34px; margin-top: 6px; overflow: visible; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .area { fill: var(--em_andamento); opacity: .12; }
.chart .line { fill: none; stroke: var(--em_andamento); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; }
.chart .marker { fill: var(--em_andamento); stroke: var(--surface); stroke-width: 2; }

.activity { display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.act { display: flex; gap: 12px; align-items: flex-start; padding: 9px 6px; border-radius: var(--r-sm); cursor: pointer; }
.act:hover { background: var(--surface-2); }
.act b { font-weight: 600; }
.act .when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.act p { margin: 0; font-size: 13px; color: var(--text-2); }

.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.hbar .lbl { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar .track { grid-column: span 2; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--em_andamento); border-radius: 0 4px 4px 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; background: var(--surface-2); }
.kpi b { display: block; font-family: var(--font-serif); font-size: 26px; line-height: 1.15; }
.kpi span { font-size: 12px; color: var(--muted); }
.empty-note { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }

.tooltip { position: fixed; z-index: 70; pointer-events: none; background: var(--navy); color: #EDF3F8; border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.tooltip b { display: block; font-size: 14px; }
:root[data-theme="dark"] .tooltip { background: #EDF3F8; color: var(--navy); }

/* ---------- funil ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(178px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 220px; transition: outline-color .15s; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: 2px; }
.col-head { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 4px 4px 10px; font-size: 13px; }
.col-head .ico { width: 24px; height: 24px; }
.col-head .ico svg { width: 13px; height: 13px; }
.col-head .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-head small { margin-left: auto; color: var(--text-2); font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.lead-card { min-width: 0; overflow: hidden; background: var(--surface); border-radius: var(--r-sm); padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: grab; display: grid; gap: 8px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.lead-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.lead-card .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.lead-card .who div { min-width: 0; }
.lead-card .row { display: flex; justify-content: space-between; gap: 6px; align-items: center; min-width: 0; }
.lead-card .tag { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.lead-card .tag svg { display: inline; vertical-align: -2px; margin-right: 3px; }
.lead-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.lead-card .phone { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card .right { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lead-card .preview { color: var(--text-2); font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag { font-size: 11px; border-radius: 6px; padding: 2px 7px; background: var(--surface-2); color: var(--text-2); font-weight: 600; white-space: nowrap; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px; }
.tag svg { width: 12px; height: 12px; }
.tag.ai { color: var(--contrato); border-color: color-mix(in srgb, var(--contrato) 30%, transparent); background: color-mix(in srgb, var(--contrato) 8%, transparent); }
.tag.warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.tag.off { color: var(--muted); }
.score { font-size: 12px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.score .mini { width: 34px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.score .mini i { display: block; height: 100%; background: var(--qualificado); }
.time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.unread { background: var(--em_andamento); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; font-weight: 700; line-height: 18px; }

/* ---------- conversas ---------- */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px; height: 100%; width: 100%; }
.chat-list { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.chat-list-head .search-box { min-width: 0; }
#conv-list { overflow: auto; flex: 1; padding: 6px; }
.conv { padding: 10px; border-radius: var(--r-sm); cursor: pointer; display: flex; gap: 10px; margin-bottom: 2px; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--surface-3); }
.conv .body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.conv .row { display: flex; gap: 6px; align-items: center; justify-content: space-between; min-width: 0; }
.conv .row > :first-child { min-width: 0; }
.conv .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--chat-bg); }
.chat-head { background: var(--surface); padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who b { display: block; font-size: 15px; }
.chat-head .who span { font-size: 12.5px; }
.chat-head .ai-toggle { white-space: nowrap; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.messages { flex: 1; overflow: auto; padding: 20px 6%; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 70%; padding: 8px 12px 5px; border-radius: 14px; background: var(--bubble-in); white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow-sm); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border-color: transparent; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg.out .meta { color: var(--brand-light); }
.msg.out.ia { background: var(--bubble-ia); color: var(--text); }
.msg.out.ia .meta { color: var(--muted); }
.msg.sistema { align-self: center; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); font-size: 12px; max-width: 90%; border-color: color-mix(in srgb, var(--danger) 25%, transparent); border-radius: var(--r-sm); }
.msg .meta { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.msg .meta svg { width: 11px; height: 11px; }
.typing { align-self: flex-end; font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.typing svg { width: 14px; height: 14px; color: var(--contrato); }
.composer { display: flex; gap: 10px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border-radius: var(--r); }
.empty { margin: auto; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty svg { width: 34px; height: 34px; opacity: .5; }

.chat-side { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 18px; }
.chat-side .section { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.chat-side .section label:first-child { margin-top: 0; }
.chat-side .actions { display: grid; gap: 8px; }
.side-profile { display: flex; align-items: center; gap: 12px; }
.side-profile b { display: block; font-size: 15px; }
.scorebar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.scorebar i { display: block; height: 100%; background: var(--qualificado); border-radius: 99px; }
.summary { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; color: var(--text-2); }
.contract-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; }
.contract-item a { color: var(--em_andamento); font-weight: 600; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.contract-item a svg { width: 14px; height: 14px; }
.alert { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }

/* ---------- benefícios / config ---------- */
.benefits-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.benefit-list { display: grid; gap: 6px; }
.benefit-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px; cursor: pointer; transition: border-color .15s; }
.benefit-item:hover { border-color: var(--line-strong); }
.benefit-item b { font-weight: 600; }
.benefit-item.active { border-color: var(--em_andamento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--em_andamento) 15%, transparent); }
.benefit-item.inactive { opacity: .55; }
.form.narrow { max-width: 920px; }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form .actions-row { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.form textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.form h3 { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.form h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.9; }
.hint code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; }
.switch-row { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; font-weight: 500; margin: 14px 0 0; cursor: pointer; }

/* ---------- whatsapp ---------- */
.wa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.wa-grid .card > label:first-of-type { margin-top: 12px; }
.wa-grid .card .btn { margin-top: 14px; }
.wa-status { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.qr { width: 280px; height: 280px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 8px; margin-top: 10px; }
.steps { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 13, 26, .55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); width: min(1000px, 94vw); max-height: 92vh; overflow: auto; padding: 26px; box-shadow: var(--shadow-lg); }
.contract-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.preview-doc { white-space: pre-wrap; font-family: var(--font-serif); font-size: 13px; background: #fff; color: #1A2430; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 22px; max-height: 62vh; overflow: auto; }
.preview-doc mark { background: #D8E2EC; color: #0C1428; border-radius: 3px; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--navy); color: #EDF3F8; padding: 11px 16px; border-radius: var(--r-sm); z-index: 60; box-shadow: var(--shadow-lg); font-weight: 500; }
:root[data-theme="dark"] .toast { background: #EDF3F8; color: var(--navy); }

@media (max-width: 1300px) {
  .stage-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chat-layout { grid-template-columns: 280px minmax(0, 1fr) 300px; }
}
@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
  .sidebar { width: 210px; }
}

/* contratos / kit da CCS */
.contract-item .links { display: inline-flex; gap: 10px; flex-shrink: 0; }
.contract-item .chip { font-size: 11px; padding: 1px 8px; margin-top: 4px; }
.form .grid2 .span2, .grid2 .span2 { grid-column: span 2; }
#contract-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* parceiros */
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-actions select { width: auto; }
.partners-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.partner-list { display: grid; gap: 6px; max-height: calc(100vh - 210px); overflow: auto; padding-right: 4px; }
.partner-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; display: grid; gap: 5px; }
.partner-item:hover { border-color: var(--line-strong); }
.partner-item.active { border-color: var(--em_andamento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--em_andamento) 15%, transparent); }
.partner-item.inactive { opacity: .55; }
.partner-item .row { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.partner-item .row:nth-child(2) { justify-content: flex-start; }
.pkg { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.small { font-size: 12px; }
.partner-detail h2 { margin: 0; }
.checks { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.checks .switch-row { margin-top: 4px; }
h3.sec { margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.tpl-row, .file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; }
.tpl-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.tpl-actions a.btn { text-decoration: none; }
.file-row span:first-child { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.file-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.file-row a { color: var(--em_andamento); font-weight: 600; text-decoration: none; font-size: 13px; }
label.btn input[type=file] { display: none; }
.note-ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }
.tpl-files { display: grid; gap: 2px; margin: 8px 0; }
.tpl-files .switch-row { margin-top: 6px; }
.ord { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: 11px; }
.slot-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.slot-row .ctx { font-size: 12.5px; color: var(--text-2); font-family: var(--font-serif); }
.slot-row mark { background: #FFF1B8; color: #1A2430; border-radius: 3px; padding: 0 2px; }
