/* RA CRM — identidade Agência RA Digital (preto #040404 + dourado #F7BB23) */
:root {
  --bg: #040404;
  --bg-2: #0d0d0d;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --line: #2a2a2a;
  --line-2: #383838;
  --text: #f4f4f4;
  --text-2: #b9b9b9;
  --muted: #8a8a8a;
  --gold: #F7BB23;
  --gold-2: #ffd466;
  --gold-ink: #040404;
  --gold-soft: rgba(247, 187, 35, .12);
  --green: #3ecf8e;
  --green-soft: rgba(62, 207, 142, .14);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .13);
  --amber: #ffb547;
  --wa: #25d366;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f4f0;
  --bg-2: #ecebe6;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --line: #e4e2da;
  --line-2: #d4d1c6;
  --text: #121212;
  --text-2: #3d3d3d;
  --muted: #6f6f6f;
  --gold: #d99a00;
  --gold-2: #b98300;
  --gold-ink: #040404;
  --gold-soft: rgba(217, 154, 0, .12);
  --green: #108a52;
  --green-soft: rgba(16, 138, 82, .1);
  --red: #c92a2a;
  --red-soft: rgba(201, 42, 42, .08);
  --amber: #b86e00;
  --shadow: 0 8px 30px rgba(0, 0, 0, .08);
  color-scheme: light;
}
:root[data-theme="light"] .btn-primary { background: #F7BB23; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; margin-top: 1.2em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.late { color: var(--red); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.dim { opacity: .5; }
.ico { flex-shrink: 0; vertical-align: -3px; }

/* ---------- Estrutura ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 244px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); padding: 4px 8px 16px; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: var(--gold-ink); font-weight: 900; font-size: 14px; letter-spacing: 0; }
.acc-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 4px 14px; }
.acc-box small { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.acc-box strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-switch { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 14px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.side nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side nav a.on { background: var(--gold-soft); color: var(--gold); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; padding: 4px; border-radius: var(--radius-sm); }
.me:hover { text-decoration: none; background: var(--surface); }
.me span:last-child { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.foot-actions { display: flex; gap: 2px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--gold); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 700; }
.topbar .menu-btn { display: none; }
.content { padding: 12px 28px 40px; }
.bare { min-height: 100vh; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow, .narrow { max-width: 720px; }
.stack > .card:last-child { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 600 13.5px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(1.05); border-color: var(--wa); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn { background: transparent; border: 0; color: var(--text-2); cursor: pointer; width: 34px; height: 34px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; font-size: 16px; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
form.inline { display: inline; margin: 0; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, label.inline-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
label.inline-label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius-sm);
  padding: 9px 11px; font: 14px/1.4 var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[disabled] { opacity: .6; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--gold); padding: 0; }
textarea { resize: vertical; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.span2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.copy-row { display: flex; gap: 8px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks .ok { color: var(--green); }
.checks .bad { color: var(--red); }

/* Alertas */
.alert { margin: 8px 28px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); }
.content .alert, .auth-box .alert, .card .alert { margin: 0 0 12px; }
.alert.ok { border-color: var(--green); background: var(--green-soft); }
.alert.err { border-color: var(--red); background: var(--red-soft); }
.alert.warn { border-color: var(--amber); background: var(--gold-soft); }

