/* Camada de UX/UI profissional. Tema claro e limpo por padrão; escuro opcional
   (botão "Tema" no rodapé do menu). Tudo usa tokens: troque o tema trocando só as variáveis. */
:root, :root[data-theme="light"] {
  --brand: #00a85a; --brand-2: #00c96b; --brand-ink: #ffffff; --brand-soft: #e7f7ef;
  --bg: #f6f7f8; --surface: #ffffff; --surface-2: #f8faf9; --field: #ffffff; --hover: #f1f4f3;
  --line: #e6e9ec; --line-2: #d6dbdf; --track: #edf0f2;
  --ink: #111827; --ink-2: #4b5563; --muted: #6b7280;
  --danger: #b42318; --danger-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6;
  --ok: #067647; --ok-soft: #e6f6ee; --info: #175cd3; --info-soft: #e8f0fd;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #00d26a; --brand-2: #12e07a; --brand-ink: #04140b; --brand-soft: rgba(0,210,106,.12);
  --bg: #0b0f0e; --surface: #111715; --surface-2: #151c1a; --field: #0d1311; --hover: #18211e;
  --line: #1f2926; --line-2: #2a3632; --track: #1b2421;
  --ink: #e9efec; --ink-2: #aab8b2; --muted: #7a8b84;
  --danger: #ff7a7a; --danger-soft: rgba(255,122,122,.12); --warn: #ffc857; --warn-soft: rgba(255,200,87,.12);
  --ok: #3ee39a; --ok-soft: rgba(62,227,154,.12); --info: #7cbcff; --info-soft: rgba(124,188,255,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}
/* Fundo liso: sem gradientes nem grade. */
body { font-size: 14.5px; letter-spacing: -.003em; background: var(--bg); color: var(--ink); }

/* Layout e respiro */
#main { padding: 32px 40px 96px; max-width: 1440px; }
.page-head { margin-bottom: 28px; align-items: flex-end; gap: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; background: none; color: var(--ink); -webkit-text-fill-color: currentColor; margin: 0; }
.page-head p { max-width: 70ch; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.grid { gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; backdrop-filter: none; box-shadow: var(--shadow); }
.card:hover { border-color: var(--line); box-shadow: var(--shadow); }
.card h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px; letter-spacing: -.01em; color: var(--ink); }
.card h2::before { display: none; }
.card h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; } .card-h h2 { margin: 0; }
a { color: var(--brand); }

/* Botões: 1 principal (verde), secundários neutros, terciários sem borda */
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 550; box-shadow: none; text-decoration: none; }
.btn:hover { background: var(--hover); border-color: var(--line-2); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 650; }
.btn.primary:hover { background: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger-t { color: var(--danger); }
.btn.glow { animation: none; }
.btn:disabled { opacity: .55; cursor: default; }
/* Menu "Mais ações" */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; } .more-menu > summary::-webkit-details-marker { display: none; }
.more-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.more-menu .menu > * { justify-content: flex-start; width: 100%; height: 36px; border: 0; background: transparent; border-radius: 8px; font-weight: 500; }
.more-menu .menu > *:hover { background: var(--hover); }

