/* Padrão visual: "Data-Dense Dashboard" da skill ui-ux-pro-max.
   Azul de dados + âmbar de destaque, fonte Fira Sans, contraste mínimo 4,5:1. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #dbe3ef;
  --text: #0f1f4b;
  --heading: #1e3a8a;
  --muted: #475569;
  --accent: #1e40af;
  --accent-2: #3b82f6;
  --obar-end: #2563eb;
  --on-accent: #ffffff;
  --accent-soft: #e9eef6;
  --highlight: #d97706;
  --good: #15803d;
  --bad: #c11f1f;
  --warn: #b45309;
  --chart-a: #1e40af;
  --chart-b: #d97706;
  --ring: #1e40af;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 31, 75, .06), 0 1px 3px rgba(15, 31, 75, .05);
  --ease: 180ms cubic-bezier(.2, 0, 0, 1);
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2e;
    --border: #1f2c47;
    --text: #e2e8f0;
    --heading: #bfdbfe;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --accent-2: #93c5fd;
    --obar-end: #93c5fd;
    --on-accent: #0b1220;
    --accent-soft: #172554;
    --highlight: #fbbf24;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --chart-a: #60a5fa;
    --chart-b: #fbbf24;
    --ring: #93c5fd;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: color-mix(in srgb, var(--accent-2) 30%, transparent); color: inherit; }
input, textarea { caret-color: var(--accent); }
html { scrollbar-color: var(--border) var(--bg); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
summary, button, .btn, tr.link, [data-nav], a { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.25; color: var(--heading); font-weight: 700; }
h2 { font-size: 1.08rem; margin: 0 0 12px; color: var(--heading); font-weight: 600; }
h2.section { font-size: 1.35rem; margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); font-weight: 700; }
h3 { font-size: .8rem; margin: 22px 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 24px 16px; }
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 8px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; transition: background var(--ease), color var(--ease); }
.topbar nav a:hover { color: var(--accent); }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .topbar { gap: 6px 16px; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex-basis: 100%; margin-inline: -16px; padding-inline: 12px; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; }
}

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

button, .btn, select, input, textarea { font: inherit; color: inherit; }
button, .btn {
  min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500;
  transition: border-color var(--ease), background var(--ease), color var(--ease), filter var(--ease);
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { filter: brightness(1.1); color: var(--on-accent); }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
@media (max-width: 768px) { button, .btn { min-height: 44px; } }
select, input, textarea {
  min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); max-width: 100%;
  transition: border-color var(--ease);
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label { display: block; font-weight: 500; margin-bottom: 12px; }
label span { display: block; margin-bottom: 4px; }
label input, label select { width: 100%; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 6px; }
label.check input { width: auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.banner { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.banner.error { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px; break-inside: avoid; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.kpi .label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kpi .value { font-size: 1.75rem; font-weight: 700; margin: 2px 0 8px; font-variant-numeric: tabular-nums; color: var(--heading); letter-spacing: -.02em; line-height: 1.15; }
.kfoot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.kpi .delta { font-size: .8rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); white-space: nowrap; }
.kpi .delta.good { background: color-mix(in srgb, var(--good) 7%, transparent); }
.kpi .delta.bad { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.kpi .delta.good { color: var(--good); }
.kpi .delta.bad { color: var(--bad); }
.kpi .delta.flat { color: var(--muted); }
.kpi .prev { font-size: .8rem; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 14px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
tbody tr { transition: background var(--ease); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 180px; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }

.bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; min-width: 90px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.over > i { background: var(--bad); }

.funnel { display: grid; gap: 10px; }
.funnel .row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.funnel .track { background: var(--bg); border-radius: 6px; }
.funnel .fill { background: var(--accent-soft); color: var(--text); border-radius: 6px; padding: 6px 10px; white-space: nowrap; min-width: max-content; font-weight: 600; }

.chart { position: relative; height: 280px; }
.ofunnel { display: grid; gap: 4px; margin: 14px 0 6px; }
.ostage > summary { list-style: none; cursor: pointer; }
.ostage > summary::-webkit-details-marker { display: none; }
.ostep { display: grid; grid-template-columns: 1fr minmax(96px, 150px); gap: 14px; align-items: center; }
.obar { margin: 0 auto; min-width: 190px; background: color-mix(in srgb, var(--accent) var(--mix, 100%), var(--obar-end, var(--accent-2))); color: var(--on-accent); border-radius: 8px; padding: 9px 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.25; text-align: center; transition: filter .15s; }
.ostage > summary:hover .obar { filter: brightness(1.12); }
.ostage:not([open]) .obar { opacity: .82; }
.olabel { font-size: .8rem; font-weight: 500; opacity: .92; }
.ovalue { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ovalue small { font-size: .8rem; font-weight: 500; opacity: .92; }
.oside .delta, .osub .delta { font-size: .82rem; font-weight: 600; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--muted); }
.oside .prev, .osub .prev { font-size: .78rem; color: var(--muted); }
.osubs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 6px; }
.osub { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.osub .label { font-size: .78rem; color: var(--muted); }
.osub .value { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.olink { display: grid; grid-template-columns: 1fr minmax(96px, 150px); gap: 14px; color: var(--muted); font-size: .82rem; text-align: center; padding: 3px 0; }
.oread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.oread li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); }
.oread li.good { border-color: color-mix(in srgb, var(--good) 35%, var(--border)); background: color-mix(in srgb, var(--good) 6%, var(--surface)); }
.oread li.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.oread li.info { background: var(--bg); }
.oread li.good .omark { color: var(--good); }
.oread li.bad .omark { color: var(--bad); }
.omark { font-weight: 700; }
.olink::after { content: ""; }
.funnel.wide .row { grid-template-columns: minmax(110px, 230px) 1fr; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid2 > .card { margin-bottom: 0; min-width: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600; }
.tag.err { background: transparent; border: 1px solid var(--bad); color: var(--bad); }

.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.gargalo { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--border)); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.gargalo.equilibrio { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
table.checks td { vertical-align: top; }
table.checks td:nth-child(2) { white-space: normal; min-width: 150px; font-weight: 500; }
table.checks td:last-child { min-width: 280px; }
table.checks td.num { min-width: 130px; }
table.checks tr.good .omark { color: var(--good); }
table.checks tr.bad .omark { color: var(--bad); }
table.checks tr.warn .omark { color: var(--warn); }
table.checks tr.info .omark { color: var(--muted); }
.actions-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.rules { margin: 0; padding-left: 20px; }
tr.muted td { color: var(--muted); }
h2.section.sub { font-size: 1.1rem; border-bottom-width: 1px; }

.report-cover { margin-bottom: 20px; }
.analysis { white-space: pre-wrap; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .actions { justify-content: flex-end; margin-top: 16px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 12px; padding: 10px 12px; }
legend { font-weight: 600; padding: 0 6px; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Régua de meta (bullet chart): faixa da meta + marcador do resultado. O número sempre aparece em texto ao lado. */
.gauge { position: relative; height: 10px; min-width: 110px; border-radius: 5px; background: var(--accent-soft); margin-top: 6px; }
.gauge .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 28%, transparent); border-left: 2px solid var(--good); border-right: 2px solid var(--good); }
.gauge .mark { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--heading); }
tr.bad .gauge .mark { background: var(--bad); }
.olink.drop { color: var(--warn); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); z-index: 10; }

