/* CRM UNINTER v3 — design tokens + componentes rp-* (bloco v3-01 "Casca nova", 2026-09)
   ============================================================
   Fonte: identidade v3 do UNINTER (azul #3A5A93 / #6E8FE0 no escuro — decisão do Danilo em 2026-09-24:
   o laranja lembrava a Anhanguera; blob gradiente nos ícones de KPI,
   cards com border-radius 18px, Inter — validada com o Danilo em 30/08, ver
   templates/marketing/campanhas/index.html) + "Direção A — Clarity" (memória `design-system`,
   escala neutra --bg/--surface/--text) + arquitetura de tema e header de 2 linhas do
   Odontiza/CRM-Cliente (`C:\CLAUD IA\RESULTPLUS\CRM ODONTO\static\css\theme.css`, molde
   oficial do bloco — ver 01-PESQUISA.md).

   Camada de compatibilidade (decisão aberta nº 2 do bloco): os 96 nomes de token do
   `base.html` antigo (levantados em 01-PESQUISA.md) continuam definidos aqui como alias
   dos tokens novos — nenhuma das 60 telas existentes precisa ser reescrita neste bloco.
   Mais 11 tokens usados sem existir no CSS antigo (7 previstos no Plano + 4 achados no
   `dev_login.html`, que já é 100% autocontido e não depende deste arquivo — ver
   03-EXECUCAO.md → Desvios) também entram como alias, pra fechar o contrato "0 faltando".

   Texto branco sobre o azul primário no claro (#3A5A93 → 6,5:1) e texto escuro (#0B1220)
   sobre o azul claro do tema escuro (#6E8FE0) — os dois passam WCAG AA.
   ============================================================ */
:root {
  /* ── Métricas ──────────────────────────────────────────── */
  --radius-sm   : 6px;
  --radius-md   : 10px;
  --radius-lg   : 14px;
  --radius-xl   : 18px;
  --font-mono   : ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --navrow-h    : 56px;
  --subheader-h : 44px;
  --brand-col-w : 232px;

  /* Escala de z-index (Riscos #5 da Pesquisa: header sticky não pode cobrir modal de
     página, que usa 50/100/900/1000/2000 hoje). Header/drawer/dropdown ficam TODOS
     abaixo do menor z de modal de página (50). */
  --z-header    : 30;
  --z-drawer    : 35;
  --z-dropdown  : 40;
  --z-modal     : 50;
  --z-toast     : 60;

  /* Legado — sidebar fixa saiu de cena (header de 2 linhas não tem sidebar), mas os
     nomes continuam existindo pra nada quebrar se algum template antigo ainda ler. */
  --sidebar-w   : 0px;
  --header-h    : calc(var(--navrow-h) + var(--subheader-h));

  /* ── Chrome (header 2 linhas + drawer) — navy R+, igual nos dois temas ── */
  --sb-bg          : #1B2438;
  --sb-surface     : #232E47;
  --sb-surface-2   : #2B3752;
  --sb-border      : #34405C;
  --sb-text        : #AEB8D1;
  --sb-text-strong : #F4F6FB;
  --sb-text-muted  : #7C87A3;
  --sb-active      : var(--primary);
  --sb-active-soft : color-mix(in oklch, var(--primary) 16%, transparent);
  --brand-accent   : var(--primary);   /* sublinhado da categoria ativa, ponto de notificação */
  --brand-yellow       : #f3b808;      /* selo da marca no header -- mesma cor do Gestor 360 */
  --brand-yellow-light : #ffe27a;
  --brand-yellow-dark  : #d99a00;

  /* ── Claro — "Direção A" (memória design-system) ─────────── */
  --bg          : #F6F7F9;
  --surface     : #FFFFFF;
  --surface-2   : #F0F1F4;
  --surface-3   : #E4E6EC;
  --border      : #DDE1E8;
  --border-2    : #C7CCD6;
  --text        : #161A22;
  --text-sub    : #3A4150;
  --text-muted  : #6B7280;

  /* ── Marca — laranja v2 do UNINTER (validado em campanhas/index.html) ───── */
  --primary            : #3A5A93;
  --primary-dark       : #2E4A7A;
  --primary-soft       : rgba(58, 90, 147, .12);
  --primary-ring       : rgba(58, 90, 147, .28);
  --primary-foreground : #FFFFFF;
  --link        : #2C5AA0;
  --link-hover  : #1F4275;
  --accent-rgb  : 242 161 10;

  /* ── Estados semânticos ───────────────────────────────────── */
  --success     : #15803D;
  --success-soft: rgba(21, 128, 61, .12);
  --success-rgb : 21,128,61;
  --warning     : #B45309;
  --warning-soft: rgba(180, 83, 9, .12);
  --error       : #B91C1C;
  --error-soft  : rgba(185, 28, 28, .10);
  --info        : #1D4ED8;
  --info-soft   : rgba(29, 78, 216, .12);

  --shadow-sm   : 0 1px 3px rgba(15, 23, 32, .06), 0 1px 2px rgba(15, 23, 32, .04);
  --shadow-md   : 0 4px 14px rgba(15, 23, 32, .08), 0 2px 6px rgba(15, 23, 32, .05);
  --shadow-lg   : 0 10px 32px rgba(15, 23, 32, .10), 0 4px 12px rgba(15, 23, 32, .06);
  --shadow-xl   : 0 20px 52px rgba(15, 23, 32, .13), 0 8px 20px rgba(15, 23, 32, .07);

  /* Linha 2 do header (itens) — faixa âmbar clara no claro, navy-claro no escuro */
  --subrow-bg   : #E8EEF8;
  --subrow-text : #1F3A66;

  /* ── Gráficos (paleta categórica, neutra de marca — não é o laranja do CTA) ── */
  --chart-1     : #3B6FB0;   /* azul */
  --chart-2     : #0F9D8A;   /* teal — 2ª série dos gráficos (era âmbar; laranja saiu da paleta em 2026-09-24) */
  --chart-3     : #2F9E6E;   /* verde */
  --chart-4     : #7A5FC9;   /* índigo/roxo */
  --chart-5     : #3B8FA6;   /* teal */

  /* ── Papéis (chips de usuário) ────────────────────────────── */
  --role-admin        : var(--chart-4);
  --role-admin-soft   : color-mix(in oklch, var(--chart-4) 14%, transparent);
  --role-gerente      : var(--chart-1);
  --role-gerente-soft : color-mix(in oklch, var(--chart-1) 14%, transparent);
  --role-sup          : var(--chart-5);
  --role-sup-soft     : color-mix(in oklch, var(--chart-5) 14%, transparent);
  --role-cons         : var(--chart-3);
  --role-cons-soft    : color-mix(in oklch, var(--chart-3) 14%, transparent);

  /* ── Cores fixas (não mudam com o tema) ───────────────────── */
  --wa          : #25D366;
  --wa-soft     : rgba(37, 211, 102, .14);
  --fb          : #1877F2;
  --fb-soft     : rgba(24, 119, 242, .12);
  --ig-1        : #833AB4;
  --ig-2        : #E1306C;
  --ig-3        : #FD1D1D;
  --com-aceite      : #16A34A;
  --com-aceite-soft : rgba(22, 163, 74, .16);
  --white           : #FFFFFF;
  --impersonate-a   : #7C3AED;
  --impersonate-b   : #4F46E5;

  /* ── Aliases de "cor com nome" (usados pelos rp-kpi-icon etc.) ────────────── */
  --amber       : var(--warning);
  --amber-soft  : var(--warning-soft);
  --blue        : var(--chart-1);
  --blue-soft   : color-mix(in oklch, var(--chart-1) 14%, transparent);
  --cyan        : var(--chart-5);
  --cyan-soft   : color-mix(in oklch, var(--chart-5) 14%, transparent);
  --green       : var(--chart-3);
  --green-soft  : color-mix(in oklch, var(--chart-3) 14%, transparent);
  --indigo      : var(--chart-4);
  --indigo-soft : color-mix(in oklch, var(--chart-4) 14%, transparent);
  --purple      : var(--chart-4);
  --purple-soft : color-mix(in oklch, var(--chart-4) 14%, transparent);

  /* ============================================================
     ALIASES — os 96 nomes de token do base.html antigo (levantados em
     01-PESQUISA.md, "O contrato do base.html atual") + os 11 usados-sem-existir.
     Só precisam ser definidos aqui em :root — como são indireções via var(), o
     valor certo por tema já resolve sozinho a partir dos tokens canônicos acima
     (que .dark redefine mais abaixo). Nenhuma tela precisa trocar de nome.
     ============================================================ */
  --background          : var(--bg);
  --bg-primary          : var(--bg);
  --bg-secondary        : var(--surface);
  --foreground          : var(--text);
  --card                : var(--surface);
  --card-foreground     : var(--text);
  --popover             : var(--surface);
  --popover-foreground  : var(--text);
  --muted               : var(--surface-2);
  --muted-foreground    : var(--text-muted);
  --secondary           : var(--surface-3);
  --secondary-foreground: var(--text-sub);
  --input               : var(--border-2);
  --surface2            : var(--surface-2);
  --text-primary        : var(--text);
  --text-secondary      : var(--text-muted);
  --accent              : var(--primary);
  --accent-foreground   : var(--primary-foreground);
  --accent-2            : var(--primary-dark);
  --accent-grad-a       : var(--primary);
  --accent-grad-b       : var(--primary-dark);
  --accent-ring         : var(--primary-ring);
  --accent-soft         : var(--primary-soft);
  --accent-subtle       : var(--primary-soft);
  --accent-hover        : color-mix(in oklch, var(--primary) 85%, black);
  --ring                : var(--primary);
  --destructive         : var(--error);
  --destructive-foreground: #FFFFFF;
  --danger              : var(--error);
  --danger-soft         : var(--error-soft);
  --error-light         : var(--error);
  --blue-hover          : color-mix(in oklch, var(--blue) 85%, black);
  --sidebar             : var(--sb-bg);
  --sidebar-foreground  : var(--sb-text);
  --sidebar-primary     : var(--sb-active);
  --sidebar-accent      : var(--sb-surface);
  --sidebar-border      : var(--sb-border);
  --sidebar-ring        : var(--sb-active);
  --navy                : var(--sb-bg);
  --dimmed              : var(--text-muted);

  /* 7 usados-sem-existir previstos no Plano (T3, critério de aceite) */
  --surface-alt   : var(--surface-3);
  --border-subtle : color-mix(in oklch, var(--border) 55%, transparent);
  --surface-hover : var(--surface-2);
  --kpi-accent    : var(--primary);
  --hover-bg      : var(--surface-2);

  --shadow        : var(--shadow-sm);   /* alias curto — algum grep antigo pode usar */
  color-scheme: light;
}

