:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #e2e7ec;
  --text: #17212b;
  --muted: #5f6d7a;
  --primary: #2F80ED;
  --primary-ink: #ffffff;
  --primary-soft: #E8F1FD;
  --danger: #c0362c;
  --danger-soft: #fdecea;
  --warn: #a35c00;
  --warn-soft: #fff3df;
  --ok: #1d7a3a;
  --ok-soft: #e5f5ea;
  --info: #2457b8;
  --info-soft: #e8effc;
  --tim: #1f4fbf;
  --tim-soft: #e7eefc;
  --goto: #7a3fc4;
  --goto-soft: #f1eafb;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .06);
  --radius: 10px;
  --side-w: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1418; --surface: #171e24; --surface-2: #1c242b; --border: #2a343d;
    --text: #e6ecf1; --muted: #93a1ad; --primary: #6EA8F5; --primary-ink: #071a33; --primary-soft: #15263d;
    --danger: #f0776d; --danger-soft: #3a1d1b; --warn: #f0b45c; --warn-soft: #3a2c14;
    --ok: #6fd08d; --ok-soft: #173222; --info: #8bb0ff; --info-soft: #1a2640;
    --tim: #8bb0ff; --tim-soft: #1a2640; --goto: #c6a2f5; --goto-soft: #2b2140;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1418; --surface: #171e24; --surface-2: #1c242b; --border: #2a343d;
  --text: #e6ecf1; --muted: #93a1ad; --primary: #6EA8F5; --primary-ink: #071a33; --primary-soft: #15263d;
  --danger: #f0776d; --danger-soft: #3a1d1b; --warn: #f0b45c; --warn-soft: #3a2c14;
  --ok: #6fd08d; --ok-soft: #173222; --info: #8bb0ff; --info-soft: #1a2640;
  --tim: #8bb0ff; --tim-soft: #1a2640; --goto: #c6a2f5; --goto-soft: #2b2140;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 15px; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name small { font-size: 12px; font-weight: 500; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 8px; font-size: 12px; color: var(--muted); word-break: break-all; }
.side-foot button { margin-top: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center;
  padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.view { padding: 20px 24px 40px; max-width: 1280px; width: 100%; }
.bottom-nav { display: none; }
.top [data-sair] { display: none; }

/* ---------- Busca global ---------- */
.gsearch { position: relative; flex: 1; max-width: 560px; }
.gsearch input { padding-left: 34px; }
.gsearch > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.gresults {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px;
}
.gresults a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.gresults a:hover, .gresults a.sel { background: var(--surface-2); text-decoration: none; }
.gresults .gtag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 6px; }
.gresults .empty { padding: 10px; color: var(--muted); }