.login { max-width: 340px; margin: 12vh auto; }

@media print {
  :root { --bg: #fff; --surface: #fff; --border: #cbd5e1; --text: #0f1f4b; --heading: #1e3a8a; --muted: #475569; --accent: #1e40af; --accent-2: #3b82f6; --accent-soft: #e9eef6; --highlight: #b45309; --good: #15803d; --bad: #c11f1f; --chart-a: #1e40af; --chart-b: #d97706; --shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 13px; }
  .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .card, .kpi { break-inside: avoid; }
  h2.section { break-before: page; }
  h2.section:first-of-type { break-before: auto; }
  /* A parte paga começa em página nova no PDF completo (como antes de separar orgânico e pago). */
  .ads-part { break-before: page; }
  body.print-paid .ads-part { break-before: auto; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  /* Título nunca fica sozinho no pé da página: vai junto com o que vem embaixo dele. */
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  .keep, .kpis { break-inside: avoid; page-break-inside: avoid; }
  .kpi { break-inside: avoid; page-break-inside: avoid; }
  h2.section.sub { break-before: page; }
  .card.plan { break-inside: auto; }
}

/* Ajustes finais (Impeccable polish): ficam no fim para valer sobre as regras de base. */
p, li, td.wrap { text-wrap: pretty; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px 12px 10px; }
  .kpi .value { font-size: 1.35rem; }
}

/* ---------- Funil interativo do dashboard do cliente ---------- */
.flayout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.ffunnel { min-width: 0; }
.fstage { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; align-items: center; }
.fbar { margin: 0 auto; min-height: 52px; padding: 8px 14px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2;
  background: color-mix(in srgb, var(--accent) var(--mix, 100%), var(--accent-2)); color: var(--on-accent); transition: width var(--ease); }
.fstage.main .fbar { background: var(--highlight); color: #1a1205; box-shadow: 0 0 0 3px color-mix(in srgb, var(--highlight) 30%, transparent); }
.flabel { font-size: .8rem; font-weight: 500; opacity: .95; }
.fvalue { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fside { display: flex; flex-direction: column; font-size: .82rem; }
.fside .delta { font-weight: 600; }
.fside .prev, .flink .prev { color: var(--muted); font-size: .78rem; }
.flink { margin: 4px 132px 4px 0; padding: 6px 10px; border-left: 3px solid var(--border); color: var(--muted); font-size: .85rem; }
.flink-text { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; justify-content: center; text-align: center; }
.flink .delta { font-weight: 600; font-size: .78rem; }
.flink.repeat { border-left-style: dashed; }
.flink.hole { border-left-color: var(--highlight); background: color-mix(in srgb, var(--highlight) 10%, transparent); border-radius: 0 6px 6px 0; color: var(--text); }
.hole-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--highlight); color: #1a1205; font-size: .72rem; font-weight: 700; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.fchips.top { margin: 0 132px 10px 0; }
.fchips.bottom { margin: 10px 132px 0 0; }
.fchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .8rem; color: var(--text); }
.fchip-label { color: var(--muted); }
.fchip .delta { font-size: .74rem; font-weight: 600; }
.fsummary { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; border-left: 4px solid var(--good); background: var(--bg); font-size: .9rem; }
.fsummary.bad { border-left-color: var(--highlight); }
.fpicker { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--bg); position: sticky; top: 12px; }
.fpicker fieldset { margin: 0 0 10px; padding: 8px 10px; background: var(--surface); }
.fpicker legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fpicker label.check { font-size: .9rem; margin: 0; padding: 5px 2px; cursor: pointer; border-radius: 6px; }
.fpicker label.check:hover { color: var(--accent); }
.fpicker input { accent-color: var(--accent); width: 16px; height: 16px; min-height: 0; }
.link-btn { min-height: 0; border: 0; background: none; padding: 4px 2px; color: var(--accent); text-decoration: underline; font-size: .85rem; }
@media (max-width: 860px) {
  .flayout { grid-template-columns: 1fr; }
  .fpicker { position: static; order: -1; }
  .fstage { grid-template-columns: minmax(0, 1fr) 92px; }
  .flink, .fchips.top, .fchips.bottom { margin-right: 0; }
  .fpicker label.check { padding: 10px 2px; }
}
@media print { .fpicker { display: none; } .flayout { grid-template-columns: 1fr; } }
.fpicker-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

