:root {
  --bg: #f6f7f9; --fg: #1c1f24; --muted: #6b7280; --line: #dfe3e8;
  --accent: #1f5fbf; --danger: #b42318; --warn: #b54708; --ok: #067647; --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--fg); }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--fg); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.active { background: #e8f0fc; color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 2px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a:hover { color: var(--fg); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.narrow { max-width: 380px; margin: 64px auto; }
label { display: block; margin: 12px 0; font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button { padding: 8px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 0; }
.alert { padding: 10px 12px; border-radius: 6px; }
.alert.error { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.muted { color: var(--muted); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.button { display: inline-block; padding: 8px 16px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.badge.draft { background: #fffaeb; color: var(--warn); border: 1px solid #fedf89; }
.badge.ready { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }
.alert { margin: 12px 0; }
.alert.warn { background: #fffaeb; color: #7a2e0e; border: 1px solid #fedf89; }
.alert.ok { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }
.alert.info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.issues .field { font-weight: 600; }
.mono, code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.grid { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; }
.grid dt { color: var(--muted); }
.grid dd { margin: 0; }
h2 { margin-top: 28px; }
/* ---- editor ---- */
.actions { display: flex; gap: 8px; align-items: center; }
.button.secondary, button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--line); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.container:has(.editor) { max-width: 1400px; }
.card + .card, .editor-main > .card { margin-bottom: 16px; }
.side-card { padding: 14px; margin-bottom: 12px; }
.side-card h3 { margin: 0 0 6px; font-size: 15px; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.f { position: relative; margin: 8px 0; }
.f .fl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.f.wide { width: 100%; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .f { flex: 0 1 180px; }
.row > .f.grow { flex: 1 1 260px; }
.counter { position: absolute; right: 8px; top: 25px; font-size: 11px; color: var(--muted); pointer-events: none; }
.counter.over { color: var(--danger); font-weight: 700; }
input.over { border-color: var(--danger); background: #fef3f2; }
.has-issue input, .has-issue select, .has-issue textarea { border-color: var(--danger); }
.ferr { display: block; font-size: 12px; color: var(--danger); margin-top: 2px; }
.ferr.warning { color: var(--warn); }
.check { display: inline-flex; gap: 6px; align-items: center; margin: 6px 18px 6px 0; font-weight: 400; }
.check input { width: auto; display: inline; margin: 0; }
.checks { margin: 6px 0; }
.small { font-size: 12px; }
.list { margin: 12px 0; padding-top: 6px; border-top: 1px dashed var(--line); }
.list-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.item { padding: 6px 10px; margin: 6px 0; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 12px; }
.group { padding: 12px 14px; margin: 12px 0; border: 1px solid #c7d7f0; border-radius: 8px; background: #f8fbff; }
.ad { padding: 8px 12px; margin: 10px 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
button.add { background: none; color: var(--accent); border: 1px dashed #9db7e0; padding: 4px 10px; font-size: 13px; margin: 4px 0; }
button.rm { background: none; color: var(--danger); border: 1px solid #fecdca; padding: 6px 10px; font-size: 13px; margin-bottom: 8px; }
.pending-box { border-color: #fedf89; background: #fffcf5; }
.okline { color: var(--ok); margin: 6px 0; }
.errline { color: var(--danger); font-weight: 600; margin: 4px 0; }
.warnline { color: var(--warn); font-weight: 600; margin: 4px 0; }
ul.mini { margin: 0; padding-left: 18px; font-size: 12px; }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.savebar button { width: 100%; padding: 10px; }
.serp { padding: 8px 0; border-bottom: 1px solid var(--line); font-family: Arial, sans-serif; }
.serp-meta { font-size: 11px; color: var(--muted); }
.serp-ad { font-size: 12px; color: #202124; }
.serp-url { color: #202124; }
.serp-title { color: #1a0dab; font-size: 17px; line-height: 1.3; margin: 2px 0; }
.serp-title .pinned { text-decoration: underline dotted; }
.serp-desc { color: #4d5156; font-size: 13px; }
pre.diff { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; font-size: 12.5px; line-height: 1.45; }
.d-add { display: block; background: #ecfdf3; color: #05603a; }
.d-del { display: block; background: #fef3f2; color: #912018; }
.d-hunk { display: block; color: #175cd3; background: #eff8ff; }
.d-file { display: block; color: var(--muted); font-weight: 600; }
.d-ctx { display: block; }
input[data-limit] { padding-right: 56px; }
/* ---- subida ---- */
button.danger { background: #b42318; }
button:disabled { background: #c9ced6; color: #fff; cursor: not-allowed; border-color: transparent; }
.badge.r-success { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }
.badge.r-error { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.badge.r-partial, .badge.r-pending { background: #fffaeb; color: var(--warn); border: 1px solid #fedf89; }
.checks-list { list-style: none; padding: 0; margin: 0 0 8px; }
.checks-list li { padding: 3px 0; }
.checks-list .ok { color: var(--ok); }
.checks-list .bad { color: var(--danger); font-weight: 600; }
.checks-list .warn { color: var(--warn); }
.result { border-width: 2px; margin-bottom: 16px; }
.result.r-success { border-color: #abefc6; }
.result.r-error, .result.r-partial, .result.r-pending { border-color: #fecdca; }
.table .actions form { display: inline; }
/* ---- inventário (M3) ---- */
.mcc { border-top: 1px solid var(--line); padding: 12px 0 6px; }
.mcc.sub { margin-left: 24px; border-left: 3px solid #c7d7f0; padding-left: 12px; }
.mcc.removed { opacity: .6; }
.mcc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline select, form.inline input { width: auto; margin: 0; }
.table.compact th, .table.compact td { padding: 5px 8px; font-size: 13px; }
tr.dim td { color: var(--muted); }
button.toggle-on { background: var(--ok); }
.table td form { margin: 0; }

/* Editor: as trocas por HTMX não devem mexer na rolagem (ver editor.js). */
#editor, #live { overflow-anchor: none; }

/* ---- início ---- */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.home-grid .card { display: flex; flex-direction: column; gap: 6px; }
.home-grid h2 { margin: 0 0 4px; font-size: 18px; }
.home-grid h2 a { color: var(--fg); text-decoration: none; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 24px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }
.home-grid ul { margin: 4px 0; padding-left: 18px; font-size: 14px; }
.home-grid .actions { margin-top: auto; padding-top: 8px; }
.soon { color: var(--muted); }

/* ---- editor: link, origem, nome automático, chips ---- */
.link-box { border-color: #b2ddff; background: #f5faff; }
.fill-btn { margin-bottom: 8px; }
details.origin { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.origin summary { cursor: pointer; font-weight: 600; }
.auto-name { margin-bottom: 14px; white-space: nowrap; }
input[readonly] { background: #f6f7f9; color: #475467; }
.hint { margin: 0 0 6px; }
.cols.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.chips:focus-within { border-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 12px; background: #e8f0fc; color: #1849a9; font-size: 13px; }
.chip button { background: none; color: inherit; padding: 0 6px; font-size: 14px; line-height: 1; }
.chips input { flex: 1 1 140px; border: 0; margin: 0; padding: 4px; min-width: 120px; }
.chips input:focus { outline: none; }
[hidden] { display: none !important; }

/* Telas estreitas: o painel de validação vai para baixo do formulário. */
@media (max-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; max-height: none; }
  .topbar { gap: 12px; padding: 8px 12px; flex-wrap: wrap; }
  .tabs { padding: 0 12px; overflow-x: auto; }
  .container { padding: 0 12px; }
}

/* ======================================================================
   Tema TowerAds (27/11/2026): paleta roxo + laranja, ciano, magenta, coral e verde-limão.
   Fica no fim do arquivo para valer sobre as regras de cima.
   ====================================================================== */
:root {
  --purple-900: #3f1552; --purple-800: #52206a; --purple: #6b2d80; --purple-600: #7e3a96;
  --purple-050: #f6eefa; --purple-100: #ecdff3;
  --orange: #f7a21b; --teal: #17b3c7; --magenta: #c018e6; --coral: #e8645a; --lime: #8cc63e;
  --bg: #f5f3f8; --line: #e4dcec; --fg: #221a2b; --muted: #6e6479;
  --accent: var(--purple); --danger: #c8443a; --warn: #b26a00; --ok: #4a7f16;
  --shadow: 0 1px 2px rgba(40, 12, 60, .06), 0 2px 8px rgba(40, 12, 60, .05);
  --ring: 0 0 0 3px rgba(192, 24, 230, .25);
}
body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--purple-600); }
a:hover { color: var(--magenta); }
h1 { color: var(--purple-900); letter-spacing: -.01em; }

/* topo e abas */
.topbar { background: linear-gradient(90deg, var(--purple-900), var(--purple) 70%, var(--purple-600)); border-bottom: 0; box-shadow: 0 2px 6px rgba(40, 12, 60, .18); }
.topbar .brand { color: #fff; display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.topbar .brand::before { content: ""; width: 14px; height: 14px; border-radius: 4px;
  background: conic-gradient(var(--orange) 0 25%, var(--teal) 0 50%, var(--magenta) 0 75%, var(--lime) 0); }
.topbar nav a { color: rgba(255, 255, 255, .82); }
.topbar nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar nav a.active { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 -3px 0 var(--orange); }
.topbar button.link { color: rgba(255, 255, 255, .85); }
.topbar button.link:hover { color: #fff; }
.tabs { box-shadow: var(--shadow); }
.tabs a.active { color: var(--purple); border-bottom: 3px solid var(--magenta); }

/* cartões e tabelas */
.card { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.table { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border-color: var(--line); }
.table th { background: #faf7fc; color: var(--purple-800); text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }
.table tbody tr:hover td { background: #fcfaff; }

/* botões */
button, .button {
  border-radius: 8px; font-weight: 600; letter-spacing: .01em; line-height: 1.2;
  transition: background-color .15s, box-shadow .15s, border-color .15s, color .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(40, 12, 60, .15);
}
button, .button { background: var(--purple); color: #fff; }
button:hover, .button:hover { background: var(--purple-800); color: #fff; box-shadow: 0 3px 10px rgba(107, 45, 128, .28); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.button.secondary, button.secondary { background: #fff; color: var(--purple); border: 1px solid #d6c7e2; box-shadow: none; }
.button.secondary:hover, button.secondary:hover { background: var(--purple-050); border-color: var(--purple-600); color: var(--purple-800); box-shadow: none; }
button.link, button.link:hover { background: none; box-shadow: none; }
button.danger { background: var(--coral); }
button.danger:hover { background: #d4544b; box-shadow: 0 3px 10px rgba(232, 100, 90, .35); }
button.toggle-on { background: var(--teal); }
button.toggle-on:hover { background: #119aac; }
button:disabled, button:disabled:hover { background: #d8d2df; color: #fff; box-shadow: none; cursor: not-allowed; transform: none; }
button.add { color: var(--purple-600); border: 1px dashed #c9b4d8; background: transparent; box-shadow: none; font-weight: 600; }
button.add:hover { background: var(--purple-050); border-color: var(--magenta); color: var(--magenta); box-shadow: none; }
button.rm { color: var(--coral); border: 1px solid #f5c7c2; background: #fff; box-shadow: none; }
button.rm:hover { background: #fdf0ee; color: #c8443a; box-shadow: none; }

/* campos */
input, select, textarea { border-color: #d9d0e2; border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple-600); box-shadow: var(--ring); }
.chips { border-color: #d9d0e2; border-radius: 8px; }
.chips:focus-within { border-color: var(--purple-600); box-shadow: var(--ring); }
.chip { background: var(--purple-100); color: var(--purple-800); }

/* selos e avisos */
.badge.ready, .badge.r-success, .badge.s-enabled { background: #eef7e2; color: #3d6e12; border: 1px solid #cfe7ad; }
.badge.draft, .badge.r-pending, .badge.r-partial, .badge.s-paused { background: #fff4e0; color: #9a5a00; border: 1px solid #fbd697; }
.badge.r-error { background: #fdeceb; color: #b03a31; border: 1px solid #f6c3be; }
.badge.s-removed { background: #f1eef4; color: var(--muted); border: 1px solid var(--line); }
.badge.tower { background: #f9e6fd; color: #8e0fae; border: 1px solid #ebb6f7; }
.alert.ok { background: #f1f8e8; color: #3d6e12; border-color: #cfe7ad; }
.alert.info { background: #e8f8fa; color: #0c6f7c; border-color: #a9e3eb; }
.alert.warn { background: #fff6e6; color: #8a4f00; border-color: #fbd697; }
.alert.error { background: #fdeeec; color: #b03a31; border-color: #f6c3be; }
.alert { border-radius: 8px; }

/* blocos do editor e do inventário */
.pending-box { border-color: #fbd697; background: #fffaf1; }
.link-box { border-color: #a9e3eb; background: #f1fbfc; }
.group { border-color: #dccbe8; background: #fcf9fe; }
.mcc.sub { border-left-color: var(--teal); }
.okline { color: var(--ok); }
.errline { color: var(--danger); }

/* início: uma cor por módulo */
.home-col:nth-child(1) .card { border-top: 4px solid var(--orange); }
.home-col:nth-child(2) .card { border-top: 4px solid var(--teal); }
.home-col:nth-child(3) .card { border-top: 4px solid var(--magenta); }
.stat b { color: var(--purple); }

/* campanhas dentro da conta (inventário) */
.camps-row td { padding-top: 0; background: #fcfaff; }
.camp-list { list-style: none; margin: 0; padding: 4px 0 6px 14px; border-left: 3px solid var(--purple-100); }
.camp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; font-size: 13px; }
.camp.gone { opacity: .55; }
.camp-name { font-weight: 600; color: var(--fg); }
.camp-status { width: 8px; height: 8px; border-radius: 50%; background: #c5bccd; flex: none; }
.camp-status.s-enabled { background: var(--lime); }
.camp-status.s-paused { background: var(--orange); }
.camp-status.s-removed { background: #c5bccd; }

/* início: botão de cada módulo, acima do quadro resumo */
.home-col { display: flex; flex-direction: column; gap: 12px; }
.home-col .card { flex: 1; margin: 0; }
.module-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; aspect-ratio: 1 / 1; width: 100%; padding: 18px; border-radius: 14px; color: #fff;
  text-decoration: none; overflow: hidden; box-shadow: 0 6px 18px rgba(63, 21, 82, .18);
  transition: transform .15s ease, box-shadow .15s ease; }
.module-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.25), transparent 55%); pointer-events: none; }
.module-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(63, 21, 82, .28); color: #fff; text-decoration: none; }
.module-tile:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.module-tile:hover .tile-art { transform: scale(1.06); }
.t-takeoff { background: linear-gradient(145deg, #f7a21b, #e8645a); }
.t-blackbox { background: linear-gradient(145deg, #17b3c7, #3f1552); }
.t-radar { background: linear-gradient(145deg, #c018e6, #6b2d80); }
.tile-art { width: 46%; max-width: 140px; height: auto; transition: transform .2s ease; }
.tile-art .ln { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.tile-art .ln.thin { stroke-width: 2.5; opacity: .85; }
.tile-art .ln.dash { stroke-dasharray: 4 6; }
.tile-art .fill { fill: #fff; }
.tile-art .win { fill: #e8645a; }
.tile-art .sweep { fill: rgba(255, 255, 255, .3); }
.tile-title { font-size: 22px; font-weight: 700; letter-spacing: .2px; margin-top: 6px; }
.tile-sub { font-size: 13px; opacity: .9; text-align: center; }

/* menu secundário na vertical (barra lateral do módulo) */
.shell.with-side { display: flex; align-items: flex-start; }
.shell.with-side .container { flex: 1; min-width: 0; margin: 24px auto; }
.sidenav { position: sticky; top: 0; flex: 0 0 210px; align-self: stretch; min-height: calc(100vh - 52px);
  padding: 20px 12px; background: var(--card); border-right: 1px solid var(--line); box-shadow: 1px 0 6px rgba(63, 21, 82, .05); }
.side-title { display: block; padding: 0 12px 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.sidenav .tabs { display: flex; flex-direction: column; gap: 2px; padding: 0; background: none; border: 0; box-shadow: none; }
.sidenav .tabs a { padding: 9px 12px; margin: 0; border: 0; border-left: 3px solid transparent; border-radius: 8px;
  color: var(--fg); font-size: 14px; font-weight: 500; }
.sidenav .tabs a:hover { background: #f4eef8; color: var(--purple); }
.sidenav .tabs a.active { background: #f1e6f7; color: var(--purple); border-left-color: var(--magenta); border-bottom: 0;
  border-radius: 0 8px 8px 0; font-weight: 600; }
@media (max-width: 1000px) {
  .shell.with-side { display: block; }
  .sidenav { position: static; min-height: 0; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-title { display: none; }
  .sidenav .tabs { flex-direction: row; overflow-x: auto; }
  .sidenav .tabs a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
  .sidenav .tabs a.active { border-bottom-color: var(--magenta); border-radius: 6px 6px 0 0; }
}

/* painel do M2 */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px; }
.filters .f { margin: 0; }
.filters .grow { flex: 1 1 260px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi b { font-size: 20px; color: var(--purple-900); }
.kpi.pb { background: #faf5fd; }
.dash-wrap { padding: 0; overflow-x: auto; max-height: 70vh; }
table.dash { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.dash th, table.dash td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff; }
table.dash thead th { position: sticky; top: 0; z-index: 2; background: #f6f0fa; color: var(--purple-900); font-size: 12px;
  font-weight: 600; text-align: left; cursor: help; }
table.dash th.n, table.dash td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.dash .sticky { position: sticky; left: 0; z-index: 1; max-width: 360px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 1px 0 0 var(--line); }
table.dash thead th.sticky { z-index: 3; }
table.dash td.pb, table.dash th.pb { background: #faf5fd; }
table.dash thead th.pb { background: #efe2f7; }
table.dash td.strong { font-weight: 600; }
table.dash td.pos { color: var(--ok); font-weight: 600; }
table.dash td.neg { color: var(--danger); font-weight: 600; }
table.dash tr.acc-head td { background: #f1e6f7; font-weight: 600; color: var(--purple-900); }
table.dash tr.subtotal td { background: #fbf8fd; font-weight: 600; }
table.dash tr.grand td { background: #3f1552; color: #fff; font-weight: 700; border-bottom: 0; }
table.dash tbody tr:not(.acc-head):not(.grand):hover td { background: #fff8ec; }
table.dash .camp-cell .camp-status { margin-right: 6px; }

.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
input.mono { width: 100%; }
section.card.dim { opacity: .65; }

/* Inventário: domínio de link de afiliado na URL final */
.dom-aff { color: #9a4a00; font-weight: 600; }

/* Diário de bordo */
.logday-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.logday-head h2 { margin: 0; }
.logday-kpis { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.logday-kpis .pb b { color: var(--purple-900); }
.logday-kpis b.pos { color: #1f7a3f; } .logday-kpis b.neg { color: #b3261e; }
.logentries { list-style: none; margin: 10px 0 0; padding: 0; }
.logentry { display: flex; gap: 12px; padding: 8px 10px; border-left: 3px solid var(--purple-100); margin-bottom: 4px; }
.logentry .logtime { font-variant-numeric: tabular-nums; color: #777; min-width: 42px; font-size: 13px; }
.logentry .logbody { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.logentry.c-lances { border-left-color: #e07a1f; }
.logentry.c-status { border-left-color: #2a9d8f; }
.logentry.c-palavras { border-left-color: #6c5ce7; }
.logentry.c-anuncios { border-left-color: #d63384; }
.logentry.k-note { border-left-color: #f4c430; background: #fffbea; }
.logentry.k-upload { border-left-color: var(--purple-900); background: #f7f3ff; }
.logentry.auto { background: #fff4e6; }
.inline-form { display: inline; }
button.linkish { background: none; border: 0; padding: 0; color: #b3261e; text-decoration: underline; cursor: pointer; font-size: 12px; }
