/* Ninho · identidade Logium: grafite + laranja, Poppins (titulos), Manrope (texto), Bebas Neue (marca) */
:root {
  --bg: #f4f4f6; --surface: #fff; --soft: #eaeaee; --line: #e3e3e8;
  --ink: #1a1a1f; --ink-2: #3a3d45; --muted: #5b5e66; --faint: #8c8f98;
  --side: #1a1a1f; --side-2: #2a2a31; --side-ink: #c9cbd1;
  --brand: #ee6a00; --brand-2: #d55f00; --brand-soft: #fff1e5;
  --blue: #2f6feb; --purple: #7c5cff; --green: #1f9d55; --green-ink: #17804a; --red: #d64545;
  --radius: 12px;
  --f-title: Poppins, system-ui, sans-serif;
  --f-text: Manrope, system-ui, sans-serif;
  --f-brand: "Bebas Neue", Impact, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--f-text); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 600; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.2; margin: 0; }
h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.break { word-break: break-all; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; display: block; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.up { color: var(--green-ink); }

/* ---------- marca ---------- */
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo img { width: 30px; height: auto; }
.logo b { font-family: var(--f-brand); font-weight: 400; font-size: 24px; letter-spacing: .04em; line-height: 1; display: block; }
.logo small { display: block; font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-top: 1px; }
.badge-agencia { display: inline-block; margin-top: 10px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 5px; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 28px 16px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 0 8px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 30px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--side-ink); font-weight: 600; }
.sidebar nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--side-2); color: #fff; }
.sidebar nav a.active svg { stroke: var(--brand); }
.sidebar nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-sep { margin: 18px 12px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6c6f78; }
.side-foot { margin-top: auto; padding-top: 18px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--side-2); color: #fff; }
.user-card:hover { text-decoration: none; background: #34343c; }
.user-card span:last-child { min-width: 0; }
.user-card b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card small { display: block; color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 600 12.5px var(--f-title); flex-shrink: 0; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; background: var(--brand-soft); color: var(--brand); }
.side-foot form { margin: 8px 0 0; }
.side-foot .sair { background: none; border: 0; color: var(--faint); font: 600 12.5px var(--f-text); cursor: pointer; padding: 4px 10px; }
.side-foot .sair:hover { color: #fff; }
.content { min-width: 0; padding: 32px 36px 64px; }
.mobile-bar { display: none; }
.vendo-como { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 22px; font-size: 13px; }
.vendo-como b { color: var(--brand); }
.vendo-como a { color: #fff; font-weight: 700; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.tight { gap: 10px 14px; }
.lead-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }

/* ---------- cartoes ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; overflow-x: auto; }
.card.narrow { max-width: 540px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.box { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.box p { margin: 6px 0; }
.ok-box { background: #eaf7ef; color: var(--green-ink); border-radius: 10px; padding: 10px 14px; margin-top: 14px; font-size: 13px; }

/* ---------- formularios ---------- */
.form { display: grid; gap: 12px; }
.form.row { display: flex; }
label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: 500 14px var(--f-text); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 40px; width: 48px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(238, 106, 0, .18); border-color: var(--brand); }
input.sm { padding: 6px 10px; width: 140px; }
input.xs { width: 68px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--brand); color: #fff; font: 600 14px var(--f-title); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #000; }
.btn.danger { color: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 36px; width: 260px; }
.filters select, .page-head select { width: auto; }
.page-head form { margin: 0; flex-wrap: nowrap; }
.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--ink); color: #fff; }
.seg a:hover { text-decoration: none; }