/* Barra de ferramentas e filtros */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input[type="date"] { width: auto; }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 32px; width: 250px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg a { padding: 8px 14px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--gold-soft); color: var(--gold); }
.seg a:hover { text-decoration: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--gold); border-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Tags e pills */
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.tag-paid { border-color: rgba(247, 187, 35, .45); color: var(--gold); background: var(--gold-soft); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill-won { background: var(--green-soft); color: var(--green); }
.pill-lost { background: var(--red-soft); color: var(--red); }
.count { display: inline-block; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 20px; padding: 0 8px; margin-left: 4px; }

/* ---------- Funil (kanban) ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 272px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col header { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.col header strong { font-size: 13.5px; }
.col header small { color: var(--muted); display: block; margin-top: 2px; }
.col-open header { border-top: 3px solid var(--gold); border-radius: var(--radius) var(--radius) 0 0; }
.col-won header { border-top: 3px solid var(--green); border-radius: var(--radius) var(--radius) 0 0; }
.col-lost header { border-top: 3px solid var(--red); border-radius: var(--radius) var(--radius) 0 0; }
.cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 80px; }
.cards.over { background: var(--gold-soft); outline: 2px dashed var(--gold); outline-offset: -6px; border-radius: var(--radius); }
.card-lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: grab; transition: border-color .15s, box-shadow .15s; }
.card-lead:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.card-lead.dragging { opacity: .45; }
.card-lead.stale { border-left: 3px solid var(--amber); }
.cl-name { font-weight: 700; color: var(--text); display: block; margin-bottom: 3px; }
.cl-field { font-size: 12.5px; color: var(--text-2); }
.cl-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.cl-meta .val { font-weight: 700; font-size: 12.5px; color: var(--green); }
.cl-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cl-foot .wa, .task-list .wa { margin-left: auto; color: var(--wa); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.cl-foot .wa:hover, .task-list .wa:hover { background: rgba(37, 211, 102, .14); }
.hint-drag { margin-top: 4px; }

/* ---------- Ficha do lead ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); margin-bottom: 12px; font-weight: 500; }
.lead-head .lh-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lead-head h2 { margin-bottom: 2px; }
.lh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.pipeline { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pipeline form { display: contents; }
.pl-step { flex: 1 1 110px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); padding: 8px 10px; font: 600 12.5px var(--font); border-radius: 6px; cursor: pointer; text-align: center; }
.pl-step:hover { border-color: var(--gold); color: var(--text); }
.pl-step.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); cursor: default; }
.pl-step.pl-won:not(.on) { border-color: rgba(62, 207, 142, .5); color: var(--green); }
.pl-step.pl-lost:not(.on) { border-color: rgba(255, 107, 107, .45); color: var(--red); }
.pl-step.on.pl-won { background: var(--green); border-color: var(--green); color: #04130c; }
.pl-step.on.pl-lost { background: var(--red); border-color: var(--red); color: #fff; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lead-grid > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack .card { margin-bottom: 0; }
.danger-zone { text-align: right; }

.task-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; }
.task-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-list li.done span { text-decoration: line-through; color: var(--muted); }
.tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-2); background: transparent; cursor: pointer; color: var(--gold-ink); font-size: 12px; font-weight: 900; padding: 0; margin-top: 1px; display: grid; place-items: center; }
.tick:hover { border-color: var(--gold); }
.tick.on { background: var(--gold); border-color: var(--gold); }
.task-add { border-top: 1px solid var(--line); padding-top: 12px; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); border-radius: 20px; padding: 4px 11px; font: 600 12px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--gold); color: var(--gold); }
.task-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.task-groups .card { margin: 0; }

.timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.timeline li.tl-note::before { background: var(--gold); }
.timeline li.tl-stage::before { background: var(--green); }
.timeline li.tl-whatsapp::before { background: var(--wa); }
.timeline li.tl-task::before { background: #7aa7ff; }
.tl-body { white-space: normal; word-wrap: break-word; }
.tl-note .tl-body { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td a strong { color: var(--text); }
.card:not(.flush) .table th:first-child, .card:not(.flush) .table td:first-child { padding-left: 0; }
.empty-cell { text-align: center; color: var(--muted); padding: 30px !important; }
.row-hl td { background: var(--gold-soft); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 14px; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- Resultados ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile small { color: var(--text-2); font-weight: 600; }
.tile strong { font-size: 26px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.tile-hl { border-color: rgba(247, 187, 35, .5); background: linear-gradient(180deg, var(--gold-soft), transparent 70%), var(--surface); }
.tile-hl strong { color: var(--gold); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-grid .card { margin: 0; }
.dash-grid .span2 { grid-column: span 2; }
.hbar { margin-bottom: 10px; }
.hbar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-track.muted-track span { background: var(--red); opacity: .75; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell .bar { height: 8px; background: var(--gold); border-radius: 0 4px 4px 0; min-width: 2px; max-width: 110px; }
.bar-cell b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Configurações ---------- */
.edit-rows { display: flex; flex-direction: column; gap: 8px; }
.er, .er-head { display: grid; grid-template-columns: 70px 1fr 170px 60px 60px; gap: 8px; align-items: center; }
.er-head span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.er .check { justify-content: center; }
.er-new input, .er-new select, .er-new textarea { border-style: dashed; }
.edit-rows.fields .er, .edit-rows.fields .er-head { grid-template-columns: 70px 1fr 150px 1fr 70px 60px; }
.edit-rows.sources .er, .edit-rows.sources .er-head { grid-template-columns: 70px 1fr 90px 60px 60px; }
.edit-rows.reasons .er, .edit-rows.reasons .er-head { grid-template-columns: 70px 1fr 60px; }
.w-num { text-align: center; }
.m-only { display: none; }

/* ---------- Modais ---------- */
dialog.modal { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--text); padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Login / instalação ---------- */
.auth, body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% -10%, rgba(247, 187, 35, .14), transparent 55%), var(--bg); }
.auth-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
.auth-box.wide { max-width: 680px; }
.auth-box h1 { font-size: 22px; }
.auth-box .card { background: var(--bg-2); }
.brand-lg { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.brand-lg .logo { width: 42px; height: 42px; font-size: 16px; border-radius: 11px; }
.powered { margin-top: 18px; }
.empty { text-align: center; padding: 60px 20px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .side { transform: none; }
  body.menu-open .side-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px 4px; }
  .topbar h1 { font-size: 18px; }
  .content { padding: 10px 16px 32px; }
  .alert { margin: 8px 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: auto; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .col { flex-basis: 82vw; max-height: none; }
  .card-lead { cursor: default; }
}
@media (max-width: 600px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .tiles, .tiles-4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile strong { font-size: 20px; }
  .card { padding: 16px; }
  .er, .er-head, .edit-rows.fields .er, .edit-rows.fields .er-head, .edit-rows.sources .er, .edit-rows.sources .er-head { grid-template-columns: 52px 1fr; }
  .er > :nth-child(n+3) { grid-column: 2; }
  .er-head { display: none; }
  .er { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .er .check { justify-content: flex-start; }
  .m-only { display: inline; }
  .toolbar { align-items: stretch; }
  .filters select, .filters input[type="date"] { flex: 1 1 45%; }
}

/* ---------- Integrações ---------- */
.ibadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted); vertical-align: 2px; margin-left: 6px; }
.ibadge.ok { color: var(--green); border-color: rgba(62, 207, 142, .45); background: var(--green-soft); }
.ibadge.warn { color: var(--amber); border-color: rgba(255, 181, 71, .5); background: var(--gold-soft); }
.ibadge.bad { color: var(--red); border-color: rgba(255, 107, 107, .5); background: var(--red-soft); }
.icard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; max-width: 980px; }
.icard > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; }
.icard > summary::-webkit-details-marker { display: none; }
.icard > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex-shrink: 0; }
.icard[open] > summary::after { transform: rotate(-135deg); }
.iicon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--gold); }
.iicon.meta { color: #4c8dff; background: rgba(76, 141, 255, .12); }
.iicon.google { color: #3ecf8e; background: var(--green-soft); }
.iicon.wa { color: var(--wa); background: rgba(37, 211, 102, .12); }
.ititle { display: flex; flex-direction: column; min-width: 0; }
.ititle strong { font-size: 16px; }
.ititle small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ibody { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.ibody h4 { margin: 6px 0 2px; }
.howto { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; }
.howto ol { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); }
.ok-box, .warn-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-radius: var(--radius-sm); padding: 12px 14px; }
.ok-box { background: var(--green-soft); border: 1px solid rgba(62, 207, 142, .35); }
.ok-box > div { display: flex; flex-direction: column; }
.ok-box > div > .ico { color: var(--green); display: none; }
.ok-box strong { color: var(--green); }
.ok-box small { color: var(--text-2); }
.warn-box { background: var(--gold-soft); border: 1px solid rgba(255, 181, 71, .45); color: var(--amber); font-size: 13.5px; }
.isection { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.sync-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.checks-row { display: flex; flex-direction: column; gap: 8px; }
.checks-row .check { font-size: 13.5px; font-weight: 400; color: var(--text); align-items: flex-start; }
.adv > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.inline-test, .row-form { display: flex; gap: 8px; flex-direction: row; align-items: center; }
.inline-test input, .row-form input { max-width: 320px; }
.page-list { display: flex; flex-direction: column; gap: 6px; }
.page-list .check { font-weight: 500; color: var(--text); }
dl.attr { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
dl.attr dt { color: var(--muted); }
dl.attr dd { margin: 0; word-break: break-word; }
.cl-ad { font-size: 12px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-ad .ico { color: var(--gold); }

.irow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.isection.form > .btn, .ibody > form.inline > .btn { align-self: flex-start; }
.dash-grid > *, .lead-grid > *, .task-groups > * { min-width: 0; }