/* ---------- Controles ---------- */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
input[readonly] { background: var(--surface-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 8px 14px; min-height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.timeline .icon-btn { display: inline-block; vertical-align: middle; padding: 2px; }
.timeline .icon-btn svg { width: 14px; height: 14px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.b-lead { background: var(--info-soft); color: var(--info); }
.b-cliente, .b-ganho, .b-ok { background: var(--ok-soft); color: var(--ok); }
.b-inativo, .b-arq { background: var(--surface-2); color: var(--muted); }
.b-perdido, .b-danger { background: var(--danger-soft); color: var(--danger); }
.b-warn, .b-negociacao { background: var(--warn-soft); color: var(--warn); }
.b-proposta, .b-qualificacao, .b-prospeccao { background: var(--primary-soft); color: var(--primary); }
.b-tim { background: var(--tim-soft); color: var(--tim); }
.b-goto { background: var(--goto-soft); color: var(--goto); }
.b-onvox { background: #fff1e6; color: #b45309; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-onvox { background: #3a2a14; color: #f5b46a; } }
:root[data-theme="dark"] .b-onvox { background: #3a2a14; color: #f5b46a; }

/* ---------- Página / listas ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.toolbar select { width: auto; flex: 0 1 auto; }
.toolbar label.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.count { color: var(--muted); font-size: 13px; margin-left: auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; user-select: none; white-space: nowrap; }
table.list th.sortable { cursor: pointer; }
table.list th.sortable:hover { color: var(--text); }
table.list th .arrow { opacity: .7; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tr.archived td { opacity: .55; }
table.list tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.late { color: var(--danger); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* ---------- Ficha ---------- */
.ficha-head { padding: 18px 20px; margin-bottom: 16px; }
.ficha-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ficha-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin-top: 16px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 500; word-break: break-word; }
.obs { margin-top: 14px; white-space: pre-wrap; color: var(--text); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.ficha-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.panel { padding: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 8px 16px 14px; }
.item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item.clickable { cursor: pointer; }
.links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-top: 2px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.t-nota::before { background: var(--warn); }
.timeline li.t-tarefa_concluida::before { background: var(--ok); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what { white-space: pre-wrap; }
.note-form { display: flex; gap: 8px; margin: 6px 0 14px; }
.note-form textarea { min-height: 40px; }

/* ---------- Modal / formulários ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
}
dialog.modal.wide { width: min(940px, calc(100vw - 24px)); }
dialog.modal.narrow { width: min(420px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 16, 22, .45); }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid .full { grid-column: 1 / -1; }
.fld label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fld label .req { color: var(--danger); }
.fld .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fld .help.warn { color: var(--warn); }
.fld .help.err { color: var(--danger); }
.fld.check { display: flex; align-items: center; gap: 8px; padding-top: 20px; }
.fld.check label { margin: 0; font-size: 14px; color: var(--text); font-weight: 500; }
.fld.invalid input, .fld.invalid select, .fld.invalid textarea { border-color: var(--danger); }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.section-title { font-size: 13px; font-weight: 700; margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: center; }

.items-table { width: 100%; border-collapse: collapse; }
.items-table th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 4px 6px; }
.items-table td { padding: 4px 6px; vertical-align: middle; }
.items-table td.sub { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items-table input { min-height: 34px; padding: 6px 8px; }
.items-total { text-align: right; font-weight: 700; padding: 8px 6px 0; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(400px, 100%); padding: 26px 24px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card form { display: grid; gap: 12px; margin-top: 18px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-top: 14px; flex-wrap: wrap; }
.notice { background: var(--info-soft); color: var(--info); padding: 8px 12px; border-radius: 8px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; }
.toast.err { background: var(--danger); color: #fff; }

.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .ficha-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 8px 16px; }
  .top [data-sair] { display: inline-flex; }
  .view { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: 11px; color: var(--muted); }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .grid { grid-template-columns: 1fr; }
  .fld.check { padding-top: 0; }
  .toolbar input[type="search"] { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1 1 40%; }
  .count { margin-left: 0; width: 100%; }

  /* tabela vira lista de cartões */
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td, table.list tfoot { display: block; width: 100%; }
  table.list tbody tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.list td { border: 0; padding: 2px 0; display: flex; gap: 8px; justify-content: space-between; text-align: right; }
  table.list td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  table.list td.primary-cell { display: block; text-align: left; padding-bottom: 4px; }
  table.list td.primary-cell::before { content: none; }
  table.list td:empty { display: none; }
  table.list td.num { justify-content: space-between; }
  table.list tfoot tr { display: flex; justify-content: space-between; padding: 10px 14px; }
  table.list tfoot td { width: auto; background: none; padding: 0; }
  table.list tfoot td::before { content: none; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .items-table td:first-child { grid-column: 1 / -1; }
  dialog.modal:not(.narrow) { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  dialog.modal:not(.narrow) form { max-height: 100dvh; height: 100%; }
  .modal-foot { padding: 10px 12px; gap: 6px; }
  .modal-foot .btn { padding: 6px 10px; }
  .modal-body { flex: 1; }
  .ficha-head { padding: 14px; }
}

/* =====================================================================
   Etapa 2: funil, Hoje, painel, importação, ajustes
   ===================================================================== */
.b-aberta { background: var(--primary-soft); color: var(--primary); }
.intro { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 8px 14px; cursor: pointer; min-height: 38px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary-soft); color: var(--primary); }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.k-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 160px; transition: background .12s, border-color .12s; }
.k-col.over { background: var(--primary-soft); border-color: var(--primary); }
.k-head { padding: 10px 12px; border-bottom: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: var(--radius) var(--radius) 0 0; }
.k-ganho .k-head { border-top-color: var(--ok); }
.k-perdido .k-head { border-top-color: var(--danger); }
.k-list { padding: 8px; display: grid; gap: 8px; overflow-y: auto; align-content: start; flex: 1; }
.k-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; border: 1px dashed var(--border); border-radius: 8px; }
.k-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); display: grid; gap: 3px; }
.k-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.k-card:focus-visible { outline: 2px solid var(--primary); }
.k-card.dragging { opacity: .4; }
.k-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.k-top strong { font-size: 13px; line-height: 1.3; }
.k-sub { font-size: 12px; color: var(--muted); }
.k-val { display: flex; gap: 4px; align-items: baseline; }
.k-next { font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 5px; margin-top: 3px; }
.k-next.warn { color: var(--warn); font-weight: 600; }
.k-next.late { color: var(--danger); font-weight: 600; }
.k-move { display: none; margin-top: 6px; min-height: 32px; padding: 4px 8px; font-size: 13px; }
@media (hover: none), (pointer: coarse) { .k-move { display: block; } .k-card { cursor: pointer; } }

/* Hoje */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
a.tile:hover { text-decoration: none; border-color: var(--primary); }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tile small { font-size: 12px; color: var(--muted); }
.tile-danger b { color: var(--danger); }
.tile-warn b { color: var(--warn); }
.hoje-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.group-title { font-size: 13px; margin: 14px 0 2px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.group-title:first-child { margin-top: 6px; }
.item.task { align-items: center; }
.item.done { opacity: .45; text-decoration: line-through; }
.big-check { width: 22px; height: 22px; flex: none; cursor: pointer; }
.when-col { white-space: nowrap; text-align: right; }

/* Painel */
.month-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.metas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.meta-card { padding: 14px 16px; display: grid; gap: 6px; }
.meta-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.meta-pct { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meta-pct.ok { color: var(--ok); }
.meter { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.meta-nums { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
details summary { cursor: pointer; color: var(--primary); }
details div { padding: 2px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bar-row { padding: 6px 0; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 3px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; min-width: 2px; }
.bar-loss span { background: var(--danger); }
.meta-row { padding: 12px; margin-bottom: 10px; box-shadow: none; }
.meta-row > .btn { margin-top: 8px; }
.chk-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); font-weight: 500; }

/* Importar */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop svg { width: 28px; height: 28px; color: var(--primary); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.imp-table tbody tr { cursor: default; }

/* Ajustes / Mais */
.etapa-row { align-items: center; }
.etapa-row .ord { display: flex; flex-direction: column; width: 28px; }
.etapa-row .ord .icon-btn:disabled { opacity: .25; cursor: default; }
.mais-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); border-bottom: 1px solid var(--border); font-weight: 500; }
.mais-list a:last-child { border-bottom: 0; }
.mais-list a:hover { text-decoration: none; background: var(--surface-2); }
.mais-list svg { width: 20px; height: 20px; color: var(--muted); }
.mais-list svg:last-child { margin-left: auto; width: 16px; height: 16px; }

.side { overflow-y: auto; }

/* Google Agenda (Etapa 3) */
.ag-ico { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.ag-ico.pend { opacity: .6; }
.ag-ico.err { color: var(--danger); }
.ag-ev { align-items: baseline; }
.ag-ev .when-col { width: 64px; text-align: left; flex: none; }

/* Gmail (Etapa 4) */
.mail-item.unread .title { font-weight: 800; }
.mail-item .when-col { flex: none; }
.mail-msg { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.mail-msg header { margin-bottom: 8px; }
.mail-frame { width: 100%; height: 340px; border: 0; background: #fff; border-radius: 6px; }
.mail-text { white-space: pre-wrap; font-size: 14px; }
.timeline li.t-email_enviado::before { background: var(--info); }
.ok-text { color: var(--ok); }

/* mapa da empresa */
.mapa { width: 100%; height: 280px; border: 0; border-radius: 8px; background: var(--surface-2); display: block; }
.mapa-head { flex-wrap: wrap; gap: 8px; }
.mapa-botoes { display: flex; gap: 6px; flex-wrap: nowrap; }

/* menu em grupos */
.nav-grupo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav .nav-grupo:first-child { padding-top: 0; }
.view > .nav-grupo { padding: 16px 4px 6px; }
.nav a { padding-top: 7px; padding-bottom: 7px; }
.funil-ctl { display: inline-flex; align-items: center; gap: 2px; }

/* Etapa 6: funis, comissão, propostas */
.funil-sel { width: auto; min-width: 170px; font-weight: 600; }
.sel-row { background: var(--primary-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.btn.primary-outline { border-color: var(--primary); color: var(--primary); }
.seg.tabs a { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 38px; font-weight: 600; color: var(--muted); }
.seg.tabs a + a { border-left: 1px solid var(--border); }
.seg.tabs a.on { background: var(--primary-soft); color: var(--primary); }
.seg.tabs a:hover { text-decoration: none; }
.com-cli { margin-bottom: 14px; overflow: hidden; }
.com-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.com-total { font-size: 20px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.com-table td, .com-table th { padding: 8px 12px; }
.com-table tbody tr { cursor: default; }
.acoes-com { text-align: right; }
tr.row-warn td { background: var(--warn-soft); }
.tabela-com input { width: 90px; min-height: 32px; padding: 4px 8px; }
.tabela-com td:first-child { white-space: nowrap; font-weight: 600; }
.logo-prev { min-width: 120px; min-height: 48px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.logo-prev img { max-height: 60px; max-width: 200px; }

/* Documentos e WhatsApp */
.doc-item { align-items: center; }
.doc-ico { font-size: 22px; line-height: 1; flex: none; }
.timeline li.t-whatsapp::before { background: #25d366; }
.timeline li.t-documento::before { background: var(--muted); }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 1000px) {
  .hoje-grid, .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .kanban { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 0 16px 12px; }
  .k-col { scroll-snap-align: start; max-height: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile b { font-size: 19px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .imp-table td.primary-cell { display: block; }
}