input, select, textarea { background: var(--field); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select option { background: var(--surface); color: var(--ink); }
label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.form { gap: 14px 16px; }
.tag { font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.banner { border-radius: 12px; }

/* Navegação lateral (escura nos dois temas: identidade Hunter) */
.side { background: #0b0f0e; border-right: 1px solid #18201d; }
#nav { padding: 8px 12px; }
#nav .group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5f7068; margin: 20px 10px 6px; }
#nav .group::before { content: none; }
#nav a { display: flex; align-items: center; justify-content: flex-start; gap: 11px; padding: 9px 10px; margin: 1px 0; border-radius: 9px; color: #b6c4bd; font-weight: 500; font-size: 14px; box-shadow: none; text-align: left; }
#nav a span { flex: 1; text-align: left; }
#nav a:hover { background: #141b18; color: #fff; }
#nav a.active { background: rgba(0,210,106,.12); color: #fff; box-shadow: none; }
#nav a.active .ni { stroke: #00d26a; }
#nav a[data-badge]:not([data-badge=""])::after { margin-left: auto; float: none; box-shadow: none; background: #00d26a; color: #04140b; }
.ni { width: 18px; height: 18px; fill: none; stroke: #7f928a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-adv { margin-top: 18px; border-top: 1px solid #18201d; padding-top: 10px; }
.nav-adv summary { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #7f928a; cursor: pointer; list-style: none; font-size: 13.5px; }
.nav-adv summary span { flex: 1; text-align: left; }
.nav-adv summary::-webkit-details-marker { display: none; }
.nav-adv summary::after { content: '›'; transition: transform .15s; } .nav-adv[open] summary::after { transform: rotate(90deg); }
.nav-adv a { padding-left: 39px !important; font-size: 13px !important; }
.theme-btn { background: transparent; border: 1px solid #26312d; color: #b6c4bd; }
.theme-btn:hover { background: #141b18; color: #fff; }

/* Painel */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.kpi:first-child { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow), inset 0 3px 0 var(--brand); }
.kpi-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.kpi-pct { color: var(--brand); font-weight: 650; }
.kpi-v { font-family: var(--display, inherit); font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 12px; color: var(--ink); }
.kpi-v small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; } .kpi-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.kpi-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
details.more { margin-top: 24px; }
details.more > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--ink-2); padding: 10px 0; display: inline-flex; gap: 8px; align-items: center; }
details.more > summary::before { content: '+'; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
details.more[open] > summary::before { content: '–'; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .grid { margin-top: 8px; }
.qitem { padding: 12px 0; border-bottom: 1px solid var(--line); } .qitem:last-child { border-bottom: 0; }
.hfun { gap: 12px; margin: 10px 0; } .bar { background: var(--track); border-radius: 99px; } .bar span { background: var(--brand); border-radius: 99px; }
.hrow { padding: 7px 0; border-bottom: 1px solid var(--line); } .hrow:last-child { border-bottom: 0; }
.h-hero { display: none; }

/* Ficha do lead: abas */
.ltabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 20px; }
.ltabs button { font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.ltabs button:hover { color: var(--ink); }
.ltabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.ld-grid { gap: 20px; }
.ld-box h3 { color: var(--muted); margin: 0 0 16px; } .ld-box h3 svg { filter: none; stroke: var(--brand); }
.ld-box dl { gap: 11px 16px; }

/* Ajuda recolhida */
details.hint { margin-top: 10px; }
details.hint summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.hint summary::before { content: 'i'; width: 16px; height: 16px; display: grid; place-items: center; font-size: 10px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 50%; }
details.hint summary::-webkit-details-marker { display: none; }
details.hint p { margin: 8px 0 0; }

/* Tabelas, kanban, modais, chat e fila seguindo os tokens */
th { background: var(--surface); color: var(--muted); font-weight: 600; } td { border-color: var(--line); }
tr.click:hover td { background: var(--hover); }
.kanban .col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.kcard:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.ai-out { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.chip { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); }
.chip:hover { color: var(--ink); border-color: var(--brand); }
.ag-msg.user .ag-b { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); color: var(--ink); }
.ag-msg.assistant .ag-b { background: var(--surface-2); border: 1px solid var(--line); }
.ag-tool { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.ag-orb { box-shadow: 0 0 20px rgba(0,210,106,.35); animation: none; }
.ag-fab { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.ag-dock { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); backdrop-filter: none; }
.ob-ch { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.ob-why { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); }

@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 760px) { #main { padding: 20px 16px 96px; } .kpis { grid-template-columns: 1fr; } .page-head h1 { font-size: 22px; } .page-head .actions-row { width: 100%; } }
@media (min-width: 901px) { .menu-btn { display: none !important; } }
/* Topo do menu só com texto (sem logos) */
.side-text { display: grid; gap: 2px; padding: 22px 22px 18px; border-bottom: 1px solid #18201d; }
.side-text strong { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.side-text span { color: #6f8179; font-size: 12px; }
.conn-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 900px) { #connForm { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 560px) { #connForm { grid-template-columns: 1fr !important; } }
.ld-people { grid-column: 1 / -1; } .ld-people .pp { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); } .ld-people .pp:last-child { border-bottom: 0; }
/* Assistente "Conectar minhas contas" */
.cx-progress { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; margin: -8px 0 24px; } .cx-progress i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.cx { display: grid; grid-template-columns: 40px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--shadow); }
.cx.ok { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.cx-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.cx.ok .cx-n { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.cx-h { display: flex; align-items: center; gap: 10px; } .cx-h h2 { margin: 0; font-size: 16px; }
.cx-lead { color: var(--ink-2); margin: 6px 0 14px; max-width: 72ch; }
.cx-row { display: flex; gap: 8px; max-width: 520px; } .cx-row input { flex: 1; }
.cx-steps { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 12px; } .cx-steps li { line-height: 1.5; }
.cx-live { font-weight: 600; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.cx.ok .cx-lead + * { } 
.cx-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: -8px 0 20px; border-radius: 12px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); color: var(--ink); text-decoration: none; }
.cx-banner span:first-of-type { color: var(--ink-2); flex: 1; }
.cx-receita { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 13.5px; margin-top: 8px; }
@media (max-width: 640px) { .cx { grid-template-columns: 1fr; } .cx-row { flex-direction: column; } }