/* ---------- avisos e etiquetas ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert.ok { background: #eaf7ef; color: var(--green-ink); }
.alert.erro { background: #fdeeee; color: #a33232; }
.alert.info { background: #eef3fe; color: #234fa8; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.pill.enviado, .pill.st-concluida, .pill.qualif { background: #eaf7ef; color: var(--green-ink); }
.pill.erro { background: #fdeeee; color: var(--red); }
.pill.pendente, .pill.st-pausada { background: var(--brand-soft); color: var(--brand-2); }
.pill.st-enviando { background: #eef3fe; color: var(--blue); }
.chip-src { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); }
.tag-seg { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--bg); color: var(--ink-2); }
.sent { color: var(--green-ink); font-size: 11.5px; font-weight: 700; }

/* ---------- tabelas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--soft); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td b { font-weight: 700; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.inativo { opacity: .5; }
.table tr.click { cursor: pointer; }
.table tr.click:hover { background: #fafafb; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .actions form, form.inline { margin: 0; display: inline-flex; gap: 6px; }
.table .resp { max-width: 300px; word-break: break-word; }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; display: block; }
.kpi b { font: 600 28px/1.25 var(--f-title); display: block; margin: 4px 0 2px; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.dark { background: var(--ink); color: #fff; }
.kpi.dark span, .kpi.dark small { color: var(--side-ink); }
.kpi.orange { background: var(--brand); color: #fff; }
.kpi.orange span, .kpi.orange small { color: #ffe3cc; }
.funil-bar { margin: 14px 0; }
.funil-bar .lbl { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.funil-bar .lbl small { color: var(--muted); font-weight: 600; }
.funil-bar .trk { background: var(--bg); border-radius: 6px; height: 16px; overflow: hidden; }
.funil-bar i { display: block; height: 100%; border-radius: 6px; }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 22px 4px 0; border-bottom: 1px solid var(--soft); }
.chart .wk { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.chart .b { width: 26px; border-radius: 5px 5px 0 0; background: var(--ink); position: relative; min-height: 2px; }
.chart .b.q { background: var(--brand); }
.chart .b em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 600 11px var(--f-title); color: var(--ink); font-style: normal; }
.chart-x { display: flex; gap: 14px; padding: 6px 4px 0; }
.chart-x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.atencao { display: grid; gap: 8px; }
.atencao div { border-radius: 10px; padding: 10px 14px; background: #fdeeee; }
.atencao div.leve { background: var(--brand-soft); }
.atencao b { display: block; }
.atencao b::before { content: "●"; color: var(--red); margin-right: 8px; }
.atencao .leve b::before { color: var(--brand); }
.atencao small { color: var(--ink-2); padding-left: 18px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { flex: 0 0 272px; background: var(--soft); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 140px); }
.col header { padding: 14px 14px 8px; display: flex; gap: 8px; align-items: center; }
.col header .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.col header b { font-weight: 700; }
.col header .count { margin-left: auto; background: var(--surface); border-radius: 99px; padding: 0 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.col .cards { padding: 4px 10px 12px; overflow-y: auto; display: grid; gap: 8px; min-height: 70px; }
.col.over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.lead-card { display: grid; gap: 4px; background: var(--surface); border-radius: 10px; padding: 12px 14px; color: var(--ink); cursor: grab; }
.lead-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--brand); }
.lead-card.dragging { opacity: .5; }
.lead-card .top { display: flex; justify-content: space-between; gap: 8px; }
.lead-card .top b { font-weight: 700; }
.lead-card .top small { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.lead-card p { margin: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead-card .bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.lead-card .val { font: 600 13px var(--f-title); }

/* ---------- ficha do lead ---------- */
.lead-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.lead-hero h1 { font-size: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lead-hero .acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; width: 100%; }
.lead-hero .acoes form { margin: 0; }
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 18px; }
.progress div { font-size: 12px; font-weight: 700; color: var(--faint); }
.progress div::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--soft); margin-bottom: 6px; }
.progress div.done { color: var(--ink); }
.progress div.done::before { background: var(--brand); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.src-tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--blue); }
.ev, .hist { padding: 8px 0; border-bottom: 1px solid var(--soft); }
.ev:last-child, .hist:last-child { border-bottom: 0; }
.chat-card { position: sticky; top: 20px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 10px; background: var(--bg); border-radius: 10px; margin-bottom: 10px; }
.msg { max-width: 80%; padding: 8px 11px; border-radius: 10px; background: var(--surface); word-wrap: break-word; }
.msg.out { align-self: flex-end; background: #e3f6e9; }
.msg small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- configuracoes ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.subnav a { padding: 7px 14px; border-radius: 99px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.subnav a:hover { text-decoration: none; background: var(--soft); }
.subnav a.on { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 5px 12px; border-radius: 8px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.etapas-edit { display: grid; gap: 6px; }
.etapa-row { display: grid; grid-template-columns: 70px 1.3fr 52px 1fr 1fr 50px 140px; gap: 8px; align-items: center; margin: 0; }
.etapa-row.head { font-size: 12px; color: var(--muted); font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--bg); margin: 0; font-weight: 600; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.steps { padding-left: 18px; }
.steps li { margin: 6px 0; }
pre.code { background: var(--bg); border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.doc h2 { margin-top: 24px; }
.doc h2:first-child { margin-top: 0; }
.copy { cursor: copy; }
.copy.copied { outline: 2px solid var(--green); }

/* ---------- modal ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 24px; width: min(460px, 92vw); background: var(--surface); color: var(--ink); }
dialog.modal::backdrop { background: rgba(26, 26, 31, .55); }
dialog.modal h2 { margin-top: 0; font-size: 18px; }

/* ---------- login ---------- */
body.auth { background: var(--bg); min-height: 100vh; }
.auth-hero { background: var(--side); color: #fff; position: relative; overflow: hidden; padding: 42px 8vw 46px; }
.auth-hero .bg-owl { position: absolute; right: -60px; top: -20px; height: 130%; opacity: .5; pointer-events: none; }
.auth-hero .logo { position: relative; }
.auth-hero h1 { position: relative; font: 400 clamp(54px, 9vw, 92px)/.92 var(--f-brand); color: #fff; margin: 44px 0 22px; letter-spacing: .01em; }
.auth-hero h1 em { font-style: normal; color: var(--brand); }
.auth-hero p { position: relative; max-width: 440px; color: #d6d7dc; font-size: 15px; margin: 0 0 22px; }
.auth-hero ul { position: relative; display: flex; gap: 22px; padding: 0; margin: 0; list-style: none; font-size: 12.5px; color: #d6d7dc; font-weight: 600; flex-wrap: wrap; }
.auth-hero li::before { content: "●"; margin-right: 7px; color: var(--green); }
.auth-hero li + li::before { color: var(--brand); }
.auth-form { max-width: 400px; margin: 0 auto; padding: 40px 20px 60px; display: grid; gap: 14px; }
.auth-form h2 { font-size: 24px; margin: 0; }
.auth-form p { margin: 0; }
.auth-card { background: var(--surface); border-radius: 14px; padding: 28px; width: min(380px, 100%); display: grid; gap: 14px; margin: 8vh auto; }
.auth-card.wide { width: min(560px, 100%); }
.brand-lg { font: 400 34px var(--f-brand); letter-spacing: .04em; }
.auth-card p { margin: 0; }
.center-box { max-width: 420px; margin: 15vh auto; text-align: center; padding: 16px; }

/* ---------- impressao (PDF do relatorio) ---------- */
@media print {
  .sidebar, .mobile-bar, .no-print, .vendo-como { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card, .kpi { break-inside: avoid; border: 1px solid var(--soft); }
}

/* ---------- celular ---------- */
@media (max-width: 1100px) {
  .kpis, .kpis.k5, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--side); position: sticky; top: 0; z-index: 30; }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  .sidebar { position: fixed; top: 56px; left: 0; bottom: 0; height: auto; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar > .logo { display: none; }
  .sidebar nav { margin-top: 0; }
  .content { padding: 20px 16px 60px; }
  .grid2, .lead-grid { grid-template-columns: 1fr; }
  .chat-card { position: static; }
  .etapa-row { grid-template-columns: 1fr 1fr; }
  .etapa-row.head { display: none; }
  .search input { width: 100%; }
  .search { flex: 1; }
  h1 { font-size: 24px; }
}
