/* ============================================================================
   RM FORNECEDORES — Design System v2
   Mobile-first · Premium · Microanimações · Microdetalhes
   ============================================================================ */

/* ------------------------------------------------------------------ Tokens */

:root {
  color-scheme: light;          /* controles nativos (scrollbar, select, autofill) em modo claro */

  /* Bloco #157 — Tokens de microanimação. Antes: 8 easings diferentes + durações em ms/s misturados.
     Agora: 4 durações semânticas + 3 easings. Auditoria contou 199 transitions/animations em 27 keyframes. */
  --dur-instant: .12s;          /* feedback imediato (checkbox, ripple) */
  --dur-quick:   .15s;          /* padrão pra hover, focus, color change */
  --dur-normal:  .25s;          /* entry de cards, slide pequeno */
  --dur-slow:    .4s;           /* fade-in de modal, scale up */
  --ease-out-quick: cubic-bezier(0.4, 0, 0.2, 1);     /* hover, transitions rápidas */
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* entry de modal/card (overshoot leve) */
  --ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);   /* hero/spotlight (curva mais expressiva) */

  /* Surfaces (warm, premium grays) */
  --bg:           #FAFAF9;
  --surface:      #FFFFFF;
  --surface-2:    #F5F5F4;
  --surface-3:    #EDEDEC;
  --border:       #E7E5E4;
  --border-strong:#D6D3D1;
  --hairline:     rgba(0, 0, 0, 0.06);

  /* Ink — Bloco #244: bumpou text-soft pra atender WCAG AA (#A8A29E falhava 2.8:1, agora 4.7:1) */
  --text:         #0C0A09;
  --text-2:       #292524;
  --text-muted:   #78716C;
  --text-soft:    #6B6661;

  /* Brand — vermelho RM #E10600 é a marca primária INEGOCIÁVEL.
     Bloco #244: brand-ring subiu de 18% pra 28% (foco visual percebido). */
  --brand:        #E10600;
  --brand-hover:  #B80500;
  --brand-soft:   #FEF1F0;
  --brand-ring:   rgba(225, 6, 0, 0.28);

  /* Semantic — Bloco #244: paleta repensada pra coerência com brand quente e WCAG.
     - danger: trocado red-600 (#DC2626) por red-500 (#EF4444) — agora distinguível do --brand puro
     - warning: trocado amber-600 (#D97706) por amber-500 (#F59E0B) — mais vivo, casa com vermelho RM
     - info: trocado blue-600 frio (#2563EB) por sky-500 (#0EA5E9) — temperatura mais próxima da marca */
  --success:      #16A34A;
  --success-soft: #DCFCE7;
  --warning:      #F59E0B;
  --warning-soft: #FEF3C7;
  --danger:       #EF4444;
  --danger-soft:  #FEE2E2;
  --info:         #0EA5E9;
  --info-soft:    #E0F2FE;

  /* Bloco #124 — Tokens unificados RM
     Antes: 3 tons de roxo (#7C3AED, #7c3aed, #6d28d9), vermelho #E11932 só em feedback público
            e STATUS_META hex duplicado 4× em views (show, pipeline, kanban). Centralizado aqui.

     Bloco #244 — DECISÃO DE MARCA: roxo é ACCENT (secundário), nunca brand primário.
     Use --brand (vermelho RM) pra qualquer CTA/header/primary; --accent pra acessórios visuais
     (Criativo design, badges Admin, decorativos). Se você se pegar pensando "vou usar --brand-purple
     pra destacar isso" → pare. Use --brand. Roxo é tinta de acabamento, não fundamento. */
  --brand-red:          #E10600;  /* alias de --brand pra clareza semântica */
  --accent:             #7c3aed;  /* alias preferencial; brand-purple-* mantidos por compat */
  --accent-deep:        #6d28d9;
  --accent-soft:        #ede9fe;
  --accent-light:       #a855f7;
  --brand-purple:       #7c3aed;  /* deprecated — use --accent */
  --brand-purple-deep:  #6d28d9;  /* deprecated — use --accent-deep */
  --brand-purple-soft:  #ede9fe;  /* deprecated — use --accent-soft */
  --brand-purple-light: #a855f7;  /* deprecated — use --accent-light */

  /* Temperatura do lead (CRM funil) */
  --funil-hot:   #DC2626;
  --funil-warm:  #D97706;
  --funil-cold:  #2563EB;

  /* Status palette das propostas (10 status do Proposta::STATUS) — fonte ÚNICA */
  --status-rascunho:     #6b7280;
  --status-solicitada:   #2563EB;
  --status-em-producao:  #a16207;
  --status-em-aprovacao: #7c3aed;
  --status-recebida:     #a855f7;
  --status-enviada:      #0891b2;
  --status-em-revisao:   #D97706;
  --status-aprovada:     #059669;
  --status-reprovada:    #DC2626;
  --status-arquivada:    #9CA3AF;

  /* Status palette de campanhas (5 status) */
  --camp-planejamento: #9CA3AF;
  --camp-aprovada:     #2563EB;
  --camp-em-execucao:  #D97706;
  --camp-concluida:    #16A34A;
  --camp-cancelada:    #DC2626;

  /* Spacing scale (8pt grid with 4 micro) */
  --s-px: 1px; --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 72px;

  /* Radius (more precise — premium feel) */
  --r-1: 4px;  --r-2: 6px;  --r:    8px;  --r-3: 10px;
  --r-4: 12px; --r-5: 16px; --r-full: 9999px;

  /* Elevation (multi-layer shadows = depth) */
  --shadow-1: 0 1px 2px rgba(12, 10, 9, 0.04), 0 1px 1px rgba(12, 10, 9, 0.03);
  --shadow-2: 0 4px 8px -2px rgba(12, 10, 9, 0.06), 0 2px 4px -2px rgba(12, 10, 9, 0.04);
  --shadow-3: 0 12px 24px -8px rgba(12, 10, 9, 0.10), 0 4px 8px -4px rgba(12, 10, 9, 0.06);
  --shadow-4: 0 24px 48px -12px rgba(12, 10, 9, 0.16), 0 8px 16px -8px rgba(12, 10, 9, 0.08);
  --shadow-pop: 0 32px 64px -24px rgba(12, 10, 9, 0.24);

  /* Motion */
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --d-fast:       120ms;
  --d:            200ms;
  --d-slow:       350ms;
  --d-page:       500ms;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* Z-layers */
  --z-base: 1;
  --z-sticky: 50;
  --z-drawer: 80;
  --z-modal: 100;
  --z-toast: 200;

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;           /* inputs/scrollbar/select nativos em modo escuro */
  --bg:           #0C0A09;
  --surface:      #161513;
  --surface-2:    #1C1A18;
  --surface-3:    #25221E;
  --border:       #2C2924;
  --border-strong:#3D3934;
  --hairline:     rgba(255, 255, 255, 0.06);

  /* Bloco #244 — Dark mode: bump em text-muted/soft pra hierarquia visível em telas escuras.
     Antes #A8A29E + #78716C eram quase iguais → muted/soft indistinguíveis no dark. */
  --text:         #FAFAF9;
  --text-2:       #E7E5E4;
  --text-muted:   #B8B4B0;
  --text-soft:    #8B8580;

  --brand-soft:   #2A0707;
  --success-soft: #052E16;
  --warning-soft: #2A1907;
  --danger-soft:  #2A0606;
  --info-soft:    #0F1B36;
  --accent-soft:  #1A0A2E;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------- Reset */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }

/* Âncoras (#id) não ficam mais escondidas atrás da topbar fixa ao saltar via link interno. */
:target { scroll-margin-top: calc(var(--topbar-h) + var(--s-4)); }

/* O atributo [hidden] sempre vence regras de display dos componentes.
   Evita bugs recorrentes (ex.: botão "Remover" e popups que apareciam mesmo com hidden). */
[hidden] { display: none !important; }

/* Form controls — base ciente do tema. Sem isso, inputs sem classe usam o branco
   padrão do navegador e quebram no dark. Regras de componente (.wizard-select etc.)
   têm mais especificidade e continuam mandando. Em light, --surface = branco (sem mudança). */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=submit]):not([type=button]):not([type=image]),
textarea,
select {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
input::placeholder, textarea::placeholder { color: var(--text-soft); }

/* Estados de interação base (hover/disabled) — consistência premium mesmo em controles
   sem classe de componente. Regras de componente (.filter-group, .wizard-select…) têm
   mais especificidade e continuam mandando onde já definem hover/focus próprios. */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=submit]):not([type=button]):not([type=image]):hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus) { border-color: var(--border-strong); }

input:disabled, textarea:disabled, select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: var(--surface-2);
}

/* Botão nativo do <input type=file> — sem isto, o navegador desenha um botão cinza-claro
   que destoa do tema (gritante no dark). Agora segue o design system em claro e escuro. */
input[type=file] {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
input[type=file]::file-selector-button,
input[type=file]::-webkit-file-upload-button {
  font: inherit;
  margin-right: var(--s-3);
  padding: 8px 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
}
input[type=file]::file-selector-button:hover {
  border-color: var(--text);
  background: var(--surface-2);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
}

/* ----- A11y: skip link (visível só com keyboard focus) ----- */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 999999;
  padding: 10px 16px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--r-2);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 150ms var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--surface);
  outline-offset: 2px;
}

/* ----- A11y: respeita prefers-reduced-motion (corta animações pra quem precisa) ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3 { letter-spacing: -0.02em; }

::selection { background: var(--brand); color: white; }

/* Custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

a { color: inherit; text-decoration: none; transition: color var(--d-fast) var(--ease); }
a:hover { color: var(--brand); }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

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

/* ----------------------------------------------------------------- Layout */

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 1024px) {
  .app-shell { grid-template-columns: var(--sidebar-w) 1fr; }
}

/* ----------------------------------------------------------------- Sidebar (desktop drawer / mobile drawer) */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 320px;
  z-index: var(--z-drawer);
  transform: translateX(-100%);
  transition: transform var(--d-slow) var(--ease-out);
  overflow-y: auto;
  padding-bottom: calc(var(--s-5) + var(--safe-bottom));
}
.sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-4); }

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    transform: none;
    width: var(--sidebar-w);
    max-width: none;
    height: 100vh;
    box-shadow: none;
  }
  .sidebar-backdrop { display: none !important; }
}

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(12, 10, 9, 0.4);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-drawer) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d) var(--ease);
}
.sidebar-backdrop.is-open { opacity: 1; pointer-events: all; }

/* Brand */
.brand {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-2) var(--s-3);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--text), #2A2625);
  color: var(--surface);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.08);
}
.brand-mark.large { width: 56px; height: 56px; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; font-weight: 700; letter-spacing: -0.015em; }
.brand-text small { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Nav */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--d-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.nav a svg { opacity: 0.6; flex-shrink: 0; transition: opacity var(--d-fast) var(--ease); }
.nav a::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height var(--d) var(--ease-spring);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:hover svg { opacity: 1; }
.nav a:active { transform: scale(0.98); }
.nav a.is-active {
  background: var(--text);
  color: var(--surface);
}
.nav a.is-active::before { height: 60%; }
.nav a.is-active svg { opacity: 1; }

.nav-section {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft);
  padding: var(--s-4) 12px var(--s-2);
}

/* Sidebar foot */
.sidebar-foot { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--border); }
.user-card {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r);
  margin-bottom: var(--s-3);
  transition: background var(--d-fast) var(--ease);
}
.user-card:hover { background: var(--surface-3); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--text), #2A2625);
  color: var(--surface);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}
.user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.user-info strong {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-pill {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: var(--r-1);
  text-transform: uppercase; letter-spacing: 0.04em;
  width: fit-content;
}
.role-admin       { background: var(--text); color: var(--surface); }
/* Bloco #328 — Líder do setor: visual distinto do admin (brand RM) pra não confundir. */
.role-lider       { background: var(--brand); color: var(--on-brand, #fff); }
.role-gestor      { background: var(--brand); color: white; }
.role-operacional { background: var(--info); color: white; }
.role-visualizador{ background: var(--surface-3); color: var(--text-muted); }

.sidebar-actions { display: flex; gap: var(--s-1); }
.ghost-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--text-2);             /* mais escuro */
  font-size: 12.5px;
  font-weight: 500;
  flex: 1;
  transition: all var(--d-fast) var(--ease);
  border: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.ghost-btn:active { transform: scale(0.97); }

/* ----------------------------------------------------------------- Main / Topbar */

.main {
  display: flex; flex-direction: column;
  min-width: 0;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}
@media (min-width: 1024px) { .main { padding-bottom: 0; } }

.topbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(250, 250, 249, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  min-height: var(--topbar-h);
  padding-top: calc(var(--s-3) + var(--safe-top));
}
[data-theme="dark"] .topbar { background: rgba(12, 10, 9, 0.78); }

@media (min-width: 1024px) {
  .topbar { padding: var(--s-4) var(--s-7); padding-top: var(--s-4); }
}

.menu-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r);
  color: var(--text);
  transition: background var(--d-fast) var(--ease);
}
.menu-btn:hover { background: var(--surface-2); }
.menu-btn:active { transform: scale(0.94); }
@media (min-width: 1024px) { .menu-btn { display: none; } }

.page-title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 768px) { .page-title { font-size: 22px; } }

.topbar-actions { display: flex; gap: var(--s-2); align-items: center; }

.search {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  width: 100%;
  max-width: 240px;
  transition: all var(--d-fast) var(--ease);
}
.search:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.search svg { color: var(--text-soft); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px; min-width: 0; }
@media (min-width: 768px) { .search { max-width: 320px; } }

/* ----------------------------------------------------------------- Content */

.content {
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-5);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  animation: fade-up var(--d-page) var(--ease-out);
}
@media (min-width: 768px) { .content { padding: var(--s-6); gap: var(--s-6); } }
@media (min-width: 1024px) { .content { padding: var(--s-7); gap: var(--s-6); } }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------- Bottom Nav (mobile) */

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
  z-index: var(--z-sticky);
  padding-bottom: var(--safe-bottom);
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
}
[data-theme="dark"] .bottom-nav { background: rgba(22, 21, 19, 0.92); }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: var(--s-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  position: relative;
  transition: color var(--d-fast) var(--ease);
}
.bottom-nav a svg { width: 22px; height: 22px; opacity: 0.7; transition: all var(--d) var(--ease-spring); }
.bottom-nav a:active { transform: scale(0.92); }
.bottom-nav a.is-active { color: var(--brand); }
.bottom-nav a.is-active svg { opacity: 1; transform: scale(1.08) translateY(-1px); }
.bottom-nav a.is-active::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  width: 24px; height: 3px;
  background: var(--brand);
  border-radius: 0 0 var(--r-1) var(--r-1);
  transform: translateX(-50%);
  animation: indicator-in var(--d-slow) var(--ease-spring);
}
@keyframes indicator-in {
  from { transform: translateX(-50%) scaleX(0); }
  to   { transform: translateX(-50%) scaleX(1); }
}

/* ----------------------------------------------------------------- KPI Grid */

/* Bloco #128 — Dashboard "Meu Dia" (extraído do <style> embarcado em dashboard.php).
   Hex hardcoded substituídos por tokens (--brand-purple-deep, --danger, --warning, --success). */
.meu-dia-card { margin-bottom: var(--s-4); padding: 16px 20px; background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--brand-purple-deep) 2%, transparent) 100%); border: 1px solid var(--border); border-radius: var(--r-4); }
.meu-dia-head h2 { margin: 0 0 2px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.meu-dia-head p { margin: 0; font-size: 12px; color: var(--text-muted); }
.meu-dia-papel { background: color-mix(in srgb, var(--brand-purple-deep) 12%, transparent); color: var(--brand-purple-deep); padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.meu-dia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
.meu-dia-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease; }
.meu-dia-stat:hover { transform: translateY(-2px); border-color: var(--brand-purple-deep); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand-purple-deep) 20%, transparent); }
.meu-dia-stat-ico { font-size: 18px; line-height: 1; }
.meu-dia-stat-val { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.meu-dia-stat-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.meu-dia-stat--urgent { border-left: 3px solid var(--danger); }
.meu-dia-stat--urgent .meu-dia-stat-val { color: var(--danger); }
.meu-dia-stat--warn { border-left: 3px solid var(--warning); }
.meu-dia-stat--warn .meu-dia-stat-val { color: var(--warning); }
.meu-dia-stat--info { border-left: 3px solid var(--brand-purple-deep); }
.meu-dia-stat--info .meu-dia-stat-val { color: var(--brand-purple-deep); }
.meu-dia-stat--ok { border-left: 3px solid var(--success); }
.meu-dia-stat--ok .meu-dia-stat-val { color: var(--success); }

/* Bloco #128 — Novidades link (CSS substitui onmouseover/onmouseout inline em dashboard.php) */
.novidade-link { display:flex; align-items:center; gap:10px; padding:8px 12px; border:1px solid; border-left-width:3px; border-radius:var(--r-2); text-decoration:none; color:inherit; font-size:13px; transition: transform .12s ease; }
.novidade-link:hover { transform: translateX(2px); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
@media (min-width: 640px)  { .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
/* auto-fit (não 6 fixas) — evita cards estreitos demais que cortam valores grandes (R$, milhares) */
@media (min-width: 1024px) { .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }

.kpi {
  /* Bloco #125 — variável --accent permite unificar visual com .forn-kpi (barra lateral 3px). */
  --accent: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  /* Bloco #54 — padding s-5→s-4 (18→14px) e gap s-3→s-2 deixa o card 30% mais compacto */
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
  transition: all var(--d) var(--ease);
  position: relative;
  overflow: hidden;
  animation: kpi-in var(--d-slow) var(--ease-out) both;
  /* min-height 96→78px — ainda confortável pro toque, sem inflar quando há pouco texto */
  min-height: 78px;
}
/* Bloco #125 — barra lateral colorida igual .forn-kpi (linha 5085). Unifica visual. */
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .9; }
.kpi:nth-child(1) { animation-delay: 0ms; }
.kpi:nth-child(2) { animation-delay: 30ms; }
.kpi:nth-child(3) { animation-delay: 60ms; }
.kpi:nth-child(4) { animation-delay: 90ms; }
.kpi:nth-child(5) { animation-delay: 120ms; }
.kpi:nth-child(6) { animation-delay: 150ms; }
.kpi:nth-child(7) { animation-delay: 180ms; }
@keyframes kpi-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.kpi:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}
.kpi::after {
  content: '';
  position: absolute; top: 0; right: 0; width: 60px; height: 60px;
  background: radial-gradient(circle at top right, var(--brand-soft), transparent 70%);
  opacity: 0;
  transition: opacity var(--d) var(--ease);
  pointer-events: none;
}
.kpi:hover::after { opacity: 1; }

.kpi.wide { grid-column: 1 / -1; }
/* Bloco #125 — variantes setam --accent (a barra lateral herda). Match com forn-kpi. */
.kpi.accent      { --accent: var(--brand);   border-color: var(--brand); }
.kpi.accent .kpi-value { color: var(--brand); }
.kpi.danger      { --accent: var(--danger);  border-color: var(--danger); }
.kpi.danger .kpi-value { color: var(--danger); }
/* Pendências: campo sem nada faltando = estado "resolvido" (verde, discreto) */
.kpi-ok          { --accent: var(--success); }
.kpi-ok .kpi-value { color: var(--text-soft); }
.kpi-ok .kpi-sub { color: var(--success); font-weight: 600; }
/* Bloco #125 — variantes BEM (alinhamento com forn-kpi--ok/warn/accent/base/danger) */
.kpi--base   { --accent: var(--text-soft); }
.kpi--ok     { --accent: var(--success); }
.kpi--warn   { --accent: var(--warning); }
.kpi--accent { --accent: var(--brand); }
.kpi--danger { --accent: var(--danger); }
.kpi--info   { --accent: var(--info); }

.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi-value {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;   /* valores grandes quebram em vez de cortar */
}
.kpi-value-lg {
  font-size: 36px; font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .kpi-value { font-size: 24px; }
  .kpi-value-lg { font-size: 48px; }
}
.kpi-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 4px; }

/* ----------------------------------------------------------------- Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  overflow: hidden;
  transition: border-color var(--d) var(--ease);
}
.card.no-pad { padding: 0; }
.card:hover { border-color: var(--border-strong); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--surface), var(--bg) 200%);
}
.card-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.link-muted {
  color: var(--text-2);            /* mais escuro pra ser legível */
  font-size: 12px;
  font-weight: 500;
  transition: color var(--d-fast) var(--ease);
  white-space: nowrap;
}
.link-muted:hover { color: var(--brand); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ----------------------------------------------------------------- Tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  padding: 12px var(--s-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  position: sticky;
  top: 0;
  height: 38px;
}
.table tbody td {
  padding: 10px var(--s-4);
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  height: 56px;                         /* altura uniforme — evita variação por ícones */
  transition: background var(--d-fast) var(--ease);
  color: var(--text);
  line-height: 1.35;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
/* acento sutil na esquerda da linha em hover — sem deslocar layout (box-shadow inset) */
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-size: 12px;
  padding-left: var(--s-2);
  padding-right: var(--s-2);
  white-space: nowrap;
  width: 1%;                              /* shrink-to-fit — ocupa só o necessário */
}
.table thead th.num { font-size: 10px; padding-left: var(--s-2); padding-right: var(--s-2); width: 1%; }
.table .muted { color: var(--text-muted); font-size: 12.5px; }
.table .actions { text-align: right; padding-right: var(--s-3); white-space: nowrap; }
.table-compact td { padding: 8px var(--s-4); }
.table-compact thead th { padding: 8px var(--s-4); }

.cell-strong { font-weight: 600; color: var(--text); transition: color var(--d-fast) var(--ease); letter-spacing: -0.005em; }
.cell-strong:hover { color: var(--brand); }
.cell-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 3px; line-height: 1.4; }

/* Célula vazia — visualmente recuada pra não competir com dados reais */
.td-empty {
  color: var(--text-soft);
  font-weight: 400;
  opacity: 0.5;
  user-select: none;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-2);
  color: var(--text-2);            /* mais escuro */
  background: var(--surface-2);    /* fundo sutil sempre — vira "botão" visual */
  border: 1px solid var(--border);
  transition: all var(--d-fast) var(--ease);
}
.icon-btn:hover {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
  transform: scale(1.05);
}
.icon-btn:active { transform: scale(0.92); }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: var(--s-9) var(--s-5) !important;
  font-size: 13px;
  line-height: 1.6;
  background: linear-gradient(180deg, var(--bg), transparent);
}
.empty::before {
  content: '';
  display: block;
  width: 32px; height: 32px;
  margin: 0 auto var(--s-3);
  background-color: var(--text-soft);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

/* ----------------------------------------------------------------- Pills & badges */

.status-pill, .tier, .quality, .margem {
  display: inline-flex; align-items: center;
  padding: 4px 10px;                /* +1px vertical, +2px horizontal */
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.3;
  /* anel interno na própria cor → borda nítida que adapta a claro/escuro (toque premium) */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 12%, transparent);
  transition: all var(--d-fast) var(--ease);
}
/* pílulas são RÓTULOS, não botões — sem "pulo" no hover (afordância falsa + jitter na tabela) */