.dark {
  color-scheme: dark;

  /* ── Escuro — mesma escala "Direção A", fundo navy profundo ── */
  --bg          : #0F1115;
  --surface     : #181B21;
  --surface-2   : #20242C;
  --surface-3   : #272C36;
  --border      : #333A47;
  --border-2    : #454E5F;
  --text        : #ECEEF2;
  --text-sub    : #C3C9D4;
  --text-muted  : #8B93A3;

  --primary            : #6E8FE0;
  --primary-dark       : #5A7BD0;
  --primary-soft       : rgba(110, 143, 224, .18);
  --primary-ring       : rgba(110, 143, 224, .32);
  --primary-foreground : #0B1220;
  --link        : #7FADE0;
  --link-hover  : #A6C6EC;
  --accent-rgb  : 249 168 37;

  --success     : #4ADE80;
  --success-soft: rgba(74, 222, 128, .14);
  --success-rgb : 74,222,128;
  --warning     : #FCD34D;
  --warning-soft: rgba(252, 211, 77, .14);
  --error       : #F87171;
  --error-soft  : rgba(248, 113, 113, .12);
  --info        : #60A5FA;
  --info-soft   : rgba(96, 165, 250, .14);

  --shadow-sm   : 0 1px 3px rgba(0, 0, 0, .40);
  --shadow-md   : 0 4px 16px rgba(0, 0, 0, .48);
  --shadow-lg   : 0 10px 34px rgba(0, 0, 0, .56);
  --shadow-xl   : 0 20px 56px rgba(0, 0, 0, .64);

  --subrow-bg   : var(--sb-surface);
  --subrow-text : var(--sb-text-strong);

  --chart-1     : #6FA0DE;
  --chart-2     : #2FC4B0;   /* teal (escuro) — era âmbar */
  --chart-3     : #52C08A;
  --chart-4     : #A290E8;
  --chart-5     : #5FB8CF;

  --com-aceite      : #34D278;
  --com-aceite-soft : rgba(52, 210, 120, .18);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
a.rp-link { color: var(--link); text-underline-offset: 2px; word-break: break-all; }
a.rp-link:hover { color: var(--link-hover); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   COMPONENTES rp-* GENÉRICOS
   ============================================================ */

.rp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.rp-btn,
.rp-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 18px; border-radius: var(--radius-md);
  border: none; cursor: pointer;
  transition: filter .14s, box-shadow .14s;
  text-decoration: none;
}
.rp-btn { background: var(--surface-2); color: var(--text); }
.rp-btn:hover { filter: brightness(1.04); }
.rp-btn-primary {
  background: linear-gradient(135deg, var(--accent-grad-a), var(--accent-grad-b));
  color: var(--primary-foreground);
}
.rp-btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 20px var(--accent-soft); }

.rp-btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); color: var(--text-sub);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  padding: 9px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border); cursor: pointer;
  transition: background .13s, color .13s, border-color .13s;
  text-decoration: none;
}
.rp-btn-secondary:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }

.rp-btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  transition: background .13s, color .13s; text-decoration: none;
}
.rp-btn-danger:hover { background: var(--error-soft); color: var(--error); }

.rp-btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.rp-btn-primary:disabled, .rp-btn-secondary:disabled, .rp-btn:disabled { opacity: .45; cursor: default; }
.rp-btn-primary:focus-visible, .rp-btn-secondary:focus-visible, .rp-btn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-ring);
}

.rp-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 6px 10px; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--link); cursor: pointer; text-decoration: none;
  transition: background .13s, color .13s;
}
.rp-btn-ghost:hover { background: var(--accent-soft); color: var(--link-hover); }
.rp-btn-ghost.success:hover { background: var(--success-soft); color: var(--success); }
.rp-btn-ghost.danger:hover { background: var(--error-soft); color: var(--error); }
.rp-btn-ghost-active { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }

.rp-icon-btn, .rp-action-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: none; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; text-decoration: none; flex-shrink: 0;
  transition: background .13s, color .13s;
}
.rp-icon-btn:hover, .rp-action-btn:hover { background: var(--accent-soft); color: var(--accent); }
.rp-action-btn.danger:hover { background: var(--error-soft); color: var(--error); }
.rp-action-btn.success:hover { background: var(--success-soft); color: var(--success); }
.rp-action-row { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }

.rp-input, .rp-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-family: inherit; font-size: 13.5px;
  color: var(--text); outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.rp-input::placeholder { color: var(--text-muted); }
.rp-input:focus, .rp-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rp-select {
  padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23888' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.rp-select:disabled { opacity: .45; cursor: default; }
.rp-input[type="file"] { padding: 6px 8px; }
.rp-input[type="file"]::file-selector-button, .rp-input[type="file"]::-webkit-file-upload-button {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-3); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
  margin-right: 10px; transition: background .13s, color .13s;
}

.rp-label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 6px;
}
.rp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rp-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.rp-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13.5px; margin-bottom: 20px;
}
.rp-alert.error,   .rp-alert-danger  { background: var(--error-soft);   color: var(--error);   border: 1px solid color-mix(in oklch, var(--error) 22%, transparent); }
.rp-alert.success, .rp-alert-success { background: var(--success-soft); color: var(--success); border: 1px solid color-mix(in oklch, var(--success) 22%, transparent); }
.rp-alert.info,     .rp-alert-info   { background: var(--info-soft);    color: var(--info);    border: 1px solid color-mix(in oklch, var(--info) 22%, transparent); }

.rp-table { width: 100%; border-collapse: collapse; }
.rp-table th {
  text-align: left; padding: 12px 20px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.rp-table td { padding: 14px 20px; font-size: 13.5px; color: var(--text-sub); border-bottom: 1px solid var(--border); vertical-align: middle; }
.rp-table tbody tr:last-child td { border-bottom: none; }
.rp-table tbody tr:hover td { background: var(--surface-2); }
.rp-table tbody tr[data-href] { cursor: pointer; }

/* Tabelas de campanhas (marketing/campanhas/index.html) -- não usam .rp-table (layout
   próprio com chips/avatares), mas reaproveitam o mesmo tr[data-href] do rp-ui.js. */
.rp-camp-row { cursor: pointer; }
.rp-camp-row:hover td { background: var(--surface-2); }
.rp-table .rp-td-name { font-weight: 600; color: var(--text); }

.rp-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
}
.rp-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.rp-status.active   { background: var(--success-soft); color: var(--success); }
.rp-status.active::before { background: var(--success); }
.rp-status.inactive { background: var(--error-soft); color: var(--error); }
.rp-status.inactive::before { background: var(--error); }
.rp-status.warning  { background: var(--warning-soft); color: var(--warning); }
.rp-status.warning::before { background: var(--warning); }
.rp-status.neutral  { background: var(--surface-3); color: var(--text-muted); }
.rp-status.neutral::before { background: var(--text-muted); }

.rp-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.rp-section-title { font-size: 15px; font-weight: 700; color: var(--text); }

