/* Otimizador de Campanhas — identidade V4 Company
   Vermelho V4, preto/grafite, títulos Bebas Neue, texto Inter. */

:root {
  color-scheme: dark;
  --brand: #e50914;
  --brand-hover: #ff1f2a;
  --brand-dark: #b20710;
  --brand-tint: rgba(229, 9, 20, 0.12);
  --brand-glow: rgba(229, 9, 20, 0.35);

  --bg: #0a0a0a;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(229, 9, 20, 0.10), transparent 60%);
  --surface: #131313;
  --surface-2: #1a1a1a;
  --surface-3: #222222;
  --border: #262626;
  --border-strong: #363636;
  --text: #f5f5f5;
  --text-2: #a8a8a8;
  --muted: #767676;
  --grid: #262626;

  --good: #0ca30c;
  --good-tint: rgba(12, 163, 12, 0.14);
  --warn: #fab219;
  --warn-tint: rgba(250, 178, 25, 0.14);
  --crit: #ff4d4f;
  --crit-tint: rgba(255, 77, 79, 0.14);
  --info-tint: rgba(255, 255, 255, 0.06);

  /* Cor fixa por plataforma (nunca por ranking) */
  --p-meta: #3987e5;
  --p-google: #d95926;
  --p-tiktok: #199e70;
  --p-linkedin: #c98500;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar: 248px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --brand-tint: rgba(229, 9, 20, 0.08);
  --bg: #f4f4f4;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(229, 9, 20, 0.06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #eeeeee;
  --border: #e6e6e6;
  --border-strong: #d4d4d4;
  --text: #0b0b0b;
  --text-2: #525252;
  --muted: #8a8a8a;
  --grid: #ececec;
  --good: #087f08;
  --warn: #b77900;
  --crit: #d03b3b;
  --info-tint: rgba(0, 0, 0, 0.04);
  --p-meta: #2a78d6;
  --p-google: #eb6834;
  --p-tiktok: #1baf7a;
  --p-linkedin: #eda100;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ marca */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 7px; background: var(--brand);
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; line-height: 1;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 6px 18px var(--brand-glow);
}
.logo-text { font-family: var(--font-display); font-size: 21px; letter-spacing: .6px; line-height: 1; }
.logo-text small { display: block; font-family: var(--font); font-size: 10.5px; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; text-transform: uppercase; line-height: 1; margin: 0; }
.eyebrow { color: var(--brand); font-size: 11.5px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px); padding: 22px 14px; display: flex; flex-direction: column; gap: 26px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { color: var(--muted); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; padding: 12px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-tint); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.active svg { color: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--text); border: 1px solid var(--border-strong); }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 32px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.topbar .crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 28px 32px 60px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 44px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 720px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--text-2); background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px -6px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-danger { color: var(--crit); }
.btn-danger:hover { border-color: var(--crit); background: var(--crit-tint); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn .spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--border-strong), 0 0 0 1px var(--border-strong); }
:root[data-theme="light"] .seg button.on { background: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select, textarea.input {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.input-prefix .input { padding-left: 34px; }
.select-sm { height: 34px; font-size: 13px; width: auto; }

.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-2); transition: .2s; }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-tint); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-glow { position: relative; overflow: hidden; }
.card-glow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, rgba(229,9,20,.10), transparent 40%); }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }

/* KPI tile */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { color: var(--text-2); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .label svg { width: 14px; height: 14px; flex: none; }
.kpi .value { font-family: var(--font-display); font-size: clamp(26px, 2.1vw, 34px); letter-spacing: .5px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kpi.accent { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); border-color: transparent; color: #fff; }
.kpi.accent .label, .kpi.accent .foot { color: rgba(255,255,255,.82); }
.kpi.accent .delta { background: rgba(0,0,0,.22); color: #fff; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--info-tint); color: var(--text-2); }
.delta.up-good, .delta.down-good { background: var(--good-tint); color: var(--good); }
.delta.up-bad, .delta.down-bad { background: var(--crit-tint); color: var(--crit); }
.delta svg { width: 11px; height: 11px; }

/* status (sempre ícone + texto) */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px 4px 8px; border-radius: 99px; white-space: nowrap; }
.status svg { width: 13px; height: 13px; }
.status.bom { background: var(--good-tint); color: var(--good); }
.status.atencao { background: var(--warn-tint); color: var(--warn); }
.status.critico { background: var(--crit-tint); color: var(--crit); }
.status.sem_dados { background: var(--info-tint); color: var(--text-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.red { background: var(--brand-tint); color: var(--brand-hover); }
:root[data-theme="light"] .badge.red { color: var(--brand-dark); }
.badge.green { background: var(--good-tint); color: var(--good); }
.badge.amber { background: var(--warn-tint); color: var(--warn); }
.badge.danger { background: var(--crit-tint); color: var(--crit); }
.badge svg { width: 12px; height: 12px; }

.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.plat i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: var(--pc); flex: none; }
.plat-ico { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: var(--pc); flex: none; }
.plat-ico.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 18px; }
[data-p="meta"] { --pc: var(--p-meta); }
[data-p="google"] { --pc: var(--p-google); }
[data-p="tiktok"] { --pc: var(--p-tiktok); }
[data-p="linkedin"] { --pc: var(--p-linkedin); }

/* ------------------------------------------------------------------ tabelas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .3px; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t th.r, .t td.r { text-align: right; }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--text); }
.t th.sorted { color: var(--text); }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr.clickable { cursor: pointer; }
.t .name { font-weight: 600; color: var(--text); }
.t .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.t td.actions { white-space: nowrap; text-align: right; }
.t td.actions .btn { margin-left: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }
.dot.off { background: var(--muted); }

/* ------------------------------------------------------------------ clientes (ranking) */
.client-row { display: grid; grid-template-columns: 56px minmax(180px, 1.4fr) repeat(4, minmax(110px, 1fr)) minmax(160px, 1.2fr) 24px; gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.client-row:last-child { border-bottom: 0; }
.client-row:hover { background: var(--surface-2); }
.client-row .cname { font-weight: 650; font-size: 14.5px; }
.client-row .cmeta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.client-row .metric .l { font-size: 11px; color: var(--muted); font-weight: 600; }
.client-row .metric .v { font-weight: 650; font-size: 14px; margin-top: 2px; }
.client-row .chev { color: var(--muted); }
.client-head { display: grid; grid-template-columns: 56px minmax(180px, 1.4fr) repeat(4, minmax(110px, 1fr)) minmax(160px, 1.2fr) 24px; gap: 16px; padding: 12px 22px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; border-bottom: 1px solid var(--border); }

.ring { position: relative; width: 52px; height: 52px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; letter-spacing: .3px; }
.ring.lg { width: 112px; height: 112px; }
.ring.lg b { font-size: 42px; }

.pace { display: flex; flex-direction: column; gap: 6px; }
.pace .bar { height: 6px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: visible; }
.pace .bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--text-2); max-width: 100%; }
.pace .bar span.over { background: var(--crit); }
.pace .bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 2px; }
.pace .txt { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* alertas */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert.alto svg { color: var(--crit); }
.alert.medio svg { color: var(--warn); }
.alert.baixo svg { color: var(--text-2); }
.alert .lvl { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin-right: 6px; }
.alert.alto .lvl { color: var(--crit); } .alert.medio .lvl { color: var(--warn); } .alert.baixo .lvl { color: var(--muted); }

/* composição da nota */
.comp { display: flex; flex-direction: column; gap: 12px; }
.comp-row .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.comp-row .top b { font-weight: 650; }
.comp-row .meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.comp-row .meter span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ------------------------------------------------------------------ gráficos */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .hair { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .bar { fill: var(--series); transition: opacity .12s; }
.chart .bar.dim { opacity: .45; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series); opacity: .12; }
.chart .pt { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .line.solo { stroke-width: 6; }
.chart .cmp { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .8; }
.chart .target { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .target-label { fill: var(--good); font-size: 10.5px; font-family: var(--font); }
.tooltip .tt-cmp { margin-top: 4px; }
.tooltip .tt-cmp i { background: none; border-top: 2px dashed var(--muted); height: 0; }
.tooltip .tt-cmp b { font-size: 12.5px; color: var(--text-2); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--brand); }
.chart-legend i.cmp { border-top: 2px dashed var(--muted); }
.chart-legend i.tgt { border-top: 2px dotted var(--good); }
.chart-metric { height: 30px; font-size: 12.5px; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12px;
  transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
}
.tooltip .tt-date { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row i { width: 12px; height: 2px; border-radius: 2px; background: var(--series); }
.tooltip .tt-row b { font-size: 14px; }
.tooltip .tt-row span { color: var(--text-2); }
.chart-toggle { font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.chart-toggle:hover { color: var(--text); }

.share { display: flex; flex-direction: column; gap: 14px; }
.share-row .top { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.share-row .top .v { margin-left: auto; font-weight: 650; }
.share-row .track { height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.share-row .track span { display: block; height: 100%; border-radius: 4px; background: var(--pc); }

/* ------------------------------------------------------------------ regras */
.rule-card { padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.rule-card + .rule-card { border-top: 1px solid var(--border); }
.rule-card h4 { margin: 0; font-size: 14.5px; font-weight: 650; }
.rule-card .desc { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.rule-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rule-card .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sentence { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); font-size: 13.5px; line-height: 1.6; }
.sentence b { color: var(--text); }
.cond-row { display: grid; grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl { text-align: left; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: .15s; }
.tpl:hover { border-color: var(--brand); background: var(--brand-tint); }
.tpl b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.tpl span { font-size: 12px; color: var(--text-2); }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 14px; height: 2px; background: var(--brand); border-radius: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; background: var(--surface-2); display: flex; gap: 10px; }
.radio-card input { accent-color: var(--brand); margin-top: 3px; }
.radio-card b { display: block; font-size: 13px; }
.radio-card span { font-size: 12px; color: var(--text-2); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }

.change { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.change s { color: var(--muted); font-weight: 500; }
.change svg { width: 13px; height: 13px; color: var(--muted); }
.evidence { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.evidence .badge { font-weight: 500; }

/* ------------------------------------------------------------------ integrações */
.int-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.int-card .top { display: flex; gap: 14px; align-items: center; }
.int-card .top h3 { margin: 0; font-size: 17px; }
.int-card .top .right { margin-left: auto; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; word-break: break-all; }

.cred-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px 6px; }
.cred-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cred-head b { font-size: 13.5px; }
.cred-head .sub, .acc-row .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.acc-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.acc-row:last-child { border-bottom: 0; }
.acc-top { display: flex; align-items: center; gap: 10px; }
.acc-top > div { flex: 1; }
.acc-top .name { font-weight: 600; font-size: 13px; }
.acc-row .select { width: 100%; }
.acc-list.scroll { max-height: 560px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.acc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0 6px; border-bottom: 1px solid var(--border); }
.acc-tools .input-prefix { flex: 1 1 200px; min-width: 0; }
.acc-tools .input-prefix .input { height: 32px; }
.acc-tools .input-prefix span svg { width: 14px; height: 14px; margin-top: 3px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.steps b { color: var(--text); }
.copy-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.copy-box .code { flex: 1; background: none; padding: 0; }
.acc-pick { display: flex; flex-direction: column; gap: 14px; }
.acc-pick-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.acc-pick-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); font-weight: 650; font-size: 13px; }
.acc-pick-head .muted { font-weight: 500; margin-left: auto; font-size: 12px; }
.acc-pick-list { max-height: 340px; overflow-y: auto; }
.acc-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.acc-opt:hover { background: var(--surface-2); }
.acc-opt input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.acc-opt .name { font-weight: 600; font-size: 13px; }
.acc-opt .sub { font-size: 11.5px; color: var(--muted); }
.acc-opt .badge { margin-left: auto; }

/* ------------------------------------------------------------------ modal / toast / vazio */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { font-size: 28px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; font-size: 13px; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--good); } .toast.err svg { color: var(--crit); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty svg { width: 40px; height: 40px; color: var(--muted); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 600; color: var(--text-2); cursor: pointer; position: relative; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tabs .count { font-size: 11px; background: var(--surface-3); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }

/* ------------------------------------------------------------------ saldos e avisos */
.neg { color: var(--crit); white-space: nowrap; }
.runway { display: flex; flex-direction: column; gap: 7px; }
.runway-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.runway-top .status { padding: 2px 8px 2px 6px; font-size: 11px; }
.runway-bar { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); }
.runway-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--good); }
.runway.atencao .runway-bar span { background: var(--warn); }
.runway.critico .runway-bar span { background: var(--crit); }
.runway-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-size: 13.5px; transition: filter .15s; }
.banner:hover { filter: brightness(1.12); }
.banner > svg { width: 22px; height: 22px; flex: none; }
.banner.crit { background: var(--crit-tint); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.banner.crit > svg { color: var(--crit); }
.banner.warn { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.banner.warn > svg { color: var(--warn); }
.banner-sub { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.banner-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
.banner-cta svg { width: 14px; height: 14px; }
.bell-wrap { position: relative; }
#bell { position: relative; }
.bell-count { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--warn); color: #111; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.bell-count.crit { background: var(--brand); color: #fff; }
.popover { position: absolute; right: 0; top: calc(100% + 10px); width: min(400px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); z-index: 40; overflow: hidden; animation: pop .15s; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pop-list { max-height: 420px; overflow-y: auto; }
.pop-list .note { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.pop-list .note:hover { background: var(--surface-2); }
.pop-foot { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 12px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.pop-foot:hover { color: var(--text); }
.pop-foot svg { width: 14px; height: 14px; }
.note { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); position: relative; }
.note.unread { background: var(--surface-2); }
.note.unread::before { content: ""; position: absolute; left: 6px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.note-ico svg { width: 18px; height: 18px; margin-top: 1px; }
.note.sev-critico .note-ico { color: var(--crit); }
.note.sev-alto .note-ico { color: var(--warn); }
.note.sev-medio .note-ico { color: var(--text-2); }
.note-body { flex: 1; min-width: 0; }
.note-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-top b { font-size: 13.5px; }
.note-top .status { padding: 2px 8px 2px 6px; font-size: 11px; }
.note-msg { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.note-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.note-meta svg { width: 12px; height: 12px; }
.note-meta a { text-decoration: underline; text-underline-offset: 2px; }
.note-acts { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.input-suffix { position: relative; }
.input-suffix .suffix { position: absolute; right: 12px; left: auto !important; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; overflow: hidden; background: #000; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero::before { content: ""; position: absolute; width: 720px; height: 720px; right: -260px; bottom: -280px; background: radial-gradient(circle, rgba(229,9,20,.55), transparent 62%); filter: blur(10px); }
.login-hero h1 { font-size: clamp(56px, 7vw, 104px); position: relative; }
.login-hero h1 em { font-style: normal; color: var(--brand); }
.login-hero p { position: relative; color: #b5b5b5; max-width: 460px; font-size: 15px; }
.login-hero .feats { position: relative; display: flex; gap: 22px; flex-wrap: wrap; color: #cfcfcf; font-size: 13px; }
.login-hero .feats span { display: flex; align-items: center; gap: 8px; }
.login-hero .feats svg { width: 16px; height: 16px; color: var(--brand); }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 40px; }
.err-msg { color: var(--crit); font-size: 13px; min-height: 18px; }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 1180px) {
  .client-head { display: none; }
  .client-row { grid-template-columns: 56px repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .client-row > div:nth-child(2) { grid-column: 2 / -1; }
  .client-row > .metric:nth-child(3) { grid-column: 2; }
  .client-row .metric.hide-md, .client-row .chev { display: none; }
  .client-row .pace { grid-column: 2 / -1; }
}
@media (max-width: 960px) {
  .editor-grid, #cred-grid, #script-grid { grid-template-columns: 1fr !important; }
  .editor-grid > .stack[style*=sticky] { position: static !important; }
  .grid[style*="1.6fr"] { grid-template-columns: 1fr !important; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 300px; padding: 32px 24px; }
  .page-head h1 { font-size: 36px; }
  .form-grid, .radio-cards { grid-template-columns: 1fr; }
  .rule-card { grid-template-columns: auto 1fr; }
  .rule-card .acts { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 960px) {
  .topbar { position: static; row-gap: 10px; }
  .topbar .crumbs { flex: 1; }
  .topbar .spacer { display: none; }
  #sync-all span { display: none; }
  #sync-all { width: 34px; padding: 0; }
  #filters { order: 5; width: 100%; flex-wrap: nowrap; }
  #filters .select { flex: 1; min-width: 0; }
}
@media (max-width: 560px) {
  .note { flex-wrap: wrap; }
  .note-acts { width: 100%; justify-content: flex-start; }
  .banner { flex-wrap: wrap; }
  .banner-cta { margin-left: 36px; }
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .seg button { padding: 0 9px; }
  .client-row { grid-template-columns: 52px repeat(2, minmax(0, 1fr)); padding: 14px 16px; column-gap: 12px; }
  .client-row > .metric:nth-child(5) { grid-column: 2; }
  .cond-row { grid-template-columns: 1fr 80px; }
  .cond-row .input { grid-column: 1; }
  .kpi .value { font-size: 28px; }
  .topbar .seg button { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* verificação em duas etapas */
.tfa-qr { background: #fff; border-radius: var(--radius-sm); padding: 6px; line-height: 0; }
.tfa-qr svg { width: 190px; height: 190px; }
@media (max-width: 720px) { #tfa-grid { grid-template-columns: 1fr !important; } .tfa-qr { justify-self: center; } }

/* relatório do cliente */
.report-bar { margin-bottom: 18px; }
.report-bar .spacer { flex: 1; }
.report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--brand); }
.report-head .logo { display: flex; align-items: center; gap: 10px; }
.report-title { text-align: right; }
.report-title h1 { margin: 4px 0 2px; }
.report-foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
@media (max-width: 720px) { .report-title { text-align: left; } }
@media print {
  @page { size: A4; margin: 12mm; }
  .sidebar, .topbar, .no-print, .toasts, .chart-toggle { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  .report .grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .report .grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .table-wrap { overflow: visible !important; max-height: none !important; }
}
.ic-inline { width: 15px; height: 15px; vertical-align: -3px; }

.update-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 210; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13.5px; max-width: calc(100vw - 32px); }
.update-bar > svg { width: 16px; height: 16px; color: var(--brand); flex: none; }

.ai-empty { display: flex; gap: 16px; align-items: flex-start; }
.ai-empty > svg, .ai-head-text > svg { width: 26px; height: 26px; color: var(--brand); flex: none; margin-top: 2px; }
.ai-empty h3, .ai-head h3 { margin: 0 0 4px; }
.ai-empty p { margin: 0 0 14px; max-width: 640px; line-height: 1.55; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ai-head-text { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.ai-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.ai-sug { border-left: 3px solid var(--border-strong); }
.ai-sug.prio-alta { border-left-color: var(--crit); }
.ai-sug.prio-media { border-left-color: var(--warn); }
.ai-title { margin: 10px 0 8px; font-size: 16px; }
.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ai-grid p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ai-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
@media (max-width: 900px) { .ai-grid { grid-template-columns: 1fr; } }

.t td.num { white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.section-title svg { width: 14px; height: 14px; }
.ai-camps td .delta { font-size: 11px; }
.t tfoot td { border-top: 1px solid var(--border-strong); padding-top: 10px; }
.t td .delta { font-size: 11px; }
.lw-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lw-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--border); }
.lw-item:first-child { border-top: 0; }
.lw-item > input { accent-color: var(--brand); width: 16px; height: 16px; margin-top: 7px; flex: none; }
.issue-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-chips .badge.issue { white-space: normal; max-width: 300px; line-height: 1.35; height: auto; padding-top: 3px; padding-bottom: 3px; cursor: help; }
.pay-issue { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--crit); font-size: 12px; font-weight: 600; line-height: 1.35; }
.pay-issue svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.mini-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 6px; overflow: hidden; margin-left: auto; width: 120px; }
.mini-bar span { display: block; height: 100%; background: var(--good); }
.fund-t td { vertical-align: top; }
.fund-t td .sub { white-space: normal; }
.fund-t td.num { white-space: normal; min-width: 120px; max-width: 170px; }
.fund-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fund-acts > div { display: flex; gap: 4px; }
.fund-t .issue-chips .badge.issue { max-width: 240px; }
.kommo-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.kommo-box b svg { width: 14px; height: 14px; vertical-align: -2px; }
.kommo-pipe { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.ad-cell { display: flex; gap: 10px; align-items: center; }
.ad-thumb { position: relative; width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); padding: 0; cursor: zoom-in; display: grid; place-items: center; color: var(--muted); }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb.empty { cursor: default; }
.ad-thumb.empty svg { width: 18px; height: 18px; opacity: .5; }
.ad-play { position: absolute; inset: auto 4px 4px auto; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.65); display: grid; place-items: center; }
.ad-play svg { width: 10px; height: 10px; color: #fff; fill: #fff; }
.creative-view { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px; }
.creative-view img { max-width: 100%; max-height: 60vh; border-radius: 6px; }
@media print { .ad-thumb { cursor: default; } }
.sticky-wrap { max-height: 72vh; overflow: auto; }
.sticky-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.sticky-wrap tfoot td { position: sticky; bottom: 0; background: var(--surface); }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--text); }
.t th.asc::after { content: " ↑"; } .t th.desc::after { content: " ↓"; }
.budget-cell { display: inline-flex; align-items: center; gap: 2px; }
.budget-cell .btn-icon { width: 26px; height: 26px; }
@media print { .sticky-wrap { max-height: none; overflow: visible; } .sticky-wrap thead th, .sticky-wrap tfoot td { position: static; } .no-print { display: none !important; } }
.plat-ico.logo { background: #fff; border: 1px solid var(--border); padding: 4px; }
.plat-ico.logo[data-p="tiktok"] { background: #111; }
.plat-ico.logo[data-p="linkedin"] { padding: 3px; }
.plat-ico.logo svg { width: 100%; height: 100%; display: block; }
.plat-ico.logo.lg { padding: 8px; }