.status-prospectar  { background: var(--surface-2); color: var(--text-muted); }
.status-contatado   { background: var(--info-soft); color: var(--info); }
.status-negociando  { background: var(--warning-soft); color: var(--warning); }
.status-aprovado    { background: var(--success-soft); color: var(--success); }
.status-ativo       { background: var(--success); color: white; }
.status-em-execucao { background: var(--info); color: white; }
.status-pausado     { background: var(--surface-2); color: var(--text-soft); }
.status-blacklist   { background: var(--brand); color: white; }
.status-planejamento{ background: var(--surface-3); color: var(--text-2); }
.status-concluida   { background: var(--success); color: white; }
.status-cancelada   { background: var(--text-soft); color: white; }

/* Clientes (CRM) — alinhado às cores do funil */
.status-prospeccao  { background: var(--info-soft); color: var(--info); }
.status-inativo     { background: var(--surface-2); color: var(--text-soft); }
.status-perdido     { background: var(--brand); color: white; }

/* Pipeline de propostas — alinhado às cores do topo das colunas do kanban */
.status-solicitada  { background: var(--surface-2); color: var(--text-muted); }
.status-em-producao { background: var(--info-soft); color: var(--info); }
.status-recebida    { background: var(--info-soft); color: var(--info); }
.status-enviada     { background: var(--warning-soft); color: var(--warning); }
.status-em-revisao  { background: var(--warning-soft); color: var(--warning); }
.status-aprovada    { background: var(--success); color: white; }
.status-reprovada   { background: var(--brand); color: white; }
.status-arquivada   { background: var(--surface-2); color: var(--text-soft); }

.tier-mega   { background: var(--text); color: var(--surface); }
.tier-macro  { background: var(--brand); color: white; }
.tier-mid    { background: #EA580C; color: white; }
.tier-micro  { background: var(--warning-soft); color: var(--warning); }
.tier-nano   { background: var(--surface-2); color: var(--text-muted); }
.tier---     { background: transparent; color: var(--text-soft); }

.quality-validado       { background: var(--success); color: white; }
.quality-histórico-ok   { background: var(--success-soft); color: var(--success); }
.quality-sem-histórico  { background: var(--surface-2); color: var(--text-muted); }
.quality-promissor      { background: var(--info-soft); color: var(--info); }
.quality-risco          { background: var(--warning); color: white; }
.quality-blacklist      { background: var(--brand); color: white; }
.quality-bom            { background: var(--success-soft); color: var(--success); }
.quality-excelente      { background: var(--success); color: white; }
.quality-ruim           { background: var(--brand); color: white; }
.quality-médio          { background: var(--warning-soft); color: var(--warning); }

.margem { font-variant-numeric: tabular-nums; }
.margem-excelente { background: var(--success); color: white; }
.margem-bom       { background: var(--success-soft); color: var(--success); }
.margem-marginal  { background: var(--warning-soft); color: var(--warning); }
.margem-zero      { background: var(--surface-2); color: var(--text-muted); }
.margem-prejuizo  { background: var(--brand); color: white; }

/* ----------------------------------------------------------------- Forms */

.filters {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}
.filter-group { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: stretch; }
.filter-group input:not([type=checkbox]):not([type=radio]),
.filter-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13px;
  outline: 0;
  transition: all var(--d-fast) var(--ease);
  height: 38px;                      /* altura uniforme em todos */
  line-height: 1;
  color: var(--text);
}
.filter-group input:not([type=checkbox]):not([type=radio]) { flex: 1; min-width: 200px; }
.filter-group select { min-width: 140px; flex: 1; cursor: pointer; }
.filter-group input::placeholder { color: var(--text-soft); }
.filter-group input:not([type=checkbox]):not([type=radio]):focus,
.filter-group select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
/* Checkbox do filtro (ex.: "Só validados") — tamanho natural, não estica como input de texto */
.filter-group .filtro-check { flex: 0 0 auto; cursor: pointer; }
.filter-group input[type=checkbox],
.filter-group input[type=radio] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--brand, #E10600);
  cursor: pointer;
}

.filter-actions {
  display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap;
  padding-top: var(--s-2);
  border-top: 1px solid var(--hairline);
}
.filter-actions .right { margin-left: auto; }

/* ----------------------------------------------------------------- Buttons */

.btn-primary {
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--s-2);
  transition: all var(--d-fast) var(--ease);
  letter-spacing: -0.005em;
  position: relative;
  isolation: isolate;             /* cria stacking context isolado */
  overflow: hidden;
  border: 1px solid var(--text);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--brand);
  transform: translateY(100%);
  transition: transform var(--d) var(--ease-out);
  z-index: -1;                    /* ::before fica ATRÁS do texto, mesmo sem wrapper */
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover { color: white; border-color: var(--brand); box-shadow: var(--shadow-3); transform: translateY(-1px); }
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.btn-primary.block { width: 100%; justify-content: center; padding: 12px; }

.btn-ghost {
  background: var(--surface);
  color: var(--text);                          /* preto sólido em repouso (era cinza fraco) */
  border: 1.5px solid var(--border-strong);     /* border mais grossa e visível */
  border-radius: var(--r);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;                             /* peso 600 (era 500) */
  display: inline-flex; align-items: center; gap: var(--s-2);
  transition: all var(--d-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.005em;
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.btn-ghost:active { transform: translateY(0) scale(0.97); }
.btn-ghost.danger {
  color: var(--danger);                         /* já vermelho em repouso */
  border-color: rgba(220, 38, 38, 0.35);
}
.btn-ghost.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Estado desabilitado — antes um botão off ficava idêntico ao ativo (confuso).
   Agora comunica claramente que não é clicável, sem o lift/ripple do hover. */
.btn-primary:disabled, .btn-primary[disabled], .btn-primary[aria-disabled="true"],
.btn-ghost:disabled,   .btn-ghost[disabled],   .btn-ghost[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary:disabled:hover, .btn-primary[disabled]:hover,
.btn-ghost:disabled:hover,   .btn-ghost[disabled]:hover {
  transform: none;
  box-shadow: none;
  background: var(--surface);
}
.btn-primary:disabled:hover { color: var(--surface); border-color: var(--text); background: var(--text); }
.btn-primary:disabled:hover::before { transform: translateY(100%); }
.btn-ghost:disabled:hover { color: var(--text); border-color: var(--border-strong); }

/* ----------------------------------------------------------------- Detail */

.detail-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--s-2);
}
.detail-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.link-back {
  font-size: 12.5px; color: var(--text-2);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: var(--s-1);
  margin-bottom: var(--s-3);
  transition: color var(--d-fast) var(--ease);
  text-decoration: none;
}
.link-back:hover { color: var(--brand); }
.detail-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: var(--s-3);
  line-height: 1.1;
}
@media (min-width: 768px) { .detail-title { font-size: 32px; } }
.detail-meta {
  display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center;
  margin-top: var(--s-1);
}

.dl {
  display: grid;
  grid-template-columns: 1fr;
  padding: var(--s-2) 0;
  gap: 0;
}
.dl > dt, .dl > dd {
  padding: 12px var(--s-5);
  border-top: 1px solid var(--hairline);
}
.dl > dt:nth-of-type(1), .dl > dd:nth-of-type(1) { border-top: 0; }
@media (min-width: 480px) {
  .dl {
    grid-template-columns: 160px 1fr;
    gap: 0;
  }
  .dl > dt { padding-right: 0; }
  .dl > dd { padding-left: var(--s-4); }
}
.dl dt {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: center;
}
.dl dd {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.dl dd.strong { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.dl dd a {
  color: var(--info);
  border-bottom: 1px dashed transparent;
  transition: border-color var(--d-fast) var(--ease);
}
.dl dd a:hover { border-bottom-color: var(--info); color: var(--info); }
.dl dd small { color: var(--text-soft); font-size: 11px; }

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  padding: var(--s-5);
}
@media (min-width: 640px) { .score-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .score-grid { grid-template-columns: repeat(6, 1fr); } }

.score-cell {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: var(--s-4);
  background: var(--surface-2);
  border-radius: var(--r);
  transition: all var(--d) var(--ease-spring);
}
.score-cell:hover { background: var(--surface-3); transform: translateY(-2px); }
.score-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.score-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.score-value.has-value { color: var(--text); }

.obs { padding: var(--s-5); color: var(--text); line-height: 1.65; }

/* ----------------------------------------------------------------- Forms detail */

.form-grid { display: flex; flex-direction: column; gap: var(--s-5); }
.form-row { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--hairline); }
.form-row:last-child { border-bottom: 0; }
.form-row.two { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.form-row.scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (min-width: 640px) { .form-row.scores { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .form-row.scores { grid-template-columns: repeat(6, 1fr); } }

.form-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--text-2); font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.form-row label > span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.form-row input,
.form-row select,
form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: 0;
  transition: all var(--d-fast) var(--ease);
  width: 100%;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  height: 40px;
}
form textarea { height: auto; }
.form-row label > small { text-transform: none; letter-spacing: normal; color: var(--text-soft); font-weight: 400; font-size: 11px; }
form textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}
.form-row input:focus,
.form-row select:focus,
form textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-row input::placeholder,
form textarea::placeholder { color: var(--text-soft); }

.form-actions {
  display: flex; justify-content: flex-end; gap: var(--s-2);
  padding-top: var(--s-2);
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------- Result summary / pagination */

.result-summary {
  font-size: 12.5px; color: var(--text-muted);
  display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center;
  padding: var(--s-2) var(--s-1);
}
.result-summary strong { color: var(--text); font-weight: 700; font-size: 14px; }

.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a {
  display: grid; place-items: center;
  min-width: 32px; height: 32px;
  padding: 0 10px;
  border-radius: var(--r-2);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--d-fast) var(--ease);
}
.pagination a:hover { border-color: var(--text); color: var(--text); transform: translateY(-1px); }
.pagination a.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }
.pagination span { display: grid; place-items: center; height: 32px; padding: 0 10px; color: var(--text-muted); }

/* ----------------------------------------------------------------- Empty state */

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  padding: var(--s-9) var(--s-5);
  text-align: center;
}
.empty-state h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ----------------------------------------------------------------- Auth / Login */

.login-body {
  background:
    radial-gradient(80% 50% at 50% 0%, var(--brand-soft), transparent 60%),
    radial-gradient(60% 40% at 100% 100%, rgba(225, 6, 0, 0.04), transparent 70%),
    var(--bg);
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: var(--s-4);
}
.login-shell { width: 100%; max-width: 420px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-7);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: var(--s-5);
  animation: card-in var(--d-page) var(--ease-spring);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.login-brand strong { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.login-brand small { font-size: 12px; color: var(--text-muted); }

.login-error {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--brand);
  animation: shake var(--d-slow) var(--ease);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.login-form { display: flex; flex-direction: column; gap: var(--s-4); }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.login-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  transition: all var(--d-fast) var(--ease);
}
.login-form input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--brand-ring); }

.login-help { margin-top: var(--s-2); }
.login-help summary { cursor: pointer; font-size: 12px; color: var(--text-muted); padding: var(--s-2) 0; }
.login-help summary:hover { color: var(--text); }
.creds { width: 100%; border-collapse: collapse; margin-top: var(--s-2); font-size: 12px; }
.creds th { text-align: left; padding: 4px 8px; color: var(--text-muted); font-weight: 600; }
.creds td { padding: 4px 8px; border-top: 1px solid var(--border); }
.creds code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
  font-size: 11px;
}
.muted-tiny { color: var(--text-soft); font-size: 11px; margin-top: var(--s-2); }

/* ----------------------------------------------------------------- Contact bar */

.contact-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3);
}

.contact-chip {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  transition: all var(--d-fast) var(--ease);
  min-width: 0;
}
.contact-chip:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.contact-chip svg { flex-shrink: 0; opacity: 0.85; }
.contact-chip .chip-label {
  font-size: 10px; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}
.contact-chip strong {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.contact-chip > div, .contact-chip > svg + div { min-width: 0; flex: 1; }
.contact-chip.wa { border-left: 3px solid #25D366; }
.contact-chip.wa:hover { border-color: #25D366; }
.contact-chip.wa svg { color: #25D366; }
.contact-chip.email { border-left: 3px solid var(--info); }
.contact-chip.email:hover { border-color: var(--info); }
.contact-chip.email svg { color: var(--info); }
.contact-chip.link { border-left: 3px solid var(--brand); }
.contact-chip.link:hover { border-color: var(--brand); }
.contact-chip.link svg { color: var(--brand); }
.contact-chip.alt { border-left: 3px solid var(--text-soft); cursor: default; }
.contact-chip.alt:hover { transform: none; box-shadow: none; }

/* Empty state: slot vazio com CTA pra preencher */
.contact-chip.empty {
  border-style: dashed;
  border-left-style: solid;
  background: var(--surface-2);
  opacity: 0.7;
}
.contact-chip.empty svg { opacity: 0.4; }
.contact-chip.empty strong {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  font-style: italic;
}
.contact-chip.empty:hover {
  opacity: 1;
  border-style: solid;
  background: var(--surface);
}
.contact-chip.empty:hover svg { opacity: 0.85; }
.contact-chip.empty:hover strong { color: var(--brand); font-weight: 600; }

/* Auto-wrap inner span */
.contact-chip { flex-wrap: wrap; }
.contact-chip > svg { align-self: center; }
.contact-chip > .chip-label { width: 100%; margin-left: 28px; margin-bottom: -6px; }
.contact-chip > strong { width: 100%; margin-left: 28px; }
@media (min-width: 480px) {
  .contact-chip > .chip-label { width: auto; margin: 0; }
  .contact-chip > strong { width: auto; margin: 0; flex: 1; }
}

/* ============================================================================
   DASHBOARD HERO + INSIGHTS + HEALTH RING
   ============================================================================ */

.dash-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-5);
  /* Bloco #54 — padding reduzido (s-7=28px → s-5=18px) pra ganhar densidade */
  padding: var(--s-5) var(--s-6);
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in oklch, var(--brand) 8%, var(--surface)), var(--surface)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  align-items: center;
}
@container (max-width: 600px) { .dash-hero { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .dash-hero { grid-template-columns: 1fr; padding: var(--s-4); gap: var(--s-3); } }
.dash-hero-text { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.dash-greeting {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dash-headline {
  /* Bloco #54 — headline ligeiramente mais compacta (32px → 26px max) */
  font-size: clamp(18px, 2.1vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}
.dash-headline strong { color: var(--brand); font-variant-numeric: tabular-nums; }
.dash-sub {
  color: var(--text-muted);
  font-size: 13px;
  display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center;
}
.hero-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in oklch, var(--success) 15%, transparent);
  color: var(--success);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-weight: 600; font-size: 12px;
  animation: hero-pulse 2s ease-in-out infinite;
}
@keyframes hero-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--success) 30%, transparent); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

.dash-hero-health {
  display: flex; align-items: center; gap: var(--s-3);
}
.health-ring {
  --health: 0;
  position: relative;
  /* Bloco #54 — donut menor (88→68) pra hero mais compacto */
  width: 68px; height: 68px;
}
.health-ring .health-num { font-size: 14px !important; }
.dash-hero-health .health-label { font-size: 10.5px; line-height: 1.2; }
.health-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.health-ring circle {
  fill: none;
  stroke-width: 8;
}
.health-ring .health-bg { stroke: color-mix(in oklch, var(--border-strong) 60%, transparent); }
.health-ring .health-fg {
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: calc(264 - (264 * var(--health) / 100));
  transition: stroke-dashoffset 1.2s var(--ease-out);
  filter: drop-shadow(0 0 8px color-mix(in oklch, var(--brand) 40%, transparent));
}
.health-num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.health-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

/* ============== Insights cards ============== */

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-4);
}
.insight-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  text-decoration: none;
  color: inherit;
  transition: all var(--d) var(--ease-spring);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.insight-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, var(--insight-glow, transparent), transparent 50%);
  opacity: 0.6;
  z-index: -1;
}
.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
  border-color: var(--insight-color, var(--text));
}
.insight-card.insight-critical { --insight-color: var(--danger); --insight-glow: color-mix(in oklch, var(--danger) 12%, transparent); }
.insight-card.insight-warning  { --insight-color: var(--warning); --insight-glow: color-mix(in oklch, var(--warning) 12%, transparent); }
.insight-card.insight-success  { --insight-color: var(--success); --insight-glow: color-mix(in oklch, var(--success) 12%, transparent); }
.insight-card.insight-info     { --insight-color: var(--info); --insight-glow: color-mix(in oklch, var(--info) 12%, transparent); }
.insight-icon {
  font-size: 28px;
  line-height: 1;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: color-mix(in oklch, var(--insight-color, var(--brand)) 12%, transparent);
  border-radius: var(--r-3);
  flex-shrink: 0;
}
.insight-body h3 {
  font-size: 14px; font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.insight-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--s-2);
}
.insight-cta {
  font-size: 12px; font-weight: 700;
  color: var(--insight-color, var(--brand));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============== Dashboard grid (cards: health/top/cobertura/atividade) ============== */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 768px) { .dash-grid { grid-template-columns: 1fr 1fr; } }

/* Health bars */
.health-bars { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.health-bar-row {
  --pct: 0%;
  display: grid;
  grid-template-columns: 100px 1fr 44px;
  align-items: center; gap: var(--s-3);
}
.health-bar-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.health-bar-track {
  height: 8px; background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.health-bar-fill {
  width: var(--pct);
  height: 100%;
  background: linear-gradient(90deg,
    color-mix(in oklch, var(--brand) 70%, var(--warning)),
    var(--brand));
  border-radius: var(--r-full);
  transition: width 1s var(--ease-out);
}
.health-bar-row:has(.health-bar-pct:not(:empty))[style*="--pct: 100%"] .health-bar-fill,
.health-bar-row[style*="--pct: 9"] .health-bar-fill { background: var(--success); }
.health-bar-pct { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--text-muted); }

/* Health bar clicável (link pra /pendencias) */
.health-bar-row.is-clickable {
  text-decoration: none;
  color: inherit;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--r-2);
  cursor: pointer;
  grid-template-columns: 100px 1fr 44px 76px;
  transition: background var(--d-fast) var(--ease);
}
.health-bar-row.is-clickable:hover {
  background: var(--surface-2);
}
.health-bar-row.is-clickable:hover .health-bar-label { color: var(--brand); }
.health-bar-cta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: right;
  white-space: nowrap;
  transition: transform var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.health-bar-cta-ok { color: var(--success); font-weight: 500; }
.health-bar-row.is-clickable:hover .health-bar-cta:not(.health-bar-cta-ok) {
  color: var(--brand);
  transform: translateX(2px);
}

/* Ranking list (top prioridade) */
.ranking-list { display: flex; flex-direction: column; }
.ranking-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: inherit;
  transition: background var(--d-fast) var(--ease);
}
.ranking-item:last-child { border-bottom: 0; }
.ranking-item:hover { background: var(--surface-2); }
.ranking-num {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: var(--text);
  color: var(--surface);
  font-size: 11px; font-weight: 700;
}
.ranking-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ranking-body strong { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-meta { font-size: 11.5px; color: var(--text-muted); }
.ranking-roi { display: flex; flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.2; }
.ranking-roi strong { font-size: 14px; color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking-roi small { font-size: 9.5px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* Cobertura por categoria */
.cobertura-list { padding: var(--s-3); display: flex; flex-direction: column; gap: 2px; }
.cobertura-row {
  --pct: 0%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r);
  text-decoration: none; color: inherit;
  transition: background var(--d-fast) var(--ease);
  position: relative;
}
.cobertura-row:hover { background: var(--surface-2); }
.cobertura-label { font-size: 13px; font-weight: 500; color: var(--text); }
.cobertura-qtd { font-size: 13px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.cobertura-bar-track {
  grid-column: 1 / -1;
  height: 4px; background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.cobertura-bar-fill {
  width: var(--pct);
  height: 100%;
  background: color-mix(in oklch, var(--brand) 80%, transparent);
  border-radius: var(--r-full);
  transition: width 1s var(--ease-out);
}

/* Activity list */
.activity-list { list-style: none; padding: var(--s-3) 0; }
.activity-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--s-3);
  padding: 10px var(--s-5);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all var(--d-fast) var(--ease);
}
.activity-item:hover { border-left-color: var(--brand); background: var(--surface-2); }
.activity-item.muted { color: var(--text-muted); border-left: 0; }
.activity-time {
  color: var(--text-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: right;
  align-self: center;
}
.activity-text { color: var(--text-2); line-height: 1.45; }
.activity-text strong { color: var(--text); font-weight: 700; }
.activity-text a { color: var(--info); border-bottom: 1px dashed transparent; }
.activity-text a:hover { border-bottom-color: var(--info); }

/* ============================================================================
   MODAL SYSTEM — usa <dialog> nativo + glass backdrop
   ============================================================================ */

dialog.modal {
  position: fixed;
  inset: 0;
  margin: auto;                          /* centraliza no viewport */
  border: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-5);
  box-shadow: var(--shadow-pop);
  width: min(640px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: hidden;
  flex-direction: column;
}
dialog.modal[open] { display: flex; }      /* fixa display:flex só quando aberto */
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop {
  background: color-mix(in oklch, black 50%, transparent);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
}
dialog.modal[open] {
  animation: modal-in var(--d-slow) var(--ease-spring);
}
dialog.modal[open]::backdrop {
  animation: backdrop-in var(--d) ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-in {
  from { opacity: 0; } to { opacity: 1; }
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
}
.modal-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; text-transform: none; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 0;
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
}
.modal-close:hover { background: var(--text); color: var(--surface); transform: rotate(90deg); }
.modal-body {
  padding: var(--s-5);
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
}

/* Modal em modo wizard — maior, com sections internas */
dialog.modal.modal-wizard { width: min(820px, calc(100vw - 32px)); }
.modal-wizard .modal-head {
  align-items: flex-start;
  padding: var(--s-5) var(--s-5) var(--s-4);
}
.modal-wizard .modal-head h2 {
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.modal-wizard .modal-body { padding: 0; }
.modal-wizard .modal-foot {
  padding: var(--s-3) var(--s-5);
}
.modal-wizard .modal-foot .btn-primary,
.modal-wizard .modal-foot .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px;
}
@media (max-width: 640px) {
  .modal-wizard .modal-head h2 { font-size: 16px; }
  .modal-wizard .modal-foot .btn-primary,
  .modal-wizard .modal-foot .btn-ghost { flex: 1; justify-content: center; }
}

/* ----- Canais: empty state + footer ----- */
.canais-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-5) var(--s-6);
  text-align: center;
}
.canais-empty-icon {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: var(--s-1);
}
.canais-empty h3 {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.canais-empty p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 0 var(--s-2);
}
.canais-empty .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  font-size: 14px;
}

/* ----- Canal row (repetível dentro do modal de adicionar canais) ----- */
.canal-row {
  border-bottom: 1px solid var(--hairline, var(--border));
  background: var(--surface);
  transition: background var(--d-fast) var(--ease);
}
.canal-row + .canal-row { border-top: 1px solid var(--hairline, var(--border)); }