.rp-empty, .rp-empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.rp-empty i, .rp-empty-state i { font-size: 36px; margin-bottom: 12px; display: block; opacity: .5; }
.rp-empty p, .rp-empty-state p { font-size: 14px; }
.rp-empty-state { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 24px; }

.rp-polo-label {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 900; letter-spacing: .12em;
  padding: 2px 8px; border-radius: 100px; white-space: nowrap; flex-shrink: 0;
  text-transform: uppercase; line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.rp-page-heading { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.rp-page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* Cabeçalho de página — mesmo id/estrutura do base.html antigo (contrato: `#rp-header
   h1`/`p` mostram page_title/page_subtitle, alguns templates leem via JS). */
#rp-header { display: none; } /* título/subtítulo de página saíram da tela (Danilo, 2026-09-24) — o elemento fica no DOM só pelo contrato (`admin/bia_aliases.html` escreve em `#rp-header h1`/`p`); o texto vai pro <title> */
#rp-header h1 { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.3px; line-height: 1.25; }
#rp-header p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

@keyframes rpSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.rp-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast);
  padding: 13px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: var(--primary-foreground);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
  display: flex; align-items: center; gap: 10px;
  max-width: 380px; animation: rpSlideIn .25s ease; transition: opacity .3s;
}
.rp-toast.success { background: var(--success); color: var(--white); }
.rp-toast.error   { background: var(--error);   color: var(--white); }
.rp-toast.info    { background: var(--info);    color: var(--white); }

.rp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-grad-a) 0%, var(--accent-grad-b) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--primary-foreground);
  flex-shrink: 0; box-shadow: 0 0 0 2px var(--accent-soft);
}
.rp-avatar-lg {
  width: 46px; height: 46px; border-radius: 50%;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-grad-a) 0%, var(--accent-grad-b) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--primary-foreground);
  flex-shrink: 0; box-shadow: 0 3px 14px var(--accent-soft);
}

.rp-theme-btn {
  position: fixed; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: background .2s, color .2s, border-color .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.rp-theme-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Delta pill — reaproveitado pelo .rp-tc-tile abaixo (variação com seta/percentual). */
.rp-kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; margin-top: 10px; padding: 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rp-kpi-delta i { font-size: 9px; }
.rp-kpi-delta.success { background: var(--success-soft); color: var(--success); }
.rp-kpi-delta.error   { background: var(--error-soft);   color: var(--error); }
.rp-kpi-delta.neutral { background: var(--surface-3);    color: var(--text-muted); }

/* Torre de Controle — KPI sem ícone-em-quadrado-colorido (2026-09-27, direção já validada com o
   Danilo no Gestor-360: ver lá `static/css/theme.css` "Torre de Controle" — o ícone em caixa
   colorida é "o padrão mais repetido de dashboard genérico feito por IA"). Substitui
   .rp-kpi-card/.rp-kpi-head/.rp-kpi-icon/.rp-kpi-blob no Painel de Marketing e Tráfego Pago: um
   friso colorido no topo (`--edge`, setável inline por card) carrega o significado, valor em
   mono, texto secundário trunca com ellipsis + `title` — nunca mais estoura a altura do card. */
.mono-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rp-tc-tile {
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--edge, var(--accent));
  border-radius: var(--radius-md); padding: 16px 18px 15px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s; cursor: default;
}
.rp-tc-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.rp-tc-tile .tc-tlabel { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.rp-tc-tile .tc-tvalue { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rp-tile-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-tc-tile .rp-kpi-delta { font-size: 11px; padding: 2px 8px; margin-top: 9px; }

.rp-card-header { padding: 14px 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-card-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.rp-card-body { padding: 14px 24px 20px; }

/* ── Listas: toolbar, busca, abas, chips, paginação ──────────────────────── */
.rp-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-toolbar .rp-select, .rp-toolbar .rp-input:not(.rp-search .rp-input) { width: auto; min-width: 150px; }
.rp-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rp-search { position: relative; flex: 1 1 240px; max-width: 380px; }
.rp-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); pointer-events: none; }
.rp-search > .rp-input { padding-left: 34px; }
.rp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: all .13s;
}
.rp-tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.rp-tab-btn.active { background: var(--accent); color: var(--primary-foreground); border-color: var(--accent); }
.rp-tab-count { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rp-tab-pane { display: none; }
.rp-tab-pane.active { display: block; }
.rp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 6px 4px 11px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-sub); font-size: 12px; font-weight: 600;
}
.rp-chip a { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: var(--text-muted); font-size: 10px; text-decoration: none; }
.rp-chip a:hover { background: var(--error-soft); color: var(--error); }
.rp-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.rp-pager-nav { display: flex; gap: 6px; }
.rp-list-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.rp-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
@media (max-width: 640px) { .rp-search { max-width: none; } .rp-toolbar-right { margin-left: 0; width: 100%; } }

/* ── Dropdowns de filtro (facet-*, dfilter, evt-*) — portado verbatim do
   base.html antigo (:1004-1077), usa só tokens já aliased acima. ── */
.dfilter { position: relative; }
.facet-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; position: relative; margin-bottom: 4px; }
.facet-dropdown-btn {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 9px;
  color: var(--text-sub); font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 7px 12px; cursor: pointer; max-width: 100%; min-width: 150px;
  justify-content: space-between; transition: border-color .13s;
}
.facet-dropdown-btn:hover, .facet-dropdown-btn:focus { border-color: var(--accent); outline: none; }
.dfilter.active .facet-dropdown-btn { border-color: color-mix(in oklch, var(--accent) 45%, transparent); background: color-mix(in oklch, var(--accent) 8%, transparent); color: var(--accent); }
.facet-dropdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; font-size: 11.5px; }
.facet-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-dropdown);
  background: var(--surface-2, var(--surface)); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  width: 300px; max-height: 340px; display: none; flex-direction: column;
}
.facet-popover-header {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); display: flex; align-items: center; justify-content: space-between;
}
.facet-popover-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.facet-quickall { background: none; border: none; color: var(--accent); font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: inherit; padding: 2px 6px; margin-left: 4px; }
.facet-quickall:hover { text-decoration: underline; }
.facet-menu-list { overflow-y: auto; padding: 6px; }
.facet-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--text-sub); }
.facet-menu-item:hover { background: var(--surface-3, var(--surface)); color: var(--text); }
.facet-menu-item i { width: 16px; text-align: center; color: var(--text-muted); font-size: 12px; }
.facet-menu-item.sel { background: color-mix(in oklch, var(--accent) 10%, transparent); color: var(--accent); font-weight: 700; }
.facet-menu-item.sel::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10px; margin-left: 6px; flex-shrink: 0; }
.facet-empty-hint { padding: 12px; color: var(--text-muted); font-size: 12.5px; }
.evt-item { align-items: flex-start; }
.evt-id { flex-shrink: 0; font-size: 10.5px; font-weight: 800; color: var(--text-muted); background: var(--surface-3); border-radius: 5px; padding: 2px 6px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.evt-item.sel .evt-id { background: color-mix(in oklch, var(--accent) 16%, transparent); color: var(--accent); }
.evt-name { font-size: 11px; line-height: 1.35; flex: 1; }
.facet-add-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.facet-add-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }
.facet-chip {
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  color: var(--accent); border-radius: 8px; padding: 6px 6px 6px 11px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.facet-chip:hover { background: color-mix(in oklch, var(--accent) 20%, transparent); }
.facet-chip .fc-count { background: var(--accent); color: var(--primary-foreground); border-radius: 99px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.facet-chip .fc-x { display: flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0; font-size: 10px; }
.facet-chip .fc-x:hover { background: color-mix(in oklch, var(--accent) 30%, transparent); }
.facet-clear-all { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-family: inherit; }
.facet-clear-all:hover { color: var(--text); }
.dfilter-pop { /* marcador de JS (querySelector), estilo vem de .facet-popover */ }
.facet-popover-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }
.facet-popover-close:hover { color: var(--error); }

/* Badge de tipo (histórico) — cor vem inline (item.tipo_color), só o layout é fixo aqui */
.rp-tipo-badge { display: inline-flex; align-items: center; white-space: nowrap; }

/* ============================================================
   HEADER DE 2 LINHAS + DRAWER MOBILE (molde Odontiza — ver 01-PESQUISA.md)
   ============================================================ */
.rp-header-outer { position: sticky; top: 0; z-index: var(--z-header); display: flex; background: var(--sb-bg); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.rp-rows { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.rp-brand-block {
  position: absolute; left: 0; top: 0;
  width: calc(var(--brand-col-w) - 10px);
  height: calc(var(--navrow-h) + var(--subheader-h));
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 0 18px 0 20px; border-radius: 0 999px 999px 0;
  background: var(--sb-bg);
  box-shadow: 6px 0 14px rgba(0, 0, 0, .35), inset -2px 0 0 rgba(255, 255, 255, .05);
  z-index: 1;
}

/* Selo da marca -- mesmo tratamento do Gestor 360 (blob dourado animado + isotipo
   dentro), só troca o texto "Gestor" por "CRM" e o isotipo pelo normal da Result
   (sem cifrão -- pedido do Danilo, 2026-09-27). */
.rp-brand-mark-wrap { width: 64px; height: 64px; flex-shrink: 0; }
.rp-brand-mark {
  width: 100%; height: 100%; border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%;
  background: radial-gradient(circle at 32% 28%, var(--brand-yellow-light) 0%, var(--brand-yellow) 55%, var(--brand-yellow-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .28), 0 0 0 3px var(--sb-bg), 0 0 0 4px rgba(255, 255, 255, .1);
  animation: rpSealFloat 6s ease-in-out infinite;
}
.rp-brand-mark img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .22)); pointer-events: none; }
@keyframes rpSealFloat {
  0%, 100% { border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%; }
  50%      { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; }
}
.rp-brand-word { display: flex; flex-direction: column; line-height: 1; gap: 6px; }
.rp-brand-word .rp-rword { font-size: 26px; font-weight: 700; letter-spacing: -.3px; color: var(--sb-text-strong); }
.rp-brand-word .rp-rword b { color: var(--brand-yellow); font-weight: 800; }
.rp-brand-word span.rp-tag { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--brand-yellow); text-transform: uppercase; }