/* ---------- Criativos (explorador estilo Gerenciador) ---------- */
.adcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.adgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.adcol { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); min-width: 0; }
.adcol-head { padding: 8px 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.adlist { list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow-y: auto; display: grid; gap: 4px; }
.adlist li.muted { padding: 8px; }
.adlist button { width: 100%; min-height: 52px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; justify-content: stretch; padding: 8px 10px; background: var(--surface); }
.adlist button img { grid-row: span 2; width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.adlist button:not(:has(img)) { grid-template-columns: 1fr; }
.adlist button.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.adname { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.admeta { font-size: .76rem; color: var(--muted); font-weight: 400; }
.addetail { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.addetail-media img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.adph { aspect-ratio: 4 / 5; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font-weight: 600; text-align: center; padding: 10px; }
.adtitle { text-transform: none; letter-spacing: 0; font-size: 1.05rem; color: var(--heading); margin: 2px 0 10px; }
.admetrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.admetrics div { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; }
.admetrics span { font-size: .74rem; color: var(--muted); }
.admetrics strong { font-size: 1.05rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.ret { display: grid; gap: 6px; max-width: 520px; }
.ret-row { display: grid; grid-template-columns: 52px 1fr 120px; gap: 8px; align-items: center; font-size: .85rem; }
.ret-track { height: 12px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; }
.ret-track i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.ret-row.drop .ret-track i { background: var(--highlight); }
.ret-row.drop .ret-val em { color: var(--highlight); font-style: normal; font-weight: 700; font-size: .75rem; }
.ret-val { font-variant-numeric: tabular-nums; }
.ret.compact .ret-row { grid-template-columns: 46px 1fr 56px; font-size: .78rem; }
.ret.compact .ret-track { height: 8px; }
.actfilter { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.chipbtn { min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; }
.chipbtn.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.acttable td { font-size: .86rem; vertical-align: top; }
.crgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.crcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; break-inside: avoid; }
.crhead { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.crhead:not(:has(img)) { grid-template-columns: 1fr; }
.crhead img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.crcard .admetrics { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .adgrid { grid-template-columns: 1fr; }
  .adlist { max-height: 220px; }
  .addetail { grid-template-columns: 1fr; }
  .addetail-media { max-width: 220px; }
}
.chart-desc { margin: -4px 0 12px; font-size: .88rem; color: var(--muted); max-width: 80ch; }
.status { font-weight: 600; font-size: .85rem; white-space: nowrap; }
.status.on { color: var(--good); }
.status.off { color: var(--muted); }
body.public .fpicker { display: none; }
body.public .flayout { grid-template-columns: 1fr; }
.plainbox { border-radius: 8px; padding: 12px 16px; background: var(--accent-soft); border-left: 4px solid var(--accent); margin-bottom: 6px; }
.plainbox ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: .95rem; }
.weekplan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dayplan { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); break-inside: avoid; }
.dayplan.off { grid-template-columns: 76px 1fr; background: var(--bg); }
.dayplan-day { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); padding: 6px; text-align: center; }
.dayplan-day strong { font-size: .85rem; }
.dayplan-day span { font-size: .78rem; }
.dayplan-format { font-weight: 700; color: var(--heading); }
.dayplan-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.tag.alt { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.dayplan-why { border-left: 3px solid var(--good); padding-left: 12px; }
.dayplan-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.dayplan-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.dayplan-chips .up { font-size: .76rem; font-weight: 600; color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); border-radius: 999px; padding: 1px 8px; }
.dayplan-why p { margin: 0; font-size: .86rem; }
@media (max-width: 760px) { .dayplan { grid-template-columns: 64px 1fr; } .dayplan-why { grid-column: 1 / -1; } }

/* Botão de ocultar tópicos e métricas do relatório */
.card, .kpi, .osub, .admetrics > div, .fchip, .dayplan, .crcard { position: relative; }
.xbtn { position: absolute; top: 6px; right: 6px; z-index: 2; min-height: 0; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 16px; line-height: 1; opacity: 0; transition: opacity var(--ease), color var(--ease), border-color var(--ease); }
.card:hover > .xbtn, .kpi:hover > .xbtn, .osub:hover > .xbtn, .admetrics > div:hover > .xbtn, .fchip:hover > .xbtn, .dayplan:hover > .xbtn, .crcard:hover > .xbtn,
tr:hover > td .xbtn, .xbtn:focus-visible { opacity: 1; }
.xbtn:hover { color: var(--bad); border-color: var(--bad); }
.fchip > .xbtn { position: static; width: 18px; height: 18px; font-size: 13px; order: 9; opacity: .5; }
@media (hover: none) { .xbtn { opacity: .7; } }
table.checks tbody td:first-child { position: relative; min-width: 34px; }
.is-hidden { display: none !important; }
.plan-note { margin: 10px 0 4px; font-size: .8rem; line-height: 1.55; color: var(--muted); max-width: 95ch; }
.plan-note strong { font-weight: 600; color: var(--muted); }
@media print { .plan-note { font-size: 10px; } }

/* Mini funil dos níveis de consciência (nota explicativa do plano) */
.lvl { margin: 14px 0 4px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: .8rem; break-inside: avoid; }
.lvl-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 8px; }
.lvl-rows { display: grid; gap: 3px; }
.lvl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; }
.lvl-bar { margin: 0 auto; padding: 4px 10px; border-radius: 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--text); }
.lvl-bar b { font-weight: 700; margin-right: 4px; }
.lvl-row.indireta .lvl-bar { background: color-mix(in srgb, var(--accent-2) 22%, transparent); }
.lvl-row.ambas .lvl-bar { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.lvl-row.direta .lvl-bar { background: color-mix(in srgb, var(--highlight) 30%, transparent); }
.lvl-side em { font-style: normal; opacity: .85; }
.lvl-side span { color: var(--muted); }
.lvl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.lvl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lvl-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lvl-legend .indireta i { background: color-mix(in srgb, var(--accent-2) 22%, transparent); }
.lvl-legend .ambas i { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.lvl-legend .direta i { background: color-mix(in srgb, var(--highlight) 30%, transparent); }
.lvl-foot { margin: 8px 0 0; }
@media (max-width: 640px) { .lvl-row { grid-template-columns: 1fr; gap: 2px; margin-bottom: 4px; } .lvl-bar { width: 100% !important; } }
@media print { .lvl { font-size: 9.5px; } }
.footnote { margin: 8px 0 0; font-size: .72rem; color: var(--muted); line-height: 1.45; }
@media print { .footnote { font-size: 9px; } }

/* Desempenho do vídeo (curva de tempo assistido, como no Gerenciador) */
.vidbox { display: grid; gap: 10px; }
.vidstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.vidstats div { display: flex; flex-direction: column; }
.vidstats span { font-size: .76rem; color: var(--muted); }
.vidstats strong { font-size: 1.5rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.vidchart { position: relative; height: 240px; }
.vidbox.compact .vidchart { height: 140px; }
.vidbox .chart-desc { margin: 0; font-size: .8rem; }
.vidbox.compact .chart-desc { font-size: .74rem; }
.fpicker .ftag { color: var(--muted); font-size: .8rem; }
@media print {
  body.print-org-full .ads-part { display: none !important; }
  body.print-paid .org-part { display: none !important; }
}
/* Origem estimada dos novos seguidores */
.fsplit { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.fsplit-head { margin-bottom: 8px; }
.fsplit-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: color-mix(in srgb, var(--good) 35%, transparent); }
.fsplit-bar .paid { background: var(--accent); }
.fsplit-bar .org { flex: 1; }
.fsplit-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: .85rem; }
.fsplit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fsplit-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fsplit-legend .paid i { background: var(--accent); }
.fsplit-legend .org i { background: color-mix(in srgb, var(--good) 35%, transparent); }
.follow-in { width: 84px; min-height: 32px; padding: 4px 8px; text-align: right; }
.print-only { display: none; }
@media print { .print-only { display: inline; } }
body.public .manager-hint { display: none; }
/* Tráfego pago por perfil */
.pbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--accent-soft); }
.pbar .p0, .fsplit-legend .p0 i { background: var(--accent); }
.pbar .p1, .fsplit-legend .p1 i { background: var(--highlight); }
.pbar .p2, .fsplit-legend .p2 i { background: var(--good); }
.profcard h2 { font-size: 1.15rem; }
.profsel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.scopedash { margin-top: 4px; }
.scopehead { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.scopehead strong { color: var(--heading); }

/* Gestores */
.lead { margin: -8px 0 16px; }
.tag.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
tfoot td { border-top: 2px solid var(--border); border-bottom: 0; }
details.howto { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
details.howto summary { font-weight: 600; color: var(--heading); }
details.howto .rules { margin-top: 10px; display: grid; gap: 4px; }
.linkbtn { min-height: 0; padding: 0 2px; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: inherit; font-weight: 400; }
.linkbtn:hover { color: var(--bad); }

/* Carteira do gestor: tabela compacta com check do alinhamento semanal */
button.sm { min-height: 30px; padding: 3px 10px; font-size: .82rem; border-radius: 6px; }
@media (max-width: 768px) { button.sm { min-height: 36px; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.cart-head h2 { margin: 0; }
.align-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.align-bar { width: 120px; min-width: 80px; }
.align-bar > i { background: var(--good); transition: width var(--ease); }
table.compact th, table.compact td { padding: 7px 10px; }
table.compact th { font-size: .72rem; }
table.cart td { font-size: .92rem; vertical-align: middle; }
table.cart th.chk, table.cart td.chk { width: 36px; padding-right: 0; text-align: center; }
table.cart td.chk input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--good); cursor: pointer; }
table.cart td.cname { white-space: normal; min-width: 200px; }
table.cart .nm { display: inline; margin: 0; font-weight: 600; cursor: pointer; }
table.cart .ext { text-decoration: none; font-size: .85rem; margin-left: 2px; }
table.cart .sub { font-size: .78rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
table.cart td.acts { white-space: nowrap; width: 1%; }
table.cart td.acts button + button { margin-left: 6px; }
table.cart tr.checked td { background: color-mix(in srgb, var(--good) 8%, transparent); }
.tag.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
input:disabled { opacity: .5; cursor: not-allowed; }

/* Lista de gestores: olhinho para ocultar valores em reunião */
table.mgr-list th.eye-col, table.mgr-list td.eye-col { width: 44px; padding-right: 0; }
button.eye { min-height: 32px; width: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); border-radius: 6px; }
button.eye:hover { border-color: var(--border); color: var(--accent); }
button.eye[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.money-mask { display: none; color: var(--muted); letter-spacing: .08em; }
tr.values-hidden .money-val { display: none; }
tr.values-hidden .money-mask { display: inline; }
/* PDF: tabela larga cabe na largura da folha (sem barra de rolagem cortando colunas). */
@media print {
  .table-wrap { overflow: visible !important; }
  .table-wrap table { width: 100%; font-size: 8.5px; }
  .table-wrap th, .table-wrap td { padding: 4px 5px; }
  .table-wrap th { white-space: normal; font-size: 7.5px; letter-spacing: .02em; line-height: 1.25; vertical-align: bottom; }
  .table-wrap td.wrap { min-width: 0; width: 22%; }
  .table-wrap tr { break-inside: avoid; page-break-inside: avoid; }
  .card:has(.table-wrap) { break-inside: auto; }
  thead { display: table-header-group; }
}