.canal-row-head {
  display: flex; align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  user-select: none;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline, var(--border));
  transition: background var(--d-fast) var(--ease);
}
.canal-row-head:hover { background: var(--surface-3); }
.canal-row.collapsed .canal-row-head { border-bottom: 0; background: var(--surface); }

.canal-row-num {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: white;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.canal-row-summary {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canal-row-summary strong {
  font-weight: 700;
  color: var(--text);
}
.canal-row-summary .muted-tiny {
  color: var(--text-soft);
  font-weight: 400;
}

.canal-row-toggle,
.canal-row-remove {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
  flex-shrink: 0;
}
.canal-row-toggle:hover { background: var(--surface); color: var(--text); }
.canal-row-remove {
  color: var(--danger);
}
.canal-row-remove:hover { background: var(--danger-soft); }
.canal-row-toggle svg { transition: transform var(--d) var(--ease); }
.canal-row.collapsed .canal-row-toggle svg { transform: rotate(-90deg); }

.canal-row-body {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height var(--d-slow) var(--ease), padding var(--d) var(--ease), opacity var(--d) var(--ease);
  opacity: 1;
}
.canal-row.collapsed .canal-row-body {
  max-height: 0;
  opacity: 0;
}

.canal-row-section {
  padding: var(--s-3) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--hairline, var(--border));
}
.canal-row-section:last-child { border-bottom: 0; }
.canal-row-section-label {
  display: block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--s-2);
}
.canal-row-section-label small {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-soft);
}

/* Pills mais compactas dentro do canal-row */
.canal-row .platform-pills {
  padding: 0;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.canal-row .platform-pill { min-height: 60px; padding: var(--s-2); }
.canal-row .platform-pill-label { font-size: 11.5px; }

.canal-row .wizard-grid {
  padding: 0;
  gap: var(--s-3);
  border-bottom: 0;
}

/* "+ Adicionar mais um canal" */
.canais-add-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--surface-2);
}
.btn-add-canal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-3);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
}
.btn-add-canal:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.btn-add-canal:active { transform: scale(0.97); }
.canais-add-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

.canais-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--hairline);
  background: linear-gradient(to bottom, var(--surface), var(--surface-2));
  flex-wrap: wrap;
}
.canais-footer-hint {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1; min-width: 0;
}
.canais-footer .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  font-size: 13.5px;
}
@media (max-width: 540px) {
  .canais-footer { justify-content: stretch; }
  .canais-footer-hint { flex: 1 1 100%; }
  .canais-footer .btn-primary { flex: 1; justify-content: center; }
}
@media (max-width: 640px) {
  dialog.modal {
    max-width: 100vw;
    width: 100%;
    border-radius: var(--r-5) var(--r-5) 0 0;
    margin: auto 0 0 0;
    max-height: 85vh;
  }
  dialog.modal[open] { animation: modal-in-sheet var(--d-slow) var(--ease-spring); }
  @keyframes modal-in-sheet {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
}

/* ============================================================================
   Wizard (criação fornecedor) — Mobile-first, responsivo, UI premium
   ============================================================================ */

/* Container geral: limita largura para conforto de leitura, centraliza */
.wizard-form { max-width: 760px; margin: 0 auto; padding-bottom: 120px; }
@media (min-width: 640px) { .wizard-form { padding-bottom: var(--s-7); } }

/* ----- Hero do wizard ----- */
.wizard-hero {
  max-width: 760px;
  margin: 0 auto var(--s-4);
  padding: var(--s-2) 0 var(--s-4);
}
.wizard-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-2);
  margin-bottom: var(--s-3);
  transition: all var(--d-fast) var(--ease);
}
.wizard-back:hover { color: var(--text); background: var(--surface-2); }
.wizard-step-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-2);
}
.wizard-title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 6px;
}
.wizard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 60ch;
}

/* ----- Progress bar ----- */
.wizard-progress {
  max-width: 760px;
  margin: 0 auto var(--s-5);
  padding: var(--s-3) 0;
}
.wizard-progress ol {
  list-style: none;
  display: flex; gap: 0; align-items: center;
  padding: 0; margin: 0;
}
.wizard-progress li {
  flex: 1;
  display: flex; align-items: center; gap: var(--s-2);
  position: relative;
  padding: var(--s-2) 0;
  min-width: 0;
}
.wizard-progress li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 var(--s-2);
  border-radius: 1px;
  transition: background var(--d) var(--ease);
}
.wizard-progress li.done:not(:last-child)::after,
.wizard-progress li.current:not(:last-child)::after {
  background: linear-gradient(to right, var(--brand) 0%, var(--brand) 50%, var(--border) 50%);
}
.wizard-progress li.done:not(:last-child)::after { background: var(--brand); }

.wizard-progress .num {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  transition: all var(--d) var(--ease);
}
.wizard-progress li.done .num {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.wizard-progress li.current .num {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px var(--brand-ring);
  animation: wizard-pulse 2s ease-in-out infinite;
}
@keyframes wizard-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-ring); }
  50%      { box-shadow: 0 0 0 7px color-mix(in oklch, var(--brand) 8%, transparent); }
}
.wizard-progress .lbl {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;          /* não encolhe: rótulo aparece inteiro (não trunca em "Identid...") */
  white-space: nowrap;
}
.wizard-progress .lbl-short { display: none; }
.wizard-progress li.done .lbl,
.wizard-progress li.current .lbl { color: var(--text); }

@media (max-width: 540px) {
  .wizard-progress .lbl-full  { display: none; }
  .wizard-progress .lbl-short { display: inline; }
  .wizard-progress .num { width: 28px; height: 28px; font-size: 12px; }
}
@media (max-width: 380px) {
  .wizard-progress .lbl { display: none; }
}

/* ----- Section (card semântico do wizard) ----- */
.wizard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s-4);
  overflow: hidden;
  transition: box-shadow var(--d) var(--ease), border-color var(--d) var(--ease);
}
/* Foco no card: realce sutil (sem borda vermelha forte — evita o 1º card "aceso"
   pelo autofocus parecer um estado de erro/inconsistência). */
.wizard-section:focus-within {
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}
.wizard-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
  background: linear-gradient(to bottom, var(--surface-2), var(--surface));
}
.wizard-section-head h2 {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.wizard-section-hint {
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 500;
  text-align: right;
  line-height: 1.3;
}

/* ----- Grid responsivo dentro da section ----- */
.wizard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
}
.wizard-grid:last-child,
.wizard-section > .wizard-field:last-child { border-bottom: 0; }
.wizard-section > .wizard-field {
  display: block;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
}
.wizard-section > .wizard-field:last-child { border-bottom: 0; }

@media (min-width: 640px) {
  .wizard-grid.two   { grid-template-columns: 1fr 1fr; gap: var(--s-4); }
  .wizard-grid.three { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
}

/* ----- Field (label + input agrupado) ----- */
.wizard-field {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.wizard-field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.wizard-field-label em {
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}
.wizard-field-label small {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-soft);
}
/* Categoria travada (Creator) — exibida como chip read-only no lugar do select */
.wizard-locked-chip {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  padding: 8px var(--s-3);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-2);
  background: var(--surface-2, rgba(127,127,127,0.06));
  color: var(--text-2);
  font-size: 13px; font-weight: 600;
}
.wizard-locked-chip svg { color: var(--text-soft); flex: none; }
/* Resumo em tags dos ativos no wizard (visão rápida do multi-ativo) */
.ativos-resumo {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2, rgba(127,127,127,0.06));
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.ativos-resumo-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-right: 2px; }
.ativos-resumo-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text-1);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wizard-field input[type="text"],
.wizard-field input[type="tel"],
.wizard-field input[type="email"],
.wizard-field input[type="url"],
.wizard-field input[type="number"],
.wizard-field .wizard-select,
.wizard-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2);
  transition: all var(--d-fast) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.wizard-field input::placeholder { color: var(--text-soft); }
.wizard-field input:hover,
.wizard-field select:hover { border-color: var(--border-strong); }
.wizard-field input:focus,
.wizard-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
  background: var(--surface);
}
/* Bloco #142 — :invalid só vermelho em campos REQUIRED. Antes: opcionais com pattern
   acionavam :invalid (textarea sem required ficava com borda vermelha quando user digitava
   formato qualquer), confundindo com erro. Agora restringe a [required] explicitamente. */
.wizard-field input[required]:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

/* Validação JS de CPF/CNPJ e telefone (data-mask) — vale em qualquer form */
input.input-invalid,
.wizard-field input.input-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}
.input-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--danger);
}

/* Select com caret custom */
.wizard-select,
.wizard-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.wizard-hint {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  margin-top: 2px;
}

/* ----- Tipo radio cards (Creator / Agência / Agregador) ----- */
.tipo-radios {
  display: grid; grid-template-columns: 1fr; gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
}
@media (min-width: 640px) { .tipo-radios { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); } }

.tipo-radio {
  display: flex; gap: var(--s-3); align-items: center;
  padding: var(--s-3) var(--s-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-3);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--d-fast) var(--ease);
  position: relative;
  min-height: 64px;
}
.tipo-radio:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.tipo-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tipo-radio .tipo-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-2);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: all var(--d-fast) var(--ease);
}
.tipo-radio .tipo-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tipo-radio strong { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.005em; }
.tipo-radio small { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }

.tipo-radio:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px var(--brand-ring);
  transform: translateY(-1px);
}
.tipo-radio:has(input:checked) strong { color: var(--brand); }
.tipo-radio:has(input:checked) .tipo-icon {
  background: var(--brand);
  color: white;
}
.tipo-radio:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ----- Platform pills (step 2) ----- */
.platform-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
}
.platform-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: var(--s-3) var(--s-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-3);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--d-fast) var(--ease);
  min-height: 76px;
  text-align: center;
  position: relative;
}
.platform-pill input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.platform-pill-icon {
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: color var(--d-fast) var(--ease);
}
.platform-pill-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.platform-pill:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.platform-pill:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.platform-pill:has(input:checked) .platform-pill-icon { color: var(--brand); }
.platform-pill:has(input:checked) .platform-pill-label { color: var(--brand); font-weight: 700; }
.platform-pill:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ----- Botões de ação ----- */
.wizard-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: var(--s-5) 0 var(--s-3);
  margin-top: var(--s-2);
}
.wizard-actions .btn-primary,
.wizard-actions .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px; font-weight: 600;
}

/* Mobile: actions stickam no rodapé pra sempre estarem visíveis */
@media (max-width: 640px) {
  .wizard-actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: var(--s-3) var(--s-4) max(var(--s-3), env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-top: 1px solid var(--border);
    z-index: 80;
    margin: 0;
  }
  .wizard-actions .btn-primary,
  .wizard-actions .btn-ghost {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
  .wizard-actions .btn-ghost.danger {
    flex: 0 0 auto;
    padding: 0 12px;
    font-size: 12.5px;
  }
}
@media (max-width: 380px) {
  .wizard-actions .btn-ghost.danger { display: none; }
}

/* Tipo chip (na listagem e detalhe) */
.tipo-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px 1px 7px;
  border-radius: var(--r-full);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.6;
}
/* dot de cor antes do texto — sinaliza o tipo sem gritar */
.tipo-chip::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: none; opacity: 0.9;
}
.tipo-creator   { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.tipo-agência   { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.tipo-agregador,
.tipo-clipadores { background: var(--brand-soft);   color: var(--brand);   border-color: color-mix(in srgb, var(--brand) 22%, transparent); }

/* chip de situação contratual (mostrado no perfil quando há contrato) */
.contrato-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.contrato-ativo   { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.contrato-inativo { background: var(--surface-2);    color: var(--text-muted); border-color: var(--border); }

/* preview do auto-fetch (foto + status) no cadastro de ativo */
.fetch-preview { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.fetch-preview img { flex: none; }

/* ----------------------------------------------------------------- Presenças (canais) */

.presencas-list { display: flex; flex-direction: column; }
.presenca-row {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: var(--s-3);
  transition: background var(--d-fast) var(--ease);
}
.presenca-row:last-child { border-bottom: 0; }
.presenca-row:hover { background: var(--surface-2); }

.presenca-head {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.presenca-plat {
  display: inline-flex; align-items: center;
  background: var(--text); color: var(--surface);
  padding: 4px 10px;
  border-radius: var(--r-2);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.presenca-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.presenca-nicho {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: var(--r-full);
  text-transform: lowercase;
  letter-spacing: 0;
}
.presenca-handle {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.presenca-handle a { color: var(--info); border-bottom: 1px dashed transparent; }
.presenca-handle a:hover { border-bottom-color: var(--info); }
.presenca-actions { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }

.presenca-metrics {
  display: flex; gap: var(--s-4); flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
  padding-left: var(--s-1);
}
.presenca-metrics span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.presenca-metrics strong { color: var(--text); font-weight: 700; font-size: 13.5px; margin-right: 4px; }

/* Chip de plataforma na listagem */
.plat-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-1);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--text-2);
}
.plat-chip strong {
  margin-left: 4px;
  background: color-mix(in srgb, var(--brand, #DC2626) 14%, var(--surface));
  color: var(--brand, #DC2626);
  padding: 0 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}

/* Chip "agregador" — fornecedor que controla múltiplos canais */
.agregador-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand), #FF7A00);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Resumo de canais por plataforma no header do card */
.presenca-summary {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.presenca-summary-item strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

/* ============================================================================
   CHIPS DE CATEGORIA (no topo da listagem)
   ============================================================================ */

.cat-chips {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-1) 0 var(--s-3);
  align-items: center;
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: all var(--d-fast) var(--ease);
  white-space: nowrap;
}
.cat-chip:hover {
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-1px);
}
.cat-chip-qtd {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cat-chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}
.cat-chip.is-active .cat-chip-qtd {
  background: color-mix(in oklch, var(--surface) 25%, transparent);
  color: var(--surface);
}

/* ============================================================================
   HUB /CATEGORIAS — cards grandes com top 3 + cobertura
   ============================================================================ */

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

/* Cards-âncora: anula o `a:hover { color: brand }` global pra texto interno não pintar */
.categoria-card,
.categoria-card:hover,
.categoria-card:focus,
.ranking-item,
.ranking-item:hover,
.ranking-item:focus,
.cobertura-row,
.cobertura-row:hover,
.cobertura-row:focus,
.busca-result-item,
.busca-result-item:hover,
.busca-result-item:focus,
.kanban-card-link,
.kanban-card-link:hover,
.kanban-card-link:focus,
.insight-card,
.insight-card:hover,
.insight-card:focus {
  color: var(--text);
  text-decoration: none;
}
.categoria-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-5);
  transition: all var(--d) var(--ease-spring);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  gap: var(--s-4);
}
.categoria-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 100% 0%, var(--cat-glow, transparent), transparent 60%);
  z-index: -1;
  opacity: 0.5;
}
.categoria-card:hover {
  border-color: var(--cat-color, var(--text));
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}
.categoria-card:hover::before { opacity: 1; }

/* Cores por categoria via :has() */
.categoria-pagina-de-nicho        { --cat-color: var(--info); --cat-glow: color-mix(in oklch, var(--info) 12%, transparent); }
.categoria-influencer-tiktok      { --cat-color: var(--brand); --cat-glow: color-mix(in oklch, var(--brand) 12%, transparent); }
.categoria-criador-capcut         { --cat-color: #8E44AD; --cat-glow: color-mix(in oklch, #8E44AD 12%, transparent); }
.categoria-playlist-de-usuario    { --cat-color: var(--success); --cat-glow: color-mix(in oklch, var(--success) 12%, transparent); }
.categoria-site-blog-de-noticia   { --cat-color: var(--warning); --cat-glow: color-mix(in oklch, var(--warning) 12%, transparent); }
.categoria-clipador               { --cat-color: #EA580C; --cat-glow: color-mix(in oklch, #EA580C 12%, transparent); }

.categoria-head {
  display: flex; align-items: flex-start; gap: var(--s-3);
}
.categoria-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-3);
  display: grid; place-items: center;
  background: color-mix(in oklch, var(--cat-color, var(--brand)) 14%, transparent);
  color: var(--cat-color, var(--brand));
  flex-shrink: 0;
}
.categoria-head h2 {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.015em;
  text-transform: none;
  margin: 0;
}
.categoria-total {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin-top: 2px;
}
.categoria-total small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 6px;
}

.categoria-top {
  list-style: none;
  padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-3);
}
.categoria-top li {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 12.5px;
}
.categoria-top .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--cat-color, var(--text-soft));
  flex-shrink: 0;
}
.categoria-top strong {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.categoria-top small {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
}

.categoria-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  align-items: center;
}
.cobertura-info { display: flex; justify-content: space-between; grid-column: 1 / -1; align-items: baseline; }
.cob-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.cobertura-info strong { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cob-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.cob-fill {
  width: var(--pct);
  height: 100%;
  border-radius: var(--r-full);
  background: var(--cat-color, var(--brand));
  transition: width 1s var(--ease-out);
}

/* ============================================================================
   /categorias — bar comparação · plataformas · nichos · health · sort · print
   ============================================================================ */

.cat-compare-bar {
  display: flex;
  height: 28px;
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.cat-compare-seg {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 10px;
  font-size: 11px; color: white; font-weight: 600;
  background: var(--text);
  text-decoration: none;
  border-right: 2px solid var(--surface);
  transition: filter var(--d-fast) var(--ease);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.cat-compare-seg:last-child { border-right: 0; }
.cat-compare-seg:hover { filter: brightness(1.15); color: white; }
.cat-compare-seg .cat-compare-label { color: white; overflow: hidden; text-overflow: ellipsis; }
/* Cores por categoria — reaproveita semântica */
.cat-seg-pagina-de-nicho     { background: var(--info); }
.cat-seg-influencer-tiktok   { background: var(--brand); }
.cat-seg-criador-capcut      { background: #8E44AD; }
.cat-seg-playlist-de-usuario { background: var(--success); }
.cat-seg-site-blog-de-noticia{ background: var(--warning); }
.cat-seg-clipador            { background: #EA580C; }

/* Sort buttons */
.cat-sort-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 10px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-2);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--d-fast) var(--ease);
}
.cat-sort-btn:hover { border-color: var(--border-strong); }
.cat-sort-btn.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Stats line nos cards */
.categoria-stats-line {
  display: flex; align-items: baseline; gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.categoria-alcance {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Plataformas + nichos */
.categoria-plats {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: var(--s-2);
}
.categoria-plat-chip {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  color: var(--text-2);
}
.categoria-plat-chip strong { color: var(--brand); margin-left: 2px; }

.categoria-nichos {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.categoria-nichos strong {
  color: var(--text-2);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

/* Top 3 reformulado: cada item é link */
.categoria-top {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: var(--s-3);
}
.categoria-top-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.categoria-top ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.categoria-top-link {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  border-radius: var(--r-2);
  text-decoration: none;
  color: inherit;
  transition: background var(--d-fast) var(--ease);
}
.categoria-top-link:hover { background: var(--surface-2); color: inherit; }
.categoria-top-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.categoria-top-info strong { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.categoria-top-info small { font-size: 10.5px; color: var(--text-muted); }

/* Mini health bars */
.health-mini {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: var(--s-2);
}
.health-mini-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.health-mini-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.health-mini-value {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.health-mini-value.health-good { color: var(--success); }
.health-mini-value.health-mid  { color: var(--warning); }
.health-mini-value.health-low  { color: var(--danger); }

.health-mini-bars {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--r-1);
}
.hmb {
  height: 4px;
  border-radius: var(--r-1);
  transition: width 800ms var(--ease-out);
}
.hmb-contato { background: var(--info); }
.hmb-preco   { background: var(--brand); }
.hmb-valid   { background: var(--success); }

.health-mini-legend {
  display: flex; gap: 8px;
  font-size: 9.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.health-mini-legend i.hmd {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
}

/* Print */
@media print {
  .sidebar, .topbar, .bottom-nav, .sidebar-backdrop,
  .cat-controls, .detail-actions, #cat-print-btn,
  .compare-bar, .compare-pill, .skip-link,
  .bug-fab, .bug-panel, .toast, .toast-host { display: none !important; }
  .main { padding: 0 !important; }
  .app-shell { display: block !important; }
  .content { padding: 0 !important; gap: var(--s-4) !important; max-width: none !important; animation: none !important; }
  .categoria-card, .card, .kpi { break-inside: avoid; }
  /* Documento limpo para o cliente: sem sombras/animações, bordas discretas */
  .card, .kpi { box-shadow: none !important; }
  body { background: white !important; color: black !important; }
}

/* ============================================================================
   Lista de fornecedores — bulk + filtros ativos + presets + sortable + sticky
   ============================================================================ */

/* ----- Status chips (quick filter) ----- */
.status-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0;
}
.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--d-fast) var(--ease);
}
.status-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.status-chip.is-active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.status-chip-qtd {
  font-weight: 800;
  font-size: 10.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--r-full);
}
.status-chip.is-active .status-chip-qtd { background: var(--surface); color: var(--text); }

/* ----- Filtros ativos (chips removíveis) ----- */
.active-filters {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: var(--s-2) 0;
  margin-top: -4px;
}
.active-filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--r-full);
  font-size: 11.5px;
  text-decoration: none;
  transition: all var(--d-fast) var(--ease);
}
.active-filter-chip:hover { background: var(--brand); color: white; }
.active-filter-chip strong { font-weight: 700; }
.active-filter-clear {
  font-size: 11px; color: var(--text-muted);
  text-decoration: underline; margin-left: 6px;
}

/* ----- Alcance presets ----- */
.alcance-presets {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: var(--s-2);
}
.ap-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--d-fast) var(--ease);
}
.ap-pill small { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.ap-pill:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ap-pill.is-active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.ap-pill.is-active small { color: var(--surface-3); }

/* ----- Sortable headers + sticky thead ----- */
.table-sortable thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-2);
  border-bottom: 1.5px solid var(--border);
}
.th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  user-select: none;
}
.th-sort:hover { color: var(--brand); }
.sort-icon { opacity: 0.4; transition: opacity var(--d-fast) var(--ease); }
.sort-icon.active { opacity: 1; color: var(--brand); }
.th-sort:hover .sort-icon { opacity: 0.8; }

/* ----- Densidade compact ----- */
.table-list.is-compact th,
.table-list.is-compact td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 12px !important;
}
.table-list.is-compact .cell-with-avatar .rm-avatar {
  width: 24px !important; height: 24px !important; font-size: 10px !important;
}
.table-list.is-compact .cell-sub { display: none; }

/* ----- Inline-edit status (popover) ----- */
.inline-status { cursor: pointer; user-select: none; }
.inline-status:hover { box-shadow: 0 0 0 2px var(--brand-ring); }
.inline-status-pop {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  padding: 6px;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 4px;
  min-width: 140px;
}
/* Esconde o popover quando não acionado — o `display:flex` acima sobrepunha o atributo [hidden]. */
.inline-status-pop[hidden] { display: none; }
.inline-status-opt {
  border: 0; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 11px;
  padding: 4px 10px;
}
.inline-status-opt:hover { transform: scale(1.02); }