.rp-topbar {
  height: var(--navrow-h); background: var(--sb-bg);
  display: flex; align-items: center; gap: 2px;
  padding: 0 18px 0 var(--brand-col-w); flex-shrink: 0;
}
.rp-cat-row { display: flex; align-items: center; gap: 2px; height: 100%; }
.rp-cat-btn {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 100%;
  padding: 0 15px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; color: var(--sb-text); transition: color .13s;
  white-space: nowrap; background: none; border: none; cursor: pointer; font-family: inherit;
}
.rp-cat-btn i { font-size: 12px; width: 14px; text-align: center; }
.rp-cat-btn:hover { color: var(--sb-text-strong); }
.rp-cat-btn.active-item, .rp-cat-btn.active { color: var(--sb-text-strong); }
.rp-cat-btn.active-item::after, .rp-cat-btn.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--brand-accent);
}

.rp-item-row {
  height: var(--subheader-h); min-height: var(--subheader-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px 0 var(--brand-col-w);
  background: var(--subrow-bg);
  overflow-x: auto; flex-shrink: 0;
}
.rp-item-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--subrow-text); text-decoration: none; white-space: nowrap;
  transition: background .13s, color .13s;
}
.rp-item-btn i { font-size: 12px; opacity: .8; }
.rp-item-btn:hover { background: var(--primary-soft); }
.rp-item-btn.active-item, .rp-item-btn.active {
  background: var(--primary); color: var(--primary-foreground); font-weight: 600;
  box-shadow: 0 2px 10px var(--primary-ring);
}

.rp-topbar-spacer { flex: 1; }
.rp-util-row { display: flex; gap: 4px; align-items: center; }
.rp-util-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sb-text); background: none; border: none; cursor: pointer;
  position: relative; font-size: 14.5px;
}
.rp-util-btn:hover { background: rgba(255, 255, 255, .08); color: var(--sb-text-strong); }
.rp-util-btn.rp-util-optional { opacity: .45; cursor: default; }
.rp-util-btn.rp-util-optional:hover { background: none; color: var(--sb-text); }
.rp-notif-dot {
  position: absolute; top: 5px; right: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--error); border: 1.5px solid var(--sb-bg);
}

/* Badge de contagem — item da linha 2 do header (Contatos novos, Criativos) */
@keyframes rp-notif-pop {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1);   opacity: 1; }
}
.rp-notif-pill {
  margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--error); color: var(--white);
  font-size: 10px; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  animation: rp-notif-pop .3s ease;
}

/* Selo "Versão Gratuita" (modo demo) */
.rp-demo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; margin-right: 6px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  color: var(--sb-text-strong); text-decoration: none; white-space: nowrap;
}
.rp-demo-badge:hover { background: rgba(255, 255, 255, .1); }
.rp-demo-badge-icon { color: var(--primary); font-size: 12px; }
.rp-demo-badge-info { display: flex; flex-direction: column; line-height: 1.2; }
.rp-demo-badge-title { font-size: 11.5px; font-weight: 700; }
.rp-demo-badge-sub { font-size: 9.5px; color: var(--sb-text); }
@media (max-width: 767px) { .rp-demo-badge-info { display: none; } }

.rp-sim-pill, .rp-impersonate-pill {
  display: inline-flex; align-items: center; gap: 7px; height: auto;
  padding: 7px 14px; border-radius: 999px; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: linear-gradient(90deg, var(--impersonate-a), var(--impersonate-b)); color: var(--white);
  box-shadow: 0 2px 8px rgba(79, 70, 229, .4); transition: filter .13s; text-decoration: none;
}
.rp-sim-pill:hover, .rp-impersonate-pill:hover { filter: brightness(1.08); }

.rp-user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  color: var(--white); cursor: default;
}
.rp-user-chip span { font-size: 13px; font-weight: 600; }
.rp-user-avatar { width: 30px; height: 30px; border-radius: 50%; position: relative; overflow: hidden; background: var(--primary); color: var(--primary-foreground); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0; }

/* Chip "Meus Polos" — mesma família visual do rp-user-chip */
.rp-polos-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  color: var(--sb-text); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.rp-polos-btn:hover { background: rgba(255, 255, 255, .1); color: var(--sb-text-strong); }
.rp-polos-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl); z-index: var(--z-dropdown); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, visibility .15s, transform .15s;
}
.rp-polos-menu.rp-open { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 767px) {
  .rp-cat-row, .rp-item-row { display: none; }
  .rp-mobile-toggle { display: inline-flex; }
  .rp-topbar { gap: 10px; padding: 0 10px 0 90px; }
  .rp-brand-block { height: var(--navrow-h); width: calc(90px - 10px); }
  .rp-brand-word { display: none; }
  .rp-user-chip span { display: none; }
  .rp-user-chip { padding: 4px; }
  .rp-polos-btn span { display: none; }
  .rp-polos-btn { padding: 6px 8px; }
  /* Achado da revisão T1-T5: a pílula de simulação com o nome completo do usuário
     empurrava Meus Polos + avatar pra fora da tela em 375px -- vira só o ícone
     (mesma solução do Odontiza, theme.css:1278 de lá, citada na Pesquisa). */
  .rp-impersonate-name { display: none; }
  .rp-impersonate-pill, .rp-sim-pill { padding: 7px 9px; gap: 4px; }
}

/* ── Hambúrguer + drawer mobile (<768px) ── */
.rp-mobile-toggle {
  display: none; width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  align-items: center; justify-content: center; color: var(--sb-text); font-size: 18px;
  background: none; border: none; cursor: pointer;
}
.rp-mobile-toggle:hover { background: rgba(255, 255, 255, .08); }
/* Depois da regra base acima (display:none) -- senão ela vence por vir depois no arquivo
   com a mesma especificidade e o hambúrguer nunca aparece (achado no roteiro em 375px). */
@media (max-width: 767px) { .rp-mobile-toggle { display: inline-flex; } }
.rp-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: var(--z-drawer); }
.rp-drawer-overlay.rp-open { display: block; }
.rp-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw);
  background: var(--sb-bg); overflow-y: auto;
  transform: translateX(-100%); transition: transform .2s ease; padding: 18px 0 28px;
}
.rp-drawer-overlay.rp-open .rp-drawer { transform: translateX(0); }
.rp-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 14px; }
.rp-drawer-header img { height: 28px; }
.rp-drawer-close { background: none; border: none; color: var(--sb-text); font-size: 18px; cursor: pointer; padding: 4px; }
.rp-drawer details { border-top: 1px solid rgba(255, 255, 255, .08); }
.rp-drawer summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; font-size: 14.5px; font-weight: 600; color: var(--sb-text-strong);
}
.rp-drawer summary::-webkit-details-marker { display: none; }
.rp-drawer summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; color: var(--sb-text-muted); transition: transform .15s; }
.rp-drawer details[open] summary::after { transform: rotate(180deg); }
.rp-drawer summary.rp-drawer-cat-active { color: var(--brand-accent); }
.rp-drawer .rp-drawer-items { padding: 2px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.rp-drawer .rp-drawer-items a {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--sb-text); text-decoration: none;
}
.rp-drawer .rp-drawer-items a:hover { background: rgba(255, 255, 255, .06); }
.rp-drawer .rp-drawer-items a.active { background: var(--primary); color: var(--primary-foreground); }