/* ----- Bulk actions modal ----- */
.bulk-section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}
.bulk-section-title:first-child { border-top: 0; }
.bulk-section-title.danger { color: var(--danger); }

/* ----- Top Performers: KPI sub, medal, anchor nav ----- */
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.medal-badge {
  display: inline-block;
  font-size: 13px;
  margin-left: 2px;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(250, 204, 21, 0.4));
}
.tp-anchors {
  scrollbar-width: none;
}
.tp-anchors::-webkit-scrollbar { display: none; }
.tp-anchor {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--d-fast) var(--ease);
  white-space: nowrap;
}
.tp-anchor:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}
.tp-anchor:target,
.tp-anchor.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ----- IA status badge (admin/ia) ----- */
.ia-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.ia-status.connected {
  background: var(--success-soft);
  color: var(--success);
}
.ia-status.disconnected {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ----- Empty state genérico (reutilizável em tabelas vazias) ----- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-2);
  padding: var(--s-7) var(--s-5) var(--s-6);
  text-align: center;
}
.empty-state-icon {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-muted);
  margin-bottom: var(--s-1);
}
.empty-state h3 {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 0 var(--s-2);
}
.empty-state .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  font-size: 13.5px;
}
.empty-state-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  justify-content: center; align-items: center;
  margin-top: var(--s-2);
}
.empty-state-actions .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  font-size: 13.5px;
}

/* ----- Card de onboarding (checklist de 1º acesso, data-driven) ----- */
.onb-card {
  position: relative;
  padding: var(--s-5) var(--s-6) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 60%);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.onb-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--brand);
}
.onb-dismiss {
  position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px; line-height: 1;
  display: grid; place-items: center;
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; color: var(--text-muted);
  border-radius: var(--r-2); transition: background .15s, color .15s;
}
.onb-dismiss:hover { background: var(--surface); color: var(--text); }
.onb-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-3);
}
.onb-head-text h2 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 4px; text-transform: none;
}
.onb-head-text p {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; max-width: 64ch;
}
.onb-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.onb-count strong { font-size: 20px; color: var(--brand); font-weight: 800; }
.onb-bar {
  height: 6px; border-radius: 999px; background: var(--border);
  overflow: hidden; margin-bottom: var(--s-4);
}
.onb-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--brand); transition: width .4s ease;
}
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.onb-step {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-3);
  background: var(--surface);
}
.onb-step.is-done { opacity: .72; }
.onb-check {
  flex-shrink: 0; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid var(--border);
}
.onb-step.is-done .onb-check {
  background: var(--success); color: #fff; border-color: var(--success);
}
.onb-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onb-step-text strong { font-size: 14px; font-weight: 600; }
.onb-step.is-done .onb-step-text strong { text-decoration: line-through; }
.onb-step-text small { font-size: 12px; color: var(--text-muted); }
.onb-step-cta {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap;
  background: var(--surface);
}
.onb-step-ok {
  flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--success);
}
@media (max-width: 640px) {
  .onb-step { flex-wrap: wrap; }
  .onb-step-cta { width: 100%; justify-content: center; }
}

/* ----- IA spinner (botões com loading state) ----- */
.ia-spinner {
  display: inline-block;
  vertical-align: middle;
  animation: ia-spin 800ms linear infinite;
  margin-right: 6px;
}
@keyframes ia-spin {
  to { transform: rotate(360deg); }
}
[data-ia-submit][data-loading] {
  pointer-events: none;
  opacity: 0.85;
}
[data-ia-submit] [data-label-loading] {
  display: inline-flex; align-items: center; gap: 4px;
}

/* ----- Toggle Lista/Kanban ----- */
.view-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}
.vt-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--r-1);
  transition: all var(--d-fast) var(--ease);
}
.vt-btn:hover { color: var(--text); background: var(--surface); }
.vt-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ----- Kanban de campanhas ----- */
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 300px;
  gap: var(--s-3);
  overflow-x: auto;
  overflow-y: hidden;               /* o board rola só na horizontal; cada coluna rola por dentro */
  padding-bottom: var(--s-2);
  scroll-snap-type: x proximity;
  /* Altura limitada à viewport → a barra horizontal fica sempre visível e cada coluna rola sozinha */
  max-height: calc(100dvh - 200px);
  min-height: 320px;
  overscroll-behavior-x: contain;
}
@media (max-width: 1024px) {
  .kanban-board { grid-auto-columns: minmax(248px, 86vw); max-height: calc(100dvh - 170px); }
}
/* Scrollbar fina e discreta (premium) */
.kanban-board::-webkit-scrollbar { height: 10px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-strong, #cbd5e1); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: var(--text-soft, #94a3b8); background-clip: padding-box; }
.kanban-col {
  background: var(--surface-2);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  min-height: 0;          /* permite o corpo encolher e rolar */
  max-height: 100%;       /* não passa da altura do board */
}
.kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--hairline, var(--border));
  background: var(--surface);
  border-radius: var(--r-3) var(--r-3) 0 0;
  border-top: 3px solid var(--border-strong);
  position: sticky; top: 0; z-index: 2;   /* header fixo enquanto a coluna rola */
  flex: 0 0 auto;
}
.kanban-col-head h2 {
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0;
}
.kanban-col-count {
  font-size: 11px; font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--r-full);
  min-width: 22px; text-align: center;
}
/* Cor da borda superior por status */
.kanban-col-planejamento .kanban-col-head { border-top-color: var(--text-soft); }
.kanban-col-aprovada .kanban-col-head    { border-top-color: var(--info); }
.kanban-col-em-execucao .kanban-col-head { border-top-color: var(--warning); }
.kanban-col-concluida .kanban-col-head   { border-top-color: var(--success); }
.kanban-col-cancelada .kanban-col-head   { border-top-color: var(--danger); }
/* Pipeline de propostas (Solicitada→…→Aprovada/Reprovada/Arquivada) */
.kanban-col-solicitada .kanban-col-head  { border-top-color: var(--text-soft); }
.kanban-col-em-producao .kanban-col-head { border-top-color: var(--info); }
/* Bloco #122 — "Em aprovação" (review interno do Comercial) ganha roxo dedicado */
.kanban-col-em-aprovacao .kanban-col-head { border-top-color: #7c3aed; }
.kanban-col-recebida .kanban-col-head    { border-top-color: #a855f7; }
.kanban-col-enviada .kanban-col-head     { border-top-color: var(--warning); }
.kanban-col-em-revisao .kanban-col-head  { border-top-color: var(--warning); }
.kanban-col-reprovada .kanban-col-head   { border-top-color: var(--danger); }
.kanban-col-arquivada .kanban-col-head   { border-top-color: var(--text-soft); }

/* Funil de clientes (CRM · Prospecção) */
.kanban-col-prospeccao .kanban-col-head { border-top-color: var(--info); }
.kanban-col-ativo .kanban-col-head      { border-top-color: var(--success); }
.kanban-col-inativo .kanban-col-head    { border-top-color: var(--text-soft); }
.kanban-col-perdido .kanban-col-head    { border-top-color: var(--danger); }
.kanban-col-more { display:block; text-align:center; font-size:12px; padding:8px; margin-top:4px; color:var(--text-muted); text-decoration:none; border-top:1px dashed var(--border); }
.kanban-col-more:hover { color:var(--brand); }

.kanban-col-body {
  flex: 1 1 auto;
  padding: var(--s-2);
  display: flex; flex-direction: column; gap: var(--s-2);
  min-height: 80px;
  overflow-y: auto;                 /* cada coluna rola seus cards por dentro */
  overscroll-behavior: contain;
  transition: background var(--d-fast) var(--ease);
}
.kanban-col-body::-webkit-scrollbar { width: 8px; }
.kanban-col-body::-webkit-scrollbar-thumb { background: var(--border-strong, #cbd5e1); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.kanban-col-body.is-over {
  background: var(--brand-soft);
}

.kanban-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3);
  box-shadow: var(--shadow-1);
  cursor: grab;
  transition: all var(--d-fast) var(--ease);
}
.kanban-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.kanban-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.kanban-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.kanban-card-head strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  line-height: 1.3;
}
.kanban-card-artista {
  font-size: 11.5px;
  color: var(--text-muted);
}
.kanban-card-foot {
  display: flex; gap: var(--s-3);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--hairline, var(--border));
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.kanban-card-foot span {
  display: inline-flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.kanban-card-custo { color: var(--text-2); font-weight: 600; }
.kanban-card-grip {
  position: absolute;
  top: 8px; right: 8px;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity var(--d-fast) var(--ease);
}
.kanban-card:hover .kanban-card-grip { opacity: 0.5; }

.kanban-empty {
  text-align: center;
  padding: var(--s-4);
  font-size: 11.5px;
  color: var(--text-soft);
  font-style: italic;
}
.kanban-col-body > .kanban-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-2);
  background: transparent;
  margin: var(--s-2) 4px;
  padding: var(--s-4) var(--s-3);
  color: var(--text-soft);
}

/* ===== Kanban interno dos itens da campanha — header com total + card refinado ===== */
.kanban-col-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.kanban-col-money {
  font-size: 11px; font-weight: 600;
  color: var(--text-2, var(--text));
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--hairline, var(--border));
  white-space: nowrap;
}
.kanban-card--item .kanban-card-head {
  display: flex; gap: 8px; align-items: center;
  padding-right: 22px; /* deixa folga pra checkbox/grip */
}
.kanban-card--item .kanban-card-nome {
  flex: 1; min-width: 0;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.01em;
}
.kanban-card--item .kanban-card-artista {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.kanban-card-foot--item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  flex-wrap: nowrap;
}
.kanban-card-valor {
  font-weight: 600;
  color: var(--text-2, var(--text));
  font-size: 12px;
}
.kanban-card-badges { display: inline-flex; gap: 4px; align-items: center; }
.kanban-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: 10.5px; font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.kanban-badge--ok   { background: rgba(22,163,74,.14); color: var(--success, #16A34A); }
.kanban-badge--warn { background: rgba(217,119,6,.16); color: var(--warning, #D97706); }

/* Checkbox de seleção no canto do card */
.kanban-card-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: var(--r-1, 4px);
  opacity: 0;
  transition: opacity var(--d-fast) var(--ease);
  z-index: 3;
}
.kanban-card:hover .kanban-card-check,
.kanban-card-check:has(input:checked),
.kanban-card.is-selected .kanban-card-check { opacity: 1; }
.kanban-card-check input { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--brand); }
.kanban-card.is-selected {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px var(--brand-ring, rgba(99,102,241,.18));
}
.kanban-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* Quando há grip+checkbox, sobe a checkbox e empurra o grip */
.kanban-card--item .kanban-card-grip { top: 30px; right: 8px; }

/* Barra flutuante de bulk-move */
.kanban-bulkbar {
  position: fixed;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border-radius: var(--r-3);
  box-shadow: 0 10px 32px rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  animation: kanban-bulkbar-in .18s ease-out both;
}
@keyframes kanban-bulkbar-in { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
.kanban-bulkbar-count { font-weight: 600; }
.kanban-bulkbar-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255,255,255,.78); }
.kanban-bulkbar-field select {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-2);
  padding: 6px 8px;
  font-size: 13px;
}
.kanban-bulkbar-field select option { color: #111; }
.kanban-bulkbar .btn-primary { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.kanban-bulkbar .btn-ghost {
  min-height: 32px; padding: 0 10px; font-size: 12.5px;
  background: transparent; color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.18);
}
.kanban-bulkbar .btn-ghost:hover { background: rgba(255,255,255,.08); }
.kanban-bulkbar-progress { font-size: 12px; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }

/* Card carregando (durante bulk) */
.kanban-card.is-loading { opacity: 0.55; pointer-events: none; position: relative; }
.kanban-card.is-loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  background-size: 200% 100%;
  animation: kanban-card-shimmer 1.2s linear infinite;
  border-radius: inherit;
  pointer-events: none;
}
@keyframes kanban-card-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----- Busca global (página /buscar) ----- */
.busca-form-global {
  display: flex; gap: var(--s-2);
  margin-bottom: var(--s-4);
  max-width: 720px;
}
.busca-input-wrap {
  flex: 1;
  position: relative;
  display: flex; align-items: center;
}
.busca-input-wrap .busca-icon {
  position: absolute; left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.busca-input-wrap input[type="search"] {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  font-size: 14.5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text);
  transition: all var(--d-fast) var(--ease);
}
.busca-input-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.busca-form-global .btn-primary { min-height: 44px; padding: 0 18px; }

.busca-results {
  list-style: none;
  margin: 0; padding: 0;
}
.busca-result-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
  text-decoration: none;
  color: inherit;
  transition: background var(--d-fast) var(--ease);
}
.busca-results li:last-child .busca-result-item { border-bottom: 0; }
.busca-result-item:hover { background: var(--surface-2); }
.busca-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.busca-result-body strong {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.busca-result-meta {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.busca-result-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}

/* ----- Observações (timeline) ----- */
.obs-add-form {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
  background: var(--surface-2);
}
.obs-add-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2);
  resize: vertical;
  transition: all var(--d-fast) var(--ease);
}
.obs-add-form textarea::placeholder { color: var(--text-soft); }
.obs-add-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.obs-add-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--s-2);
  gap: var(--s-3);
  flex-wrap: wrap;
}
.obs-hint { font-size: 11px; color: var(--text-muted); }
.obs-add-actions .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  font-size: 13px;
}

.obs-timeline {
  list-style: none;
  margin: 0; padding: 0;
}
.obs-item {
  display: flex; gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--hairline, var(--border));
  position: relative;
  transition: background var(--d-fast) var(--ease);
}
.obs-item:last-child { border-bottom: 0; }
.obs-item:hover { background: var(--surface-2); }
.obs-body { flex: 1; min-width: 0; }
.obs-head {
  display: flex; align-items: baseline; gap: var(--s-2);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.obs-head strong { font-size: 13px; font-weight: 700; color: var(--text); }
.obs-time { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.obs-texto {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.obs-delete { margin: -2px 0 0 var(--s-2); }
.obs-delete .icon-btn {
  opacity: 0;
  transition: opacity var(--d-fast) var(--ease);
}
.obs-item:hover .obs-delete .icon-btn { opacity: 0.7; }
.obs-delete .icon-btn:hover { opacity: 1; color: var(--danger); }

.obs-empty {
  padding: var(--s-5);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ----- Avatar com iniciais (View::avatar) ----- */
.rm-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  vertical-align: middle;
  font-family: inherit;
  user-select: none;
}
.rm-avatar-photo {
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* Avatar do fornecedor no detail — clicável pra trocar foto */
.forn-avatar-wrap {
  position: relative;
  display: inline-block;
}
.forn-avatar-edit {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--brand);
  color: white;
  border: 2px solid var(--surface);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--d-fast) var(--ease);
}
.forn-avatar-wrap.editable:hover .forn-avatar-edit,
.forn-avatar-edit:focus-visible {
  opacity: 1;
  transform: scale(1);
}
.forn-avatar-edit:hover { background: var(--brand-hover); }

/* Wrapper para usar avatar + nome em células de tabela */
.cell-with-avatar {
  display: flex; align-items: center; gap: var(--s-2);
  min-width: 0;
}
.cell-with-avatar .cell-strong,
.cell-with-avatar .cell-text {
  min-width: 0;
}

/* ----- Status Funnel (relação no detalhe do fornecedor) ----- */
.status-funnel {
  display: flex;
  align-items: center;
  gap: 0;
  margin: var(--s-3) 0 var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border-radius: var(--r-3);
  border: 1px solid var(--hairline, var(--border));
  flex-wrap: wrap;
}
.funnel-step {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0;
  position: relative;
  padding: 4px 0;
  cursor: help;
}
.funnel-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 var(--s-2);
  transition: background var(--d) var(--ease);
}
.funnel-step.done:not(:last-child)::after { background: var(--success); }
.funnel-dot {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
  flex-shrink: 0;
  transition: all var(--d) var(--ease);
}
.funnel-step.done .funnel-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.funnel-step.current .funnel-dot {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.funnel-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.funnel-step.done .funnel-label,
.funnel-step.current .funnel-label { color: var(--text); }
.funnel-step.current .funnel-label { color: var(--brand); }

/* Fora do funil (Pausado / Blacklist) — aparece destacado */
.funnel-step.status-pausado-step .funnel-dot {
  background: var(--warning-soft); border-color: var(--warning); color: var(--warning);
}
.funnel-step.status-pausado-step .funnel-label { color: var(--warning); }
.funnel-step.status-blacklist-step .funnel-dot {
  background: var(--danger-soft); border-color: var(--danger); color: var(--danger);
}
.funnel-step.status-blacklist-step .funnel-label { color: var(--danger); }

@media (max-width: 640px) {
  .status-funnel { padding: var(--s-2) var(--s-3); }
  .funnel-step { flex: 0 0 auto; }
  .funnel-label { display: none; }
  .funnel-step.current .funnel-label { display: inline; }
}

/* Card vazio (categoria sem fornecedor ainda) */
.categoria-empty-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}
.categoria-card.is-empty {
  opacity: 0.78;
  border-style: dashed;
}
.categoria-card.is-empty:hover {
  opacity: 1;
  border-style: solid;
}
.categoria-card.is-empty .categoria-icon {
  background: var(--surface-2);
  color: var(--text-muted);
}
.categoria-card.is-empty:hover .categoria-icon {
  background: var(--cat-color, var(--brand-soft));
  color: var(--cat-color, var(--brand));
}
.categoria-empty-hint {
  flex: 1;
  display: flex; align-items: center;
  padding: var(--s-3) 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  font-style: italic;
}
.categoria-card.is-empty .categoria-foot {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}
.categoria-card.is-empty .categoria-cta {
  color: var(--brand);
  font-weight: 700;
}
.cob-bar.cob-good .cob-fill { background: var(--success); }
.cob-bar.cob-mid  .cob-fill { background: var(--warning); }
.cob-bar.cob-low  .cob-fill { background: var(--danger); }

/* ===== Catálogo: expandir fornecedores por categoria ===== */
.categoria-expand { margin-top: var(--s-2); }
.categoria-expand-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
}
.categoria-expand-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.categoria-expand-btn .cx-chevron { transition: transform var(--d) var(--ease); }
.categoria-expand-btn.is-open .cx-chevron { transform: rotate(180deg); }
.categoria-expand-panel {
  margin-top: var(--s-2);
  display: flex; flex-direction: column; gap: 2px;
  max-height: 380px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-2);
  padding: 6px; background: var(--surface);
  animation: fade-up var(--d) var(--ease-out);
}
.cx-loading { padding: 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.cx-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 1px 10px; padding: 8px 10px; border-radius: var(--r-1);
  text-decoration: none; color: var(--text);
  transition: background var(--d-fast) var(--ease);
}
.cx-item:hover { background: var(--surface-2); }
.cx-item-name { grid-column: 1; font-size: 13px; font-weight: 600; }
.cx-item-sub  { grid-column: 1; font-size: 11px; color: var(--text-muted); }
.cx-item-meta { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); font-weight: 700; white-space: nowrap; }

.categoria-cta {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: var(--cat-color, var(--brand));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex; align-items: center; gap: 4px;
  justify-self: end;
}

/* ===== Catálogo de ativos: tabela + agrupamento ===== */
/* tabela do catálogo: preenche no desktop, rola na horizontal no mobile (sem os hacks de coluna fixa do .table-list) */
.catalogo-table { min-width: 100%; }
@media (max-width: 720px) {
  .catalogo-table { min-width: 720px; }
}
/* chip de plataforma (caso .plat-chip não cubra algum contexto do catálogo) */
.ativo-plat-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}

/* ----- Catálogo agrupado por fornecedor ----- */
.ativo-grupo { margin-bottom: var(--s-4); }
.ativo-grupo-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-1);
  border-bottom: 1px solid var(--border);
}
.ativo-grupo-forn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  text-decoration: none; color: var(--text);
}
.ativo-grupo-forn > span { display: flex; flex-direction: column; gap: 1px; }
.ativo-grupo-forn strong { font-size: 14.5px; font-weight: 700; }
.ativo-grupo-forn small { font-size: 11.5px; color: var(--text-muted); }
.ativo-grupo-forn:hover strong { color: var(--brand); }
.ativo-grupo-count {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}

/* ===== Alertas agregados da base (dashboard) ===== */
.alertas-base-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.alerta-base { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); border-left-width: 3px; text-decoration: none; color: var(--text); transition: all var(--d-fast) var(--ease); }
a.alerta-base:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-1px); }
.alerta-base strong { font-size: 22px; font-weight: 700; line-height: 1; min-width: 28px; }
.alerta-base span { font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.alerta-base-warning { border-left-color: var(--warning); }
.alerta-base-warning strong { color: var(--warning); }
.alerta-base-danger { border-left-color: var(--danger); }
.alerta-base-danger strong { color: var(--danger); }
.alerta-base-info { border-left-color: #2563EB; }
.alerta-base-info strong { color: #2563EB; }

/* ===== Tendência de métricas (sparklines) ===== */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-4); padding: var(--s-4) var(--s-5); }
.trend-item { display: flex; flex-direction: column; gap: var(--s-2); }
.trend-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
.trend-spark { height: 30px; }
.trend-spark svg { width: 100%; height: 30px; display: block; }
.trend-delta { font-size: 13px; font-weight: 600; }
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--text-muted); font-weight: 500; }

/* ===== Insights & alertas (ficha do fornecedor) ===== */
.insights-list { list-style: none; margin: 0; padding: var(--s-3) var(--s-5) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.insight { display: flex; align-items: flex-start; gap: var(--s-2); font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.insight-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: var(--r-full); margin-top: 6px; background: var(--text-muted); }
.insight-danger  .insight-dot { background: var(--danger); }
.insight-warning .insight-dot { background: var(--warning); }
.insight-success .insight-dot { background: var(--success); }
.insight-info    .insight-dot { background: #2563EB; }
.insight-danger  { color: var(--danger); }

/* ===== Modal de confirmação reutilizável (substitui confirm() nativo) ===== */
.rm-confirm {
  max-width: 400px; width: calc(100% - 32px);
  border: 0; border-radius: var(--r-4); padding: 0;
  box-shadow: var(--shadow-pop);
  background: var(--surface); color: var(--text);
}
.rm-confirm::backdrop { background: rgba(12, 10, 9, 0.45); backdrop-filter: blur(2px); }
.rm-confirm-body { padding: var(--s-5); text-align: center; }
.rm-confirm-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin: 0 auto var(--s-3);
  border-radius: var(--r-full);
  background: var(--brand-soft); color: var(--brand);
}
.rm-confirm-body p { font-size: 14.5px; color: var(--text); margin-bottom: var(--s-4); line-height: 1.5; }
.rm-confirm-actions { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }
.rm-confirm-actions .btn-ghost,
.rm-confirm-actions .btn-primary { min-width: 120px; min-height: 42px; justify-content: center; }
.rm-confirm-ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.rm-confirm-ok:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ----------------------------------------------------------------- Tags */

.tag-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: var(--r-full);
  color: white;
  text-decoration: none;
  letter-spacing: 0.005em;
  transition: all var(--d-fast) var(--ease);
}
.tag-pill:hover { transform: translateY(-1px) scale(1.05); color: white; box-shadow: var(--shadow-2); }

/* ----------------------------------------------------------------- Compare bar (sticky bottom) */

.compare-bar[hidden],
.compare-pill[hidden] { display: none !important; }

.compare-bar {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--s-3));
  left: 50%; transform: translateX(-50%);
  z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--s-4);
  background: var(--text);
  color: var(--surface);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-pop);
  animation: compare-in var(--d) var(--ease-spring);
  max-width: calc(100vw - 32px);
}
@media (min-width: 1024px) { .compare-bar { bottom: var(--s-5); } }
@keyframes compare-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.compare-info { display: flex; align-items: center; gap: var(--s-2); font-size: 13px; min-width: 0; }
.compare-info strong { font-size: 16px; color: var(--brand); }
.compare-names { color: var(--text-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.compare-actions { display: flex; gap: var(--s-2); }
.compare-actions .btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--surface-3); }
.compare-actions .btn-ghost:hover { color: var(--surface); border-color: var(--surface); }

/* Botão minimizar dentro da barra */
.compare-min-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  margin-left: var(--s-2);
  transition: all var(--d-fast) var(--ease);
}
.compare-min-btn:hover {
  background: var(--surface);
  color: var(--text);
}

/* Pill minimizada — canto inferior direito */
.compare-pill {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--s-3));
  right: var(--s-4);
  z-index: var(--z-sticky);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--text);
  color: var(--surface);
  border: 0;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  font-family: inherit;
  animation: compare-in 200ms var(--ease);
  transition: transform var(--d-fast) var(--ease);
}
.compare-pill:hover { transform: translateY(-2px); }
.compare-pill strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1024px) { .compare-pill { bottom: var(--s-5); } }
.compare-actions .btn-primary { background: var(--brand); color: white; }

/* ----------------------------------------------------------------- Compare table */

.compare-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}
.compare-table th, .compare-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--hairline);
  vertical-align: middle;
  white-space: nowrap;
}
.compare-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  text-align: left;
  position: sticky; top: 0;
  min-width: 180px;
}
.compare-table .compare-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  position: sticky; left: 0;
  border-right: 1px solid var(--border);
  min-width: 160px;
}
.compare-table tbody tr:hover td { background: var(--surface-2); }
.compare-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.compare-table .best {
  background: rgba(22, 163, 74, 0.08);
  font-weight: 700;
  color: var(--success);
  position: relative;
}
.compare-table .best::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 6px;
  vertical-align: -2px;
  background-color: var(--success);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

/* ----------------------------------------------------------------- Inline-input (quick edit nas listagens) */

.inline-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-1);
  padding: 6px 8px;
  font-size: 12.5px;
  color: var(--text);
  outline: 0;
  transition: all var(--d-fast) var(--ease);
  font-family: inherit;
}
.inline-input::placeholder { color: var(--text-soft); font-style: italic; }
.inline-input:hover { background: var(--surface-2); border-color: var(--border); }
.inline-input:focus {
  background: var(--surface);
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.inline-input.saving {
  background: var(--info-soft);
  border-color: var(--info);
}
.inline-input.saved {
  background: var(--success-soft);
  border-color: var(--success);
  animation: pulse-saved var(--d-slow);
}
.inline-input.error {
  background: var(--brand-soft);
  border-color: var(--brand);
  animation: shake var(--d-slow);
}
@keyframes pulse-saved {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ----------------------------------------------------------------- Contact icons na tabela */

.contact-icons {
  display: inline-flex; gap: 4px; align-items: center;
  flex-wrap: nowrap;
  vertical-align: middle;
  line-height: 1;
}
.contact-icons a {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--r-1);
  transition: all var(--d-fast) var(--ease);
  text-decoration: none;
  flex-shrink: 0;
}
.contact-icons a svg { width: 12px; height: 12px; }
.ico-wa {
  background: rgba(37, 211, 102, 0.12);
  color: #128C7E;
}
.ico-wa:hover {
  background: #25D366; color: white;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}
.ico-email {
  background: var(--info-soft);
  color: var(--info);
}
.ico-email:hover {
  background: var(--info); color: white;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ----------------------------------------------------------------- Copy button & PIX */

.copy-btn {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--d-fast) var(--ease);
  vertical-align: middle;
  margin-left: 4px;
}
.copy-btn:hover { background: var(--brand); color: white; transform: scale(1.05); }
.copy-btn:active { transform: scale(0.92); }

.pix-key { user-select: all; cursor: text; }

/* ----------------------------------------------------------------- Masked & misc */

.masked {
  font-family: var(--font-mono);
  color: var(--text-soft);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
  font-size: 12px;
  letter-spacing: 0.05em;
  user-select: none;
  cursor: not-allowed;
  border: 1px dashed var(--border-strong);
}

/* ----------------------------------------------------------------- Autocomplete */

.autocomplete { position: relative; }
.autocomplete input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13.5px;
  width: 100%;
  outline: 0;
  transition: all var(--d-fast) var(--ease);
}
.autocomplete input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--brand-ring); }
.autocomplete-results {
  list-style: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  max-height: 280px;
  overflow-y: auto;
  z-index: var(--z-modal);
  box-shadow: var(--shadow-4);
  display: none;
  animation: dropdown-in var(--d) var(--ease-out);
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.autocomplete-results.open { display: block; }
.autocomplete-results li {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: all var(--d-fast) var(--ease);
}
.autocomplete-results li:last-child { border-bottom: 0; }
.autocomplete-results li:hover { background: var(--brand-soft); color: var(--brand); padding-left: 16px; }
/* Estados (buscando / vazio / erro): não-clicáveis */
.autocomplete-results li.autocomplete-empty,
.autocomplete-results li.autocomplete-empty:hover {
  color: var(--text-muted); cursor: default; background: transparent; padding-left: 12px; font-style: italic;
}

/* ----------------------------------------------------------------- Inline edit */

.inline-edit { display: inline-block; position: relative; }
.inline-edit > summary {
  list-style: none; cursor: pointer;
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-2); color: var(--text-muted);
  transition: all var(--d-fast) var(--ease);
}
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit > summary:hover { background: var(--surface-2); color: var(--text); }
.inline-edit[open] > summary { background: var(--text); color: var(--surface); }

.inline-form {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  box-shadow: var(--shadow-4);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
  z-index: var(--z-modal);
  width: min(460px, calc(100vw - 32px));
  margin-top: 4px;
  right: 0;
  animation: dropdown-in var(--d) var(--ease-out);
  max-height: 70vh;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .inline-form {
    position: fixed;
    left: 16px; right: 16px;
    bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px);
    top: auto;
    width: auto;
    grid-template-columns: 1fr;
    box-shadow: var(--shadow-pop);
  }
}
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.inline-form input,
.inline-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 7px 9px;
  font-size: 12.5px;
  outline: 0;
  transition: all var(--d-fast) var(--ease);
}
.inline-form input:focus, .inline-form select:focus { border-color: var(--text); }

/* ----------------------------------------------------------------- AI output */

.ai-output {
  background: linear-gradient(135deg, rgba(225,6,0,0.025), transparent 50%);
  border-left: 3px solid var(--brand);
  padding: var(--s-5);
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.7;
  animation: fade-up var(--d-slow) var(--ease-out);
}

/* ----------------------------------------------------------------- IA cards */

.ia-card {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-4);
  transition: all var(--d) var(--ease-spring);
  cursor: pointer;
}
.ia-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
}
.ia-card .ia-icon {
  font-size: 28px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  border-radius: var(--r-3);
  transition: transform var(--d) var(--ease-spring);
}
.ia-card:hover .ia-icon { transform: rotate(-6deg) scale(1.08); }
.ia-card h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.ia-card p { color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* ----------------------------------------------------------------- Toast */

.toast-stack {
  position: fixed; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--s-4));
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: var(--s-2);
  z-index: var(--z-toast);
  pointer-events: none;
}
@media (min-width: 1024px) {
  /* bottom = bug-fab.bottom (18px) + bug-fab.height (52px) + folga (16px) = 86px — toast nunca cobre o botão */
  .toast-stack { bottom: 86px; left: auto; right: var(--s-5); transform: none; }
}
@media (max-width: 1023px) {
  /* No mobile bug-fab fica em bottom:74px (4855) — soma 52+16 = 142 */
  .toast-stack { bottom: 142px; }
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--text);
  color: var(--surface);
  padding: 11px 15px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-4);
  animation: toast-in var(--d-slow) var(--ease-spring);
  pointer-events: all;
  max-width: min(440px, calc(100vw - 32px));
}
.toast-ico {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.toast-msg { flex: 1 1 auto; line-height: 1.35; }
.toast--ok .toast-ico  { background: var(--success); color: #fff; }
.toast--err .toast-ico { background: var(--danger);  color: #fff; }
.toast--err { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--danger) 45%, transparent), var(--shadow-4); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ----------------------------------------------------------------- Skeleton (loading) */

.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-1);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ----------------------------------------------------------------- Mobile-specific tweaks */

@media (max-width: 1023px) {
  /* Hide search on small mobile */
  .topbar .search { display: none; }

  /* Detail title smaller */
  .detail-actions { width: 100%; }
  .detail-actions .btn-primary,
  .detail-actions .btn-ghost { flex: 1; justify-content: center; min-width: 0; }
  .detail-actions form { display: contents; }
  .detail-actions form button { flex: 1; width: 100%; }
}

@media (max-width: 640px) {
  /* Stack KPIs more compactly */
  .kpi { padding: var(--s-3); }
  .kpi-value { font-size: 22px; }

  /* Cards more breathing room */
  .card-head { padding: var(--s-3) var(--s-4); flex-wrap: wrap; }
  .card-head h2 { font-size: 14px; }
  .table tbody td, .table thead th { padding: 10px var(--s-3); }
  .obs { padding: var(--s-4); }
  .dl { padding: var(--s-4); }
  .form-row { padding: var(--s-3) var(--s-4); }

  /* Detail meta wraps */
  .detail-meta { width: 100%; }
  .detail-title { word-break: break-word; }

  /* Cell strong não quebra layout */
  .cell-strong { word-break: break-word; }
  .cell-sub { word-break: break-word; }

  /* Filtros mais compactos */
  .filter-group { gap: var(--s-2); }
  .filter-group input:not([type=checkbox]):not([type=radio]),
  .filter-group select { min-width: 100%; flex: 1 1 100%; }
  .filter-actions { flex-direction: column; align-items: stretch; }
  .filter-actions .right { margin-left: 0; }
  .filter-actions a, .filter-actions button { width: 100%; justify-content: center; }
}

/* ============== Tabelas: scroll horizontal limpo + sticky column + fade ============== */

/* min-width:100% (não max-content): o wrapper .card.no-pad já faz scroll-x no overflow real.
   max-content disparava um bug de flexbox (.cell-with-avatar) que inflava a tabela a ~14000px. */
.table-list { min-width: 100%; }

.card.no-pad {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* Fade nas bordas indicando scroll possível */
  background:
    linear-gradient(90deg, var(--surface) 30%, rgba(255,255,255,0)),
    linear-gradient(90deg, rgba(255,255,255,0), var(--surface) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.08), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.08), rgba(0,0,0,0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
[data-theme="dark"] .card.no-pad {
  background:
    linear-gradient(90deg, var(--surface) 30%, rgba(22,21,19,0)),
    linear-gradient(90deg, rgba(22,21,19,0), var(--surface) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(255,255,255,.08), rgba(255,255,255,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(255,255,255,.08), rgba(255,255,255,0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
.card.no-pad::-webkit-scrollbar { height: 8px; }

/* Sticky cols SÓ na lista de fornecedores (#forn-table tem checkbox + Nome).
   Escopado pra não grudar as 2 primeiras colunas de tabelas .table-list sem checkbox
   (ex.: Usuários, Auditoria), que sobrepunham no scroll. */
#forn-table thead th:nth-child(2),
#forn-table tbody td:nth-child(2) {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  box-shadow: 1px 0 0 var(--border);
}
#forn-table thead th:nth-child(2) { background: var(--surface-2); z-index: 3; }
#forn-table tbody tr:hover td:nth-child(2) { background: var(--surface-2); }

/* Checkbox column also sticky */
#forn-table thead th:nth-child(1),
#forn-table tbody td:nth-child(1) {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  width: 40px;
}
#forn-table thead th:nth-child(1) { background: var(--surface-2); z-index: 3; }
#forn-table tbody tr:hover td:nth-child(1) { background: var(--surface-2); }
/* Quando checkbox existe, Nome vai pra coluna 2 com offset */
#forn-table:has(thead th:nth-child(1) input[type=checkbox]) thead th:nth-child(2),
#forn-table:has(thead th:nth-child(1) input[type=checkbox]) tbody td:nth-child(2) {
  left: 40px;
}

/* Score grid no mobile menor */
@media (max-width: 480px) {
  .score-grid { grid-template-columns: repeat(2, 1fr); padding: var(--s-3); gap: var(--s-2); }
  .score-cell { padding: var(--s-3); }
  .score-value { font-size: 20px; }

  /* Anexos: nome do arquivo respira */
  .table-list a.cell-strong { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
}

/* ============== Containers globais — anti-overflow ============== */

.content > * { min-width: 0; max-width: 100%; }
.card { min-width: 0; max-width: 100%; }
.dl, .obs, .form-row { max-width: 100%; }
.dl dd { min-width: 0; word-break: break-word; }
.dl dd a { word-break: break-all; }

/* Detail-actions wrap melhor em mobile */
@media (max-width: 768px) {
  .detail-head { flex-direction: column; align-items: stretch; }
  .detail-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .detail-actions form { flex: 1 1 auto; display: contents; }
  .detail-actions form button { width: 100%; }
}

/* Filtros: inputs nunca quebram layout */
.filter-group { min-width: 0; }
.filter-group > * { min-width: 0; max-width: 100%; }

/* Compare bar no mobile não cobre tudo */
@media (max-width: 640px) {
  .compare-bar {
    left: 8px; right: 8px;
    transform: none;
    max-width: none;
    border-radius: var(--r-3);
    flex-wrap: wrap;
  }
  .compare-names { display: none; }
}

/* Inline-form em mobile vira sheet — já tinha, reforço */
@media (max-width: 640px) {
  .inline-form { left: 8px; right: 8px; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 8px); }
}

/* Pills/badges nunca causam overflow */
.status-pill, .tier, .quality, .margem, .role-pill, .tag-pill { max-width: 100%; word-break: break-word; }

/* SVG ícones nas tabelas mantêm linha única — não wrappa pra evitar vazamento visual */
.contact-icons { flex-wrap: nowrap; }

/* Inline-edit modal: garantir que summary fique alinhado e form caiba */
.actions { position: relative; }
.actions .inline-edit { position: relative; }

/* Card-footer (rodapé do card com details) */
.card-footer summary { font-size: 12.5px; }

/* CPF/Bancário codes não quebram em mobile */
.dl dd code { word-break: break-all; }

/* Pix-key responsivo */
.pix-key { word-break: break-all; display: inline-block; max-width: 100%; }

/* ============== Mobile: evita zoom automático do iOS ao focar campos ==============
   O Safari no iPhone dá zoom toda vez que um input com font-size < 16px recebe foco.
   Subimos os campos de formulário pra 16px só no mobile (desktop mantém o compacto). */
@media (max-width: 1023px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px !important; /* !important: vence regras mais específicas (.inline-form select etc.) só no mobile */
  }
  /* Alvos de toque com altura confortável (>= ~44px) nos campos principais */
  .search { padding-top: 10px; padding-bottom: 10px; }
  .filter-group input,
  .filter-group select { min-height: 44px; }
  /* Selects e botões de ícone com área de toque maior no mobile */
  select { min-height: 44px; }
  .icon-btn { width: 40px; height: 40px; }
}

/* ----------------------------------------------------------------- View transitions */

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 250ms;
  }
}

/* ============================================================
   POLIMENTO GERAL + MOBILE-FIRST (aditivo — não sobrescreve desktop)
   ============================================================ */

/* Focus ring de marca consistente em links-botão e chips */
.btn-primary:focus-visible, .btn-ghost:focus-visible, .vt-btn:focus-visible,
.status-chip:focus-visible, .ap-pill:focus-visible, .icon-btn:focus-visible,
.modal-close:focus-visible, .active-filter-chip:focus-visible, .contact-chip:focus-visible,
.cat-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Garante que o último conteúdo não fique sob o bottom-nav fixo */
@media (max-width: 1023px) {
  .content { padding-bottom: calc(var(--s-6) + var(--safe-bottom)); }
}

@media (max-width: 640px) {
  /* Toggles (Lista/Kanban/Histórico, Fornecedores/Ativos/IA) rolam em vez de quebrar feio */
  .view-toggle, .tp-viewtoggle {
    display: flex; flex-wrap: nowrap; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .view-toggle::-webkit-scrollbar, .tp-viewtoggle::-webkit-scrollbar { display: none; }
  .vt-btn { flex: 0 0 auto; white-space: nowrap; }
  .tp-viewtoggle > a { flex: 0 0 auto; white-space: nowrap; }

  /* Alvos de toque >= 44px nos controles táteis */
  .icon-btn, .modal-close { width: 44px; height: 44px; }
  .modal-close { font-size: 20px; }
  .btn-primary, .btn-ghost { min-height: 44px; }
  .vt-btn { min-height: 38px; padding: 7px 12px; }
  .status-chip, .ap-pill, .active-filter-chip, .cat-chip { min-height: 36px; }

  /* Área de toque maior nos ícones de contato e no "✕"/links de ação das tabelas */
  .contact-icons a { min-width: 40px; min-height: 40px; }
  .link-muted { display: inline-flex; align-items: center; min-height: 36px; }

  /* Espaçamento pra não errar o toque em linhas densas */
  .view-toggle { gap: 6px; }
  .filter-actions, .detail-actions, .alcance-presets, .active-filters { gap: var(--s-3); }

  /* Grip do kanban sempre visível (hover não dispara no touch) + alvo maior */
  .kanban-card-grip { opacity: .4; padding: 8px; margin: -8px; }

  /* Escala de tipo: nada abaixo de 12px no mobile */
  .cell-sub, .muted-tiny, .status-chip, .active-filter-chip, .ap-pill { font-size: 12px; }
}

@media (max-width: 390px) {
  .page-title { font-size: 17px; }
}

/* ============================================================
   LISTA DE FORNECEDORES → CARDS no mobile (100% responsivo, sem scroll lateral)
   ============================================================ */
.edit-label { display: none; } /* rótulo do botão editar: só no card mobile */

@media (max-width: 640px) {
  .card.no-pad:has(#forn-table) { overflow: visible; background: none; }
  #forn-table, #forn-table tbody, #forn-table tr, #forn-table td { display: block; }
  #forn-table thead { display: none; }
  #forn-table tr {
    position: relative; border: 1px solid var(--border); border-radius: var(--r-3);
    background: var(--surface); padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-3);
    box-shadow: var(--shadow-1);
  }
  #forn-table td {
    position: static !important; width: auto !important; border: 0 !important;
    padding: 6px 0; min-width: 0; text-align: right;
    display: flex; align-items: center; gap: var(--s-3);
  }
  #forn-table td[data-label]::before {
    content: attr(data-label); flex: 1 1 auto; text-align: left;
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 700; white-space: nowrap;
  }
  /* Nome vira o cabeçalho do card */
  #forn-table td.cell-nome {
    display: block; text-align: left; padding: 0 34px 8px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--hairline) !important;
  }
  /* Checkbox no canto superior direito do card */
  #forn-table td.cell-check { position: absolute !important; top: var(--s-3); right: var(--s-4); padding: 0; }
  #forn-table td.contact-icons, #forn-table td.actions { justify-content: flex-end; }
  #forn-table td.actions .icon-btn { width: auto; height: 40px; padding: 0 14px; gap: 6px; }
  #forn-table .edit-label { display: inline; font-size: 13px; }
  /* desliga o sticky herdado (no card não faz sentido) */
  #forn-table tbody tr:hover td { background: transparent; }
}

/* Form de "Editar ativo" DENTRO do modal: em fluxo normal, não popover flutuante */
.inline-form--static {
  position: static; width: auto; right: auto; top: auto; bottom: auto;
  max-height: none; box-shadow: none; animation: none;
}
@media (max-width: 640px) {
  .inline-form--static { position: static; left: auto; right: auto; bottom: auto; top: auto; }
}
/* Form estático de 3 colunas (ex.: adicionar anexo) — empilha no mobile.
   Antes era grid-template-columns:1fr 1fr 1fr inline, que vencia a media query e
   deixava 3 colunas espremidas no celular. */
.inline-form--up3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .inline-form--up3 { grid-template-columns: 1fr; } }

/* Cards de stat do Painel comercial (dashboard) — dedup dos estilos inline */
.dash-stat {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--r-3); padding: var(--s-4);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dash-stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }

/* ===== Report de bug (botão flutuante + painel) ===== */
.nav-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:auto;font-size:11px;font-weight:700;color:#fff;background:var(--brand);border-radius:9px}
.bug-fab{position:fixed;right:18px;bottom:18px;width:52px;height:52px;border-radius:50%;border:0;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.35);z-index:900;transition:transform .15s}
.bug-fab:hover{transform:scale(1.08)}
.bug-panel{position:fixed;right:18px;bottom:80px;width:320px;max-width:calc(100vw - 36px);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-3,12px);box-shadow:0 12px 40px rgba(0,0,0,.45);z-index:901;overflow:hidden}
.bug-panel-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.bug-panel-head button{background:none;border:0;color:var(--text-muted);font-size:20px;line-height:1;cursor:pointer}
.bug-panel-body{padding:14px}
@media (max-width:600px){.bug-fab{bottom:74px}.bug-panel{bottom:134px}}
/* Respiro inferior pro conteúdo não ficar coberto pelo botão flutuante (bug-fab) */
.content { padding-bottom: 88px; }

/* ===== Funil de prospecção — cards ricos (escopado, não afeta outros kanbans) ===== */
.funil-board .funil-card { padding: 12px 12px 11px; }
.funil-card-head { display: flex; align-items: center; gap: 9px; }
.funil-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--c, var(--brand)); box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 22%, transparent);
  letter-spacing: .02em;
}
.funil-card-id { min-width: 0; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.funil-card-id strong { font-size: 13.5px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-card-marca { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-rd { flex: none; font-size: 12px; opacity: .8; align-self: flex-start; }

.funil-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.funil-tag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-full); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
}
.funil-heat {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full); border: 1px solid transparent;
}
.funil-heat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.funil-heat--fresh { color: var(--success); background: var(--success-soft); }
.funil-heat--ok    { color: var(--text-muted); background: var(--surface-2); }
.funil-heat--warn  { color: var(--warning); background: var(--warning-soft); }
.funil-heat--cold  { color: var(--danger); background: var(--danger-soft); }