/* ── Conteúdo abaixo do header ── */
#rp-main { flex: 1; display: flex; flex-direction: column; min-height: calc(100dvh - var(--navrow-h) - var(--subheader-h)); min-width: 0; }
.rp-page { flex: 1; padding: 28px; }
.rp-footer { padding: 12px 28px; border-top: 1px solid var(--border); }
.rp-footer p { font-size: 12px; color: var(--text-muted); margin: 0; }
@media (max-width: 767px) { .rp-page { padding: 16px 14px 40px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); } .rp-footer { padding: 12px 14px; } }

/* ============================================================
   DROPDOWN DO USUÁRIO + TEMA + ABAS
   ============================================================ */
#rp-user-btn {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer; transition: background .14s, border-color .14s; outline: none; white-space: nowrap;
}
#rp-user-btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .14); }
#rp-user-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
#rp-chevron { font-size: 10px; color: var(--sb-text); transition: transform .18s ease; }
#rp-user-btn[aria-expanded="true"] #rp-chevron { transform: rotate(180deg); }

#rp-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 278px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); overflow: hidden; z-index: var(--z-dropdown);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top right;
  transition: opacity .17s ease, visibility .17s, transform .17s ease;
}
#rp-dropdown.rp-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.rp-dd-card { padding: 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.rp-dd-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  font-size: 13.5px; font-weight: 500; color: var(--text-sub);
  text-decoration: none; transition: background .12s, color .12s; cursor: pointer;
}
.rp-dd-item:hover { background: var(--surface-2); color: var(--text); }
.rp-dd-item.danger:hover { background: var(--error-soft); color: var(--error); }
.rp-dd-item.danger:hover .rp-dd-icon { border-color: var(--error); color: var(--error); }
.rp-dd-icon {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted); flex-shrink: 0; transition: border-color .12s, color .12s;
}
.rp-dd-item:not(.danger):hover .rp-dd-icon { border-color: var(--border-2); color: var(--text-sub); }

.rp-role-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; letter-spacing: .01em; }

.rp-theme-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.rp-theme-left { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.rp-toggle, .rp-switch-track {
  width: 38px; height: 22px; background: var(--border-2); border-radius: 99px; position: relative;
  cursor: pointer; transition: background .22s; border: none; padding: 0; flex-shrink: 0;
}
.dark .rp-toggle, .rp-switch-track.on, .rp-switch-track[aria-checked="true"] { background: var(--accent); }
.rp-toggle-thumb, .rp-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: var(--white); border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.dark .rp-toggle-thumb, .rp-switch-track.on .rp-switch-thumb, .rp-switch-track[aria-checked="true"] .rp-switch-thumb { transform: translateX(16px); }
.rp-switch { display: inline-flex; align-items: center; gap: 8px; }

.tab-nav { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  font-size: .8125rem; font-weight: 600; color: var(--text-muted);
  background: none; border: none; outline: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; border-radius: 8px 8px 0 0; transition: color .15s, background .13s;
  white-space: nowrap; flex-shrink: 0;
}
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   MODAL — sempre a classe `hidden` (nunca `.open`)
   ============================================================ */
.rp-modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal); padding: 16px;
}
.rp-modal-overlay.hidden { display: none !important; }
.rp-modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 100%; max-width: 480px; max-height: calc(100dvh - 64px); overflow-y: auto; box-shadow: var(--shadow-xl); }
.rp-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.rp-modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.rp-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: background .13s, color .13s;
}
.rp-modal-close:hover { background: var(--error-soft); color: var(--error); }
.rp-modal-body { padding: 20px 24px 24px; }
.rp-modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   CASCA DE AUTENTICAÇÃO (T6) — templates/layout_auth.html: login, login/verificar,
   dev-login, senha/recuperar+redefinir, demo_signup/passo1-3, master/selecionar_*,
   error.html. Reaproveita rp-input/rp-select/rp-label/rp-field/rp-alert/rp-btn-primary/
   rp-search já existentes (COMPONENTES rp-* GENÉRICOS acima) -- só o que é específico
   do shell centrado/tema/OTP/master entra aqui, com prefixo `auth-` (fora do escopo do
   scripts/check_css_contract.py, que só audita rp-*, facet-*, dfilter, evt-*).
   ============================================================ */
.auth-shell-centered {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow-x: hidden;
}
.auth-shell-plain { display: flex; flex-direction: column; }

.auth-glow-a, .auth-glow-b { position: absolute; border-radius: 50%; pointer-events: none; opacity: .10; }
.auth-glow-a { top: -180px; right: -120px; width: 460px; height: 460px; background: radial-gradient(circle, var(--primary) 0%, transparent 70%); }
.auth-glow-b { bottom: -200px; left: -140px; width: 420px; height: 420px; opacity: .08; background: radial-gradient(circle, var(--primary-dark) 0%, transparent 70%); }

.auth-theme-btn {
  position: fixed; top: 16px; right: 16px; width: 36px; height: 36px; z-index: var(--z-dropdown);
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: background .18s, color .18s, border-color .18s;
  box-shadow: var(--shadow-sm);
}
.auth-theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.auth-theme-icon-sun { display: none; }
.dark .auth-theme-icon-sun { display: inline; }
.dark .auth-theme-icon-moon { display: none; }

.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 380px; }
.auth-wrap-wide { max-width: 420px; }

.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 10px; }
.auth-logo img { width: 200px; height: auto; display: block; }
.dark .auth-logo .logo-light { display: none !important; }
.dark .auth-logo .logo-dark  { display: block !important; }
html:not(.dark) .auth-logo .logo-dark  { display: none !important; }
html:not(.dark) .auth-logo .logo-light { display: block !important; }
.auth-logo-mark { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.auth-logo-mark img { width: 40px; height: 40px; object-fit: contain; }
.auth-logo-crm { width: 200px; text-align: right; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }
.auth-logo-text { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--text); line-height: 1.1; }
.auth-logo-text span { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.auth-subtitle { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 28px; font-weight: 500; letter-spacing: .02em; }

.auth-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.auth-step-dot { width: 28px; height: 4px; border-radius: 99px; background: var(--border); }
.auth-step-dot.active { background: var(--accent); }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); padding: 32px; }
.auth-card-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-card-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.auth-card-sub strong { color: var(--text-sub); font-weight: 600; }

.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none; transition: color .15s;
}
.auth-input-wrap .rp-input { padding-left: 38px; }
.auth-input-wrap .auth-input-toggle {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px;
  transition: color .15s;
}
.auth-input-wrap .auth-input-toggle:hover { color: var(--accent); }
.auth-input-wrap .rp-input.has-toggle { padding-right: 38px; }
.rp-input.invalid { border-color: var(--error); }
.auth-field-hint { font-size: 11px; margin-top: -6px; margin-bottom: 6px; }
.auth-field-hint.error { color: var(--error); }
.auth-field-hint.ok { color: var(--success); }

.auth-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--primary-foreground); border: none; border-radius: var(--radius-md);
  padding: 13px; font-size: 14px; font-weight: 700; font-family: inherit; letter-spacing: .02em;
  cursor: pointer; box-shadow: 0 6px 20px var(--primary-soft);
  transition: opacity .18s, transform .12s, box-shadow .18s;
}
.auth-btn:hover { opacity: .94; transform: translateY(-1px); box-shadow: 0 8px 26px var(--primary-ring); }
.auth-btn:active { transform: translateY(0); opacity: 1; }
.auth-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.auth-toggle { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--text-muted); }
.auth-toggle a { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.auth-toggle a:hover { opacity: .75; }

.auth-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; font-size: 12.5px; }
.auth-actions a, .auth-actions button {
  color: var(--text-muted); text-decoration: none; font-weight: 500; background: none; border: none;
  cursor: pointer; font-family: inherit; font-size: 12.5px; padding: 0; transition: opacity .15s;
}
.auth-actions button { color: var(--accent); font-weight: 600; }
.auth-actions a:hover, .auth-actions button:hover { opacity: .75; }

.auth-back-link { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-back-link:hover { opacity: .75; }

.auth-footer { text-align: center; font-size: 11.5px; color: var(--text-muted); margin-top: 22px; }

.auth-dev-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.auth-dev-link {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 33%, transparent); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 12.5px; color: var(--accent); font-weight: 600; text-decoration: none;
}