.funil-card-valor { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.funil-mensal { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.funil-mensal small { font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-left: 1px; }
.funil-avulso { font-size: 11.5px; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }

.funil-card-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--hairline); }
.funil-resp { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.funil-resp-ini {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; color: var(--text-2);
  background: var(--surface-3, var(--surface-2)); border: 1px solid var(--border);
}
.funil-resp-nome { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Estado vazio de números grandes — evita "bloco preto" do "—" em negrito/grande */
.social-an-big strong.is-empty { color: var(--text-soft); font-weight: 500; opacity: .5; }
.carteira-card-mrr strong.is-empty { color: var(--text-soft); font-weight: 500; font-size: 13px; }

/* Linha editorial — preview do "Gerar semana" + donut de pilares */
.social-prev-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-full); color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ch) 35%, transparent); }
.social-prev-chip strong { color: var(--ch); font-weight: 800; font-variant-numeric: tabular-nums; }

.pilar-canal { display: flex; flex-direction: column; }
.pilar-donut { flex: none; width: 96px; height: 96px; }
.pilar-donut-cap { font-size: 16px; font-weight: 800; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.pilar-leg { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pilar-leg li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.pilar-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.pilar-nome { font-weight: 600; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilar-vals { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pilar-vals strong { font-variant-numeric: tabular-nums; font-weight: 800; }
.pilar-vals small { color: var(--text-soft); font-size: 10.5px; }
.pilar-diff { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-full); font-variant-numeric: tabular-nums; }
.pilar-diff--ok   { background: var(--success-soft); color: var(--success); }
.pilar-diff--warn { background: var(--warning-soft); color: var(--warning); }
.pilar-diff--cold { background: var(--danger-soft); color: var(--danger); }
.pilar-del { background: none; border: 0; cursor: pointer; color: var(--text-soft); font-size: 13px; padding: 0 3px; line-height: 1; }
.pilar-del:hover { color: var(--danger); }
.pilar-reco { margin-top: 12px; padding: 9px 12px; border-radius: var(--r-3); background: var(--warning-soft);
  color: var(--text-2); border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); font-size: 12.5px; line-height: 1.4; }

/* === Cards de rede @rapmarketing — premium com cores de marca === */
.social-card { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-5); box-shadow: var(--shadow-2, var(--shadow-1)); overflow: hidden;
  display: flex; flex-direction: column; }
.social-card-hero { position: relative; padding: 18px 18px 14px; color: #fff; overflow: hidden; }
.social-card-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.social-card-hero-row, .social-card-bio { position: relative; z-index: 1; }
.social-card-hero-row { display: flex; align-items: center; gap: 12px; }

/* Gradientes oficiais de cada plataforma */
.social-card--ig .social-card-hero-bg { background: linear-gradient(135deg, #FEDA77 0%, #F58529 25%, #DD2A7B 55%, #8134AF 80%, #515BD4 100%); }
.social-card--tt .social-card-hero-bg { background: linear-gradient(135deg, #00F2EA 0%, #161823 50%, #FF0050 100%); }
.social-card--li .social-card-hero-bg { background: linear-gradient(135deg, #0A66C2 0%, #004182 100%); }
.social-card--def .social-card-hero-bg { background: linear-gradient(135deg, var(--brand), var(--brand-hover)); }
/* Sutilíssima textura escura por cima pro texto branco respirar */
.social-card-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.18) 100%); pointer-events: none; z-index: 0; }

.social-card-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 4px 14px rgba(0,0,0,.25); }
.social-card-avatar--ph { display: grid; place-items: center; font-size: 22px; font-weight: 800;
  color: var(--text-2); background: #fff; }

.social-card-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.social-card-platform { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  opacity: .92; line-height: 1.2; }
.social-card-name { font-size: 15px; font-weight: 800; line-height: 1.22; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.social-card-verif { color: #fff; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.social-card-handle { font-size: 12.5px; opacity: .9; color: #fff; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-card-handle:hover { text-decoration: underline; color: #fff; }

.social-card-actions { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }
.social-card-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-full); line-height: 1.3; backdrop-filter: blur(8px); }
.social-card-badge--api    { background: rgba(34, 197, 94, .9); color: #fff; }
.social-card-badge--manual { background: rgba(255, 255, 255, .25); color: #fff; }
.social-card-stamp { font-size: 10.5px; opacity: .85; color: #fff; font-variant-numeric: tabular-nums; }

.social-card-bio { margin: 11px 0 0; font-size: 12.5px; line-height: 1.45; color: rgba(255,255,255,.94);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.social-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.social-card-big { display: flex; flex-direction: column; gap: 2px; }
.social-card-big strong { font-size: clamp(26px, 5vw, 32px); font-weight: 850; line-height: 1.04;
  color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.social-card-big strong.is-empty { color: var(--text-soft); font-weight: 500; opacity: .5; }
.social-card-big small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.social-an-delta.is-up   { color: var(--success); font-size: 12px; font-weight: 700; }
.social-an-delta.is-down { color: var(--danger);  font-size: 12px; font-weight: 700; }

.social-card-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--hairline); }
.social-card-stats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.social-card-stats span { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-card-stats strong { font-size: 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

/* Botão global "Atualizar tudo via API" — spin no ícone enquanto roda */
.js-fetch-all svg { transition: transform .6s var(--ease); }
.js-fetch-all:hover svg { transform: rotate(180deg); }
.js-fetch-all:disabled { opacity: .7; cursor: progress; }
.js-fetch-all:disabled svg { animation: link-spin .9s linear infinite; }

/* ===== Correções de auditoria visual ===== */
/* Label de campo (.form-row): asterisco de obrigatório e "(opcional)" ficam inline
   com o texto (antes quebravam pra baixo por causa do flex-column). Só labels diretos
   — os .servico-chip aninhados não são atingidos. */
.form-row > label { display: block; }
.form-row > label > input:not([type="checkbox"]):not([type="radio"]),
.form-row > label > select,
.form-row > label > textarea { display: block; width: 100%; margin-top: 6px; }

/* ===== Auto-fetch do link no wizard de fornecedor (loading) ===== */
.link-fetch { position: relative; }
.link-fetch-spin {
  position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border: 2px solid var(--border-strong); border-top-color: var(--brand);
  border-radius: 50%; animation: link-spin .7s linear infinite; pointer-events: none;
}
@keyframes link-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   PREMIUM — Lista de fornecedores (/fornecedores)
   ===================================================================== */

/* ---- Faixa de KPIs ---- */
.forn-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
@media (min-width: 860px) { .forn-kpis { grid-template-columns: repeat(4, 1fr); } }
.forn-kpi {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 14px var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
  transition: border-color var(--d) var(--ease), box-shadow var(--d) var(--ease), transform var(--d) var(--ease);
}
.forn-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--brand)); opacity: .9; }
.forn-kpi:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.forn-kpi--base   { --accent: var(--text-soft); }
.forn-kpi--ok     { --accent: var(--success); }
.forn-kpi--warn   { --accent: var(--warning); }
.forn-kpi--accent { --accent: var(--brand); }
.forn-kpi-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--r-3, 12px);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent, var(--brand));
  background: color-mix(in srgb, var(--accent, var(--brand)) 12%, var(--surface));
}
.forn-kpi-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.forn-kpi-val { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.forn-kpi-lbl { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 3px; }
.forn-kpi-lbl small { font-weight: 500; color: var(--text-muted); font-size: 11px; }

/* ---- Tabela premium (GLOBAL — vale em todas as .table-list) ---- */
.table-list tbody tr { transition: background var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.table-list tbody tr:hover {
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
  box-shadow: inset 3px 0 0 var(--brand);
}
.cell-with-avatar .avatar,
.cell-with-avatar img {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
}
.table-list .cell-strong { font-weight: 650; }
.table-list .cell-strong:hover { color: var(--brand); }
/* Chips de plataforma na lista — pill discreta */
.table-list .plat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline, var(--border));
  font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.table-list .plat-chip strong { color: var(--brand); font-weight: 800; }

/* ---- Toolbar / busca premium (GLOBAL — toda busca dentro de .filters ganha a lupa) ---- */
.filters input[type="search"] {
  padding-left: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat; background-position: 13px center;
}

/* ---- Empty state premium ---- */
.empty-state {
  text-align: center; padding: var(--s-7, 48px) var(--s-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
}
.empty-state-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  margin-bottom: var(--s-2);
}
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }

/* ---- Loading: tabela esmaece enquanto filtra (global) ---- */
.filters-loading #forn-table,
.filters-loading .table-list,
.filters-loading .table-wrap { opacity: .55; transition: opacity .2s var(--ease); pointer-events: none; }
/* Barra de progresso no topo durante o filtro (estilo top-loading-bar) */
body.filters-loading::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: rm-topbar 1s linear infinite;
}
@keyframes rm-topbar { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { body.filters-loading::before { animation: none; } }

/* ===== Banner de "entrar como" (impersonation) — Super Admin navegando como outro usuário ===== */
.impersonation-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  flex-wrap: wrap;
  padding: 10px var(--s-5);
  background: #92400E; color: #FEF3C7;
  font-size: 13px; font-weight: 600;
  position: sticky; top: 0; z-index: 60;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.impersonation-msg { display: inline-flex; align-items: center; gap: 8px; }
.impersonation-msg strong { color: #fff; }
.impersonation-back {
  background: #FEF3C7; color: #92400E; border: 0;
  padding: 6px 12px; border-radius: var(--radius-sm, 8px);
  font-weight: 700; font-size: 13px; cursor: pointer;
  min-height: 32px; white-space: nowrap;
  transition: filter .15s var(--ease);
}
.impersonation-back:hover { filter: brightness(.94); }

/* Botão-ícone destrutivo (ex.: excluir usuário): fica vermelho no hover/focus */
.icon-btn-danger:hover, .icon-btn-danger:focus-visible {
  color: var(--danger, #DC2626);
  border-color: color-mix(in srgb, var(--danger, #DC2626) 40%, transparent);
  background: color-mix(in srgb, var(--danger, #DC2626) 10%, transparent);
}

/* ============================================================
   Redes @rapmarketing — planner de conteúdo (board + calendário)
   ============================================================ */
/* Chip do canal (cor da marca via --ch) */
.social-chan {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 8px; border-radius: 99px;
  color: var(--ch, var(--text-2));
  background: color-mix(in srgb, var(--ch, var(--border)) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ch, var(--border)) 30%, transparent);
  white-space: nowrap;
}
/* Snippet da legenda no card */
.social-card-leg {
  margin: 6px 0 0; font-size: 12px; line-height: 1.45;
  color: var(--text-soft, #64748b);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Data com urgência */
.social-date { font-size: 11px; color: var(--text-soft, #64748b); font-variant-numeric: tabular-nums; }
.social-date.is-hoje { color: var(--brand, #7C3AED); font-weight: 700; }
.social-date.is-atrasado { color: var(--danger, #DC2626); font-weight: 700; }
/* "+ adicionar" no rodapé da coluna */
.social-quickadd {
  display: block; text-align: center; padding: 8px; margin: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-soft, #64748b);
  border: 1px dashed var(--border-strong, #cbd5e1); border-radius: var(--r-2, 8px);
  text-decoration: none; transition: all var(--d-fast, .15s) var(--ease, ease);
}
.social-quickadd:hover { color: var(--brand, #7C3AED); border-color: var(--brand, #7C3AED); background: var(--brand-soft, color-mix(in srgb, #7C3AED 8%, transparent)); }

/* Barra de navegação do mês */
.social-cal-bar { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-3, 12px); }
.social-cal-bar .btn-ghost { padding: 4px 12px; font-size: 18px; line-height: 1; }
.social-cal-title { margin: 0; font-size: 18px; font-weight: 700; min-width: 160px; text-align: center; }

/* Grade do calendário */
.social-cal { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--r-3, 12px); overflow: hidden; }
.social-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2, #f8fafc); border-bottom: 1px solid var(--border); }
.social-cal-head span { padding: 8px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft, #64748b); }
.social-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.social-cal-cell {
  min-height: 104px; padding: 4px; border-right: 1px solid var(--hairline, var(--border)); border-bottom: 1px solid var(--hairline, var(--border));
  display: flex; flex-direction: column; gap: 3px;
}
.social-cal-cell:nth-child(7n) { border-right: 0; }
.social-cal-cell.is-out { background: var(--surface-2, #f8fafc); }
.social-cal-cell.is-today { background: color-mix(in srgb, var(--brand, #7C3AED) 7%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand, #7C3AED) 35%, transparent); }
.social-cal-celltop { display: flex; align-items: center; justify-content: space-between; }
.social-cal-num { font-size: 12px; font-weight: 600; color: var(--text-2, #334155); padding: 1px 4px; }
.is-today .social-cal-num { color: var(--brand, #7C3AED); font-weight: 800; }
.social-cal-add { opacity: 0; text-decoration: none; font-weight: 700; color: var(--text-soft); width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 5px; transition: opacity var(--d-fast, .15s); }
.social-cal-cell:hover .social-cal-add { opacity: 1; }
.social-cal-add:hover { background: var(--brand, #7C3AED); color: #fff; }
.social-cal-chip {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  font-size: 11px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; text-decoration: none;
  color: var(--text-2, #334155);
  background: color-mix(in srgb, var(--ch, var(--border)) 12%, var(--surface));
  border-left: 3px solid var(--st, var(--border));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.social-cal-chip:hover { background: color-mix(in srgb, var(--ch, var(--border)) 24%, var(--surface)); }
.social-cal-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ch, var(--text-soft)); }
.social-cal-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: var(--s-3, 12px); }
.social-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.social-cal-legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
@media (max-width: 720px) {
  .social-cal-cell { min-height: 76px; }
  .social-cal-chip { font-size: 10px; padding: 2px 4px; }
  .social-cal-head span { font-size: 10px; padding: 6px 2px; }
}

/* --- Analytics de crescimento --- */
.social-an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-4, 16px); }
.social-an-card { padding: var(--s-4, 16px); display: flex; flex-direction: column; gap: 10px; }
.social-an-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.social-an-big { line-height: 1.1; }
.social-an-big strong { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.social-an-big small { color: var(--text-soft, #64748b); font-size: 13px; }
.social-an-delta { display: inline-block; margin-left: 6px; font-size: 13px; font-weight: 700; padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.social-an-delta.is-up { color: var(--success, #16A34A); background: color-mix(in srgb, var(--success, #16A34A) 12%, transparent); }
.social-an-delta.is-down { color: var(--danger, #DC2626); background: color-mix(in srgb, var(--danger, #DC2626) 12%, transparent); }
.spark { width: 100%; height: 44px; display: block; }
.spark-line { fill: none; stroke: var(--c, var(--brand)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--c, var(--brand)); opacity: .10; stroke: none; }
.spark-empty { height: 44px; display: flex; align-items: center; }
.social-an-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--hairline, var(--border)); padding-top: 10px; }
.social-an-mini > div { display: flex; flex-direction: column; gap: 2px; }
.social-an-mini strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.social-an-edit { font-size: 13px; }
.social-an-edit > summary { cursor: pointer; color: var(--text-soft, #64748b); padding: 6px 0; user-select: none; }
.social-an-edit > summary:hover { color: var(--brand, #7C3AED); }

/* --- Cronograma editorial (grade canal × dia) --- */
.social-cron { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.social-cron th { text-align: center; padding: 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft, #64748b); border-bottom: 1px solid var(--border); }
.social-cron th.social-cron-canalcol { text-align: left; }
.social-cron td { vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--hairline, var(--border)); border-left: 1px solid var(--hairline, var(--border)); min-width: 78px; }
.social-cron td.social-cron-canalcol { border-left: 0; white-space: nowrap; }
.social-cron-slot { position: relative; background: color-mix(in srgb, var(--ch, var(--border)) 10%, var(--surface)); border-left: 3px solid var(--ch, var(--border)); border-radius: 6px; padding: 5px 18px 5px 7px; margin-bottom: 5px; }
.social-cron-slot-main { display: flex; flex-direction: column; line-height: 1.25; }
.social-cron-slot-main strong { font-size: 12px; }
.social-cron-obs { margin-top: 2px; }
.social-cron-del { position: absolute; top: 2px; right: 2px; margin: 0; }
.social-cron-del button { background: none; border: 0; cursor: pointer; color: var(--text-soft, #94a3b8); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.social-cron-del button:hover { color: var(--danger, #DC2626); background: color-mix(in srgb, var(--danger, #DC2626) 12%, transparent); }
.social-cron-empty { color: var(--border-strong, #cbd5e1); display: block; text-align: center; }

/* --- Serviços RM: chips selecionáveis (forms) + tags (exibição) --- */
.servico-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.servico-chip { position: relative; }
.servico-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.servico-chip span {
  display: inline-block; padding: 7px 13px; border: 1px solid var(--border); border-radius: 99px;
  font-size: 13px; font-weight: 600; color: var(--text-2, #334155); cursor: pointer; user-select: none;
  transition: all var(--d-fast, .15s) var(--ease, ease);
}
.servico-chip span:hover { border-color: var(--brand, #7C3AED); color: var(--brand, #7C3AED); }
.servico-chip input:checked + span { background: var(--brand, #7C3AED); border-color: var(--brand, #7C3AED); color: #fff; }
.servico-chip input:focus-visible + span { outline: 2px solid var(--brand, #7C3AED); outline-offset: 2px; }
.servico-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.servico-tag {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 9px; border-radius: 99px;
  color: var(--brand, #7C3AED);
  background: color-mix(in srgb, var(--brand, #7C3AED) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand, #7C3AED) 28%, transparent);
}
.servico-tag.sm { font-size: 10px; padding: 2px 7px; }

/* --- Pilares de conteúdo: barra real (preenchida) + marcador de alvo --- */
.pilar-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2, #f1f5f9); overflow: visible; }
.pilar-bar > span { display: block; height: 100%; border-radius: 99px; min-width: 2px; transition: width var(--d-fast, .2s) var(--ease, ease); }
.pilar-bar > i { position: absolute; top: -2px; width: 2px; height: 12px; background: var(--text-2, #334155); border-radius: 2px; transform: translateX(-1px); }

/* --- Score do fornecedor: estrelas coloridas + nota final --- */
.score-stars { letter-spacing: 1px; font-size: 16px; line-height: 1; }
.score-stars > span { color: var(--border-strong, #cbd5e1); }
.score-stars > span.on { color: var(--c, var(--brand, #7C3AED)); }
.score-final-badge { font-size: 13px; color: var(--c, var(--text-2)); background: color-mix(in srgb, var(--c, var(--border)) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--border)) 30%, transparent); padding: 3px 10px; border-radius: 99px; }
.score-final-badge strong { font-size: 15px; }

/* --- Campanha: toggle compacto pra adicionar material (libera o topo) --- */
.campanha-upload { margin: var(--s-2, 8px) var(--s-5, 20px) 0; }
.campanha-upload > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft, #64748b); padding: 6px 12px; border: 1px dashed var(--border-strong, #cbd5e1); border-radius: var(--r-2, 8px); width: max-content; list-style: none; user-select: none; transition: all var(--d-fast, .15s) var(--ease, ease); }
.campanha-upload > summary::-webkit-details-marker { display: none; }
.campanha-upload > summary:hover { color: var(--brand, #7C3AED); border-color: var(--brand, #7C3AED); }
.campanha-upload[open] > summary { color: var(--brand, #7C3AED); border-style: solid; }

/* ============================================================
   Fornecedores — toggle Lista/Cards + grade de cards + refino
   ============================================================ */
/* Segmented toggle */
.forn-viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-2, 8px); overflow: hidden; background: var(--surface); }
.forn-viewtoggle .fvt-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; background: none; border: 0; cursor: pointer; color: var(--text-soft, #64748b); transition: all var(--d-fast, .15s) var(--ease, ease); }
.forn-viewtoggle .fvt-btn + .fvt-btn { border-left: 1px solid var(--border); }
.forn-viewtoggle .fvt-btn:hover { color: var(--text-2, #334155); }
.forn-viewtoggle .fvt-btn.is-active { background: var(--brand, #DC2626); color: #fff; }

/* Grade de cards */
.forn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4, 16px); margin-top: var(--s-2, 8px); }
.forn-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--r-3, 12px); text-decoration: none; color: inherit; transition: border-color var(--d-fast, .15s) var(--ease), box-shadow var(--d-fast, .15s) var(--ease), transform var(--d-fast, .15s) var(--ease); }
.forn-card:hover { border-color: color-mix(in srgb, var(--brand, #DC2626) 40%, var(--border)); box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--brand, #DC2626) 30%, transparent); transform: translateY(-2px); }
.forn-card-top { display: flex; align-items: center; gap: 10px; }
.forn-card-nome { display: block; font-size: 14px; font-weight: 700; color: var(--text, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forn-card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forn-card-plats { display: flex; flex-wrap: wrap; gap: 5px; }
.forn-card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--hairline, var(--border)); padding-top: 10px; }
.forn-card-metrics > div { display: flex; flex-direction: column; gap: 1px; }
.forn-card-metrics strong { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-2, #334155); }
.forn-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }

/* Refino da tabela de fornecedores */
#forn-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2, #f8fafc); }
#forn-table tbody tr { transition: background var(--d-fast, .12s) var(--ease, ease); }
#forn-table tbody tr:hover { background: color-mix(in srgb, var(--brand, #DC2626) 4%, var(--surface)); }
#forn-table td.num, #forn-table th.num { font-variant-numeric: tabular-nums; }

/* KPI cards: leve elevação no hover (sensação premium) */
.forn-kpi { transition: border-color var(--d-fast, .15s) var(--ease), box-shadow var(--d-fast, .15s) var(--ease), transform var(--d-fast, .15s) var(--ease); }
.forn-kpi:hover { transform: translateY(-1px); box-shadow: 0 4px 14px -8px rgba(0,0,0,.18); }


/* ============================================================
 * DIALOG REUSÁVEL — confirmação ("Confira antes de enviar")
 * Centralizado, responsivo, com backdrop blur. Usado em:
 *   - propostas/form.php  (#dlg-confirm-solic)
 *   - campanhas/edit.php  (#dlg-confirm-camp)
 *   - campanhas/show.php  (#dlg-confirm-espelhar, #dlg-confirm-excluir-camp)
 *   - propostas/show.php  (#dlg-confirm-excluir-prop)
 *
 * Bloco #236: aliasado a dialog.modal — mesma estética premium centralizada
 * (backdrop blur 8px+saturate, animação spring, shadow-pop, border-radius r-5).
 * Mantém estrutura header/div/footer legacy pra não quebrar as views existentes.
 * ============================================================ */
dialog.rm-dialog {
  position: fixed;
  inset: 0;
  border: 0;
  border-radius: var(--r-5);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  width: min(560px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
  max-height: 90vh;
  margin: auto;
  overflow: hidden;
  flex-direction: column;
}
dialog.rm-dialog[open] { display: flex; animation: modal-in var(--d-slow) var(--ease-spring); }
dialog.rm-dialog:not([open]) { display: none; }
dialog.rm-dialog::backdrop {
  background: color-mix(in oklch, black 50%, transparent);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
}
dialog.rm-dialog[open]::backdrop { animation: backdrop-in var(--d) ease-out; }
dialog.rm-dialog > header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2, var(--surface)));
  display: flex;
  align-items: center;
  gap: 10px;
}
dialog.rm-dialog > header strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
dialog.rm-dialog > div { /* body */
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.55;
  max-height: 60vh;
  overflow-y: auto;
  color: var(--text);
}
dialog.rm-dialog > footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
/* Linhas LABEL: valor do resumo (geradas no JS de cada dialog) */
dialog.rm-dialog > div > div[style*="grid-template-columns"] {
  display: grid !important;
  grid-template-columns: 130px 1fr !important;
  gap: 10px;
  padding: 8px 0 !important;
  border-bottom: 1px dashed var(--border) !important;
}
dialog.rm-dialog > div > div[style*="grid-template-columns"]:last-child {
  border-bottom: none !important;
}

/* Mobile */
@media (max-width: 520px) {
  dialog.rm-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    margin: auto auto 0 auto; /* gruda no rodapé tipo bottom-sheet */
    border-bottom: none;
  }
  dialog.rm-dialog > div > div[style*="grid-template-columns"] {
    grid-template-columns: 100px 1fr !important;
  }
}

/* ============================================================
   Bloco #115 — Mobile hardening (override final)
   Aplica em telas <= 640px. Foca nas 4 telas críticas + padrões
   comuns que quebraram com inline styles de blocos #110-#113.
   ============================================================ */

@media (max-width: 640px) {
  /* ---- Padding global menor pra ganhar área útil ---- */
  .content { padding: var(--s-3) !important; gap: var(--s-3) !important; }
  .card { border-radius: 8px; }
  .card.no-pad > .table-wrap { margin: 0 -2px; }

  /* ---- KPIs viram 1 coluna (eram 2) pra não cortar valor ---- */
  .kpi-grid { grid-template-columns: 1fr !important; gap: var(--s-2) !important; }
  .kpi-value { font-size: 20px !important; }
  .kpi-label { font-size: 11px !important; }

  /* ---- Inline grids dos blocos recentes (alertas, atalhos, forms grid) ---- */
  /* Bloco #113 alertas: grid-template-columns:repeat(auto-fit,minmax(280px,1fr)) */
  [style*="minmax(280px"],
  [style*="minmax(180px,"],
  [style*="minmax(160px,"],
  [style*="minmax(140px,"],
  [style*="minmax(200px,"] {
    grid-template-columns: 1fr !important;
  }

  /* ---- Forms inline com display:flex sem wrap (folha edit, etc.) ---- */
  .card form[style*="display:flex"],
  details form[style*="display:flex"],
  .prop-aprovacao-interna div[style*="display:flex"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  /* Inputs do form ocupam linha inteira em mobile */
  form[style*="display:flex"] label,
  form[style*="display:flex"] input,
  form[style*="display:flex"] select { width: 100%; }
  form[style*="display:flex"] button { flex: 1 1 auto; width: 100%; }

  /* ---- Botões em geral ficam fáceis de tocar (touch target 44px) ---- */
  .btn-primary, .btn-secondary, .btn-ghost {
    min-height: 44px;
    font-size: 14px !important;
  }
  button.btn-link { min-height: 36px; padding: 6px 10px; }

  /* ---- Status chips do nav agrupado do /financeiro ---- */
  .fin-nav { gap: 6px !important; }
  .fin-nav-group > summary { padding: 8px 12px; font-size: 12px; }
  .fin-nav-current { display: none; } /* economiza linha */

  /* ---- Tabela: força font menor + scroll horizontal SEMPRE ---- */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; font-size: 12.5px; }
  .table-wrap th, .table-wrap td { padding: 8px 10px !important; }

  /* ---- Cards de proposta show — banner topo + meta ---- */
  .prop-stage-banner { padding: 12px !important; flex-direction: column !important; align-items: stretch !important; }
  .prop-stage-banner .prop-stage-cta { width: 100%; }
  .prop-stage-banner button[type="submit"] { width: 100%; justify-content: center; }

  /* ---- Kanban: cards menores ---- */
  .kanban-board { grid-auto-columns: minmax(220px, 88vw); }
  .kanban-card { padding: 10px !important; }

  /* ---- Painel de aprovação interna (#109) ---- */
  .prop-aprovacao-interna form, .prop-aprovacao-interna button { width: 100%; }

  /* ---- Tabs/chips wrap melhor ---- */
  .status-chips { gap: 4px !important; }
  .status-chip { padding: 6px 10px !important; font-size: 12px !important; }

  /* ---- Detail/summary (form expansível folha) sem cortar ---- */
  details > summary { font-size: 13px !important; }

  /* ---- KPI sub texts mais discretos ---- */
  .kpi-sub { font-size: 10.5px !important; }

  /* ---- Pop-ups dropdowns do /financeiro ocupam toda largura ---- */
  .fin-nav-group .fin-nav-menu { left: 0 !important; right: 0 !important; min-width: 0 !important; }

  /* ---- Bottom nav já existe (mobile-only) — garante que conteúdo não fica atrás dela ---- */
  .main { padding-bottom: 84px; }

  /* ---- Filtro do CRM (filter-group) — inputs largos ---- */
  .filter-group { flex-direction: column !important; align-items: stretch !important; }
  .filter-group input, .filter-group select { min-width: 0 !important; width: 100% !important; }
}

/* ---- Tablet (641-1023px): ajustes mais sutis ---- */
@media (min-width: 641px) and (max-width: 1023px) {
  /* KPI grid: 2 colunas no tablet (era 3 em 640+) */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  /* Alertas (#113) em 2 colunas no tablet */
  [style*="minmax(280px"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================================
   Bloco #131 — CSS extraído de propostas/show.php (god-file).
   Antes: 3 <style> blocks dispersos somando ~375 linhas embedded.
   Agora: regras CSS globais reutilizáveis. View ficou ~370 linhas menor.
   ============================================================ */
/* Fluxo da proposta — stepper HORIZONTAL compacto */
.prop-flow-stepper{ list-style:none; margin:0; padding:4px 2px 6px; display:flex; align-items:flex-start;
  gap:0; overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; -webkit-overflow-scrolling:touch }
.prop-flow-step{ display:flex; flex-direction:column; align-items:center; gap:6px;
  flex:0 0 auto; min-width:74px; position:relative; padding:2px 4px }
.prop-flow-step .prop-flow-dot{ width:26px; height:26px; border-radius:var(--r-full);
  display:grid; place-items:center; font-size:12px; font-weight:800; line-height:1;
  background:var(--surface); color:var(--text-soft); border:1.5px solid var(--border);
  z-index:2; position:relative; transition:all var(--d-fast,150ms) ease }
.prop-flow-step .prop-flow-lbl{ font-size:11px; font-weight:600; color:var(--text-muted);
  text-align:center; white-space:nowrap; letter-spacing:-0.005em }
.prop-flow-conn{ flex:1 1 auto; min-width:14px; height:2px; background:var(--border);
  margin-top:13px; /* alinha com centro do dot 26/2 */ position:relative; z-index:1; align-self:flex-start }
/* concluídas */
.prop-flow-step.is-done .prop-flow-dot{ background:var(--success); color:#fff; border-color:var(--success) }
.prop-flow-step.is-done .prop-flow-lbl{ color:var(--text-2) }
.prop-flow-conn.is-done{ background:var(--success) }
/* atual */
.prop-flow-step.is-current .prop-flow-dot{ background:var(--brand); color:#fff; border-color:var(--brand);
  box-shadow:0 0 0 4px var(--brand-ring); animation:propFlowPulse 1.8s ease-in-out infinite }
.prop-flow-step.is-current .prop-flow-lbl{ color:var(--text); font-weight:700 }
@keyframes propFlowPulse{
  0%,100%{ box-shadow:0 0 0 4px var(--brand-ring) }
  50%   { box-shadow:0 0 0 7px rgba(99,102,241,.10) }
}
/* pendentes */
.prop-flow-step.is-pending .prop-flow-dot{ background:transparent; color:var(--text-soft); border-color:var(--border) }
/* terminais alternativas */
.prop-flow-step.is-reprov.is-current .prop-flow-dot,
.prop-flow-step.is-reprov.is-done .prop-flow-dot{ background:var(--danger); border-color:var(--danger); color:#fff }
.prop-flow-step.is-reprov.is-current .prop-flow-lbl{ color:var(--danger) }
.prop-flow-step.is-archiv.is-current .prop-flow-dot,
.prop-flow-step.is-archiv.is-done .prop-flow-dot{ background:var(--text-soft); border-color:var(--text-soft); color:#fff }
.prop-flow-step.is-archiv.is-current .prop-flow-lbl{ color:var(--text-2) }
/* ações abaixo */
.prop-actions{ margin-top:var(--s-4); display:flex; flex-direction:column; gap:10px }
.prop-other{ display:flex; gap:6px; flex-wrap:wrap }
.prop-other .btn-ghost{ padding:6px 11px; font-size:12px }
.prop-other .btn-ghost.danger{ color:var(--danger); border-color:rgba(220,38,38,.35) }
@media (max-width:720px){
  .prop-flow-step{ min-width:62px }
  .prop-flow-step .prop-flow-lbl{ font-size:10.5px }
}

/* ONDA 1 — Linhas compactas sticky de cenário (substituem cards verticais) */
.prop-cen-stack{ display:flex; flex-direction:column; gap:4px; padding:var(--s-3) var(--s-5);
  position:sticky; top:0; z-index:5; background:var(--surface);
  border-bottom:1px solid var(--border) }
.prop-cen-row{ display:grid;
  grid-template-columns: 8px 96px 110px minmax(80px, 1fr) 56px 10px 70px auto;
  align-items:center; gap:10px;
  min-height:36px; padding:4px 12px 4px 8px;
  border:1px solid var(--border); border-left:3px solid var(--row-accent, var(--border));
  border-radius:var(--r-2); background:var(--surface); position:relative;
  color:var(--text); text-decoration:none; cursor:pointer;
  transition:background var(--d-fast,150ms) ease, border-color var(--d-fast,150ms) ease, box-shadow var(--d-fast,150ms) ease;
  font-size:12px; line-height:1.2; font-variant-numeric:tabular-nums }
.prop-cen-row:hover{ background:var(--surface-2, rgba(0,0,0,.03)); border-color:var(--text-soft, var(--border)) }
/* Bloco #143 — Cenário ATIVO usa roxo (brand-purple), não vermelho RM. Antes: var(--brand)
   resolveu pra #E10600 (vermelho), e user confundiu com erro ("Cen 1 vermelho vs Cen 2/3
   verde"). Agora purple explícito = sinaliza "selecionado/em foco" sem ambiguidade. */
.prop-cen-row.is-active{
  background:linear-gradient(90deg, color-mix(in srgb, var(--brand-purple, #6d28d9) 8%, transparent) 0%, transparent 60%), var(--surface);
  border-color:var(--brand-purple, #6d28d9);
  border-left-width:4px; border-left-color:var(--brand-purple, #6d28d9);
  box-shadow:0 0 0 2px color-mix(in srgb, var(--brand-purple, #6d28d9) 22%, transparent), 0 4px 14px -6px rgba(109,40,217,.45);
  position:relative; z-index:1;
  animation: pf-active-pulse 2.4s ease-in-out infinite;
}
@keyframes pf-active-pulse {
  0%,100% { box-shadow:0 0 0 2px color-mix(in srgb, var(--brand-purple, #6d28d9) 22%, transparent), 0 4px 14px -6px rgba(109,40,217,.45); }
  50%     { box-shadow:0 0 0 3px color-mix(in srgb, var(--brand-purple, #6d28d9) 30%, transparent), 0 8px 22px -6px rgba(109,40,217,.55); }
}
/* Hover lift suave (não-ativo) */
.prop-cen-row:not(.is-active) { transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.prop-cen-row:not(.is-active):hover { transform: translateX(2px); }
/* Banner de etapa: fade-up sutil ao carregar */
.prop-stage-banner { animation: pf-fade-up .45s cubic-bezier(.22,1,.36,1) both; margin:0 !important; }
/* Bloco #53 — Banner + Histórico do fluxo juntos no topo (grid 2-col responsivo) */
.prop-topo-grid { display:grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap:14px; align-items:stretch; margin: var(--s-4) 0 var(--s-5); }
.prop-topo-grid > .prop-stage-banner { height:100%; }
.prop-topo-grid > [data-prop-fluxo-card] { margin:0; height:100%; display:flex; flex-direction:column; }
.prop-topo-grid > [data-prop-fluxo-card] > .card-head { padding:10px 14px; min-height:auto; }
.prop-topo-grid > [data-prop-fluxo-card] > .card-head h2 { font-size:12.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin:0; }
.prop-topo-grid > [data-prop-fluxo-card] > div { padding:10px 14px !important; }
.prop-topo-grid > [data-prop-fluxo-card] .prop-flow-stepper { gap:4px; padding:2px 0; }
.prop-topo-grid > [data-prop-fluxo-card] .prop-flow-step .prop-flow-lbl { font-size:10px; }
.prop-topo-grid > [data-prop-fluxo-card] .prop-flow-dot { width:22px; height:22px; font-size:11px; }
.prop-topo-grid > [data-prop-fluxo-card] .prop-flow-conn { min-width:8px; }
@media (max-width: 1024px) {
  .prop-topo-grid { grid-template-columns: 1fr; gap:10px; }
}
/* Bloco #54 — quando .grid-2 fica solo (após move do histórico) vira 1 col full-width;
   E o <dl> interno do Operacional ganha layout 2-pares-por-linha pra aproveitar o espaço.
   Estrutura: dt val | dt val   (cada dt na col ímpar, cada dd na col par) */
.grid-2.is-solo { grid-template-columns: 1fr !important; }
.grid-2.is-solo > .card > .dl {
  display: grid;
  grid-template-columns: minmax(140px, max-content) minmax(200px, 1fr) minmax(140px, max-content) minmax(200px, 1fr);
  gap: 10px 18px;
  padding: 14px 18px;
  align-items: baseline;
}
.grid-2.is-solo > .card > .dl dt {
  margin: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); border: 0; padding: 0;
}
.grid-2.is-solo > .card > .dl dd {
  margin: 0; font-size: 13px; color: var(--text); border: 0; padding: 0 0 8px;
  border-bottom: 1px dashed var(--border);
}
/* Última linha sem borda inferior — só os 2 últimos dd */
.grid-2.is-solo > .card > .dl dd:nth-last-of-type(-n+2) { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 900px) {
  .grid-2.is-solo > .card > .dl {
    grid-template-columns: minmax(140px, max-content) 1fr;
  }
  .grid-2.is-solo > .card > .dl dd:nth-last-of-type(-n+2) { border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
  .grid-2.is-solo > .card > .dl dd:last-of-type { border-bottom: 0; padding-bottom: 0; }
}
@keyframes pf-fade-up { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.prop-stage-banner button[type=submit] { transition: transform .15s ease, box-shadow .2s ease; }
.prop-stage-banner button[type=submit]:hover { transform: translateY(-2px); box-shadow:0 8px 20px -4px currentColor; }
.prop-stage-banner button[type=submit]:active { transform: translateY(0); }
/* Headers de fase na lista de itens: entram suaves */
.pf-cen-fase-row { animation: pf-slide-in .35s ease both; }
@keyframes pf-slide-in { from { opacity:0; transform:translateX(-8px); } to { opacity:1; transform:translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .prop-cen-row.is-active, .prop-stage-banner, .pf-cen-fase-row, .prop-cen-row { animation: none !important; transition: none !important; }
}
.prop-cen-row.is-active .cen-label{ color:var(--brand-purple, #6d28d9); font-weight:700 }
.prop-cen-row.is-active .cen-label::before{ content:'● '; color:var(--brand-purple, #6d28d9); font-size:10px; vertical-align:middle }
/* Badge "Não passa no comitê" injetada via JS — REMOVIDA do visual da row pra não sobrepor
   o texto de alocação. O alerta "Cenário X não passa no comitê" abaixo das rows já cumpre essa função. */
.prop-cen-comite-badge{ display:none !important }
.prop-cen-row .cen-dot{ width:8px; height:8px; border-radius:50%; flex:none }
.prop-cen-row .cen-label{ font-weight:600; color:var(--text); font-size:12px;
  letter-spacing:-0.005em }
.prop-cen-row .cen-valor{ font-weight:700; font-size:13px; color:var(--text) }
.prop-cen-row .cen-prog{ position:relative; height:6px; background:rgba(100,116,139,.15);
  border-radius:var(--r-full, 999px); overflow:hidden; min-width:60px }
.prop-cen-row .cen-prog-fill{ position:absolute; left:0; top:0; bottom:0;
  background:var(--success); transition:width var(--d, 200ms) ease;
  opacity:.78 }
.prop-cen-row .cen-margem{ font-weight:700; font-size:12px; text-align:right }
.prop-cen-row .cen-margem-dot{ width:7px; height:7px; border-radius:50%; flex:none }
.prop-cen-row .cen-itens{ font-size:11px; color:var(--text-muted); white-space:nowrap }
.prop-cen-row .cen-aloc{ font-size:11px; color:var(--text-muted); white-space:nowrap; text-align:right }
@media (max-width: 720px){
  .prop-cen-row{ grid-template-columns: 8px 1fr auto 10px; gap:8px; padding:6px 10px }
  .prop-cen-row .cen-prog,
  .prop-cen-row .cen-itens,
  .prop-cen-row .cen-aloc{ display:none }
}

/* ONDA 1 — Lista colapsável de itens (substitui .pf-itens-cen com <ul><li>) */
.pf-cen-list-head{ display:flex; align-items:center; gap:10px; padding:6px 0 8px;
  font-size:12px; color:var(--text-muted) }
.pf-cen-list-head .pf-cen-list-count{ font-weight:600; color:var(--text-2) }
.pf-cen-list-head .pf-cen-list-actions{ margin-left:auto; display:inline-flex; gap:6px }
.pf-cen-list-head .pf-cen-list-actions button{ background:none; border:0; color:var(--text-muted);
  cursor:pointer; font-size:11px; padding:2px 6px; border-radius:var(--r-1); font-family:inherit }
.pf-cen-list-head .pf-cen-list-actions button:hover{ color:var(--text); background:var(--surface-2) }
.pf-cen-details{ border:1px solid var(--border); border-radius:var(--r-2); background:var(--surface);
  overflow:hidden; margin-bottom:8px }
.pf-cen-details + .pf-cen-details{ margin-top:0 }

/* ─── FUSÃO com as rows do topo ────────────────────────────────────────
   As rows .prop-cen-row no topo já são o "sumário" de cada cenário (nome, valor,
   itens, alocado, barra). Aqui escondemos os duplicados e mostramos SÓ o cenário
   ATIVO logo abaixo dele, sem nome/valor/contagem repetidos. */
.pf-cen-list-head{ display:none !important }                         /* "X itens em N cenários · Expandir/Colapsar" */
.pf-cen-details{ border:0 !important; background:transparent !important;
  box-shadow:none !important; margin-top:6px !important }
.pf-cen-details:not(.is-cen-active){ display:none !important }       /* só mostra o ativo */
.pf-cen-details.is-cen-active > .pf-cen-summary{
  background:transparent; border:0;
  padding:4px 0 6px; display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  font-size:11px; color:var(--text-muted) }
.pf-cen-details > .pf-cen-summary > .chev,
.pf-cen-details > .pf-cen-summary > strong,
.pf-cen-details > .pf-cen-summary > .muted-tiny{ display:none !important }  /* nome/valor/itens já estão na row do topo */
.pf-cen-details > .pf-cen-summary::before{
  content:'Itens deste cenário'; font-size:10px; font-weight:700;
  text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted);
  opacity:.65; margin-right:auto }
.pf-cen-summary{ display:flex; align-items:center; gap:8px; padding:6px 10px; cursor:pointer;
  list-style:none; user-select:none; font-size:12px; background:var(--surface-2, rgba(0,0,0,.02));
  border-bottom:1px solid transparent; transition:border-color var(--d-fast,150ms) ease }
.pf-cen-summary::-webkit-details-marker{ display:none }
.pf-cen-summary .chev{ display:inline-block; transition:transform var(--d-fast,150ms) ease;
  color:var(--text-soft); font-size:11px; width:10px; text-align:center }
.pf-cen-details[open] > .pf-cen-summary{ border-bottom-color:var(--border) }
.pf-cen-details[open] > .pf-cen-summary .chev{ transform:rotate(90deg) }
.pf-cen-summary strong{ font-size:12px; font-weight:700; color:var(--text) }
.pf-cen-summary .muted-tiny{ font-size:11px }
/* Botão "Limpar cenário" no summary */
.pf-cen-clear{ background:none; border:1px solid rgba(220,38,38,.25); color:var(--danger,#b91c1c);
  font-size:11px; padding:3px 8px; border-radius:var(--r-1); cursor:pointer; font-family:inherit;
  display:inline-flex; align-items:center; gap:4px; line-height:1;
  transition:background var(--d-fast,150ms) ease, border-color var(--d-fast,150ms) ease, color var(--d-fast,150ms) ease }
.pf-cen-clear:hover{ background:rgba(220,38,38,.10); border-color:var(--danger,#b91c1c); color:#fff;
  background-color:var(--danger,#b91c1c) }
.pf-cen-clear[disabled]{ opacity:.4; cursor:not-allowed }
@media (max-width:720px){
  .pf-cen-clear .pf-cen-clear-lbl{ display:none }
}
.pf-cen-table{ width:100%; border-collapse:collapse; font-size:12px }
.pf-cen-table tr{ border-top:1px solid var(--border) }
.pf-cen-table tr:first-child{ border-top:0 }
.pf-cen-table td{ padding:4px 8px; vertical-align:middle; height:36px }
.pf-cen-table .pf-row-av{ width:36px; padding-left:10px }
.pf-cen-table .pf-row-av img,
.pf-cen-table .pf-row-av .avatar{ width:28px; height:28px; border-radius:50%; display:block }
.pf-cen-table .pf-row-name{ font-size:12px; line-height:1.3 }
.pf-cen-table .pf-row-name strong{ font-weight:600; color:var(--text) }
.pf-cen-table .pf-row-name .muted-tiny{ font-size:10.5px; color:var(--text-muted) }
.pf-cen-table .pf-row-val{ width:90px; text-align:right; font-weight:600;
  font-variant-numeric:tabular-nums; color:var(--text); white-space:nowrap }
.pf-cen-table .pf-row-act{ width:36px; text-align:right; padding-right:10px }
.pf-cen-table .pf-row-act button{ background:none; border:0; color:var(--text-soft); cursor:pointer;
  font-size:14px; padding:2px 6px; border-radius:var(--r-1); line-height:1 }
.pf-cen-table .pf-row-act button:hover{ color:var(--danger); background:var(--danger-soft, rgba(220,38,38,.08)) }
.pf-cen-empty{ padding:8px 12px; font-size:12px; color:var(--text-muted) }

/* ONDA 3 — escala (filtro local, paginação, footer fixo, empty state rico) */
.pf-cen-summary .pf-cen-filter{ margin-left:auto; font-size:11px; padding:3px 7px;
  border:1px solid var(--border); border-radius:var(--r-1); background:var(--surface);
  color:var(--text); width:130px; max-width:32vw; transition:border-color var(--d-fast,150ms) ease;
  font-family:inherit }
.pf-cen-summary .pf-cen-filter:focus{ outline:none; border-color:var(--primary, #6366f1);
  box-shadow:0 0 0 2px rgba(99,102,241,.15) }
.pf-cen-summary .pf-cen-filter-count{ font-size:10.5px; color:var(--text-muted);
  margin-left:6px; font-variant-numeric:tabular-nums; min-width:0 }
.pf-cen-summary .pf-cen-filter-count.is-empty{ color:var(--danger) }
.pf-cen-pager-row td{ padding:6px 8px; text-align:center; background:var(--surface-2, rgba(0,0,0,.02)) }
.pf-cen-pager-btn{ background:none; border:1px dashed var(--border); border-radius:var(--r-1);
  padding:4px 10px; font-size:11px; color:var(--text-muted); cursor:pointer; font-family:inherit }
.pf-cen-pager-btn:hover{ color:var(--text); border-color:var(--text-soft); background:var(--surface) }
.pf-cen-empty-rich{ padding:18px 14px; text-align:center; background:var(--surface-2, rgba(0,0,0,.02));
  border-radius:var(--r-2) }
.pf-cen-empty-rich .pf-cen-empty-icon{ font-size:28px; line-height:1; margin-bottom:6px }
.pf-cen-empty-rich h3{ font-size:13px; font-weight:700; margin:0 0 4px; color:var(--text) }
.pf-cen-empty-rich p{ font-size:12px; color:var(--text-muted); margin:0 0 10px }
.pf-cen-empty-actions{ display:inline-flex; gap:8px; flex-wrap:wrap; justify-content:center }
.pf-cen-empty-actions button{ background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-1); padding:6px 12px; font-size:12px; cursor:pointer; color:var(--text);
  font-family:inherit; transition:all var(--d-fast,150ms) ease }
.pf-cen-empty-actions button:hover{ background:var(--text); color:var(--surface); border-color:var(--text) }
.pf-cen-empty-actions .is-primary{ background:var(--text); color:var(--surface); border-color:var(--text) }
.pf-cen-empty-actions .is-primary:hover{ opacity:.85 }

/* Footer fixo de totais — fica ACIMA do carrinho quando ambos visíveis */
.pf-cen-footer-fixed{ position:fixed; left:0; right:0; bottom:0; z-index:48;
  background:var(--surface); border-top:1px solid var(--border);
  box-shadow:0 -4px 16px -8px rgba(0,0,0,.18);
  padding:8px 16px; display:none; align-items:center; gap:12px; font-size:12px;
  transform:translateY(100%); transition:transform var(--d-norm,220ms) ease, bottom var(--d-norm,220ms) ease;
  font-family:inherit }
.pf-cen-footer-fixed.is-visible{ display:flex; transform:translateY(0) }
.pf-cen-footer-fixed .pf-cf-dot{ width:9px; height:9px; border-radius:50%; flex:none;
  background:var(--success); box-shadow:0 0 0 2px rgba(0,0,0,.04) }
.pf-cen-footer-fixed .pf-cf-active{ cursor:pointer; color:var(--text); font-weight:600;
  display:inline-flex; align-items:center; gap:6px }
.pf-cen-footer-fixed .pf-cf-active:hover{ text-decoration:underline }
.pf-cen-footer-fixed .pf-cf-sep{ color:var(--text-soft); opacity:.5 }
.pf-cen-footer-fixed .pf-cf-meta{ color:var(--text-muted) }
.pf-cen-footer-fixed .pf-cf-margem{ font-weight:700; font-variant-numeric:tabular-nums }
.pf-cen-footer-fixed .pf-cf-spread{ margin-left:auto; color:var(--text-muted); font-size:11.5px }
/* Empilhamento c/ carrinho: ajustado via JS setando --pf-cart-h em :root */
body.pf-cart-open .pf-cen-footer-fixed{ bottom:var(--pf-cart-h, 64px) }

/* ===== Mobile (<720px) ===== */
@media (max-width:720px){
  .prop-cen-stack{ /* coluna stack já é flex column, garantir gap pra leitura */ gap:6px }
  .pf-cen-summary{ flex-wrap:wrap; row-gap:6px }
  .pf-cen-summary .pf-cen-filter{ margin-left:0; flex:1 1 100%; width:100% }
  .pf-cen-summary .pf-cen-filter-count{ flex:1 1 100%; margin-left:0 }
  /* Tabela vira cards verticais: cada <tr> bloco; cada <td> linha label+valor */
  .pf-cen-table, .pf-cen-table tbody, .pf-cen-table tr, .pf-cen-table td{ display:block; width:auto }
  .pf-cen-table tr{ padding:8px 10px; border-top:1px solid var(--border) }
  .pf-cen-table td{ height:auto; padding:3px 0; text-align:left }
  .pf-cen-table .pf-row-av{ width:auto; padding-left:0; display:inline-block; margin-right:8px;
    vertical-align:middle }
  .pf-cen-table .pf-row-name{ display:inline-block; vertical-align:middle }
  .pf-cen-table .pf-row-val{ width:auto; text-align:left; padding-top:6px }
  .pf-cen-table .pf-row-val::before{ content:'Custo: '; color:var(--text-muted); font-weight:400;
    font-size:11px; margin-right:4px }
  .pf-cen-table .pf-row-act{ width:auto; text-align:left; padding-right:0; padding-top:4px }
  /* Footer encolhe — só dot, contagem e margem */
  .pf-cen-footer-fixed{ padding:6px 12px; gap:8px; font-size:11.5px }
  .pf-cen-footer-fixed .pf-cf-active strong{ display:none }
  .pf-cen-footer-fixed .pf-cf-sep,
  .pf-cen-footer-fixed .pf-cf-spread{ display:none }
}

/* Animação tween — números tabulares (ONDA 2: cobertura ampliada pra evitar "pulo" de largura) */
[data-pf-anim], [data-pf-margem],
.cen-valor, .cen-aloc, .cen-margem, .cen-itens,
.pf-row-val{ font-variant-numeric:tabular-nums }
@keyframes pfRowPulse{
  0%   { box-shadow: 0 1px 6px -3px rgba(0,0,0,.18), 0 0 0 0 rgba(99,102,241,0) }
  40%  { box-shadow: 0 2px 10px -4px rgba(99,102,241,.4), 0 0 0 3px rgba(99,102,241,.12) }
  100% { box-shadow: 0 1px 6px -3px rgba(0,0,0,.18), 0 0 0 0 rgba(99,102,241,0) }
}
.prop-cen-row.is-animating{ animation: pfRowPulse .6s ease-out }
  @media (min-width: 768px) {
    .prop-stage-banner {
      position: sticky;
      top: 8px;
      z-index: 5;
      backdrop-filter: blur(10px) saturate(140%);
      -webkit-backdrop-filter: blur(10px) saturate(140%);
      box-shadow: 0 4px 16px -8px rgba(0,0,0,.12);
    }
  }
  .prop-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 var(--s-4);
    padding: 4px;
    background: var(--surface-2, #f1f5f9);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .prop-tab {
    flex: 1;
    min-width: 130px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s ease, color .15s ease, transform .1s ease;
    white-space: nowrap;
  }
  .prop-tab:hover { background: rgba(109,40,217,.06); color: #6d28d9; }
  .prop-tab.is-active {
    background: var(--surface, #fff);
    color: #0f172a;
    box-shadow: 0 1px 3px -1px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.06);
  }
  .prop-tab-ico { font-size: 14px; }
  .prop-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: rgba(109,40,217,.15);
    color: #6d28d9;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
  }
  .prop-tab.is-active .prop-tab-badge { background: #6d28d9; color: #fff; }
  .prop-tab-panel[hidden] { display: none !important; }
  @media (max-width: 600px) {
    .prop-tab { font-size: 12.5px; padding: 9px 10px; min-width: 110px; }
    .prop-tab-ico { display: none; }
  }

/* ============================================================
   Bloco #134 — Dashboard universal (KPIs Agência + Atalhos)
   Hierarquia clara: como a RM está (todos) → meu dia (papel) → atalhos.
   ============================================================ */

/* KPIs Agência — 4 cards cross-setor no topo do Dashboard */
.kpi-agencia { margin: 0 0 var(--s-4); }
.kpi-agencia-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin: 0 0 var(--s-3); }
.kpi-agencia-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.kpi-agencia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3); }
.kpi-ag { --accent: var(--text-soft);
  display: flex; align-items: center; gap: var(--s-3);
  padding: 14px var(--s-4); background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-4); box-shadow: var(--shadow-1);
  text-decoration: none; color: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.kpi-ag:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--shadow-2); }
.kpi-ag--ok     { --accent: var(--success); }
.kpi-ag--warn   { --accent: var(--warning); }
.kpi-ag--accent { --accent: var(--brand); }
.kpi-ag--base   { --accent: var(--text-soft); }
.kpi-ag-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--r-3);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.kpi-ag-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.kpi-ag-val { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-ag-lbl { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 3px; }
.kpi-ag-lbl small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11px; margin-top: 1px; }

/* Atalhos rápidos */
.atalhos-uni { margin: var(--s-4) 0; }
.atalhos-uni-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin: 0 0 var(--s-3); }
.atalhos-uni-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.atalhos-uni-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-2); }
.atalho-card { display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-3);
  text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 13px;
  text-align: center; transition: all .15s ease;
}
.atalho-card:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.atalho-ico { color: var(--text-soft); transition: color .15s ease; }
.atalho-card:hover .atalho-ico { color: var(--brand); }

/* ============================================================================
   Bloco #157 — Acessibilidade · prefers-reduced-motion blanket global
   Antes: 27 keyframes + 199 transitions sem cobertura uniforme (6 blocos =22%).
   Agora: 100% das animações respeitam preferência do usuário (WCAG 2.3.3).
   Spinners infinitos param após 1 iteração; transitions caem pra ~0ms.
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
 * Bloco #171 — Hardening mobile 360px (audit pós-blocos #134/#149/#159/#160/#161/#165b).
 * Pós-#115 sobrou muita grid `auto-fit minmax(220–280px, 1fr)` inline que falha em viewport 360px.
 * Aqui forçamos 1col nas grades de KPI/painéis e expandimos dropdown do Financeiro até 640px.
 * ============================================================ */
@media (max-width: 480px) {
  /* M1 — Painel Comercial + cards do dashboard caem em 1 coluna; KPI agência fica 2x2 compacto */
  .dash-comercial,
  .kpi-grid,
  .carteira-grid {
    grid-template-columns: 1fr !important;
  }
  /* KPI agência: 2x2 (4 KPIs em 4 stripes verticais ocupava >600px de scroll) */
  .kpi-agencia-grid,
  section.kpi-grid[data-agencia] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .kpi-ag-ico,
  .kpi-agencia .kpi-ag-ico { display: none; }

  /* Header de card: título + actions caem em linhas separadas sem cortar nada */
  .detail-head,
  .card-head {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .detail-actions { flex-wrap: wrap; }

  /* M4 — Persona toggle: chips agora atingem o mínimo touch (36px) */
  .persona-toggle .status-chip {
    padding: 8px 12px !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    font-size: 12px !important;
  }

  /* Breadcrumb: trunca último item longo (campanhas/propostas com nome enorme) */
  .breadcrumb [aria-current="page"] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  /* Capa interna proposta (Bloco #147): aliviar altura em mobile */
  .prop-show-cover-internal { height: 80px !important; }
}

/* M3 — fin-nav dropdown: a regra antiga só pegava até 520px. Estender pra 640px
 * (entre 521–640px o dropdown 200px ainda vazava viewport). */
@media (max-width: 640px) {
  .fin-nav { gap: 6px; }
  .fin-nav-group .fin-nav-menu {
    left: 0 !important;
    right: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }
  .fin-nav-current { display: none; }
  /* Botão "Baixar CSV" não pode estourar a linha */
  .fin-nav > a.btn-ghost { flex: 1 1 auto; justify-content: center; }
}

/* M2 — Grades de alertas do Financeiro/Overview: minmax 280px estourava em 360px.
 * Usar min(100%, …) força card a respeitar viewport menor. */
@media (max-width: 520px) {
  .fin-alertas-grid,
  .grid-2,
  .grid-3,
  .overview-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Bloco #233 — Classes utilitárias de botão (premium polish).
   Antes: dezenas de inline styles ad-hoc tipo `font-size:12px;padding:4px 10px`
   espalhados em forms admin. Agora: aplica .btn-sm/.btn-danger e fim.
   ─────────────────────────────────────────────────────────────────────────── */
.btn-sm {
  font-size: 12px !important;
  padding: 4px 10px !important;
  min-height: 0 !important;
  line-height: 1.4 !important;
}
.btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}
.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 88%, #000) !important;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Status pills semânticas reutilizáveis (badges de estado em listas) */
.pill-ok     { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success);  border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.pill-warn   { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning);  border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); }
.pill-danger { background: color-mix(in srgb, var(--danger)  12%, transparent); color: var(--danger);   border: 1px solid color-mix(in srgb, var(--danger)  25%, transparent); }
.pill-muted  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.pill-ok, .pill-warn, .pill-danger, .pill-muted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* ============================================================
   Bloco #247 â€” Cockpit de execuÃ§Ã£o de campanha
   Substitui 2 banners antigos por painel Ãºnico com KPIs + CTA contextual.
   ============================================================ */
.campanha-cockpit {
  margin: var(--s-3) 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 4px 16px -10px color-mix(in srgb, var(--text) 25%, transparent);
}
.campanha-cockpit-brand    { --cockpit-tone: var(--brand); }
.campanha-cockpit-accent   { --cockpit-tone: var(--accent); }
.campanha-cockpit-success  { --cockpit-tone: var(--success); }
.campanha-cockpit-warning  { --cockpit-tone: var(--warning); }
.campanha-cockpit-info     { --cockpit-tone: var(--info); }
.campanha-cockpit { border-left: 4px solid var(--cockpit-tone, var(--brand)); }

.cockpit-head {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: var(--s-5);
  padding: var(--s-5);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cockpit-tone, var(--brand)) 5%, var(--surface)) 0%, var(--surface) 60%);
}
.cockpit-head-meta { min-width: 0; }
.cockpit-eyebrow { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cockpit-tone, var(--brand)); }
.cockpit-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 8px; color: var(--text); }
.cockpit-meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-muted); }
.cockpit-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.cockpit-meta-item.is-warn { color: var(--warning); font-weight: 600; }
.cockpit-meta-item.is-danger { color: var(--danger); font-weight: 700; }

.cockpit-next {
  background: color-mix(in srgb, var(--cockpit-tone, var(--brand)) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cockpit-tone, var(--brand)) 25%, transparent);
  border-radius: var(--r-3);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.cockpit-next-eyebrow { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cockpit-tone, var(--brand)); }
.cockpit-next-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.cockpit-next-label svg { color: var(--cockpit-tone, var(--brand)); flex: none; }
.cockpit-next-desc { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.cockpit-next-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cockpit-tone, var(--brand)) !important;
  border-color: var(--cockpit-tone, var(--brand)) !important;
  color: #fff !important;
  font-weight: 700; font-size: 13px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--cockpit-tone, var(--brand)) 50%, transparent);
  transition: transform var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.cockpit-next-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--cockpit-tone, var(--brand)) 60%, transparent); }
.cockpit-next-cta svg { transition: transform var(--d-fast); }
.cockpit-next-cta:hover svg { transform: translateX(2px); }

.cockpit-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.cockpit-kpi { display: flex; flex-direction: column; gap: 6px; padding: var(--s-4) var(--s-5); background: var(--surface); text-decoration: none; color: inherit; transition: background var(--d-fast) var(--ease); }
.cockpit-kpi:hover { background: var(--surface-2); }
.cockpit-kpi-head { display: flex; align-items: center; gap: 6px; }
.cockpit-kpi-icon { display: inline-flex; color: var(--text-muted); }
.cockpit-kpi-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.cockpit-kpi-value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.cockpit-kpi-value span { font-size: 16px; font-weight: 600; color: var(--text-muted); }
.cockpit-kpi-bar { height: 5px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.cockpit-kpi-fill { height: 100%; background: linear-gradient(90deg, var(--cockpit-tone, var(--brand)), color-mix(in srgb, var(--cockpit-tone, var(--brand)) 60%, var(--success))); border-radius: var(--r-full); transition: width .5s var(--ease); }
.cockpit-kpi-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }

@media (max-width: 900px) {
  .cockpit-head { grid-template-columns: 1fr; }
  .cockpit-kpis { grid-template-columns: 1fr; }
  .cockpit-kpi { border-bottom: 1px solid var(--border); }
  .cockpit-kpi:last-child { border-bottom: 0; }
}

/* ============================================================
   Bloco #247 â€” Controle de Postagens premium (token-based, sem amarelo gritante)
   ============================================================ */
.postagens-section { margin-bottom: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); }
.postagens-head { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--hairline); }
.postagens-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; display: inline-flex; align-items: center; gap: 8px; color: var(--text); margin: 0; }
.postagens-head h2 svg { color: var(--brand); flex: none; }
.postagens-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); font-variant-numeric: tabular-nums; }
.postagens-hint { font-size: 11.5px; color: var(--text-muted); flex: 1 1 100%; margin: 4px 0 0; }
.postagens-hint a { color: var(--brand); }
.postagens-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); padding: var(--s-3) var(--s-5); }
.postagens-kpi { text-align: center; padding: var(--s-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--hairline); }
.postagens-kpi-value { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.postagens-kpi-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 4px; }
.postagens-kpi-agendada .postagens-kpi-value { color: var(--warning); }
.postagens-kpi-postada  .postagens-kpi-value { color: var(--success); }
.postagens-kpi-atrasada .postagens-kpi-value { color: var(--danger); }
.postagens-table-wrap { overflow-x: auto; padding: 0 var(--s-2) var(--s-3); }
.postagens-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.postagens-table thead tr { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.postagens-table th { text-align: left; padding: 8px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.postagens-table td { padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid var(--hairline); }
.postagens-table tr.is-postada td { background: color-mix(in srgb, var(--success) 4%, transparent); }
.postagens-table tr:last-child td { border-bottom: 0; }
.postagens-table .pst-fornecedor { font-weight: 600; color: var(--text); }
.postagens-table .pst-handle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.postagens-table .pst-link { color: var(--brand); font-size: 12px; text-decoration: underline; word-break: break-all; display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.postagens-table .pst-rm { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: var(--r-1); }
.postagens-table .pst-rm:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.postagens-status-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-full); }
.postagens-status-pill.is-agendada { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.postagens-status-pill.is-postada  { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.postagens-status-pill.is-atrasada { background: color-mix(in srgb, var(--danger) 14%, transparent);  color: var(--danger); }
.postagens-status-pill.is-cancelada{ background: var(--surface-2); color: var(--text-muted); }
.postagens-empty { padding: var(--s-7) var(--s-5); text-align: center; color: var(--text-muted); }
.postagens-empty p { margin: 0; }
.postagens-empty p + p { margin-top: 6px; font-size: 11.5px; }
.postagens-input-link { width: 100%; max-width: 320px; font-size: 12px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--r-1); }
.postagens-postar-btn { font-size: 11px; padding: 5px 10px; background: var(--success); color: #fff; border: 0; border-radius: var(--r-1); cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.postagens-postar-btn:hover { filter: brightness(0.92); }

/* ============================================================
   Bloco #248 â€” Pipeline pÃ³s-conclusÃ£o dentro do cockpit
   Renderiza os 4 passos: Concluir â†’ Insights â†’ Devolutiva â†’ Feedback.
   ============================================================ */
.cockpit-pipeline {
  background: color-mix(in srgb, var(--success) 4%, var(--surface));
  border-top: 1px solid color-mix(in srgb, var(--success) 25%, transparent);
  padding: var(--s-4) var(--s-5);
}
.cockpit-pipeline-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-bottom: var(--s-3);
}
.cockpit-pipeline-eyebrow {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--success);
}
.cockpit-pipeline-hint { font-size: 11.5px; color: var(--text-muted); }

.cockpit-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  counter-reset: cockpit-step;
}
.cockpit-step {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.cockpit-step.is-done { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 5%, var(--surface)); }
.cockpit-step.is-current { border-color: var(--brand); border-width: 1.5px; box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--brand) 40%, transparent); }
.cockpit-step.is-skip { opacity: 0.55; }
.cockpit-step.is-pending { opacity: 0.85; }

.cockpit-step-marker {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-muted);
  flex: none;
  font-weight: 800;
}
.cockpit-step.is-done .cockpit-step-marker { background: var(--success); color: #fff; }
.cockpit-step.is-current .cockpit-step-marker { background: var(--brand); color: #fff; }
.cockpit-step.is-pending .cockpit-step-marker { background: var(--surface-2); color: var(--text-soft); }
.cockpit-step-num { font-size: 13px; line-height: 1; }

.cockpit-step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cockpit-step-label {
  font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.25;
  display: inline-flex; align-items: center; gap: 5px;
}
.cockpit-step-label svg { color: var(--text-muted); flex: none; }
.cockpit-step.is-done .cockpit-step-label svg { color: var(--success); }
.cockpit-step.is-current .cockpit-step-label svg { color: var(--brand); }

.cockpit-step-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.cockpit-step-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--brand); text-decoration: none;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: var(--r-1);
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  transition: all var(--d-fast) var(--ease);
}
.cockpit-step-cta:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.cockpit-step-cta svg { transition: transform var(--d-fast); }
.cockpit-step-cta:hover svg { transform: translateX(2px); }

@media (max-width: 900px) {
  .cockpit-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cockpit-steps { grid-template-columns: 1fr; }
}

/* ============================================================
   Bloco #333 — Mobile 360px fix
   Neutraliza min-width hardcoded em styles inline quando viewport < 480px.
   Resolve overflow horizontal em: admin/bugs, admin/papeis, campanhas/index,
   campanhas/relatorios, admin/notif_cron_setup, e qualquer outro com flex+min-width fixo.
   Os styles inline tem prioridade sobre CSS — usar !important é necessário.
   ============================================================ */
@media (max-width: 480px) {
  /* Containers flex com min-width:200px+ travavam em telas estreitas */
  [style*="min-width:200px"],
  [style*="min-width:220px"],
  [style*="min-width:240px"],
  [style*="min-width:260px"],
  [style*="min-width:280px"],
  [style*="min-width:300px"] {
    min-width: 0 !important;
    flex-basis: 100% !important;
  }
  /* min-width médios (140-180px) — colapsa pra 100px na vertical */
  [style*="min-width:140px"],
  [style*="min-width:160px"],
  [style*="min-width:180px"] {
    min-width: 100px !important;
  }
  /* Tabelas largas — permite scroll horizontal interno em vez de quebrar tudo */
  table th[style*="min-width"],
  table td[style*="min-width"] {
    /* mantém min-width (precisamos pra coluna não sumir), mas
       força a tabela a ter overflow-x scrollable */
  }
}