.auth-otp-boxes { display: flex; gap: 10px; justify-content: center; margin-bottom: 28px; }
.auth-otp-box {
  width: 46px; height: 56px; background: var(--bg); color: var(--text); border: 2px solid var(--border);
  border-radius: var(--radius-md); font-size: 22px; font-weight: 700; font-family: inherit;
  text-align: center; outline: none; transition: border-color .18s, box-shadow .18s; caret-color: var(--accent);
}
.auth-otp-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-otp-box.filled { border-color: var(--accent); }
.auth-otp-boxes-sm { gap: 7px; }
.auth-otp-boxes-sm .auth-otp-box { width: 38px; height: 48px; font-size: 18px; border-radius: var(--radius-sm); }
.auth-otp-group { margin-bottom: 22px; }
.auth-otp-label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.auth-otp-devbox {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px; text-align: center;
}
.auth-otp-devbox-label { font-size: .68rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.auth-otp-devbox-code { font-size: 1.8rem; font-weight: 800; letter-spacing: .3em; color: var(--primary-dark); font-family: monospace; }
.auth-otp-devbox-link { display: block; margin-top: 6px; font-size: .72rem; color: var(--accent); }

/* dev-login (dev-only, cartão sempre no tom escuro-neutro do card padrão) */
.auth-dev-card { background: var(--surface); border: 1px solid color-mix(in oklch, var(--accent) 33%, transparent); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 420px; }
.auth-dev-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 4px 10px; font-size: .72rem; color: var(--accent); font-weight: 700; margin-bottom: 20px; }
.auth-dev-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.auth-dev-sub { font-size: .8rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.auth-dev-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.auth-dev-section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin-bottom: 12px; }
.auth-dev-option { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.auth-dev-option h3 { font-size: .88rem; font-weight: 700; margin-bottom: 2px; }
.auth-dev-option p { font-size: .74rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.auth-dev-option label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.auth-dev-option input[type=tel] {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; color: var(--text); font-size: .85rem; margin-bottom: 8px; font-family: monospace;
}
.auth-dev-option input[type=tel]:focus { outline: none; border-color: var(--accent); }
.auth-dev-btn-admin, .auth-dev-btn-direct {
  width: 100%; border: none; border-radius: var(--radius-sm); padding: 9px; font-weight: 700; font-size: .85rem; cursor: pointer;
}
.auth-dev-btn-admin { background: var(--primary); color: var(--primary-foreground); }
.auth-dev-btn-admin:hover { background: var(--primary-dark); }
.auth-dev-btn-direct { background: var(--blue); color: var(--white); }
.auth-dev-btn-direct:hover { background: var(--blue-hover); }
.auth-dev-tip { font-size: .68rem; color: var(--text-muted); margin-top: 4px; }
.auth-dev-error { background: var(--error-soft); border: 1px solid var(--error); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .78rem; color: var(--error); margin-bottom: 16px; }
.auth-dev-back { display: block; text-align: center; margin-top: 20px; font-size: .75rem; color: var(--text-muted); text-decoration: none; }
.auth-dev-back:hover { color: var(--text-sub); }

/* master/selecionar-empresa e selecionar-usuario */
.auth-badge {
  display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent); border-radius: var(--radius-sm); padding: 3px 9px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; margin-bottom: 14px;
}
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.auth-user-block { margin-top: 18px; animation: auth-fade-in .18s ease; }
@keyframes auth-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.auth-footer-links { margin-top: 24px; text-align: center; font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 14px; }
.auth-footer-links a { color: var(--text-muted); text-decoration: none; transition: color .13s; }
.auth-footer-links a:hover { color: var(--text); }
.auth-footer-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

.auth-topbar { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 60px; position: sticky; top: 0; z-index: var(--z-header); }
.auth-topbar-left { display: flex; align-items: center; gap: 12px; }
.auth-topbar-back { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); text-decoration: none; padding: 5px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); transition: background .15s, color .15s; }
.auth-topbar-back:hover { background: var(--surface-2); color: var(--text); }
.auth-topbar-logo { display: flex; align-items: center; gap: 10px; }
.auth-topbar-logo img { height: 30px; }
.auth-topbar-logo span { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; }
.auth-topbar-sep-v { width: 1px; height: 20px; background: var(--border); }
.auth-topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.auth-topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--primary-foreground); }
.auth-topbar-badge { font-size: 10.5px; font-weight: 600; background: var(--role-admin-soft); color: var(--role-admin); padding: 2px 8px; border-radius: 20px; }
.auth-topbar-logout { font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 4px 10px; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.auth-topbar-logout:hover { background: var(--surface-2); color: var(--text); }

.auth-page { flex: 1; padding: 40px 28px; max-width: 680px; width: 100%; margin: 0 auto; }
.auth-page-heading { margin-bottom: 28px; }
.auth-company-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.auth-page-heading h2 { font-size: 22px; font-weight: 700; }
.auth-page-heading p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-users-list { display: flex; flex-direction: column; gap: 8px; }
.auth-user-card, .auth-user-card-gerente {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-family: inherit; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.auth-user-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.auth-user-card-gerente { border: 1.5px solid var(--accent); padding: 16px 20px; margin-bottom: 4px; }
.auth-user-card-gerente:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.auth-user-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.auth-avatar-gerente { background: var(--accent-soft); color: var(--accent); }
.auth-avatar-gerente_geral { background: var(--role-gerente-soft); color: var(--role-gerente); }
.auth-avatar-supervisor_comercial { background: var(--role-sup-soft); color: var(--role-sup); }
.auth-avatar-consultor_comercial { background: var(--role-cons-soft); color: var(--role-cons); }
.auth-user-info { flex: 1; min-width: 0; }
.auth-user-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-user-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.auth-role-badge { font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.auth-role-gerente { background: var(--accent-soft); color: var(--accent); }
.auth-role-gerente_geral { background: var(--role-gerente-soft); color: var(--role-gerente); }
.auth-role-supervisor_comercial { background: var(--role-sup-soft); color: var(--role-sup); }
.auth-role-consultor_comercial { background: var(--role-cons-soft); color: var(--role-cons); }
.auth-section-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 10px; }
.auth-empty-state { padding: 32px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); font-size: 13px; }

.auth-btn-super { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px 16px; background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); border-radius: var(--radius-md); color: var(--accent); font-size: .875rem; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; transition: background .15s, box-shadow .15s; }
.auth-btn-super:hover { background: color-mix(in oklch, var(--accent) 18%, transparent); box-shadow: var(--shadow-sm); }
.auth-field-label { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.auth-btn-logar { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 11px 16px; background: var(--primary); border: none; border-radius: var(--radius-md); color: var(--primary-foreground); font-size: .9375rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity .15s, box-shadow .15s; }
.auth-btn-logar:hover { opacity: .88; box-shadow: var(--shadow-sm); }

/* err.html */
.auth-err-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); max-width: 440px; width: 100%; padding: 40px 34px; text-align: center; box-shadow: var(--shadow-xl); }
.auth-err-icon { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-size: 30px; }
.auth-err-code { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.auth-err-title { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: var(--text); }
.auth-err-msg { font-size: 14.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 26px; }
.auth-err-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.auth-err-brand { margin-top: 28px; font-size: 11px; color: var(--text-muted); opacity: .8; }

@media (max-width: 480px) {
  .auth-otp-box { width: 40px; height: 50px; font-size: 19px; }
  .auth-card, .auth-dev-card { padding: 24px; }
  .auth-topbar { padding: 0 16px; }
  .auth-page { padding: 28px 16px; }
}

/* ============================================================
   Insights (bloco v3-02, T10) — card "precisa de você hoje" + página Comercial → Insights.
   Molde: Pendências do Gestor-360 (templates/dashboard/_pendencias.html + theme.css:1577-1632),
   desenho aprovado no protótipo `planejamento/v3/blocos/v3-02-painel-re-m1/prototipo/`
   (comercial-painel.html / comercial-insights.html). Só tokens — nenhuma cor literal aqui.
   ============================================================ */
.rp-table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.rp-vh-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.rp-vh-title { font-size: 13px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.rp-vh-title i { color: var(--accent); }
.rp-pend-card { border-left: 3px solid var(--warning); margin-bottom: 20px; }
.rp-hdr-amber { background: var(--warning-soft); border-bottom: 1px solid color-mix(in oklch, var(--warning) 35%, var(--border)); }
.rp-hdr-amber.fechado { border-bottom: none; }
.rp-pend-toggle { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); text-align: left; min-height: 32px; }
.rp-pend-toggle > span, .rp-pend-toggle > i { flex-shrink: 0; }
.rp-pend-toggle .rp-pend-icone { color: var(--warning); }
.rp-chev { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: transform .18s, background .13s; }
.rp-chev i { font-size: 12px; }
.fechado .rp-chev { transform: rotate(-90deg); }
.rp-vh-data { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rp-pend-resumo { font-size: 12px; color: var(--text-muted); font-weight: 500; display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fechado .rp-pend-resumo { display: inline; }
.rp-pend-head-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fechado + .rp-card-body { display: none; }
.rp-pend-card .rp-card-body { padding: 0; }
.rp-grp-label { padding: 8px 16px 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.rp-grp-label .rp-grp-n { color: var(--text); font-variant-numeric: tabular-nums; }
.rp-grp-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface-3); padding: 1px 6px; border-radius: 99px; margin-left: 6px; }
.rp-list-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.rp-list-row:last-child { border-bottom: none; }
.rp-list-row:hover { background: var(--surface-2); }
.rp-list-main { min-width: 0; flex: 1; }
.rp-pend-row { min-height: 48px; }
.rp-list-title { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-pend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rp-pend-dot.critico { background: var(--error); }
.rp-pend-dot.atencao { background: var(--warning); }
.rp-pend-dot.sugestao { background: var(--info); }
.rp-pend-dot.info { background: var(--text-muted); }
.rp-pend-prazo { font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rp-pend-prazo.critico { color: var(--error); }
.rp-pend-prazo.atencao { color: var(--warning); }
.rp-pend-prazo.sugestao, .rp-pend-prazo.info { color: var(--text-muted); }
.rp-pend-valor { min-width: 84px; text-align: right; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rp-pend-valor small { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 3px; }
.rp-pend-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rp-pend-acoes form, .ins-actions form { display: inline-flex; margin: 0; }
.rp-btn-act { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; font-family: inherit; }
.rp-btn-act i { font-size: 10px; }
.rp-btn-act:hover { background: var(--surface-2); color: var(--text); }
.rp-btn-act.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.rp-btn-act.primary:hover { filter: brightness(1.08); color: var(--primary-foreground); }
.rp-btn-act.ghost { border-color: transparent; color: var(--text-muted); padding: 5px 7px; }
.rp-btn-act.ghost:hover { background: var(--surface-2); color: var(--text); }
.rp-btn-act:disabled { opacity: .55; cursor: wait; }
.rp-empty-ok { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; color: var(--success); font-size: 13.5px; font-weight: 600; }
.rp-card-more { display: block; padding: 9px 16px; font-size: 12px; font-weight: 600; color: var(--link); text-decoration: none; border-top: 1px solid var(--border); text-align: center; }
.rp-card-more:hover { background: var(--surface-2); color: var(--link-hover); }
@media (max-width: 720px) {
  .rp-vh-header { flex-wrap: wrap; }
  .rp-pend-toggle { flex-basis: 100%; }
  .rp-pend-head-end { width: 100%; justify-content: flex-end; }
  .fechado .rp-pend-resumo { display: none; }
  .rp-list-row { flex-wrap: wrap; }
  .rp-pend-valor { min-width: 0; }
  .rp-pend-acoes { width: 100%; justify-content: flex-end; }
  .rp-list-title, .rp-list-sub { white-space: normal; }
}

/* Rê — resumo do dia e fala por insight */
.pn-re { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.pn-re-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.pn-re-corpo { flex: 1; min-width: 0; }
.pn-re-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pn-re-text { font-size: 13.5px; color: var(--text); line-height: 1.5; margin-top: 4px; white-space: pre-line; }
.pn-re-text.sub { font-size: 12.5px; color: var(--text-sub); }
.pn-re-say { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-sub); line-height: 1.5; background: var(--surface-2); border-radius: var(--radius-md); padding: 9px 11px; }
.pn-re-say > span:last-child { white-space: pre-line; }
.pn-re-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; object-fit: cover; margin-top: 1px; }

/* Página Comercial → Insights */
.ins-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ins-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ins-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.ins-seg a { white-space: nowrap; padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.ins-seg a:hover { color: var(--text); background: var(--surface-3); }
.ins-seg a.active { background: var(--accent); color: var(--primary-foreground); }
.ins-meta { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ins-row { border-bottom: 1px solid var(--border); }
.ins-row:last-child { border-bottom: 0; }
.ins-row summary { list-style: none; cursor: pointer; }
.ins-row summary::-webkit-details-marker { display: none; }
.ins-row .rp-list-row { border-bottom: 0; }
.ins-row[open] .rp-list-row { background: var(--surface-2); }
.ins-body { padding: 4px 16px 14px 36px; display: flex; flex-direction: column; gap: 10px; }
.ins-fact { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; }
.ins-fact b { color: var(--text); font-variant-numeric: tabular-nums; }
.ins-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ins-spacer { flex: 1; }
.ins-rodape { font-size: 11px; color: var(--text-muted); }
.ins-rodape code, .ins-calc code { font-size: 11px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.ins-hist .rp-list-row { padding: 8px 16px; }
.ins-hist .rp-list-title { font-weight: 500; color: var(--text-sub); white-space: normal; }
.ins-calc-lista { padding: 12px 16px 12px 34px; margin: 0; font-size: 12.5px; color: var(--text-sub); line-height: 1.6; list-style: disc; }
.ins-calc-lista li + li { margin-top: 4px; }

/* ── Quadro "post-it" (etapa Testes, 2026-09-27 — pesquisa: Todoist/Things/Google Keep/Notion callout/Linear
   inbox: 1 sinal de cor + 1 frase + 1 ação por nota; "como calculamos" escondido atrás de 1 clique). ── */
.ins-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.ins-legend b { font-variant-numeric: tabular-nums; color: var(--text); }
.ins-legend .rp-pend-dot { margin-right: 2px; }
.ins-filtrar { position: relative; }
.ins-filtrar > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 6px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ins-filtrar > summary::-webkit-details-marker { display: none; }
.ins-filtrar[open] > summary { color: var(--text); border-color: var(--accent); }
.ins-filtrar-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; width: 240px; }
.ins-filtrar-pop .ins-seg { display: flex; flex-direction: column; background: none; border: 0; }
.ins-filtrar-pop .ins-seg a { border-radius: 6px; }

.ins-board { column-count: 4; column-gap: 14px; }
@media (max-width: 1400px) { .ins-board { column-count: 3; } }
@media (max-width: 1000px) { .ins-board { column-count: 2; } }
@media (max-width: 640px)  { .ins-board { column-count: 1; } }

.ins-note { break-inside: avoid; margin: 0 0 14px; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,32,.06), 0 3px 8px rgba(15,23,32,.07); transition: transform .15s, box-shadow .15s; }
.ins-note:hover, .ins-note[open] { box-shadow: 0 6px 18px rgba(15,23,32,.12); }
.ins-note.critico  { background: color-mix(in oklch, var(--error) 9%, var(--surface)); }
.ins-note.atencao  { background: color-mix(in oklch, var(--warning) 11%, var(--surface)); }
.ins-note.sugestao { background: color-mix(in oklch, var(--info) 8%, var(--surface)); }
.ins-note.info     { background: var(--surface-2); }
.ins-note summary { list-style: none; cursor: pointer; padding: 14px 15px 12px; }
.ins-note summary::-webkit-details-marker { display: none; }
.ins-note-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.ins-note-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.ins-note-more { margin-left: auto; color: var(--text-muted); font-size: 13px; line-height: 1; }
.ins-note h3 { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.35; margin: 0 0 5px; }
.ins-note-txt { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; margin: 0 0 10px; }
.ins-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ins-note-foot .rp-pend-valor { font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 0; }
/* Ação dentro da nota fechada: texto-link, nunca um botão preenchido (a nota é lembrete, não formulário) */
.ins-note-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--primary); background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: none; font-family: inherit; }
.ins-note-link:hover { text-decoration: underline; }
.ins-note-foot form, .rp-bubble-acoes form { display: contents; }
.ins-note .ins-body { padding: 0 15px 14px; margin-top: -2px; }
.ins-note-simple { padding: 14px 15px; }
.ins-note-simple .ins-note-txt { margin-bottom: 0; }

/* Balões de conversa (card compacto de Insights, partials/insights_card.html — 2026-09-27, Danilo: "como se fosse
   alguém falando com o usuário"). 1 linha por insight (texto já em 1ª pessoa, escrito pela Rê); "..." expande até
   2 linhas + a ação — nunca mais que isso, pra não virar de novo uma lista administrativa. */
.rp-bubble-list { display: flex; flex-direction: column; gap: 6px; }
.rp-bubble-item summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.rp-bubble-item summary::-webkit-details-marker { display: none; }
.rp-bubble-item[open] summary { margin-bottom: 2px; }
.rp-bubble-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 9px; }
.rp-bubble-dot.critico  { background: var(--error); }
.rp-bubble-dot.atencao  { background: var(--warning); }
.rp-bubble-dot.sugestao { background: var(--info); }
.rp-bubble-dot.info     { background: var(--text-muted); }
.rp-bubble-balao { min-width: 0; flex: 1; position: relative; background: var(--surface-2); border: 1px solid transparent; border-radius: 13px 13px 13px 4px; padding: 6px 13px; }
.rp-bubble-balao.critico { border-color: color-mix(in oklch, var(--error) 32%, transparent); }
.rp-bubble-balao.atencao { border-color: color-mix(in oklch, var(--warning) 32%, transparent); }
.rp-bubble-txt { display: block; font-size: 12.5px; color: var(--text); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-bubble-item[open] .rp-bubble-balao { border-radius: 13px; }
.rp-bubble-more { flex-shrink: 0; color: var(--text-muted); font-size: 12px; margin-top: 8px; transition: color .13s; }
.rp-bubble-item:hover .rp-bubble-more, .rp-bubble-item[open] .rp-bubble-more { color: var(--accent); }
.rp-bubble-exp { margin: 0 0 2px 15px; background: var(--surface-2); border-radius: 4px 13px 13px 13px; padding: 8px 13px 10px; }
.rp-bubble-exp p { font-size: 12px; color: var(--text-sub); line-height: 1.5; margin: 0 0 6px; }
.rp-bubble-exp p:last-of-type { margin-bottom: 8px; }
.rp-bubble-acoes { display: flex; align-items: center; gap: 10px; }
.rp-bubble-acoes .rp-pend-valor { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: auto; }

/* Aviso "módulo em desenvolvimento" + sugestão (partials/aviso_beta.html, 2026-09-27) — canto superior direito DO
   CONTEÚDO da página (não flutua sobre o header/abas — empurra o resto pra baixo); some com F5 se o usuário fechar
   (localStorage por origem). */
.rp-beta-aviso { position: relative; max-width: 300px; margin: 0 0 14px auto; background: var(--warning-soft); border: 1px solid color-mix(in oklch, var(--warning) 30%, transparent); border-radius: var(--radius-md); padding: 10px 30px 10px 12px; box-shadow: var(--shadow-sm); }
.rp-beta-aviso p { font-size: 12px; line-height: 1.5; color: var(--text); margin: 0; }
.rp-beta-aviso p > i { color: var(--warning); margin-right: 3px; }
.rp-beta-aviso a { color: var(--primary); font-weight: 700; text-decoration: none; }
.rp-beta-aviso a:hover { text-decoration: underline; }
.rp-beta-fechar { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px 5px; border-radius: 6px; font-size: 11px; line-height: 1; }
.rp-beta-fechar:hover { background: rgba(0,0,0,.08); color: var(--text); }
@media (max-width: 720px) { .rp-beta-aviso { max-width: none; margin-left: 0; } }

/* Painel do Marketing (só redes, v3-02 T12) e KPI de Tráfego Pago — protótipo marketing-painel.html */
.mk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.mk-kpis .rp-kpi-delta { max-width: 100%; white-space: normal; line-height: 1.35; }
.mk-2col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .mk-2col { grid-template-columns: 1fr; } }
.mk-2col > * { min-width: 0; }
.mk-bloco { margin-bottom: 16px; }
.mk-tabela { overflow-x: auto; padding-top: 8px; }
.mk-nota { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.pn-table { width: 100%; border-collapse: collapse; }
.pn-table th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pn-table td { font-size: 13px; color: var(--text-sub); padding: 9px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.pn-table tr:last-child td { border-bottom: 0; }
.pn-table td.n, .pn-table th.n { text-align: right; }
.pn-table td.name { font-weight: 600; color: var(--text); }
.pn-table td.muted, .pn-table .muted { color: var(--text-muted); font-weight: 400; }
.pn-delta { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; margin-left: 4px; }
.pn-delta.up { background: var(--success-soft); color: var(--success); }
.pn-delta.down { background: var(--error-soft); color: var(--error); }
.pn-delta.flat { background: var(--surface-3); color: var(--text-muted); }
.mk-soon { border: 1px dashed var(--border-2); border-radius: var(--radius-lg); padding: 18px; color: var(--text-muted); font-size: 12.5px; line-height: 1.6; background: var(--surface-2); }
.mk-soon b { color: var(--text); }

/* Comparativo entre polos (2026-09-27) -- abas via radio+label (sem JS), desenho da social media parceira
   (Gyovanna) aplicado ao dado que já temos hoje (sem nota 0-100 / criativo vencedor, que dependem do sync por
   publicação do v3-03). */
.mk-comp-radio { position: absolute; opacity: 0; pointer-events: none; }
.mk-comp-tab { display: inline-flex; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; margin-right: 6px; transition: background .13s, color .13s; }
.mk-comp-tab:hover { color: var(--text); }
.mk-comp-radio:checked + .mk-comp-tab { background: var(--primary); color: var(--primary-foreground); }
.mk-comp-radio:focus-visible + .mk-comp-tab { outline: 2px solid var(--primary); outline-offset: 1px; }
.mk-comp-panels { margin-top: 14px; }
.mk-comp-panel { display: none; flex-direction: column; gap: 10px; }
/* Linha empilhada (2026-09-27, 2ª rodada) -- nome numa linha própria acima da barra: a versão em grade
   (nome | barra | valor) cortava nomes de polo no meio da palavra por causa da coluna de largura fixa. */
.mk-comp-row { display: flex; flex-direction: column; gap: 5px; }
.mk-comp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mk-comp-label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-comp-label small { font-weight: 400; color: var(--text-muted); }
.mk-comp-bar { display: block; width: 100%; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mk-comp-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.mk-comp-val { font-size: 12.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; }
#mk-comp-seguidores:checked ~ .mk-comp-panels [data-panel="seguidores"],
#mk-comp-alcance:checked ~ .mk-comp-panels [data-panel="alcance"],
#mk-comp-visitas:checked ~ .mk-comp-panels [data-panel="visitas"],
#mk-comp-novos:checked ~ .mk-comp-panels [data-panel="novos"] { display: flex; }
.mk-tabela-toggle summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); list-style: none; }
.mk-tabela-toggle summary::-webkit-details-marker { display: none; }
.mk-tabela-toggle[open] summary { margin-bottom: 10px; }

/* Seletor de conta -- Minhas Redes (2026-09-27): 1 botão (foto real da conta ativa, já buscada hoje pro selo
   do Instagram -- nenhuma chamada nova à Meta) que abre um menu com as contas (iniciais coloridas, sem buscar
   foto de cada uma). Mesmo mecanismo de `rpToggleDropdown`/`.rp-open` que "Meus Polos" já usa no cabeçalho.
   Pesquisa: padrão "account switcher" (Slack, Metricool "brand switching", exemplo do shadcn). */
.rn-switch { position: relative; display: inline-block; }
.rn-switch-btn {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-family: inherit;
  transition: border-color .15s, box-shadow .15s; max-width: 320px;
}
.rn-switch-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rn-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--white);
}
.rn-avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.rn-avatar.ig { background: linear-gradient(135deg, var(--ig-1) 0%, var(--ig-2) 50%, var(--ig-3) 100%); }
.rn-avatar.off { background: var(--text-muted); }
.rn-switch-text { min-width: 0; text-align: left; }
.rn-switch-text strong { display: block; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-switch-text small { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-switch-btn > i { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.rn-switch-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-dropdown); width: 300px; max-height: 360px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, visibility .15s, transform .15s;
}
.rn-switch-dropdown.rp-open { opacity: 1; visibility: visible; transform: translateY(0); }
.rn-switch-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  cursor: pointer; transition: background .12s;
}
.rn-switch-item:hover { background: var(--surface-2); }
.rn-switch-item.active { background: var(--accent-soft); }
.rn-switch-item .rn-check { margin-left: auto; color: var(--accent); font-size: 12px; flex-shrink: 0; }
@media (max-width: 480px) {
  .rn-switch-btn { max-width: 220px; }
  .rn-switch-dropdown { width: 260px; }
}

/* Marketing → Conexão (2026-09-27) -- painel de saúde das contas, mockup aprovado pelo Danilo em
   planejamento/v3/blocos/v3-02-painel-re-m1/prototipo/conexao-v1.html. */
.cx-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cx-title { font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.cx-fb-linha { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.cx-fb-linha i { color: var(--fb); }
.cx-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.cx-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.cx-info { flex: 1; min-width: 0; }
.cx-info strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.cx-info span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cx-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cx-card.err { border-color: color-mix(in oklch, var(--error) 35%, var(--border)); }
.cx-err-msg { margin: -6px 0 0 58px; padding: 0 0 2px; font-size: 12px; color: var(--error); }
.cx-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 1.5px dashed var(--border-2); border-radius: var(--radius-lg); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s; }
.cx-add:hover { border-color: var(--accent); color: var(--accent); }
.cx-empty { text-align: center; padding: 48px 24px; }
.cx-empty i { font-size: 30px; color: var(--fb); margin-bottom: 14px; display: block; }
.cx-avatar-wrap { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.cx-avatar-wrap .rn-avatar { width: 44px; height: 44px; }
.cx-badges { position: absolute; bottom: -3px; right: -6px; display: flex; gap: 2px; }
.cx-badge { width: 19px; height: 19px; border-radius: 50%; border: 2.5px solid var(--surface); display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--white); }
.cx-badge.ig { background: linear-gradient(135deg, var(--ig-1), var(--ig-2), var(--ig-3)); }
.cx-badge.fb { background: var(--fb); }
@media (max-width: 560px) {
  .cx-card { flex-wrap: wrap; row-gap: 10px; }
  .cx-actions { flex-basis: 100%; justify-content: space-between; }
}
