/* ============================================================
   AutoInsta — Premium Dark SaaS Theme
   Inspired by Linear, Vercel, Raycast
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-body:        #f8fafc;
  --bg-sidebar:     #ffffff;
  --bg-panel:       #ffffff;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --bg-input:       #f1f5f9;
  --bg-topbar:      rgba(255, 255, 255, 0.85);
  --bg-modal:       #ffffff;
  --bg-toast:       #ffffff;

  /* Borders */
  --border-subtle:  #e2e8f0;
  --border-medium:  #cbd5e1;
  --border-strong:  #94a3b8;
  --border-input:   #cbd5e1;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-faint:     #94a3b8;

  /* Accents */
  --accent:         #0f172a;
  --accent-dark:    #000000;
  --accent-glow:    #334155;
  --accent-bg:      #f1f5f9;

  /* Status */
  --success:        #10b981;
  --warning:        #f59e0b;
  --error:          #ef4444;
  --info:           #3b82f6;

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #0f172a, #334155);
  --grad-glow:      linear-gradient(135deg, #0f172a, #334155);
  --grad-subtle:    linear-gradient(180deg, #f8fafc 0%, transparent 100%);

  /* Shadows */
  --shadow-card:    0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-glow:    0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-glow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-modal:   0 20px 40px rgba(0, 0, 0, 0.12);

  /* Layout */
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius-sm:      6px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --radius-xl:      16px;

  /* Transitions */
  --tr-fast:        0.15s ease;
  --tr-base:        0.2s ease;
  --tr-smooth:      0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-bounce:      0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  /* Paleta do redesign SIRIÚS (pasta redesign/): preto neutro + dourado.
     Os nomes antigos continuam valendo — as telas usam estes tokens — e os
     novos (--gold, --line, --bg2…) são os do redesign, para o CSS novo. */
  --bg:             #0a0a0f;
  --bg2:            #12121a;
  --bg3:            #181824;
  --line:           #26263a;
  --line-hover:     #3d3d5a;
  --gold:           #ffd21f;
  --ink:            #1a1500;   /* texto sobre o dourado */
  --ok:             #4ade80;
  --bad:            #ff6b6b;
  --f-title:        'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --f-body:         'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Backgrounds — cards OPACOS, como no redesign */
  --bg-body:        #0a0a0f;
  --bg-sidebar:     rgba(10, 10, 15, 0.6);
  --bg-panel:       #12121a;
  --bg-card:        #12121a;
  --bg-card-hover:  #181824;
  --bg-card-solid:  #12121a;
  --bg-input:       #0d0d14;
  --bg-topbar:      transparent;
  --bg-modal:       #12121a;
  --bg-toast:       #12121a;

  /* Borders — linha neutra; o dourado fica para o que está selecionado */
  --border-subtle:  #26263a;
  --border-medium:  #3d3d5a;
  --border-strong:  rgba(255, 210, 31, 0.45);
  --border-input:   #26263a;

  /* Text */
  --text-primary:   #f4f4f8;
  --text-secondary: #c9c9d6;
  --text-muted:     #9a9ab0;
  --text-faint:     #6d6d85;

  /* Accents */
  --accent:         #ffd21f;
  --accent-dark:    #e6bb00;
  --accent-glow:    #ffe15c;
  --accent-bg:      rgba(255, 210, 31, 0.10);

  /* Primary override for buttons */
  --primary:        #ffd21f;

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #ffe15c, #ffd21f);
  --grad-glow:      linear-gradient(135deg, #ffd21f, #ffaa28);
  --grad-subtle:    linear-gradient(180deg, rgba(255, 210, 31, 0.04) 0%, transparent 100%);

  /* Shadows — sombra escura; brilho dourado só no que pede atenção */
  --shadow-card:    none;
  --shadow-glow:    0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
  --shadow-modal:   0 20px 60px rgba(0, 0, 0, 0.6);

  /* Neon extras (nomes antigos) */
  --neon-purple: #ffd21f;
  --neon-cyan: #ffaa28;
  --neon-pink: #ffaa28;
  --neon-green: #4ade80;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--f-body, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-variant-numeric: tabular-nums;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
  position: relative;
  transition: background-color var(--tr-smooth), color var(--tr-smooth);
}

/* ── Custom Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 31, 0.25);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 210, 31, 0.45);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 31, 0.25) transparent;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-title, inherit);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { color: var(--text-secondary); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--tr-fast);
}

a:hover {
  color: var(--accent-glow);
}

::selection {
  background: rgba(255, 210, 31, 0.30);
  color: #fff;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  /* No z-index here: an explicit z-index would create a stacking context that
     traps Bootstrap modals below the backdrop (appended to <body>). The shell
     already paints above the fixed .diamond-rain via DOM order. */
}

/* ── Sidebar ───────────────────────────────────────────────── */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-right: 1px solid rgba(255, 210, 31, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--tr-smooth);
}

.side-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.side-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.side-brand .brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 25px rgba(255, 210, 31, 0.45), 0 0 40px rgba(255, 170, 40, 0.15);
  flex-shrink: 0;
}

.side-brand .brand-text {
  display: flex;
  flex-direction: column;
}

.side-brand .brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.side-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Nav Links */
.side-links {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--tr-base);
  position: relative;
}

.side-links a i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--tr-base);
}

.side-links a:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}

.side-links a:hover i {
  color: var(--accent);
}

.side-links a.active {
  background: rgba(255, 210, 31, 0.15);
  color: #f4f4f8;
  font-weight: 600;
  box-shadow: inset 0 0 20px rgba(255, 210, 31, 0.06);
}

.side-links a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--grad-glow);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(255, 210, 31, 0.6);
}

.side-links a.active i {
  color: #ffd21f;
  filter: drop-shadow(0 0 6px rgba(255, 210, 31, 0.5));
}

/* Diamond bullet accent */
.side-links a .nav-diamond {
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity var(--tr-base);
  flex-shrink: 0;
  margin-left: auto;
}

.side-links a.active .nav-diamond,
.side-links a:hover .nav-diamond {
  opacity: 0.6;
}

/* ── Menu em grupos (modelo da aba Admin) ─────────────────── */
/* O título do grupo abre/fecha; só o grupo da página atual nasce aberto. */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: all var(--tr-base);
}
.nav-group-title > i:first-child { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-group-title:hover { background: var(--accent-bg); color: var(--text-primary); }
.nav-group-title .nav-chev { margin-left: auto; font-size: .75rem; transition: transform var(--tr-base); }
.nav-group.fechado .nav-chev { transform: rotate(-90deg); }
.nav-group-itens { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; }
.nav-group.fechado .nav-group-itens { display: none; }
.nav-group-itens a { padding-top: 9px; padding-bottom: 9px; font-size: 0.86rem; }

/* Sidebar Footer */
.side-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.side-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.side-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.7); }
}

/* ── Topbar ────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  /* min-height, não height: com altura fixa, a segunda linha das ações (que o
     `flex-wrap` cria quando falta espaço) era CORTADA — o wrap existia e não
     servia para nada. Medido: as ações pediam 679px e o botão Sincronizar
     saía com 89px de 127. */
  min-height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  /* `flex-start` + `margin-left:auto` nas ações, e não `space-between`: o
     resultado é o mesmo quando tudo cabe numa linha, mas quando a barra quebra
     o título continua à esquerda em vez de ser jogado para o canto direito,
     que é o que fazia a barra parecer quebrada. */
  justify-content: flex-start;
  padding: 0 32px;
  gap: 16px;
}

.top-bar .top-actions { margin-left: auto; }

.top-bar .page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  /* O título cede espaço antes dos botões: cortar o texto é melhor do que
     empurrar as ações para fora da tela. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar .top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Sem `min-width: 0` este bloco não encolhe (padrão `auto` do flex) e
     ESTICA a barra — que estica a página inteira, cortando tudo à direita.
     Medido: a barra pedia 852px num espaço de 792px. Com o wrap, as ações
     descem para uma segunda linha em vez de sumir. */
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 6px;
  padding: 8px 0;
}

/* BOTÃO DE AÇÃO NÃO ENCOLHE. O padrão do flex é encolher, e foi assim que
   "Sincronizar" virou "Sincron": o texto continuava lá, cortado por dentro do
   botão. Quem cede espaço é o título, que já tem reticências.

   Vale EM PROFUNDIDADE, não só no filho direto: as telas embrulham as ações
   num `<div class="d-flex">`, e proteger só o embrulho deixa os botões de
   dentro encolhendo do mesmo jeito. */
.top-bar .top-actions > *,
.top-bar .top-actions .btn,
.top-bar .top-actions a,
.top-bar .top-actions button,
.top-bar .top-actions select {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Telas onde as ações são muitas: a barra cresce em vez de cortar. */
.top-bar {
  flex-wrap: wrap;
  height: auto;
  min-height: var(--topbar-h);
  padding-top: 8px;
  padding-bottom: 8px;
  row-gap: 8px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ── Content Wrap ──────────────────────────────────────────── */
.content-wrap {
  padding: 28px 32px 48px;
  position: relative;
  /* No z-index: keep this out of the modal's stacking ancestry (see .app-shell). */
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  /* No z-index: keep this out of the modal's stacking ancestry (see .app-shell). */
  display: flex;
  flex-direction: column;
  /* min-width: 0 é OBRIGATÓRIO aqui. Item flex nasce com min-width:auto, ou
     seja, não encolhe abaixo do conteúdo — então uma tabela larga (a planilha
     de contas, a fila) ESTICA a página inteira em vez de rolar dentro do
     próprio container: o cabeçalho, os cards e os KPIs saem da tela junto,
     cortados à direita. Com 0, o conteúdo largo rola no lugar dele. */
  min-width: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: all var(--tr-smooth);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-subtle);
  opacity: 0;
  transition: opacity var(--tr-smooth);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

.card-body {
  padding: 24px;
  position: relative;
  z-index: 1;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  position: relative;
  z-index: 1;
}

/* ── Metric Cards ──────────────────────────────────────────── */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(12px);
  transition: all var(--tr-smooth);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 210, 31, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.metric-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.metric-card .metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 18px;
}

.metric-card .metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-card .metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card .metric-change {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--error); }

/* ── Hero Section (Dashboard) ──────────────────────────────── */
.hero-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 210, 31, 0.10) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 210, 31, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section .hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-section .hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.hero-section .hero-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* ── Account Card ──────────────────────────────────────────── */
.account-card {
  background: rgba(17, 17, 17, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 9px 10px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--tr-smooth);
  position: relative;
  overflow: hidden;
}

.account-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255, 210, 31, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--tr-smooth);
  pointer-events: none;
}

.account-card:hover::before {
  opacity: 1;
}

.account-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.account-card .account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  object-fit: cover;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--accent);
  flex-shrink: 0;
}

.account-card .account-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.glass-modal {
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 210, 31, 0.12);
  box-shadow: 0 0 30px rgba(255, 210, 31, 0.05);
}

.account-card .account-info {
  flex: 1;
  min-width: 0;
}

.account-card .account-username {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.account-card .account-fullname {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.account-card .account-stats {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.account-card .account-stats .stat {
  text-align: center;
}

.account-card .stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.account-card .stat-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-card .account-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── Compactação do card de conta (identidade mantida, só mais denso) ──
   O card empilha muitas seções (pasta, modelo, forçar, pausar, views,
   próximo post, cota, limite). Aqui apertamos os espaçamentos internos
   sem mexer no template, para caber mais conta por tela. */
.account-card .mb-3 { margin-bottom: 0.4rem !important; }
.account-card .mb-4 { margin-bottom: 0.5rem !important; }
.account-card .conta-modelo-form { margin-bottom: 0.35rem; }
.account-card .d-flex.align-items-center.mb-3 { margin-bottom: 0.45rem !important; }
.account-card .status-banner { padding: 6px 9px; }
.account-card .status-banner .small { font-size: 0.68rem; line-height: 1.25; }
.account-card .forcar-topo,
.account-card form.mb-3 { margin-bottom: 0.35rem !important; }
.account-card .proximo-post { padding: 5px 9px; }
.account-card .account-stats { margin-top: 6px; padding-top: 6px; }
.account-card .conta-modelo-form input,
.account-card input.form-control-sm,
.account-card .form-select-sm { padding-top: 2px; padding-bottom: 2px; font-size: 0.76rem; }
/* Toggles Forçar/Pausar mais baixos. */
.account-card .form-switch .form-check-input { width: 1.9em; height: 1em; }
.account-card .btn-sm { padding: 3px 8px; font-size: 0.76rem; }
.account-card .account-actions { margin-top: 8px; }

/* ── Post Card ─────────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--tr-smooth);
}

.post-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.post-card .post-thumb {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 200px;
  object-fit: cover;
  background: rgba(255, 210, 31, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 2rem;
}

.post-card .post-body {
  padding: 20px;
}

.post-card .post-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  line-height: 1.5;
}

.post-card .post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-card .post-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Caption Card ──────────────────────────────────────────── */
.caption-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--tr-smooth);
}

.caption-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.caption-card .caption-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.caption-card .caption-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.caption-card .caption-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.caption-card .caption-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Audio Card ────────────────────────────────────────────── */
.audio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--tr-smooth);
}

.audio-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.audio-card .audio-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--tr-base);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(255, 210, 31, 0.25);
}

.audio-card .audio-play:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(255, 210, 31, 0.35);
}

.audio-card .audio-info {
  flex: 1;
  min-width: 0;
}

.audio-card .audio-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.audio-card .audio-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* ── Status Dots & Badges ──────────────────────────────────── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.connecting {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  animation: pulse-dot-warn 1.5s ease infinite;
}

.status-dot.error {
  background: var(--error);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-dot-warn {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.7); }
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-connecting {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-published {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-queued {
  background: rgba(255, 210, 31, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 210, 31, 0.25);
}

.badge-draft {
  background: rgba(163, 160, 181, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(163, 160, 181, 0.20);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--tr-base);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(255, 210, 31, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 210, 31, 0.40);
  color: #fff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 210, 31, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.20);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: var(--error);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 7px 14px;
}

.btn-lg {
  font-size: 1rem;
  padding: 14px 28px;
}

.btn-icon {
  padding: 10px;
  width: 40px;
  height: 40px;
  justify-content: center;
}

/* ── Form Controls ─────────────────────────────────────────── */
.form-control,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 12px 16px;
  transition: all var(--tr-base);
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-input);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-faint);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-text {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.form-group {
  margin-bottom: 20px;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-select option {
  background: var(--bg-body);
  color: var(--text-primary);
}

/* ── Tables ────────────────────────────────────────────────── */
.table {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.table thead th {
  background: rgba(10, 10, 15, 0.50);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px;
}

.table tbody td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 16px;
  vertical-align: middle;
  font-size: 0.88rem;
}

.table tbody tr {
  transition: background var(--tr-fast);
}

.table tbody tr:hover {
  background: rgba(255, 210, 31, 0.04);
}

.table-dark {
  --bs-table-bg: transparent;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(2, 1, 5, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--tr-smooth);
  display: none;
}

.modal-backdrop-custom.show {
  display: block;
  opacity: 1;
}

.modal-custom {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 1000;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transition: all var(--tr-smooth);
  display: none;
}

.modal-custom.show {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-custom .modal-header {
  padding: 24px 28px 0;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-custom .modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-custom .modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--tr-fast);
  line-height: 1;
}

.modal-custom .modal-close:hover {
  color: var(--text-primary);
}

.modal-custom .modal-body {
  padding: 24px 28px;
}

.modal-custom .modal-footer {
  padding: 0 28px 24px;
  border: none;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toasts ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-toast);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-width: 320px;
  max-width: 440px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: all;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.toast.toast-exit {
  animation: toastSlideOut 0.25s ease forwards;
}

.toast .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast .toast-content {
  flex: 1;
}

.toast .toast-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.toast .toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast .toast-close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  transition: color var(--tr-fast);
  flex-shrink: 0;
}

.toast .toast-close:hover {
  color: var(--text-primary);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-left: 3px solid var(--error); }
.toast-error .toast-icon { color: var(--error); }

.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  color: var(--accent);
}

.empty-state .empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state .empty-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ── Auth Shell ────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  /* coluna: a marca fica ACIMA do card (era row, e o logo ia para o lado) */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glow-lg);
  padding: 44px 40px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 0 0 8px 8px;
}

.auth-card .auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-card .auth-logo .brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 210, 31, 0.30);
}

.auth-card .auth-logo .brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-card .auth-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 32px;
  letter-spacing: -0.03em;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card .auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

/* Form errors */
.form-errors {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.20);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.form-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.form-errors li {
  font-size: 0.82rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-errors li + li {
  margin-top: 4px;
}

/* ── Section Headers ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header .section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header .section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Quick Actions ─────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--tr-smooth);
  text-decoration: none;
  color: var(--text-primary);
  flex: 1;
  min-width: 200px;
}

.quick-action-btn:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: var(--text-primary);
}

.quick-action-btn .qa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.quick-action-btn .qa-text {
  font-weight: 600;
  font-size: 0.9rem;
}

.quick-action-btn .qa-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Activity Feed ─────────────────────────────────────────── */
.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item .activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-item .activity-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-item .activity-time {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ── Queue Sections ────────────────────────────────────────── */
.queue-section {
  margin-bottom: 40px;
}

.queue-section .queue-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-section .queue-count {
  background: var(--accent-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 0.72rem;
  color: var(--accent);
}

/* ── Loading / Spinner ─────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 210, 31, 0.05) 25%,
    rgba(255, 210, 31, 0.10) 50%,
    rgba(255, 210, 31, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── HTMX Indicator ────────────────────────────────────────── */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

/* ── Mobile Bottom Nav ─────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
  backdrop-filter: blur(20px);
}

.mobile-nav .mobile-links {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav .mobile-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 6px 4px;
  transition: color var(--tr-fast);
}

.mobile-nav .mobile-links a i {
  font-size: 1.2rem;
}

.mobile-nav .mobile-links a.active,
.mobile-nav .mobile-links a:hover {
  color: var(--accent);
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-accent { color: var(--accent) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }

.border-accent { border-color: var(--border-medium) !important; }

.bg-accent-soft { background: var(--accent-bg) !important; }

.glow { box-shadow: var(--shadow-glow) !important; }

.gap-grid { gap: 20px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

/* ── Bootstrap Overrides ───────────────────────────────────── */
.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dropdown-menu {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 8px;
}

.dropdown-item {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.88rem;
  transition: all var(--tr-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--accent-bg);
  color: var(--text-primary);
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
}

/* Modal comprido não pode passar da tela.
   `100dvh` e não `100vh`: no celular a barra do navegador entra e sai, e com vh
   o rodapé do modal (onde ficam Cancelar/Salvar) some embaixo dela.
   Vale para TODO modal, com ou sem `.modal-dialog-scrollable` — os formulários
   longos do painel (montar plano, composer) estavam cortando o rodapé, e
   depender de o Bootstrap acertar sozinho já falhou. */
.modal-dialog {
  max-height: calc(100dvh - 1rem);
}
.modal-content {
  max-height: calc(100dvh - 1rem);
  /* Rede de segurança: alguns modais têm estrutura complexa (abas + vários
     .modal-body, como o de adicionar conta) e a rolagem interna do .modal-body
     não pega. Sem isto, o conteúdo passava do teto de altura e vazava por baixo
     SEM o fundo do modal — o "background incompleto". Com overflow no próprio
     content-box, o excedente rola aqui e o fundo cobre tudo. */
  overflow-y: auto;
}

/* O <form> que envolve header/body/rodapé PRECISA ser flex também.
   O `.modal-content` do Bootstrap é `display:flex; flex-direction:column`, mas
   ele conta com header/body/rodapé como filhos DIRETOS. Quando um <form> entra
   no meio (todo modal de formulário do painel faz isso), o form vira o único
   filho flex e o corpo lá dentro não recebe altura limitada: ele cresce à
   vontade e o rodapé — onde ficam Cancelar/Criar — sai da tela. Era este o
   corte do modal de montar plano. */
.modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

/* `min-height:0` é obrigatório: item flex nasce com min-height auto, ou seja,
   não encolhe abaixo do conteúdo — e sem encolher não existe rolagem interna. */
.modal-body {
  overflow-y: auto;
  min-height: 0;
}

/* Barra de rolagem VISÍVEL dentro do modal — formulário longo que rola sem
   barra nenhuma é lido como formulário cortado.

   Medido no Edge 151 real: com `scrollbar-width`/`scrollbar-color` definidos,
   o Chromium usa a barra SOBREPOSTA do sistema (Windows 11), que ocupa 0px de
   largura e só aparece durante o gesto — largura medida: 0. Por isso a barra
   continuava invisível lá por mais que engordássemos a versão -webkit.

   A saída é o contrário do que parece: devolver `auto` nas duas propriedades
   padrão (o tema as define globalmente em `*`), porque o Chromium só respeita
   `::-webkit-scrollbar` quando AMBAS estão em `auto`. Aí a barra vira clássica,
   ocupa espaço e fica sempre à vista. */
.modal .modal-body {
  scrollbar-width: auto;
  scrollbar-color: auto;
}
.modal .modal-body::-webkit-scrollbar {
  width: 12px;
}
.modal .modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 100px;
}
.modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 31, 0.75);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 210, 31, 1);
  background-clip: content-box;
}

.modal-header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 28px;
}

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 28px;
}

.modal-backdrop {
  background-color: rgba(2, 1, 5, 0.75);
}

.nav-tabs {
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs .nav-link {
  color: var(--text-muted);
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--tr-base);
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary);
  border-color: transparent;
}

.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--accent);
  border: none;
  border-bottom: 2px solid var(--accent);
}

.alert {
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.88rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.20);
  color: var(--error);
}

.alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.20);
  color: var(--success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.20);
  color: var(--warning);
}

/* Override Bootstrap's default bg colors */
.bg-dark { background: var(--bg-card) !important; }

/* Input group */
.input-group-text {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Challenge Code Input ──────────────────────────────────── */
.challenge-input {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  padding: 16px;
  font-family: var(--f-body, inherit);
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress {
  background: rgba(255, 210, 31, 0.08);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  background: var(--grad-primary);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ── Page Transition ───────────────────────────────────────── */
.content-wrap {
  animation: fadeIn 0.3s ease;
}

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .side-nav {
    transform: translateX(-100%);
  }

  .side-nav.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }

  /* ESSENCIAL: o sidebar é `position: fixed` e o conteúdo abre espaço para
     ele com `margin-left: var(--sidebar-w)` (260px). No celular o sidebar
     sai de cena, então a margem PRECISA ir a zero — senão a tela inteira
     fica empurrada 260px para a direita e cortada.
     (Antes havia aqui `grid-template-columns`/`grid-column`, resquício de
     um layout em grid; o shell é flex, então não faziam efeito nenhum.) */
  .main-content {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-nav {
    display: block;
  }

  .top-bar {
    padding: 0 16px;
  }

  /* A FOLGA DE BAIXO TEM DE PASSAR DA BOLHA, NAO SO DA BARRA.
     Com 100px o ultimo elemento da pagina parava debaixo do botao flutuante
     do Hotier -- e no FIM da pagina nao ha como rolar para tira-lo de la.
     Medido: a bolha ocupa os 140px de baixo (88 de afastamento + 52 de
     diametro); 152 deixa 12px de respiro. O env() acompanha o indicador de
     home do iPhone, que empurra tudo para cima. */
  .content-wrap {
    padding: 20px 16px calc(152px + env(safe-area-inset-bottom, 0px));
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding: 28px 20px;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .modal-custom {
    width: 95%;
    max-height: 85vh;
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-action-btn {
    min-width: 100%;
  }

  .metric-card .metric-value {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .hero-section .hero-title {
    font-size: 1.2rem;
  }

  .top-bar .page-title {
    font-size: 1.1rem;
  }

  .toast {
    min-width: 280px;
    max-width: calc(100vw - 40px);
  }
}

/* ── Reforço de responsividade mobile ────────────────────────────── */
/* Nada deve empurrar a página para os lados: conteúdo largo rola dentro
   do próprio container, nunca a tela inteira. */
/* `clip`, e não `hidden`: com `hidden` no html E no body, o body vira um
   contêiner de rolagem que nunca rola — e todo `position: sticky` lá dentro
   (a barra de envio do Postar) gruda nele em vez da tela, ou seja, nunca
   gruda. `clip` corta o transbordo lateral do mesmo jeito, sem esse efeito. */
html, body { max-width: 100%; overflow-x: clip; }

@media (max-width: 768px) {
  /* ALVO DE TOQUE MINIMO.
     Medido no iPhone: 101 alvos abaixo de 30px na tela de Publicados, 82 em
     Contas -- caixinhas de 12 a 16px. Com o dedo isso e' sorteio, e o que
     chega e' "cliquei e nao marcou". A Apple recomenda 44px; aqui vamos a 22
     de caixa com area de toque de 44 por fora, que aumenta o alvo SEM
     empurrar o layout de tabela ja apertada.

     `:not([role=switch])` porque o interruptor do Bootstrap e' deliberadamente
     mais largo que alto -- forcar largura nele o deformaria. */
  /* A caixa cresce de verdade -- nao da para ampliar so a area clicavel com
     um pseudo-elemento, porque <input> e' elemento substituido e nao aceita
     ::before. 24px nao chega aos 44 da Apple, mas dobra o alvo sem quebrar a
     linha da tabela, que e' o limite real aqui. */
  .form-check-input:not([role="switch"]) {
    min-width: 24px;
    min-height: 24px;
  }

  /* Botao pequeno continua pequeno de aparencia, mas nao abaixo do que o
     dedo acerta. */
  /* CRESCE POR PADDING, E NAO POR min-height + inline-flex.
     A primeira versao usava `display: inline-flex` para poder centralizar o
     conteudo dentro do min-height. Funcionou na altura e ESTRAGOU a largura:
     a barra de acoes da Fila passou de 466px para 549px numa tela de 390, e
     dois botoes que ja estavam cortados ficaram mais longe ainda.
     Padding cresce o alvo sem tocar em `display` nem na largura.

     O seletor entra junto porque `.btn-sm` nao alcanca `.form-select-sm`:
     medido em Contas, 9 deles com 24px de altura. */
  .btn-sm, .btn-group-sm > .btn {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .form-select-sm {
    min-height: 34px;
  }

  /* Tabelas largas rolam sozinhas em vez de estourar o layout. */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  table { min-width: 0; }

  /* SINAL DE QUE A TABELA CONTINUA. So no celular: no computador as tabelas
     cabem e o degrade seria enfeite. O atributo e' posto pelo app.js, que
     mede de verdade -- CSS sozinho nao sabe se sobrou conteudo. */
  .tabela-larga { position: relative; }
  .tabela-larga[data-lado="mais"]::after {
    content: "";
    position: absolute; top: 0; right: 0; bottom: 0; width: 42px;
    pointer-events: none;                 /* nao pode roubar o toque do botao */
    background: linear-gradient(to right, rgba(10, 10, 15,0), rgba(10, 10, 15,.92));
    border-radius: 0 10px 10px 0;
  }
  .tabela-larga[data-lado="mais"]::before {
    /* Caractere de texto, e nao o codepoint do Bootstrap Icons: aquele muda
       de valor entre versoes da fonte e falha virando um quadradinho. */
    content: "››";               /* >> */
    font-weight: 700; letter-spacing: -2px;
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    z-index: 2; pointer-events: none;
    color: var(--accent); font-size: 1.1rem;
    opacity: .9; animation: cutucaLado 1.6s ease-in-out infinite;
  }
  @keyframes cutucaLado {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(-50%) translateX(4px); }
  }

  /* Top-bar enxuta: a busca vira só o ícone, o título encolhe.
     A barra pode crescer em altura e QUEBRAR LINHA: telas com botões
     próprios (ex.: "Adicionar conta") passavam de 510px numa tela de 390 e
     os botões ficavam cortados — inalcançáveis, porque o overflow-x:hidden
     escondia o estouro em vez de resolver. */
  .top-bar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .top-bar .page-title {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
  }
  .top-bar .top-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }
  /* Botões de ação da página não encolhem a ponto de sumir o rótulo. */
  .top-bar .top-actions .btn { white-space: nowrap; }
  .cmdk-trigger-label, .cmdk-kbd { display: none; }
  .cmdk-trigger { padding: 8px 10px; }

  /* Barras de ação em massa e cabeçalhos de card sempre quebram linha. */
  .card-header { flex-wrap: wrap; }

  /* Imagens e vídeos nunca ultrapassam a largura disponível. */
  img, video { max-width: 100%; height: auto; }

  /* Grupos de botões do topo descem para baixo do título sem cortar. */
  .top-actions .btn { padding: 6px 10px; }
}

@media (max-width: 480px) {
  /* A folga de baixo repete o valor da regra de 768px DE PROPOSITO: esta
     media query vem depois no arquivo e tem a mesma especificidade, entao
     ela ganha -- foi o que fez o conserto anterior nao valer em 390px, que
     e' justamente a largura de um iPhone. Ver a nota la em cima sobre por
     que 152. */
  .content-wrap {
    padding: 16px 12px calc(152px + env(safe-area-inset-bottom, 0px));
  }
  /* Cards de métrica em 2 colunas no celular (melhor que 1 gigante). */
  .hero-title { font-size: 1.15rem; }
  .modal-dialog { margin: 0.5rem; }
}

/* ── Sidebar overlay for mobile ────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity var(--tr-smooth);
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* ── Campo de senha com botão "olhinho" (revelar/ocultar) ──────
   Envolve um <input type="password"> e um <button.pw-toggle>. O JS
   (app.js) alterna o type do input e a classe .is-visible no wrapper,
   que troca qual ícone (olho / olho cortado) aparece. */
.pw-field {
  position: relative;
}
.pw-field > .form-control {
  padding-right: 44px;
}
.pw-field > .pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--tr-base);
}
.pw-field > .pw-toggle:hover {
  color: var(--text-primary);
}
.pw-field > .pw-toggle .pw-icon-off { display: none; }
.pw-field.is-visible > .pw-toggle .pw-icon-on { display: none; }
.pw-field.is-visible > .pw-toggle .pw-icon-off { display: inline-flex; }

/* ── Painel de verificação INLINE (2FA / checkpoint) ───────────
   Substitui o antigo modal Bootstrap que ficava preso dentro do
   .account-card (backdrop-filter/transform prendiam o position:fixed
   e o polling do HTMX órfãos o backdrop → tela congelava). Inline não
   tem backdrop nem posição fixa: nada trava, nada corta. */
.verify-panel {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md, 12px);
  background: rgba(245, 197, 24, 0.06);
  padding: 16px;
  margin-bottom: 16px;
}
.verify-panel .verify-title {
  color: #f5c518;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.verify-panel .verify-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 12px;
}
.verify-panel .verify-code-input {
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.4em;
  font-weight: 700;
  padding: 10px 12px;
}
.verify-panel .verify-code-input::placeholder {
  letter-spacing: 0.2em;
  font-weight: 500;
}
.verify-panel .verify-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.verify-panel .verify-resend {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.verify-panel .verify-resend:hover {
  color: var(--text-primary);
}
.verify-panel .verify-resend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* ============================================================
   COMPONENTES DO BOOTSTRAP NO VISUAL SIRIÚS (redesign preto/dourado)
   ------------------------------------------------------------
   Era o bloco "Neon": gradiente roxo→ciano com !important. Agora o primário
   é DOURADO CHAPADO com texto escuro, e os secundários são cinza com borda —
   como na pasta redesign/. O !important continua só onde o Bootstrap ou
   estilo inline das telas venceriam.
   ============================================================ */

/* ── Botões ──────────────────────────────────────────────── */
[data-theme="dark"] .btn-primary {
  background: var(--gold) !important;
  border: 1px solid var(--gold) !important;
  color: var(--ink) !important;
  font-weight: 700;
  box-shadow: none;
  transition: filter .15s ease, border-color .15s ease;
}
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus-visible {
  filter: brightness(1.07);
  transform: none;
}
[data-theme="dark"] .btn-primary:disabled,
[data-theme="dark"] .btn-primary.disabled {
  opacity: .45;
}

[data-theme="dark"] .btn-outline-secondary {
  background: var(--bg3) !important;
  border-color: var(--line) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] .btn-outline-secondary:hover,
[data-theme="dark"] .btn-outline-secondary.active {
  background: var(--bg3) !important;
  border-color: var(--line-hover) !important;
  color: var(--text-primary) !important;
}

/* ── Campos ──────────────────────────────────────────────── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--line) !important;
  color: var(--text-primary) !important;
  border-radius: 10px;
  transition: border-color .15s ease;
}
[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-select:hover {
  border-color: var(--line-hover) !important;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.12) !important;
  outline: none;
}
[data-theme="dark"] .form-control::placeholder {
  color: #6d6d85 !important;
}

/* ── Tabelas ─────────────────────────────────────────────── */
[data-theme="dark"] .table-dark {
  --bs-table-bg: transparent !important;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.03) !important;
}
[data-theme="dark"] .table-dark thead th {
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--line) !important;
}

/* ── Barra de rolagem ────────────────────────────────────── */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2c2c42;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #3d3d5a;
}
[data-theme="dark"] * {
  scrollbar-color: #2c2c42 transparent;
}
/* O corpo do modal fica de fora da barra fina acima. Precisa estar aqui
   porque `[data-theme="dark"] *` vence `.modal-body` (mesma força, vem depois),
   e qualquer valor diferente de `auto` faria o Chromium voltar para a barra
   sobreposta de 0px — ver a explicação completa no bloco do modal. */
[data-theme="dark"] .modal .modal-body {
  scrollbar-width: auto;
  scrollbar-color: auto;
}

[data-theme="dark"] .nav-category {
  color: var(--text-faint) !important;
}

/* ── Card: sem "flutuar" no hover; só a borda clareia ────── */
[data-theme="dark"] .card:hover {
  border-color: var(--line-hover);
  box-shadow: none;
}

/* ── Menus suspensos (sino, usuário, ações) ──────────────── */
[data-theme="dark"] .dropdown-menu {
  background: var(--bg2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .dropdown-item {
  color: var(--text-primary) !important;
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 500;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: var(--bg3) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] .dropdown-divider { border-color: var(--line) !important; }

/* ============================================================
   ONDA 1 — Fundação de UX: sidebar colapsável · ⌘K · progresso
   ============================================================ */

/* ── Barra de progresso global (navegação + HTMX) ─────────── */
.app-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad-primary, linear-gradient(90deg, #ffd21f, #ffaa28));
  box-shadow: 0 0 12px rgba(255, 210, 31, 0.7);
  z-index: 2000;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.3s ease;
  pointer-events: none;
}
.app-progress.active { opacity: 1; }

/* ── Toggle de colapsar a sidebar (somente desktop) ───────── */
.desk-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all var(--tr-base);
}
.desk-toggle:hover { color: var(--text-primary); background: var(--accent-bg); }

@media (min-width: 769px) {
  .desk-toggle { display: inline-flex; align-items: center; }

  :root[data-nav="collapsed"] { --sidebar-w: 78px; }

  [data-nav="collapsed"] .side-brand { padding: 24px 0; }
  [data-nav="collapsed"] .side-brand .brand-logo { justify-content: center; gap: 0; }
  [data-nav="collapsed"] .brand-text { display: none; }
  [data-nav="collapsed"] .side-links { padding: 16px 10px; }
  [data-nav="collapsed"] .side-links .nav-text,
  [data-nav="collapsed"] .nav-category { display: none; }
  /* Recolhido: só ícones, então os grupos somem e todos os links aparecem. */
  [data-nav="collapsed"] .nav-group-title { display: none; }
  [data-nav="collapsed"] .nav-group.fechado .nav-group-itens { display: flex; }
  [data-nav="collapsed"] .nav-group-itens { padding-left: 0; }
  [data-nav="collapsed"] .side-links a { justify-content: center; padding: 12px 0; gap: 0; }
  [data-nav="collapsed"] .side-links a i { width: auto; }
  [data-nav="collapsed"] .side-links a.active::before { display: none; }

  /* Tooltip do rótulo ao passar o mouse na sidebar colapsada */
  [data-nav="collapsed"] .side-links a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: opacity var(--tr-base);
    z-index: 300;
  }
  [data-nav="collapsed"] .side-links a:hover::after { opacity: 1; }
}

/* ── Gatilho da busca ⌘K na topbar ────────────────────────── */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  min-width: 220px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--tr-base);
}
.cmdk-trigger:hover { border-color: var(--primary); color: var(--text-primary); }
.cmdk-trigger .cmdk-trigger-label { flex: 1; text-align: left; }
.cmdk-kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-app, transparent);
  color: var(--text-muted);
  line-height: 1;
}
@media (max-width: 768px) {
  .cmdk-trigger { min-width: 0; }
  .cmdk-trigger .cmdk-trigger-label, .cmdk-trigger .cmdk-kbd { display: none; }
}

/* ── Command Palette (overlay + caixa) ────────────────────── */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk-box {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(255, 210, 31, 0.12);
  overflow: hidden;
  animation: cmdk-in 0.16s ease;
}
@keyframes cmdk-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.cmdk-input-wrap i { color: var(--text-muted); font-size: 1.1rem; }
.cmdk-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
}
.cmdk-input-wrap .cmdk-esc {
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 6px;
}
.cmdk-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 46vh;
  overflow-y: auto;
}
.cmdk-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.cmdk-list a i { font-size: 1.05rem; width: 22px; text-align: center; }
.cmdk-list li.active a,
.cmdk-list a:hover {
  background: rgba(255, 210, 31, 0.15);
  color: var(--text-primary);
}
.cmdk-list li.active a i { color: var(--primary); }
.cmdk-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   Correção de contraste — texto auxiliar em dark mode
   ------------------------------------------------------------
   O Bootstrap acha que estamos em light (usamos data-theme, não
   data-bs-theme), então .text-muted/.text-secondary e placeholders
   saem com cinza de light-mode e ficam ilegíveis sobre o fundo
   escuro. Forçamos tons legíveis.
   ============================================================ */
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-body-secondary,
[data-theme="dark"] small.text-muted,
[data-theme="dark"] .form-text {
  color: var(--text-muted) !important;
}

/* Tabelas: o .table do Bootstrap assume fundo BRANCO (light mode). Sem isto
   as linhas saem brancas sobre o tema escuro. Vale para todas as telas. */
[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border-subtle);
  --bs-table-striped-bg: rgba(255, 210, 31, 0.05);
  --bs-table-striped-color: var(--text-primary);
  --bs-table-hover-bg: rgba(255, 210, 31, 0.09);
  --bs-table-hover-color: var(--text-primary);
  --bs-table-active-bg: rgba(255, 210, 31, 0.12);
  --bs-table-active-color: var(--text-primary);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
[data-theme="dark"] .table > thead th {
  color: var(--text-muted);
  border-bottom-color: var(--border-subtle);
}
[data-theme="dark"] .form-label.text-muted,
[data-theme="dark"] label.text-muted {
  color: #c9c9d6 !important;
}
[data-theme="dark"] .text-secondary {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
  color: #6d6d85 !important;
}
/* Garante contraste do corpo de texto padrão do Bootstrap em dark */
[data-theme="dark"] .card-body,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

/* ============================================================
   Input de arquivo — o nativo ("Escolher Arquivo | Nenhum arquivo
   escolhido") é feio e quebra o tema. Vira um dropzone tracejado
   com botão em gradiente. Vale para TODOS os formulários.
   ============================================================ */
input[type="file"].form-control {
  padding: 0;
  background: var(--bg-input) !important;
  border: 1px dashed var(--border-medium) !important;
  border-radius: 10px !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 0.86rem;
  min-height: 46px;
}
input[type="file"].form-control:hover {
  border-color: var(--primary) !important;
  background: var(--bg-card-hover) !important;
}
input[type="file"].form-control::file-selector-button {
  background: var(--grad-primary);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  margin: 0 14px 0 0;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter var(--tr-base);
  height: 100%;
}
input[type="file"].form-control::file-selector-button:hover {
  filter: brightness(1.15);
}
input[type="file"].form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.12) !important;
}

/* ============================================================
   FullCalendar — tema escuro/neon (o padrão vinha sem estilo)
   ============================================================ */
.fc {
  --fc-border-color: var(--border-subtle);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 210, 31, 0.06);
  --fc-today-bg-color: rgba(255, 210, 31, 0.14);
  color: var(--text-primary);
}
.fc .fc-toolbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: capitalize;
}
.fc .fc-button {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  padding: 7px 14px !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  transition: all var(--tr-base);
  text-transform: capitalize;
}
.fc .fc-button:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-medium) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--grad-primary) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 0 18px rgba(255, 210, 31, 0.35) !important;
}
.fc .fc-button:disabled { opacity: 0.4 !important; }
.fc .fc-button-group { gap: 6px; display: inline-flex; }
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }

.fc .fc-col-header-cell {
  background: rgba(255, 210, 31, 0.07);
  padding: 10px 0;
}
.fc .fc-col-header-cell-cushion {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.fc .fc-daygrid-day-number {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 10px;
  text-decoration: none;
}
.fc .fc-daygrid-day:hover { background: rgba(255, 210, 31, 0.05); }
.fc .fc-day-today .fc-daygrid-day-number {
  color: #fff;
  background: var(--grad-primary);
  border-radius: 8px;
  margin: 5px;
  padding: 4px 9px;
  box-shadow: 0 0 14px rgba(255, 210, 31, 0.5);
}
.fc .fc-day-other .fc-daygrid-day-number { opacity: 0.35; }

/* Eventos como pílulas com brilho */
.fc-daygrid-event, .fc-timegrid-event {
  border: 0 !important;
  border-radius: 8px !important;
  padding: 3px 8px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform var(--tr-base);
}
.fc-daygrid-event:hover, .fc-timegrid-event:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}
.fc-event-title, .fc-event-time { color: #fff !important; }
.fc .fc-daygrid-more-link { color: var(--accent); font-weight: 600; font-size: 0.75rem; }
.fc .fc-scrollgrid { border-radius: 12px; overflow: hidden; }

/* Legenda de status do calendário */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.cal-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cal-legend .leg .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ============================================================
   Estrela de Davi — marca do SiriúsFlow
   ============================================================ */
.sf-star {
  width: 1.05em;
  height: 1.05em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
/* Dentro de botões/pílulas a estrela acompanha a cor do texto */
.sf-star.mono g { stroke: currentColor; }
.btn .sf-star { margin-right: 0.45em; }

.sf-star.star-sm { width: 0.95em; height: 0.95em; }
.sf-star.star-lg { width: 92px; height: 92px; }
.sf-star.star-xl { width: 128px; height: 128px; }

/* Brilho dourado da marca (usado no logo das telas de acesso) */
.sf-star.glow {
  filter: drop-shadow(0 0 10px rgba(245, 197, 24, 0.55))
          drop-shadow(0 0 34px rgba(245, 197, 24, 0.25));
}

/* ============================================================
   Logo NOVA (imagem) — a marca do SiriúsFlow
   ============================================================
   As artes têm fundo transparente e proporção própria, então só a ALTURA é
   fixada: travar a largura junto deformaria a arte. A estrelinha dos botões
   continua no `star.html` (SVG), porque lá ela precisa acompanhar a cor do
   texto — imagem não faz isso. */
.sf-logo {
  display: block;
  height: auto;
  max-width: 100%;
}
.sf-logo-horizontal { height: 34px; width: auto; }
.sf-logo-vertical   { height: 132px; width: auto; }
.sf-logo-estrela    { height: 34px; width: auto; }

/* Na barra lateral a logo é a marca inteira — não há texto ao lado dela. */
.side-brand .sf-logo-horizontal { height: 30px; }

/* Telas de acesso (login, cadastro, senha): a logo vertical ocupa o lugar
   que era da estrela + wordmark. */
.sf-brand .sf-logo-vertical { height: 148px; }

/* O brilho dourado da marca, agora sobre a imagem. */
.sf-logo.glow {
  filter: drop-shadow(0 0 10px rgba(245, 197, 24, 0.45))
          drop-shadow(0 0 34px rgba(245, 197, 24, 0.20));
}

/* Logo completo das telas de acesso: estrela + wordmark */
.sf-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.sf-brand .sf-halo {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
}
.sf-brand .sf-halo::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(245, 197, 24, 0.35);
  box-shadow: 0 0 34px rgba(245, 197, 24, 0.12) inset;
}
.sf-wordmark {
  text-align: center;
  line-height: 1;
}
.sf-wordmark .sf-name {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #ffffff 35%, #9a9ab0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sf-wordmark .sf-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: #f5c518;
  text-indent: 0.42em;
}
.sf-wordmark .sf-sub::before,
.sf-wordmark .sf-sub::after {
  content: '';
  height: 1px;
  width: 42px;
  background: linear-gradient(90deg, transparent, rgba(245, 197, 24, 0.75), transparent);
}

/* ============================================================
   TEMA CLARO — correções
   ------------------------------------------------------------
   O app foi construído dark-first e muitas telas usam `text-white`
   fixo, que fica ilegível no modo claro. Aqui convertemos esses
   casos, PRESERVANDO o branco onde ele é correto (badges, botões
   e qualquer elemento com fundo colorido).
   ============================================================ */
[data-theme="light"] .text-white:not(.badge):not(.btn):not([class*="bg-"]):not(.btn *):not(.badge *):not(.alert *) {
  color: var(--text-primary) !important;
}

/* Blocos "bg-dark" viram superfícies claras no tema claro */
[data-theme="light"] .bg-dark:not(.badge) {
  background: var(--bg-card-hover) !important;
}

/* A sidebar continua escura nos DOIS temas (é proposital). Por isso o
   texto dela não pode seguir os tokens do tema claro, ou some. */
[data-theme="light"] .side-nav .brand-name,
[data-theme="light"] .side-nav .side-links a.active {
  color: #f4f4f8;
}
[data-theme="light"] .side-nav .side-links a,
[data-theme="light"] .side-nav .brand-sub,
[data-theme="light"] .side-nav .nav-category {
  color: #9a9ab0;
}
[data-theme="light"] .side-nav .side-links a:hover {
  color: #fff;
}

/* Inputs no tema claro: o --bg-input é claro, então o texto precisa ser escuro */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .field-suffix input {
  color: var(--text-primary) !important;
}
[data-theme="light"] .opt-title { color: var(--text-primary); }
[data-theme="light"] .opt-card:has(input:checked) .opt-title { color: var(--accent-dark); }

/* ============================================================
   Tags de status da conta (ON / BAN / TOKEN…)
   ============================================================ */
.acct-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  border: 1px solid transparent;
}
.acct-tag.on {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}
.acct-tag.ban {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}
.acct-tag.warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
.acct-tag.wait {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* ============================================================
   Cards de opção (radio) — usado no Composer
   Substitui os btn-group cinzas do Bootstrap por cards com
   título + descrição e destaque neon no selecionado.
   ============================================================ */
.opt-grid {
  display: grid;
  gap: 10px;
}
.opt-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) {
  .opt-grid.cols-2 { grid-template-columns: 1fr; }
}

.opt-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--tr-base);
  position: relative;
  margin: 0;
}
.opt-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}
.opt-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  border: 2px solid var(--border-medium);
  transition: all var(--tr-base);
}
.opt-title {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}
.opt-desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 3px;
  line-height: 1.4;
}

/* Estado selecionado — destaque neon (sem cinza apagado) */
.opt-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(255, 210, 31, 0.12);
  box-shadow: inset 0 0 24px rgba(255, 210, 31, 0.10), 0 0 0 1px rgba(255, 210, 31, 0.25);
}
.opt-card:has(input:checked) .opt-dot {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 45%, transparent 47%);
  box-shadow: 0 0 10px rgba(255, 210, 31, 0.6);
}
.opt-card:has(input:checked) .opt-title { color: #fff; }
.opt-card:focus-within {
  outline: none;
  border-color: var(--accent);
}

/* Campo numérico com sufixo (min, vez(es)) */
.field-suffix {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
}
.field-suffix input {
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  color: var(--text-primary) !important;
  padding: 10px 14px;
  outline: none;
  min-width: 0;
}
.field-suffix input:focus { box-shadow: none !important; }
.field-suffix .suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(255, 210, 31, 0.12);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border-left: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.field-suffix:focus-within { border-color: var(--primary); }

/* Resumo do composer */
.composer-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.composer-summary .sum-item {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.composer-summary .sum-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.composer-summary .sum-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.composer-total {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 170, 40, 0.08);
  border: 1px solid rgba(255, 170, 40, 0.22);
  margin-bottom: 14px;
}
.composer-total .total-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad-glow);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.composer-total .total-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   Ranking de Produtividade (componente dark próprio)
   ============================================================ */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ranking-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--tr-base), transform var(--tr-base);
}
.ranking-row:hover {
  border-color: var(--border-medium);
  transform: translateX(2px);
}
.ranking-row.is-me {
  background: rgba(255, 210, 31, 0.12);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 24px rgba(255, 210, 31, 0.08);
}
.ranking-pos { flex-shrink: 0; }
.ranking-medal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.ranking-medal.gold {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #3a2a00;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}
.ranking-medal.silver {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #1e293b;
}
.ranking-medal.bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}
.ranking-medal.plain {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.ranking-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.ranking-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 210, 31, 0.2);
  color: #ffe68a;
  border: 1px solid rgba(255, 210, 31, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.ranking-name {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-you {
  font-size: 0.62rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.ranking-sub {
  color: #9a9ab0;
  font-size: 0.8rem;
  margin-top: 2px;
}
.ranking-sub .ranking-dot { margin: 0 6px; opacity: 0.5; }
.ranking-score {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 7px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.min-w-0 { min-width: 0; }
@media (max-width: 576px) {
  .ranking-row { gap: 10px; padding: 10px 12px; }
  .ranking-sub { font-size: 0.72rem; }
  .ranking-score { padding: 6px 10px; font-size: 0.78rem; }
}

/* ── Painel de stories ativos ────────────────────────────────────── */
.stories-resumo-kicker { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.66rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.stories-stat { flex: 1; background: var(--bg-card-hover); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px; text-align: center; }
.stories-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stories-stat-lbl { font-size: 0.64rem; color: var(--text-muted); margin-top: 4px; }
.stories-conta-card { background: var(--bg-card-hover); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.stories-pic { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: rgba(255, 210, 31,.2); display: flex; align-items: center; justify-content: center; color: #ffe68a; }
.stories-pic img { width: 100%; height: 100%; object-fit: cover; }
.stories-mini { position: relative; width: 64px; aspect-ratio: 9/16; border-radius: 8px; overflow: hidden; background: #05050a; border: 1px solid var(--border-subtle); }
.stories-mini > img { width: 100%; height: 100%; object-fit: cover; }
.stories-mini-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; background: linear-gradient(transparent, rgba(0,0,0,.85)); display: flex; flex-direction: column; gap: 1px; }
.stories-mini-data { color: #fff; font-size: 0.52rem; opacity: 0.9; }
.stories-mini-abrir { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; text-decoration: none; }
.stories-mini-abrir:hover { background: var(--primary); color: #fff; }

/* ── Cabeçalho de dia na fila ────────────────────────────────────── */
.dia-header td {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px !important;
  border-top: 1px solid var(--border-subtle) !important;
}

/* ── Diretório de usuários (painel de gestão) ────────────────────── */
.user-dir-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: border-color var(--tr-base), transform var(--tr-base);
}
.user-dir-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.user-dir-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: rgba(255, 210, 31, 0.18); display: flex; align-items: center;
  justify-content: center; color: #ffe68a; font-size: 1.2rem;
}
.user-dir-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dir-name { color: var(--text-primary); font-weight: 700; }
.user-dir-count { color: var(--primary); font-weight: 800; font-size: 1.3rem; line-height: 1; }

/* ── Foto da conta no composer ───────────────────────────────────── */
.composer-acc-pic {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: rgba(255, 210, 31, 0.18); display: flex; align-items: center;
  justify-content: center; color: #ffe68a;
}
.composer-acc-pic img { width: 100%; height: 100%; object-fit: cover; }

/* ── Grupos por modelo (tela de Contas) ──────────────────────────── */
.modelo-cabecalho {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 8px 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.modelo-nome { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; }

/* ── Banners de status da conta (caiu / limitada / pausada) ──────── */
.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.status-banner > i { font-size: 1.1rem; margin-top: 1px; }
.status-banner .small { font-size: 0.72rem; opacity: 0.85; margin-top: 2px; }
.banner-erro { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.banner-limite { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.banner-pausa { background: rgba(148, 163, 184, 0.12); border: 1px solid rgba(148, 163, 184, 0.3); color: #cbd5e1; }
.proximo-post { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-card-hover); border: 1px solid var(--border-subtle); }
.conta-modelo-form { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.conta-modelo-form input {
  flex: 1; min-width: 0; background: var(--bg-input);
  border: 1px solid var(--border-subtle); color: var(--text-primary);
  border-radius: 8px; padding: 4px 10px; font-size: 0.82rem;
}

/* ── Configuração de alertas ─────────────────────────────────────── */
.alerta-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.alerta-titulo { color: var(--text-primary); font-weight: 600; }
.alerta-desc { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.alerta-passos { display: flex; flex-direction: column; gap: 10px; }
.alerta-passos > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.alerta-passos span {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 210, 31, 0.18);
  color: #ffe68a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ── Moderação (painel admin) ────────────────────────────────────── */
.mod-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
}
.mod-account.is-banned { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.06); }
.mod-account-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 210, 31, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe68a;
}
.mod-account-pic img { width: 100%; height: 100%; object-fit: cover; }
.mod-media {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #05050a;
  border: 1px solid var(--border-subtle);
}
.mod-media img,
.mod-media video { width: 100%; height: 100%; object-fit: cover; }
.mod-media-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}
.mod-media-date { color: #fff; font-size: 0.68rem; opacity: 0.85; }

/* ── Tela de sucesso da campanha ─────────────────────────────────── */
.campaign-ok {
  display: flex;
  justify-content: center;
  padding: 20px 0 80px;
}
.campaign-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 22px;
  padding: 36px 34px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}
.campaign-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--tr-base);
}
.campaign-close:hover { color: var(--text-primary); border-color: var(--border-strong); }
/* Olhinho + fechar lado a lado no canto. Os dois usam .campaign-close (mesmo
   círculo); o grupo é que fica absoluto, e eles voltam ao fluxo normal. */
.campaign-topo {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}
.campaign-topo .campaign-close { position: static; background: transparent; }
.campaign-marca { margin-bottom: 14px; }
.campaign-estrela { height: 56px; }
.campaign-card {
  /* Feixe roxo da marca atrás do topo do card. */
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(255, 210, 31, 0.16), transparent 60%),
    var(--bg-card);
}
.campaign-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.campaign-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 8px 0 12px;
}
.campaign-sub { color: var(--text-secondary); margin-bottom: 24px; }
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.campaign-stat {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
}
.campaign-stat-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.campaign-stat-value { color: var(--text-primary); font-weight: 700; font-size: 1.05rem; }
.campaign-fila-badge {
  display: inline-block;
  background: rgba(255, 210, 31, 0.12);
  border: 1px solid rgba(255, 210, 31, 0.3);
  color: #ffe68a;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.campaign-accounts {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 6px 4px;
  margin-bottom: 18px;
}
.campaign-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
}
.campaign-account-row + .campaign-account-row { border-top: 1px solid var(--border-subtle); }
.campaign-account-name { color: var(--text-secondary); font-size: 0.9rem; }
.campaign-account-count { color: var(--text-primary); font-weight: 700; }
.campaign-notes {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.campaign-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 576px) {
  .campaign-card { padding: 28px 20px; border-radius: 16px; }
  .campaign-title { font-size: 1.6rem; }
  .campaign-grid { grid-template-columns: 1fr 1fr; }
  .campaign-actions .btn { flex: 1; }
}

/* ── Ranking "Top 5 players do dia" (estilo painel) ───────────────── */
.rank-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.rank-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 22px;
}
.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.rank-row:last-child { border-bottom: 0; }
/* Barrinha vertical à esquerda, como na referência */
.rank-row::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 26px;
  border-radius: 3px;
  background: var(--primary);
  opacity: 0.55;
}
.rank-row.is-me::before { opacity: 1; box-shadow: 0 0 12px var(--primary); }
.rank-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255, 210, 31, 0.18);
  border: 1px solid rgba(255, 210, 31, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe68a;
  font-size: 1.2rem;
}
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-id { flex: 1; min-width: 0; }
.rank-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-sep { margin: 0 5px; opacity: 0.5; }
.rank-posts {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  white-space: nowrap;
}
@media (max-width: 576px) {
  .rank-title { font-size: 1.3rem; margin-bottom: 16px; }
  .rank-row { gap: 12px; padding: 12px 4px; }
  .rank-avatar { width: 40px; height: 40px; }
  .rank-name { font-size: 0.92rem; }
  .rank-posts { font-size: 0.85rem; }
}


/* Conta nascida no motor de criação e ainda SEM token da Meta.
   Ela publica story-link pela engine, mas não publica Reels/CTA — o card
   precisa dizer isso à distância, senão some no meio das outras. */
.account-card.nascida-lab {
  border-color: rgba(255, 193, 7, 0.45);
  background: rgba(255, 193, 7, 0.05);
}
.account-card.nascida-lab::after {
  content: 'NOVA · sem token';
  position: absolute;
  top: 8px; right: 8px;
  font-size: .58rem;
  letter-spacing: .04em;
  color: #ffc107;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 999px;
  padding: 1px 7px;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TELA DE ACESSO — aurora animada + vidro
   ───────────────────────────────────────────────────────────────────────────
   Referência: o login do Autofy, que o cliente elogiou — card de vidro
   flutuando sobre um fundo atmosférico. Trazido para a NOSSA identidade: roxo
   (#ffd21f) + ciano (#ffaa28), nunca o vermelho deles. Tudo em CSS puro (sem
   imagem de fundo): pesa nada, escala em qualquer tela e respeita a CSP.
   Só afeta as telas de acesso (.auth-page); o painel interno não é tocado.
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0a0f;
  overflow: hidden;
}

/* Dois "sóis" de cor que giram devagar atrás do card — é o que dá a atmosfera
   sem precisar de foto. O blur enorme derrete as bordas em luz. */
.auth-page::before,
.auth-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.auth-page::before {
  width: 620px; height: 620px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(255, 210, 31, 0.85), transparent 62%);
  animation: auroraA 22s ease-in-out infinite alternate;
}
.auth-page::after {
  width: 560px; height: 560px;
  bottom: -200px; right: -140px;
  background: radial-gradient(circle, rgba(255, 170, 40, 0.7), transparent 62%);
  animation: auroraB 26s ease-in-out infinite alternate;
}

@keyframes auroraA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(140px, 120px) scale(1.18); }
}
@keyframes auroraB {
  0%   { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-130px, -90px) scale(0.92); }
}

/* Grade fina por cima, quase invisível — dá textura de "produto" e tira a
   sensação de fundo liso. Um brilho de varredura passa por ela de vez em
   quando, que é o toque de vida que o painel do Autofy tem no cabeçalho. */
.diamond-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}
.diamond-rain::after {
  content: '';
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(115deg, transparent 40%,
              rgba(255, 210, 31, 0.10) 48%, rgba(255, 170, 40, 0.08) 52%, transparent 60%);
  animation: authSweep 9s ease-in-out infinite;
}
@keyframes authSweep {
  0%, 62%   { transform: translateX(-60%); opacity: 0; }
  70%       { opacity: 1; }
  100%      { transform: translateX(60%); opacity: 0; }
}

/* A marca e o card entram deslizando — a primeira coisa que o cliente vê já se
   move, que é o "isto é vivo" que ele pediu. */
.auth-shell > .sf-brand { animation: authRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.auth-shell > .auth-card {
  animation: authRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}
@keyframes authRise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Vidro de verdade: mais translúcido e com mais blur, para o fundo colorido
   aparecer POR TRÁS do card (era opaco e o fundo morria na borda). */
.auth-page .auth-card {
  background: rgba(18, 18, 26, 0.55);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 60px -10px rgba(255, 210, 31, 0.25);
}

/* O filete de gradiente no topo do card vira uma linha viva, respirando. */
.auth-page .auth-card::before {
  left: 8%; right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd21f 30%, #ffaa28 70%, transparent);
  animation: authGlow 4s ease-in-out infinite;
}
@keyframes authGlow {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Campos: foco com halo roxo, como o resto do painel — mas aqui a transição é
   mais visível porque a tela é o cartão de visita. */
.auth-page .form-control {
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-page .form-control:focus {
  background: rgba(10, 10, 15, 0.7);
  border-color: rgba(255, 210, 31, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.18);
}

/* Botão Entrar: brilho que atravessa no hover — o mesmo gesto do botão de CTA
   do Autofy, feito com um pseudo-elemento em vez de imagem. */
.auth-page .btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
}
.auth-page .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px -6px rgba(255, 210, 31, 0.55);
}
.auth-page .btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.5s;
}
.auth-page .btn-primary:hover::after { left: 130%; }

/* Quem pediu para o sistema não animar (acessibilidade) recebe tudo parado. */
@media (prefers-reduced-motion: reduce) {
  .auth-page::before, .auth-page::after, .diamond-rain::after,
  .auth-shell > .sf-brand, .auth-shell > .auth-card,
  .auth-page .auth-card::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD — mais "produto": raios no cabeçalho, bordas que brilham, funil
   Inspirado no painel do Autofy, na nossa cor (roxo/ciano). Só no dashboard.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Cabeçalho: raios de luz diagonais que passam devagar por trás do título —
   a atmosfera do topo do painel deles, sem imagem. */
.hero-section {
  background:
    linear-gradient(120deg, rgba(255, 210, 31, 0.10), transparent 45%),
    linear-gradient(300deg, rgba(255, 170, 40, 0.08), transparent 45%),
    var(--bg-card);
}
.hero-section .hero-kicker,
.hero-section .hero-title { position: relative; z-index: 2; }
.hero-section > .hero-rays {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
.hero-section > .hero-rays::before {
  content: '';
  position: absolute;
  top: -60%; left: -20%;
  width: 60%; height: 220%;
  background: linear-gradient(90deg, transparent,
              rgba(255, 210, 31, 0.16), rgba(255, 170, 40, 0.10), transparent);
  transform: rotate(18deg);
  filter: blur(14px);
  animation: heroRay 11s ease-in-out infinite;
}
@keyframes heroRay {
  0%   { transform: translateX(-40%) rotate(18deg); opacity: 0; }
  25%  { opacity: 1; }
  60%, 100% { transform: translateX(260%) rotate(18deg); opacity: 0; }
}

/* Cards de métrica: borda de gradiente que acende. É um pseudo-elemento com o
   gradiente roxo/ciano "vazado" (mask) para virar só a linha da borda — no
   hover ela ganha brilho. */
.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 210, 31, 0.55), rgba(255, 170, 40, 0.35) 60%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.5;
  transition: opacity var(--tr-smooth);
  pointer-events: none;
}
.metric-card:hover::before { opacity: 1; }
.metric-card:hover {
  box-shadow: 0 10px 40px -12px rgba(255, 210, 31, 0.35),
              0 0 30px -8px rgba(255, 170, 40, 0.18);
}

/* O número principal de cada card ganha um leve brilho — o "vivo" que os
   grandes números do Autofy têm. */
.metric-card .metric-value {
  text-shadow: 0 0 22px rgba(255, 210, 31, 0.22);
}

/* ── Funil de conversão (SharkBot: Leads → Pix → Venda) ─────────────────── */
.funil { display: flex; flex-direction: column; gap: 8px; }
.funil-etapa {
  position: relative;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 210, 31, 0.22), rgba(255, 210, 31, 0.10));
  border: 1px solid rgba(255, 210, 31, 0.28);
  margin: 0 auto;
  text-align: center;
  transition: transform var(--tr-smooth), box-shadow var(--tr-smooth);
}
.funil-etapa:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -10px rgba(255, 210, 31, 0.5);
}
.funil-etapa .funil-rot {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 5px;
}
.funil-etapa .funil-num { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.15; }
/* Cada etapa mais estreita que a anterior — a forma de funil. */
.funil-etapa.f1 { width: 100%; }
.funil-etapa.f2 { width: 84%; }
.funil-etapa.f3 { width: 68%; background: linear-gradient(135deg, rgba(255, 170, 40, 0.22), rgba(255, 170, 40, 0.10)); border-color: rgba(255, 170, 40, 0.3); }
.funil-taxa {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: -2px 0;
}
.funil-taxa b { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .hero-section > .hero-rays::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FUNDO GLOBAL (redesign SIRIÚS) — atrás do painel INTEIRO (todas as telas)
   ───────────────────────────────────────────────────────────────────────────
   Grade de pontos que anda, manchas douradas que flutuam e um brilho que
   segue o mouse. Os cards são opacos e ficam por cima. Camada única no
   base.html, então vale em toda tela sem tocar em nenhuma delas.
   ═══════════════════════════════════════════════════════════════════════════ */

/* O corpo fica transparente para a atmosfera (z-index -1) aparecer nas frestas.
   A cor de base mora agora na própria camada. Só no painel — a tela de acesso
   tem a aurora dela. */
body.app-body {
  background-color: var(--bg-body);
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: sfDrift 14s linear infinite;
}
@keyframes sfDrift { to { background-position: 26px 52px; } }

/* Manchas douradas borradas que flutuam devagar (redesign). */
.app-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(520px 380px at 12% 28%, rgba(255, 210, 31, 0.10), transparent 70%),
    radial-gradient(700px 500px at 100% 0, rgba(255, 210, 31, 0.07), transparent 70%);
}
.app-ambient i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
  animation: sfBlob 16s ease-in-out infinite alternate;
}
.app-ambient i:nth-child(1) { width: 380px; height: 380px; left: -80px; top: 8%;  background: rgba(255, 210, 31, 0.20); }
.app-ambient i:nth-child(2) { width: 320px; height: 320px; right: -60px; top: 2%; background: rgba(255, 160, 30, 0.14); animation-duration: 21s; animation-delay: -6s; }
.app-ambient i:nth-child(3) { width: 420px; height: 420px; left: 35%; top: 55%;   background: rgba(255, 210, 31, 0.10); animation-duration: 25s; animation-delay: -11s; }
.app-ambient i:nth-child(4) { width: 260px; height: 260px; right: 10%; top: 70%;  background: rgba(255, 230, 120, 0.10); animation-duration: 19s; animation-delay: -3s; }
@keyframes sfBlob {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(70px, -50px) scale(1.18); }
  100% { transform: translate(-50px, 60px) scale(.92); }
}

/* Brilho que segue o mouse + pontos da grade acesos em volta dele.
   O JS (app.js, initBrilhoMouse) só move e liga; sem JS ficam apagados. */
.app-glow {
  position: fixed; left: 0; top: 0; z-index: -1;
  width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 31, 0.30), rgba(255, 210, 31, 0.08) 45%, transparent 68%);
  pointer-events: none; opacity: 0; transition: opacity .4s; will-change: transform;
}
.app-spot {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background-image: radial-gradient(rgba(255, 210, 31, 0.95) 1.3px, transparent 1.8px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 30%), #000, transparent);
  mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 30%), #000, transparent);
  animation: sfDrift 14s linear infinite;
}
.app-glow.on, .app-spot.on { opacity: 1; }
.sf-spark {
  position: fixed; pointer-events: none; z-index: 55;
  color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 31, 0.9);
  transform: translate(-50%, -50%);
  animation: sfSpark .9s ease-out forwards;
}
@keyframes sfSpark {
  to { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + 42px)) scale(.3) rotate(120deg); }
}

/* Borda de card que CORRE: um brilho gira em volta da borda. É o "vivo" que o
   painel pedia. Devagar por padrão, acelera no hover. Só nos cards de métrica
   e nos cartões do painel — não em tabela, para não virar circo. */
.metric-card::before {
  background:
    conic-gradient(from var(--giro, 0deg),
      transparent 0deg,
      rgba(255, 210, 31, 0.9) 40deg,
      rgba(255, 170, 40, 0.7) 90deg,
      transparent 150deg,
      transparent 360deg);
  animation: giraBorda 6s linear infinite;
}
.metric-card:hover::before { animation-duration: 2.5s; opacity: 1; }

/* A variável --giro precisa ser animável: registra a propriedade. Onde o
   navegador não suporta @property, a borda fica fixa (sem correr) mas ainda
   acesa — degrada com elegância. */
@property --giro {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes giraBorda {
  to { --giro: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  body.app-body, .app-ambient i, .app-spot { animation: none; }
  .app-glow, .app-spot, .sf-spark { display: none; }
  .metric-card::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIS EFEITO — vidro, entrada de página e revelar ao rolar
   ═══════════════════════════════════════════════════════════════════════════ */

/* Cards opacos (redesign): sem vidro — o blur por trás só custaria GPU. */
.card, .metric-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Entrada de página: o conteúdo sobe e aparece a cada navegação. Como o painel
   recarrega a página inteira, uma animação no .main-content dá a sensação de
   "transição entre telas" sem framework nenhum. */
.app-body .content-wrap.page-enter {
  animation: pageEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Revelar ao rolar: cards entram deslizando quando aparecem na tela. A classe
   `revelar` começa apagada; o JS põe `revelado` quando o card cruza a viewport.
   Sem JS (ou reduced-motion) tudo já nasce visível — nunca some conteúdo. */
.revelar {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.revelar.revelado {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .app-body main.page-enter { animation: none; }
  .revelar { opacity: 1; transform: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTÃO ENTRAR (login) — borda de gradiente que percorre, moderno
   ───────────────────────────────────────────────────────────────────────────
   A borda roxo→ciano gira em volta do botão continuamente (conic-gradient +
   @property), e um brilho atravessa no hover. Só na tela de acesso.
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-page .btn-entrar,
[data-theme="dark"] .auth-page .btn-entrar {
  position: relative;
  isolation: isolate;
  /* Fundo ESCURO (vence o gradiente !important do .btn-primary) para a borda
     animada e o brilho interno se destacarem — como no print de referência. */
  background: rgba(10, 10, 15, 0.92) !important;
  border: none !important;
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 13px 20px;
  overflow: hidden;
}
/* A borda: um retângulo de gradiente cônico girando, "vazado" no meio (mask)
   para virar só a linha da borda. */
.auth-page .btn-entrar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.6px;
  background: conic-gradient(from var(--giro-btn, 0deg),
      #ffd21f, #ffaa28, #ffaa28, #ffd21f);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: giraBtn 3.2s linear infinite;
  z-index: -1;
}
@property --giro-btn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes giraBtn { to { --giro-btn: 360deg; } }

/* Um leve preenchimento de gradiente pulsando por dentro, para não ficar só a
   borda — dá o brilho que vaza no print. */
.auth-page .btn-entrar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 210, 31,.28), rgba(255, 170, 40,.20));
  opacity: .5;
  z-index: -1;
  transition: opacity .25s;
}
.auth-page .btn-entrar:hover { transform: translateY(-1px); box-shadow: 0 10px 34px -8px rgba(255, 170, 40,.5); }
.auth-page .btn-entrar:hover::after { opacity: .9; }
.auth-page .btn-entrar:hover::before { animation-duration: 1.2s; }

.auth-page .btn-entrar-conteudo { position: relative; z-index: 1; display: inline-flex; align-items: center; }
.auth-page .btn-entrar .bi-arrow-right { transition: transform .2s; }
.auth-page .btn-entrar:hover .bi-arrow-right { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .auth-page .btn-entrar::before { animation: none; }
}


/* ── Selo de notificações ──────────────────────────────────────────────────
   O selo do Bootstrap (`top-0 start-100 translate-middle`) deixa METADE dele
   fora do botão. Com 598 não lidas ele fica com 39px, invade o botão seguinte
   — que, por vir depois no DOM, pinta por cima e o "engole".

   Aqui ele fica DENTRO do canto, com `z-index` para não ser coberto, e a
   contagem é limitada a 99+ no template: acima disso o número já não informa
   nada além de "muitas". */
.selo-notif {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 3;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--bg-topbar);
  pointer-events: none;
}


/* ── Notebook (1366 e vizinhos) ────────────────────────────────────────────
   O rótulo "Buscar… Ctrl K" custa 150px e só era escondido abaixo de 768px.
   Medido na tela de Contas a 1366px: as ações pediam 1247px num espaço de
   1096, e esses 150px são a diferença entre uma linha e duas. O ícone da lupa
   já diz o que o botão faz. */
@media (max-width: 1500px) {
  .cmdk-trigger-label,
  .cmdk-trigger .cmdk-kbd { display: none; }
  /* `min-width: 0` junto: sem isto o botão continua com os 220px reservados
     para um texto que não está mais lá — medido, o rótulo sumia e a largura
     não mudava. */
  .cmdk-trigger { min-width: 0; padding: 8px 12px; }
  .top-bar .top-actions { gap: 8px; }
}

/* ── Modo privado (olhinho) ────────────────────────────────────────────
   A classe `privado` vai no <html> pelo script do <head>, ANTES da pintura —
   por isso as regras moram aqui e não no template da página: CSS lido no fim
   do <body> deixava as contas aparecerem por um instante a cada atualização.
   Marque com `.conta-privada` qualquer @/foto de conta que deva sumir junto. */
html.privado .ranking-name,
html.privado .rank-name,
html.privado .conta-privada {
  filter: blur(6px);
  user-select: none;
}
html.privado .ranking-avatar,
html.privado .rank-avatar,
html.privado .conta-privada-foto { filter: blur(8px); }
/* O ícone do botão também é CSS: trocado por JS, ele mostrava o olho aberto
   até o script rodar. */
.privado-on { display: none; }
html.privado .privado-on { display: inline-block; }
html.privado .privado-off { display: none; }
html.privado .btn-privado {
  background: rgba(255, 210, 31, 0.22);
  border-color: rgba(255, 210, 31, 0.6);
  color: #fff;
}

/* ── Tag de vencimento do plano (Visão Geral) ─────────────────────────────
   Três degraus: semana (amarelo), cinco dias (laranja) e no dia (vermelho,
   pulsando). Fica DENTRO do hero, ao lado do título: a faixa do topo do
   base.html some no meio dos outros avisos, a tag não. */
.plano-tag {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid;
}
.plano-tag strong { font-weight: 800; }
.plano-tag-data { opacity: 0.7; font-weight: 500; }
.plano-tag-semana { color: #facc15; background: rgba(250, 204, 21, 0.10); border-color: rgba(250, 204, 21, 0.35); }
.plano-tag-cinco  { color: #fb923c; background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.45); }
.plano-tag-hoje   { color: #f87171; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.55);
                    animation: plano-pulso 2s ease-in-out infinite; }
.plano-tag-btn {
  padding: 3px 12px;
  border-radius: 999px;
  background: currentColor;
  text-decoration: none;
  font-weight: 800;
}
.plano-tag-btn span { color: #111827; }
@keyframes plano-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18); }
}
@media (prefers-reduced-motion: reduce) { .plano-tag-hoje { animation: none; } }


/* ═══════════════════════════════════════════════════════════════════════════
   SIRIÚS — CASCA E COMPONENTES DO REDESIGN (pasta redesign/)
   ───────────────────────────────────────────────────────────────────────────
   Fica no FIM do arquivo de propósito: vence as regras antigas lá de cima sem
   precisar apagá-las de uma vez. Cada aba revisada depois tira daqui o que
   sobrar de velho.
   ═══════════════════════════════════════════════════════════════════════════ */

:root { --sidebar-w: 236px; --radius-lg: 14px; }

/* ── Ponte com o Bootstrap ───────────────────────────────────────────────
   O <html> agora tem data-bs-theme="dark": o Bootstrap passa a saber que o
   fundo é escuro (fim das caixas brancas de bg-body/alert-secondary). Aqui o
   "primary" dele vira o dourado — antes saía o azul #0d6efd em abas, switches,
   paginação e botões outline. */
[data-bs-theme="dark"] {
  --bs-body-bg: #0a0a0f;
  --bs-body-color: #f4f4f8;
  --bs-body-font-family: var(--f-body);
  --bs-secondary-color: #9a9ab0;
  --bs-tertiary-bg: #181824;
  --bs-secondary-bg: #12121a;
  --bs-border-color: #26263a;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
  --bs-primary: #ffd21f;
  --bs-primary-rgb: 255, 210, 31;
  --bs-primary-text-emphasis: #ffe15c;
  --bs-primary-bg-subtle: rgba(255, 210, 31, 0.10);
  --bs-primary-border-subtle: rgba(255, 210, 31, 0.40);
  --bs-link-color: #ffd21f;
  --bs-link-color-rgb: 255, 210, 31;
  --bs-link-hover-color: #ffe15c;
  --bs-link-hover-color-rgb: 255, 225, 92;
  --bs-focus-ring-color: rgba(255, 210, 31, 0.30);
  --bs-success: #4ade80;
  --bs-success-rgb: 74, 222, 128;
  --bs-danger: #ff6b6b;
  --bs-danger-rgb: 255, 107, 107;
  --bs-purple: #ffd21f;
  --bs-code-color: #ffe15c;   /* era o rosa do Bootstrap */
}
[data-bs-theme="dark"] .text-primary { color: var(--gold) !important; }
[data-bs-theme="dark"] .bg-primary { background-color: var(--gold) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .border-primary { border-color: rgba(255, 210, 31, 0.6) !important; }
[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: #ffd21f;
  --bs-btn-border-color: rgba(255, 210, 31, 0.45);
  --bs-btn-hover-color: #1a1500;
  --bs-btn-hover-bg: #ffd21f;
  --bs-btn-hover-border-color: #ffd21f;
  --bs-btn-active-color: #1a1500;
  --bs-btn-active-bg: #ffd21f;
  --bs-btn-active-border-color: #ffd21f;
  --bs-btn-disabled-color: #ffd21f;
  --bs-btn-disabled-border-color: rgba(255, 210, 31, 0.45);
}
[data-bs-theme="dark"] .nav-pills {
  --bs-nav-pills-link-active-bg: rgba(255, 210, 31, 0.12);
  --bs-nav-pills-link-active-color: #ffd21f;
  --bs-nav-link-color: #9a9ab0;
  --bs-nav-link-hover-color: #f4f4f8;
}
[data-bs-theme="dark"] .nav-pills .nav-link.active { box-shadow: inset 0 0 0 1px rgba(255, 210, 31, 0.45); }
[data-bs-theme="dark"] .nav-underline { --bs-nav-underline-link-active-color: #ffd21f; --bs-nav-link-color: #9a9ab0; }
[data-bs-theme="dark"] .form-check-input { background-color: #0d0d14; border-color: #3d3d5a; }
[data-bs-theme="dark"] .form-check-input:checked { background-color: #ffd21f; border-color: #ffd21f; }
[data-bs-theme="dark"] .form-check-input:focus { border-color: #ffd21f; box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.15); }
[data-bs-theme="dark"] .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231a1500'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .form-range::-webkit-slider-thumb { background: #ffd21f; }
[data-bs-theme="dark"] .form-range::-moz-range-thumb { background: #ffd21f; }
[data-bs-theme="dark"] .pagination {
  --bs-pagination-bg: #12121a;
  --bs-pagination-border-color: #26263a;
  --bs-pagination-color: #f4f4f8;
  --bs-pagination-hover-bg: #181824;
  --bs-pagination-hover-color: #f4f4f8;
  --bs-pagination-hover-border-color: #3d3d5a;
  --bs-pagination-active-bg: #ffd21f;
  --bs-pagination-active-border-color: #ffd21f;
  --bs-pagination-active-color: #1a1500;
  --bs-pagination-disabled-bg: #0d0d14;
  --bs-pagination-disabled-border-color: #26263a;
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.2);
}
[data-bs-theme="dark"] .progress { background-color: #181824; }
/* `.progress-bar` do tema usa background-image (gradiente); as cores de estado
   do Bootstrap só trocam background-color, que fica POR BAIXO. Sem isto a
   barra nunca ficava vermelha ao estourar o limite. */
.progress-bar.bg-danger  { background-image: none; background-color: var(--bad) !important; }
.progress-bar.bg-warning { background-image: none; background-color: #f59e0b !important; }
.progress-bar.bg-success { background-image: none; background-color: var(--ok) !important; }
.progress-bar.bg-info    { background-image: none; }
[data-bs-theme="dark"] .badge.bg-primary { color: var(--ink) !important; }
[data-bs-theme="dark"] .btn-warning { --bs-btn-color: #1a1500; --bs-btn-hover-color: #1a1500; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; }

/* ── Classes que as telas usam e que nunca tinham sido definidas ────────── */
.text-purple { color: var(--gold) !important; }
.bg-purple { background-color: rgba(255, 210, 31, 0.14) !important; color: var(--gold) !important; }
.bg-surface { background-color: var(--bg2) !important; }
.border-subtle { border-color: var(--line) !important; }
hr.border-subtle { opacity: 1; }
.page-kicker {
  display: block;
  color: var(--gold);
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 4px;
}
.icon-shape {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg3);
}
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; }
.avatar.bg-primary { color: var(--ink) !important; font-family: var(--f-title); font-weight: 800; }

/* ── Marca (estrela + SIRIÚS + FLOW) ────────────────────────────────────── */
.marca { display: inline-flex; align-items: center; gap: 9px; color: var(--text-primary); }
.marca-estrela { width: 26px; height: 30px; flex: none; display: block; }
.marca-nome { font: 800 1.3rem/1 var(--f-title); letter-spacing: -.02em; }
.marca-selo {
  background: var(--gold); color: var(--ink);
  font: 800 .62rem/1.5 var(--f-body); letter-spacing: .02em;
  border-radius: 5px; padding: 1px 6px;
}

/* ── Menu lateral ───────────────────────────────────────────────────────── */
.side-nav {
  background: var(--bg-sidebar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  gap: 4px;
}
.side-brand { padding: 0 8px 18px; border-bottom: 0; }
.side-brand .brand-logo { gap: 0; color: var(--text-primary); }
.side-links { padding: 0; gap: 2px; flex: 1 0 auto; }
.side-links a,
.nav-group-title {
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.side-links a i,
.nav-group-title > i:first-child { font-size: 1.05rem; width: 20px; }
.side-links a:hover,
.nav-group-title:hover { background: var(--bg3); color: var(--text-primary); }
.side-links a:hover i { color: inherit; }
.side-links a.active {
  background: rgba(255, 210, 31, 0.10);
  color: var(--gold);
  font-weight: 600;
  box-shadow: none;
}
.side-links a.active::before { display: none; }
.side-links a.active i { color: var(--gold); filter: none; }
.nav-group { margin-top: 0; }
.nav-group-title .nav-chev { font-size: .8rem; transform: rotate(0); }
.nav-group.fechado .nav-chev { transform: rotate(-90deg); }
/* Subitens como no redesign: sem ícone, recuados até alinhar com o texto do
   grupo. O ícone continua no HTML — o menu recolhido (só ícones) precisa dele. */
.nav-group-itens { padding-left: 0; gap: 1px; margin: 2px 0 4px; }
.nav-group-itens a { padding: 8px 12px 8px 43px; font-size: .92rem; }
.nav-group-itens a i { display: none; }

/* Rodapé do menu: Gestão, quem está logado e Sair */
.side-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.side-links-foot { flex: none; margin-bottom: 4px; }
.side-links a.link-gestao { color: var(--bad); }
.side-links a.link-gestao:hover { color: var(--bad); background: rgba(255, 107, 107, 0.08); }
.side-links a.link-gestao.active { background: rgba(255, 107, 107, 0.10); color: var(--bad); }
.side-links a.link-gestao.active i { color: var(--bad); }
.side-who { padding: 10px 8px 0; font-size: .82rem; color: var(--text-muted); }
.side-who b { display: block; color: var(--text-primary); font-weight: 500; margin-bottom: 2px; overflow-wrap: anywhere; }
.side-who span { display: block; margin-bottom: 8px; }
.side-who form { margin-top: 6px; }

/* Menu recolhido (só ícones): subitens voltam a mostrar o ícone, rodapé some */
@media (min-width: 769px) {
  [data-nav="collapsed"] .side-nav { padding: 20px 10px; }
  [data-nav="collapsed"] .marca-nome,
  [data-nav="collapsed"] .marca-selo { display: none; }
  [data-nav="collapsed"] .side-brand { padding: 0 0 18px; }
  [data-nav="collapsed"] .nav-group-itens a { padding: 11px 0; }
  [data-nav="collapsed"] .nav-group-itens a i { display: inline-block; }
  [data-nav="collapsed"] .side-who { display: none; }
}

/* ── Barra do topo ──────────────────────────────────────────────────────── */
/* Como no redesign: o topo não é uma barra fixa, rola junto com a página —
   sem a faixa escura por cima da grade de pontos. */
.top-bar {
  position: relative;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
  padding: 14px clamp(16px, 3vw, 38px);
  gap: 12px;
}
.top-bar .page-title { font: 800 1.5rem/1.2 var(--f-title); letter-spacing: -.02em; }
.content-wrap { padding: 8px clamp(16px, 3vw, 38px) 70px; }

/* Chips do topo: busca, validade, sino e usuário (todos com a mesma cara) */
.chip-topo,
.cmdk-trigger,
.mobile-toggle,
.desk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.chip-topo:hover,
.cmdk-trigger:hover,
.mobile-toggle:hover,
.desk-toggle:hover { border-color: var(--line-hover); color: var(--text-primary); background: var(--bg2); }
.mobile-toggle, .desk-toggle { width: 40px; justify-content: center; padding: 0; font-size: 1.15rem; }
/* Um botão de menu por vez: o do celular abre a gaveta, o do desktop recolhe. */
.mobile-toggle { display: none; }
@media (max-width: 768px) { .mobile-toggle { display: inline-flex; } .desk-toggle { display: none; } }
.cmdk-trigger { min-width: 230px; }
/* "Buscar… Ctrl K" por extenso só onde cabe; abaixo disso, só a lupa (sem
   reservar a largura do texto que sumiu). */
@media (min-width: 1281px) {
  .cmdk-trigger-label, .cmdk-trigger .cmdk-kbd { display: inline; }
}
@media (max-width: 1280px) {
  .cmdk-trigger { min-width: 0; width: 40px; justify-content: center; padding: 0; }
  .cmdk-trigger-label, .cmdk-trigger .cmdk-kbd { display: none; }
}
.cmdk-kbd { background: var(--bg3); border-color: var(--line); color: var(--text-muted); font-size: .74rem; }
.chip-topo .bi-bell { font-size: 1.05rem; }
.selo-notif {
  top: -7px; right: -7px;
  background: var(--bad);
  border: 0;
  font-size: .66rem;
  border-radius: 99px;
}

.chip-usuario { padding: 0 9px 0 4px; gap: 6px; }
.chip-usuario .chip-chev { font-size: .75rem; }
.me-av {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--gold); color: var(--ink);
  font: 800 .72rem/1 var(--f-title);
  box-shadow: 0 0 0 2px rgba(255, 210, 31, 0.45);
}
.me-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-av-g { width: 44px; height: 44px; font-size: .9rem; box-shadow: none; }
.menu-perfil { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.menu-perfil b { display: block; color: var(--text-primary); font-weight: 600; }
.menu-perfil small { color: var(--text-muted); font-size: .8rem; }

/* Validade do acesso: dourado; amarelo forte na última semana; vermelho
   piscando nos últimos 3 dias (o JS põe .perto / .urgente). */
.chip-validade { cursor: pointer; }
.chip-validade b { color: var(--gold); font-weight: 700; }
.chip-validade.perto { border-color: rgba(255, 210, 31, 0.5); }
.chip-validade.urgente { --pc: 255, 107, 107; border-color: rgba(255, 107, 107, 0.5); animation: sfPiscar .8s ease-in-out infinite; }
.chip-validade.urgente b { color: var(--bad); }
.chip-validade.urgente .chip-validade-txt,
.chip-validade.urgente i { animation: sfPiscaTxt .8s ease-in-out infinite; }
@keyframes sfPiscar {
  0%, 100% { border-color: rgba(var(--pc), .25); box-shadow: 0 0 0 0 rgba(var(--pc), 0); }
  50%      { border-color: rgba(var(--pc), 1);   box-shadow: 0 0 16px 2px rgba(var(--pc), .5); }
}
@keyframes sfPiscaTxt { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (max-width: 1100px) { .chip-validade .pre { display: none; } }

/* ── Avisos do topo (filas pausadas, vencimento) ───────────────────────── */
.aviso-topo {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255, 210, 31, 0.08);
  border: 1px solid rgba(255, 210, 31, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .9rem;
  color: var(--text-secondary);
}
.aviso-topo > i { color: var(--gold); font-size: 1.1rem; line-height: 1.3; }
.aviso-topo strong { color: var(--text-primary); }
.aviso-topo a { color: var(--gold); }
.aviso-topo-ruim { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.35); }
.aviso-topo-ruim > i { color: var(--bad); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card { border-radius: 14px; }
.card:hover { transform: none; }
.card::before { display: none; }
.card-header { padding: 16px 18px; border-bottom-color: var(--line); }

/* Cabeçalho de boas-vindas (hero) */
.hero-section {
  background: linear-gradient(120deg, rgba(255, 210, 31, 0.10), transparent 60%), var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: none;
}
.hero-section::before, .hero-section::after, .hero-section > .hero-rays { display: none; }
.hero-section .hero-kicker {
  color: var(--gold);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 4px;
}
.hero-section .hero-title { font: 800 1.7rem/1.2 var(--f-title); letter-spacing: -.02em; }

/* Cards de número (stat do redesign): luz dourada percorrendo SÓ o contorno */
.metric-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: none;
}
.metric-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
/* O anel de luz fica 1px PARA FORA (inset:-1px, como no redesign), por cima
   da borda. Com overflow:hidden ele era cortado inteiro e a animação rodava
   invisível. Nada mais dentro do card precisa do corte. */
.metric-card { overflow: visible; }
.metric-card::after { display: none; }
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.metric-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  padding: 1px;
  pointer-events: none;
  opacity: 1;
  background: conic-gradient(from var(--ang), transparent 0deg, transparent var(--tail, 230deg),
              rgba(255, 210, 31, 0.18) calc(var(--tail, 230deg) + 55deg), #ffd21f 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 5px rgba(255, 210, 31, 0.55));
  animation: sfBorda 3.2s linear infinite;
}
.col:nth-child(4n+1) > .metric-card::before { --tail: 230deg; animation-duration: 3.2s; animation-delay: -.8s; }
.col:nth-child(4n+2) > .metric-card::before { --tail: 170deg; animation-duration: 4.2s; animation-delay: -2s; }
.col:nth-child(4n+3) > .metric-card::before { --tail: 260deg; animation-duration: 2.8s; animation-delay: -1.4s; }
.col:nth-child(4n+4) > .metric-card::before { --tail: 200deg; animation-duration: 3.6s; animation-delay: -2.6s; }
.metric-card:hover::before { opacity: 1; }
@keyframes sfBorda { to { --ang: 360deg; } }
.metric-card .metric-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg3); border: 0;
  margin-bottom: 14px; font-size: 1.1rem;
}
.metric-card .metric-value { font: 800 1.9rem/1.1 var(--f-title); letter-spacing: -.02em; text-shadow: none; }
.metric-card .metric-label {
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin: 2px 0 8px;
}
.metric-card .metric-change { margin-top: 0; font-size: .84rem; font-weight: 500; }

/* ── Modais, toasts e menus ─────────────────────────────────────────────── */
.modal-content,
.glass-modal {
  background: var(--bg2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}
.modal-header, .modal-footer { border-color: var(--line) !important; }
.modal-title { font-family: var(--f-title); font-weight: 800; }
.modal-backdrop.show { opacity: .6; }

/* ── Barra de progresso de navegação ────────────────────────────────────── */
.app-progress { background: var(--gold); box-shadow: 0 0 10px rgba(255, 210, 31, 0.6); }

/* ── Busca rápida (Ctrl K) ──────────────────────────────────────────────── */
.cmdk-overlay { background: rgba(0, 0, 0, 0.6); }
.cmdk-box { background: var(--bg2); border-color: var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.cmdk-list li.active a,
.cmdk-list a:hover { background: rgba(255, 210, 31, 0.10); color: var(--gold); }
.cmdk-list li.active a i { color: var(--gold); }

/* ── Navegação inferior (celular) ───────────────────────────────────────── */
.mobile-nav { background: rgba(18, 18, 26, 0.95); border-top: 1px solid var(--line); }

/* ── Atendimento (a bolinha do Sirius IA mora em partials/hotier.html) ──────────────────────────────────── */
.atd-bolha {
  background: var(--bg2) !important;
  border-color: var(--line) !important;
  color: var(--text-primary) !important;
}
.atd-bolha:hover { border-color: rgba(255, 210, 31, 0.5) !important; }
.atd-bolha .bi { color: var(--gold) !important; }
.atd-painel { background: var(--bg2) !important; border-color: var(--line) !important; }
.atd-m.cliente { background: var(--gold) !important; color: var(--ink) !important; }
.atd-m.sirius { background: var(--bg3) !important; border-color: var(--line) !important; }

@media (prefers-reduced-motion: reduce) {
  .metric-card::before, .chip-validade.urgente,
  .chip-validade.urgente i, .chip-validade.urgente .chip-validade-txt { animation: none; }
}

/* ── Ações da tela (linha abaixo do topo) ───────────────────────────────── */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
}
.page-actions:not(:has(*)) { display: none; }
.page-actions > *,
.page-actions .btn,
.page-actions a,
.page-actions button,
.page-actions select { flex: 0 0 auto; white-space: nowrap; }
.top-bar .top-actions { flex-wrap: nowrap; }

/* ── Faixa do relógio do iPhone (painel instalado como app) ───────────────
   O <head> pede `viewport-fit=cover` + barra de status `black-translucent`, e
   o manifesto abre em `standalone`. Nesse modo o iPhone desenha a página POR
   BAIXO do relógio, da bateria e da Dynamic Island — e o toque nessa faixa vai
   para o iPhone (rolar ao topo), não para o site. O CSS já descontava a faixa
   de BAIXO (`safe-area-inset-bottom`), mas a de CIMA não aparecia em lugar
   nenhum: o botão do menu, com o centro a 34px do topo, ficava dentro dos
   47-59px da faixa e não respondia ("a barra de cima não dá para clicar").
   As notificações push do iPhone só funcionam com o painel instalado, então
   é justamente quem usa o painel no celular que cai nisso.
   Fora do iPhone instalado, `env()` vale 0 e nada muda. As laterais entram
   pelo entalhe com o celular deitado, que cobria o botão do menu igual. */
.top-bar {
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-left: max(clamp(16px, 3vw, 38px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 3vw, 38px), env(safe-area-inset-right, 0px));
}
.side-nav {
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.toast-container { top: calc(20px + env(safe-area-inset-top, 0px)); }

/* ── Barra do topo no celular: botões em cima, título embaixo ─────────────
   Antes, o título ocupava a primeira linha e os botões (busca, sino, usuário)
   caíam para uma segunda linha, encostados à direita, com um vão do lado — a
   barra parecia quebrada. Agora a primeira linha é sempre "menu à esquerda,
   botões à direita", que é onde o polegar procura, e o título ganha a linha
   de baixo inteira em vez de disputar espaço com quatro botões.
   O grid só existe aqui: no computador a barra segue em uma linha só. */
@media (max-width: 768px) {
  .top-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "menu acoes" "titulo titulo";
    align-items: center;
    column-gap: 8px;
    row-gap: 10px;
    padding-bottom: 6px;
  }
  .top-bar .mobile-toggle { grid-area: menu; }
  .top-bar .page-title {
    grid-area: titulo;
    margin: 0;
    min-width: 0;
  }
  /* Página sem título: a segunda linha some em vez de deixar um vão. */
  .top-bar .page-title:empty { display: none; }
  /* Os botões ficam na célula da direita. Se não couberem (tela estreita com
     o chip de validade), quebram DENTRO da célula em vez de sair da tela —
     botão cortado pela borda é botão que não dá para tocar. */
  .top-bar .top-actions {
    grid-area: acoes;
    margin-left: 0;
    padding: 0;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* Usuário só com a foto, quadrado como os vizinhos: a setinha custava 21px
     e é ela que fazia a linha passar da tela de 360 com o chip de validade. */
  .chip-usuario { padding: 0 5px; }
  .chip-usuario .chip-chev { display: none; }
}

/* ── "Info" no visual SIRIÚS ────────────────────────────────────────────────
   O redesign não tem ciano: aviso informativo é neutro (cinza com borda) e o
   botão "info" segue o secundário. Aviso de atenção continua âmbar, erro
   vermelho e sucesso verde — as cores de estado não mudam de sentido. */
[data-bs-theme="dark"] .alert-info {
  --bs-alert-bg: rgba(255, 255, 255, 0.03);
  --bs-alert-border-color: var(--line);
  --bs-alert-color: var(--text-secondary);
  --bs-alert-link-color: var(--gold);
}
[data-bs-theme="dark"] .alert-info strong,
[data-bs-theme="dark"] .alert-info b { color: var(--text-primary); }
[data-bs-theme="dark"] .alert-primary {
  --bs-alert-bg: rgba(255, 210, 31, 0.08);
  --bs-alert-border-color: rgba(255, 210, 31, 0.3);
  --bs-alert-color: var(--text-primary);
  --bs-alert-link-color: var(--gold);
}
[data-bs-theme="dark"] .btn-outline-info {
  --bs-btn-color: var(--text-primary);
  --bs-btn-bg: var(--bg3);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--text-primary);
  --bs-btn-hover-bg: var(--bg3);
  --bs-btn-hover-border-color: var(--line-hover);
  --bs-btn-active-color: var(--text-primary);
  --bs-btn-active-bg: var(--bg3);
  --bs-btn-active-border-color: var(--line-hover);
  --bs-btn-disabled-color: var(--text-muted);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--line);
}

/* ── Gaveta do menu no celular ──────────────────────────────────────────────
   Opaca (o vidro deixava o painel vazar por trás) e ACIMA da barra inferior,
   senão a barra cobria o rodapé da gaveta (nome e Sair). */
@media (max-width: 768px) {
  .side-nav { background: var(--bg2); z-index: 1041; width: 260px; }
  .sidebar-overlay { z-index: 1040; background: rgba(0, 0, 0, 0.55); }
}


/* ── Popover do sino (redesign): ponto colorido + título + texto + quando ── */
.pop-cab {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0; padding: 8px 10px;
  font: 700 .8rem var(--f-body); color: var(--text-muted);
}
.pop-cab span {
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 99px; padding: 1px 7px;
}
.pop-it {
  display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-primary); font-size: .9rem; white-space: normal;
}
.pop-it:hover { background: var(--bg3); }
.pop-it b { display: block; font-weight: 500; }
.pop-it.nao-lida b { font-weight: 700; }
.pop-it small { display: block; color: var(--text-muted); font-size: .78rem; line-height: 1.35; }
.pop-it small.pop-quando { color: var(--text-faint); font-size: .72rem; margin-top: 2px; }
.pop-vazio { color: var(--text-muted); }
.pop-ponto { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--gold); }
.pop-ponto-error { background: var(--bad); }
.pop-ponto-success { background: var(--ok); }
.pop-ponto-warning { background: #f59e0b; }
.dropdown-menu li.d-flex > .dropdown-item { width: auto; flex: 1 1 auto; min-width: 0; }
.dropdown-menu li.d-flex > .dropdown-item.pop-config { flex: 0 0 auto; color: var(--text-muted) !important; }

/* ── Convite do Sirius Mail (redesign) ──────────────────────────────────── */
.promo-mail {
  position: fixed; right: 20px; z-index: 1050; width: 272px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45); overflow: hidden;
  animation: promoEntra .5s ease-out .3s backwards;
}
.promo-mail[hidden] { display: none; }
/* Altura conforme o que já ocupa o canto (ver partials/sirius_mail.html) */
.promo-mail-a0 { bottom: 20px; }
.promo-mail-a1 { bottom: 76px; }
.promo-mail-a2 { bottom: 86px; }
.promo-mail-a3 { bottom: 142px; }
.promo-mail::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--gold), rgba(255, 210, 31, 0.15));
}
.promo-mail-link { display: block; padding: 16px 16px 14px; color: var(--text-primary); text-decoration: none; }
.promo-mail-link:hover { background: var(--bg3); color: var(--text-primary); }
.promo-mail-marca { display: flex; align-items: center; gap: 7px; font: 800 1.1rem/1.2 var(--f-title); letter-spacing: -.02em; }
.promo-mail-marca i {
  font: 800 .62rem/1.5 var(--f-body); font-style: normal;
  background: var(--gold); color: var(--ink); border-radius: 5px; padding: 1px 6px;
}
.promo-mail-txt { display: block; margin: 6px 0 10px; color: var(--text-muted); font-size: .86rem; line-height: 1.35; }
.promo-mail-ir { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .84rem; color: var(--gold); }
.promo-mail-ir i { font-size: .8rem; }
.promo-mail-x {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-muted);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.promo-mail-x:hover { background: var(--bg3); color: var(--text-primary); }
@keyframes promoEntra { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
body.ia-open .promo-mail { display: none; }
@media (max-width: 768px) { .promo-mail { display: none; } }
@media (prefers-reduced-motion: reduce) { .promo-mail { animation: none; } }


/* ── Menu recolhido (redesign): o ☰ ESCONDE o menu no desktop ─────────────
   Antes ele virava uma faixa só de ícones; no redesign some de vez e o
   conteúdo ocupa a largura toda. A preferência continua em localStorage. */
@media (min-width: 769px) {
  :root[data-nav="collapsed"] { --sidebar-w: 0px; }
  [data-nav="collapsed"] .side-nav { display: none; }
}

/* ── Sem a barra de baixo no celular (o redesign não tem: a navegação é a
   gaveta do ☰). O fim da página só precisa de folga para a bolinha da IA. */
.mobile-nav { display: none !important; }
@media (max-width: 768px) {
  .content-wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ── Abas da página: as telas que viraram aba de um item do menu ───────── */
.abas-pagina {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.abas-pagina::-webkit-scrollbar { display: none; }
.abas-pagina a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.abas-pagina a:hover { border-color: var(--line-hover); color: var(--text-primary); }
.abas-pagina a.on {
  background: rgba(255, 210, 31, 0.12);
  border-color: rgba(255, 210, 31, 0.5);
  color: var(--gold);
}

/* ── Busca Ctrl K com grupos (Páginas / Contas), como no redesign ───────── */
.cmdk-list li.cmdk-grupo {
  padding: 8px 12px 4px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-muted);
}
.cmdk-list a span {
  margin-left: auto;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 400;
}
.cmdk-input-wrap input::placeholder { color: #6d6d85; }

/* ── Destaque ao chegar numa seção (flash do redesign) ─────────────────────
   Quem pula para um ponto da página — pela busca, por um aviso, por um link
   com #âncora — vê o alvo piscar em dourado e sabe onde foi parar. */
.sf-flash { animation: sfFlash 1.8s ease-out; }
@keyframes sfFlash {
  0%, 45% { box-shadow: 0 0 0 2px var(--gold); background-color: rgba(255, 210, 31, 0.16); }
  100%    { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .sf-flash { animation: none; outline: 2px solid var(--gold); } }


/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTES DO REDESIGN (prefixo sf-)
   ───────────────────────────────────────────────────────────────────────────
   Copiados das medidas do redesign/ (Dashboard e Postar). O prefixo existe
   porque o redesign usa nomes que o Bootstrap já tem (.row, .btn, .tag) — e
   misturar os dois quebraria as telas que ainda usam o grid do Bootstrap.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Botões do redesign */
.sf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: .84rem; font-weight: 600; line-height: 1.3;
  color: var(--text-primary); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, filter .15s, background .15s;
}
.sf-btn:hover { border-color: var(--line-hover); color: var(--text-primary); }
.sf-btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.sf-btn.gold:hover { filter: brightness(1.07); color: var(--ink); }
.sf-btn.on { background: rgba(255, 210, 31, .12); border-color: rgba(255, 210, 31, .5); color: var(--gold); }
.sf-btn.lg { padding: 13px 26px; font-size: 1rem; border-radius: 12px; }
.sf-btn:disabled, .sf-btn.disabled { opacity: .45; cursor: not-allowed; }
.sf-btn-ico { padding: 6px 10px; }
html.privado .btn-privado.sf-btn { background: rgba(255, 210, 31, .12); border-color: rgba(255, 210, 31, .4); color: var(--gold); }

/* Boas-vindas */
.sf-hero {
  padding: 24px 26px; margin-bottom: 16px;
  background: linear-gradient(120deg, rgba(255, 210, 31, .10), transparent 60%), var(--bg2);
}
.sf-hero p { margin: 0 0 4px; color: var(--gold); font-weight: 700; font-size: .85rem; }
.sf-hero h2 { font: 800 1.7rem/1.2 var(--f-title); letter-spacing: -.02em; margin: 0; }

/* Faixa de aviso discreta (.warn do redesign) */
.sf-warn {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 210, 31, .08); border: 1px solid rgba(255, 210, 31, .3);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  font-size: .9rem; color: var(--text-secondary);
}
.sf-warn > i { color: var(--gold); font-size: 1.05rem; }
.sf-warn > span { flex: 1 1 260px; min-width: 0; }
.sf-warn b { color: var(--text-primary); }
.sf-warn.bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); }
.sf-warn.bad > i { color: var(--bad); }

/* Os quatro números (.stats / .stat) */
.sf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.sf-stats > .metric-card:nth-child(1)::before { --tail: 230deg; animation-duration: 3.2s; animation-delay: -.8s; }
.sf-stats > .metric-card:nth-child(2)::before { --tail: 170deg; animation-duration: 4.2s; animation-delay: -2s; }
.sf-stats > .metric-card:nth-child(3)::before { --tail: 260deg; animation-duration: 2.8s; animation-delay: -1.4s; }
.sf-stats > .metric-card:nth-child(4)::before { --tail: 200deg; animation-duration: 3.6s; animation-delay: -2.6s; }
.sf-ico {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg3); margin-bottom: 14px; font-size: 1.1rem; color: var(--text-primary);
}
.sf-ico.ok, .sf-d.ok { color: var(--ok); }
.sf-ico.gold, .sf-d.gold { color: var(--gold); }
.sf-n { font: 800 1.9rem/1.1 var(--f-title); letter-spacing: -.02em; }
.sf-l { color: var(--text-muted); font-size: .88rem; margin: 2px 0 8px; }
.sf-d { font-size: .84rem; font-weight: 500; }

/* Duas colunas: lista + lateral */
.sf-cols { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sf-ch { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sf-ch h3 { font: 800 1.1rem var(--f-title); margin: 0 auto 0 0; }

/* Lista em linhas (.list / .row) */
.sf-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sf-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg3);
}
.sf-row-id { min-width: 0; flex: 1 1 auto; }
.sf-row b, .sf-rk b { display: block; font-weight: 700; overflow-wrap: anywhere; color: var(--text-primary); }
.sf-m { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-av {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden;
  font: 700 .85rem var(--f-title); color: var(--ink); background: var(--gold);
}
.sf-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-tag {
  margin-left: auto; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 3px 10px;
  border: 1px solid rgba(255, 210, 31, .45); color: var(--gold); white-space: nowrap;
}
.sf-tag.ok  { color: var(--ok);  border-color: rgba(74, 222, 128, .4); }
.sf-tag.bad { color: var(--bad); border-color: rgba(255, 107, 107, .45); }
.sf-tag.mut { color: var(--text-muted); border-color: var(--line-hover); }

/* Ranking (.rank / .rk) */
.sf-rank { padding: 16px 18px 8px; }
.sf-kick { margin: 0 0 2px; font-size: .82rem; color: var(--text-muted); }
.sf-rank h3 { font: 800 1.2rem var(--f-title); margin: 0 0 6px; }
.sf-rk { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sf-rk:last-child { border-bottom: 0; }
.sf-rk-id { min-width: 0; }
.sf-t { font-size: .76rem; color: var(--text-muted); }
.sf-p { margin-left: auto; font-weight: 700; color: var(--gold); white-space: nowrap; }
/* ── Ranking de views: pódio do 1º lugar, prata/bronze e barra até o líder ── */
.sf-av-wrap { position: relative; flex: none; }
.sf-coroa {
  position: absolute; left: 50%; top: -12px; width: 21px; height: 14px; transform: translateX(-50%) rotate(-8deg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); z-index: 1;
  animation: sf-coroa-brilho 2.8s ease-in-out infinite;
}
@keyframes sf-coroa-brilho {
  0%, 100% { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 210, 31, .85)); }
}
.sf-podio {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 16px 14px 12px;
  border-radius: 14px; border: 1px solid rgba(255, 210, 31, .45);
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 210, 31, .16), transparent 60%), var(--bg3);
}
.sf-av-lider { width: 44px; height: 44px; font-size: .9rem; box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(255, 210, 31, .35); }
.sf-podio-id { min-width: 0; flex: 1 1 auto; }
.sf-podio-id b { display: block; font: 800 1rem var(--f-title); color: var(--text-primary); overflow-wrap: anywhere; }
.sf-podio-tag {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--gold); border-radius: 99px; padding: 2px 9px; margin-bottom: 4px;
}
.sf-podio-n { margin-left: auto; text-align: right; white-space: nowrap; }
.sf-podio-n b { display: block; font: 800 1.2rem var(--f-title); color: var(--gold); line-height: 1.1; }
.sf-podio-n span { font-size: .72rem; color: var(--text-muted); }
.sf-pos {
  flex: none; width: 30px; text-align: center; font: 800 .82rem var(--f-title); color: var(--text-muted);
}
.sf-pos.prata { color: #d9dde3; }
.sf-pos.bronze { color: #d38b4f; }
.sf-rk-id { flex: 1 1 auto; }
.sf-barra { height: 4px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.sf-barra i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 210, 31, .55), var(--gold)); }

/* A MINHA posição, no topo do dashboard */
.sf-meu-rank {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin: 0 0 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg3); text-align: left;
}
.sf-meu-rank.lider {
  border-color: rgba(255, 210, 31, .55);
  background: radial-gradient(90% 160% at 0% 50%, rgba(255, 210, 31, .18), transparent 65%), var(--bg2, var(--bg3));
}
.sf-meu-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 210, 31, .12); color: var(--gold); font-size: 1.4rem; }
.sf-coroa-grande { width: 24px; height: 16px; animation: sf-coroa-brilho 2.8s ease-in-out infinite; }
.sf-meu-txt { flex: 1 1 260px; min-width: 0; }
.sf-meu-txt h3 { font: 800 1.15rem var(--f-title); margin: 0 0 2px; }
.sf-meu-txt p { margin: 0; color: var(--text-muted); }
.sf-meu-txt p b { color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .sf-coroa, .sf-coroa-grande { animation: none; } }
.sf-eu {
  white-space: nowrap; display: inline-block;
  font-size: .66rem; font-weight: 700; background: var(--gold); color: var(--ink);
  border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px;
}

/* Vazio */
.sf-vazio { text-align: center; color: var(--text-muted); padding: 28px 12px; }
.sf-vazio i { font-size: 2.2rem; display: block; margin-bottom: 8px; opacity: .7; }
.sf-vazio p { margin: 0; color: var(--text-muted); }

/* Olho (modo privado): no redesign borra o avatar, o @ e a linha de horário */
html.privado .sf-row .sf-av,
html.privado .sf-row b,
html.privado .sf-row .sf-m { filter: blur(7px); user-select: none; }
.sf-row .sf-av, .sf-row b, .sf-row .sf-m { transition: filter .25s; }

@media (max-width: 1100px) {
  .sf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .sf-stats { grid-template-columns: 1fr; }
  .sf-hero h2 { font-size: 1.4rem; }
  .sf-tag { display: none; }
}


/* ── Faixa que abre no lugar (.sf-expansivel) ──────────────────────────────
   A lista desliza para baixo animando a ALTURA (grid 0fr → 1fr, que anima
   até o tamanho real do conteúdo sem medir nada em JS) e cada item entra
   em sequência. Sem recarregar a página. */
.sf-colapso {
  flex-basis: 100%;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .38s cubic-bezier(.2, .8, .2, 1);
}
.sf-colapso-dentro { overflow: hidden; min-height: 0; }
.sf-expansivel.aberto .sf-colapso { grid-template-rows: 1fr; }
.sf-expandir i { transition: transform .25s; font-size: .8rem; }
.sf-expansivel.aberto .sf-expandir i { transform: rotate(180deg); }
.sf-expandir .txt-ocultar { display: none; }
.sf-expansivel.aberto .sf-expandir .txt-ver { display: none; }
.sf-expansivel.aberto .sf-expandir .txt-ocultar { display: inline; }
.sf-caidas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding-top: 12px;
}
.sf-caidas .sf-row { text-decoration: none; padding: 8px 10px; }
.sf-caidas .sf-row:hover { border-color: rgba(255, 107, 107, .45); }
.sf-caidas .sf-av { width: 32px; height: 32px; font-size: .74rem; }
.sf-caidas .sf-m { color: var(--bad); font-size: .76rem; }
.sf-caidas > * { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
.sf-expansivel.aberto .sf-caidas > * { opacity: 1; transform: none; }
.sf-expansivel.aberto .sf-caidas > *:nth-child(2) { transition-delay: .04s; }
.sf-expansivel.aberto .sf-caidas > *:nth-child(3) { transition-delay: .08s; }
.sf-expansivel.aberto .sf-caidas > *:nth-child(4) { transition-delay: .12s; }
.sf-expansivel.aberto .sf-caidas > *:nth-child(5) { transition-delay: .16s; }
.sf-expansivel.aberto .sf-caidas > *:nth-child(n+6) { transition-delay: .2s; }
html.privado .sf-caidas .sf-av,
html.privado .sf-caidas b { filter: blur(7px); user-select: none; }
@media (prefers-reduced-motion: reduce) {
  .sf-colapso, .sf-caidas > *, .sf-expandir i { transition: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FORMULÁRIOS DO REDESIGN (Postar e as telas que seguem o mesmo padrão)
   ───────────────────────────────────────────────────────────────────────────
   Medidas do redesign/Postar: cartão com título de ícone (.sf-ct), rótulos
   (.sf-lab), dicas (.sf-hint), opções em cartão (.sf-opts/.sf-opt), área de
   arrastar (.sf-drop), grade de mídias (.sf-lib/.sf-th), contas (.sf-acc),
   avisos (.sf-al), barra fixa de envio (.sf-dock), janela (.sf-modal).
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-form .card { padding: 20px; margin-bottom: 16px; }
.sf-cols2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sf-col { min-width: 0; }
.sf-ct { display: flex; align-items: center; gap: 10px; font: 800 1.08rem var(--f-title); margin-bottom: 14px; color: var(--text-primary); }
.sf-ct .ic {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: rgba(255, 210, 31, .1); border: 1px solid rgba(255, 210, 31, .25); color: var(--gold); font-size: .95rem;
}
.sf-ct .r { margin-left: auto; display: flex; gap: 8px; align-items: center; font: 500 .8rem var(--f-body); color: var(--text-muted); }
.sf-lab { display: block; font-size: .82rem; font-weight: 700; color: var(--text-muted); margin: 16px 0 6px; }
.sf-lab:first-child { margin-top: 0; }
.sf-lab span { font-weight: 400; }
.sf-hint { color: var(--text-muted); font-size: .8rem; margin-top: 6px; }
.sf-hint a { color: var(--gold); }
.sf-sep { height: 1px; background: var(--line); margin: 18px 0; }
.sf-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sf-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sf-cnt { color: var(--text-muted); font-size: .8rem; }
.sf-chk { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; color: var(--text-primary); margin: 0; }
.sf-form input[type=checkbox], .sf-form input[type=radio] { accent-color: var(--gold); width: 17px; height: 17px; flex: none; margin: 0; }
.sf-form .form-control, .sf-form .form-select { padding: 10px 12px; font-size: .95rem; }
.sf-form textarea.form-control { min-height: 84px; resize: vertical; }
.sf-form input[type=datetime-local] { color-scheme: dark; }

/* Opções em cartão (.opts / .opt) */
.sf-opts { display: grid; gap: 10px; }
.sf-opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg3); cursor: pointer;
  transition: border-color .15s, background .15s; color: var(--text-primary);
}
.sf-opt:hover { border-color: var(--line-hover); }
.sf-opt:has(input:checked) { border-color: rgba(255, 210, 31, .6); background: rgba(255, 210, 31, .07); }
.sf-opt:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.sf-opt:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.sf-opt input { margin-top: 3px !important; accent-color: var(--gold); }
.sf-opt b { display: block; font-size: .94rem; }
.sf-opt span { display: block; color: var(--text-muted); font-size: .8rem; line-height: 1.4; margin-top: 2px; }
.sf-opt span a { color: var(--gold); }
.sf-opt em {
  font-style: normal; font-size: .6rem; font-weight: 800; letter-spacing: .04em;
  background: var(--gold); color: var(--ink); border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}
.sf-opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sf-opts.three .sf-opt { position: relative; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 8px; }
.sf-opts.three .sf-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sf-opts.three .sf-opt > i { font-size: 1.35rem; color: var(--text-muted); }
.sf-opts.three .sf-opt:has(input:checked) > i { color: var(--gold); }
.sf-opts.three .sf-opt span { margin-top: 0; }
.sf-sw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-sw .sf-opt { padding: 9px 12px; align-items: center; }
.sf-sw .sf-opt b { font-size: .88rem; }

/* Área de arrastar (.drop) e arquivos escolhidos (.fchip) */
.sf-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--line-hover); border-radius: 12px; padding: 22px 16px;
  color: var(--text-muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.sf-drop:hover, .sf-drop.over { border-color: var(--gold); background: rgba(255, 210, 31, .05); }
.sf-drop:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sf-drop > i { font-size: 1.6rem; color: var(--gold); }
.sf-drop b { color: var(--text-primary); }
.sf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sf-chips:empty { display: none; }
.sf-fchip {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 99px; padding: 4px 6px 4px 12px; font-size: .8rem;
}
.sf-fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.sf-fchip button {
  border: 0; background: transparent; color: var(--text-muted); width: 22px; height: 22px;
  border-radius: 50%; padding: 0; line-height: 1; cursor: pointer;
}
.sf-fchip button:hover { background: var(--line); color: var(--text-primary); }
.sf-box { background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; }

/* Grade da biblioteca (.lib / .th) */
.sf-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 12px; }
.sf-th { position: relative; display: block; cursor: pointer; margin: 0; }
.sf-th input { position: absolute; opacity: 0; pointer-events: none; }
.sf-th .im {
  aspect-ratio: 9/16; border-radius: 10px; border: 2px solid var(--line); overflow: hidden;
  display: grid; place-items: center; color: rgba(255, 255, 255, .75); background: #05050a;
  transition: border-color .15s, transform .15s;
}
.sf-th .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-th .im i { font-size: 1.3rem; }
.sf-th:hover .im { transform: translateY(-2px); }
.sf-th input:checked + .im { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 31, .25); }
.sf-th input:focus-visible + .im { outline: 3px solid var(--gold); outline-offset: 2px; }
.sf-th .ck {
  position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 6px;
  background: rgba(0, 0, 0, .55); border: 1.5px solid rgba(255, 255, 255, .4);
  display: grid; place-items: center; color: var(--ink); font-size: .75rem;
}
.sf-th .ck i { opacity: 0; }
.sf-th input:checked ~ .ck { background: var(--gold); border-color: var(--gold); }
.sf-th input:checked ~ .ck i { opacity: 1; }
.sf-th .tipo {
  position: absolute; bottom: 6px; right: 6px; font-size: .62rem; font-weight: 700;
  background: rgba(0, 0, 0, .65); border-radius: 5px; padding: 1px 6px; color: #fff;
}
.sf-pager { display: flex; align-items: center; gap: 8px; }
.sf-pager span { min-width: 52px; text-align: center; color: var(--text-muted); font-size: .82rem; }

/* Ordem de publicação arrastável (.ord / .oi) */
.sf-ord { display: flex; gap: 12px; overflow-x: auto; padding: 12px 4px 8px; margin-top: 4px; }
.sf-oi { position: relative; flex: none; width: 78px; cursor: grab; user-select: none; -webkit-user-select: none; }
.sf-oi.drag { opacity: .4; }
.sf-oi.over .im { border-color: var(--gold); transform: scale(1.04); }
.sf-oi .im {
  aspect-ratio: 9/16; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center;
  color: rgba(255, 255, 255, .75); overflow: hidden; background: #14141f center/cover no-repeat;
  transition: border-color .15s, transform .15s;
}
.sf-oi .n {
  position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 7px;
  background: var(--gold); color: var(--ink); font: 800 .78rem var(--f-title);
  display: grid; place-items: center; padding: 0 5px;
}
.sf-oi .mv { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.sf-oi .mv button {
  width: 32px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg3);
  padding: 0; display: grid; place-items: center; color: var(--text-primary); cursor: pointer;
}
.sf-oi .mv button:hover:not(:disabled) { border-color: var(--line-hover); }
.sf-oi .mv button:disabled { opacity: .3; cursor: not-allowed; }
.sf-oi small {
  display: block; text-align: center; font-size: .62rem; color: var(--text-muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Avisos (.al) */
.sf-al {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .86rem; margin-top: 10px;
  background: rgba(255, 210, 31, .08); border: 1px solid rgba(255, 210, 31, .3); color: var(--text-secondary);
}
.sf-al > i { flex: none; color: var(--gold); margin-top: 2px; }
.sf-al b, .sf-al strong { color: var(--text-primary); }
.sf-al.bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); }
.sf-al.bad > i { color: var(--bad); }
.sf-al[hidden] { display: none; }
.sf-ex { margin-top: 10px; display: grid; gap: 8px; }
.sf-ex div { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: .88rem; white-space: pre-wrap; }
.sf-ex small { display: block; color: var(--text-muted); font-size: .74rem; margin-bottom: 2px; }

/* Contas (.acc) */
.sf-acc-lista { max-height: 340px; overflow-y: auto; margin-top: 2px; padding-right: 2px; }
.sf-acc {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 8px 0 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg3); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sf-acc:hover { border-color: var(--line-hover); }
.sf-acc:has(input:checked) { border-color: rgba(255, 210, 31, .6); background: rgba(255, 210, 31, .07); }
.sf-acc.off { opacity: .5; cursor: not-allowed; }
.sf-acc .sf-av { width: 32px; height: 32px; font-size: .72rem; }
.sf-acc-id { min-width: 0; }
.sf-acc-id b { font-size: .92rem; display: block; overflow-wrap: anywhere; }
.sf-acc-id small { display: block; color: var(--text-muted); font-size: .76rem; }
.sf-acc-id .why { color: var(--bad); }
.sf-st { margin-left: auto; font-size: .68rem; font-weight: 700; border-radius: 99px; padding: 2px 9px; border: 1px solid; white-space: nowrap; }
.sf-st.ok { color: var(--ok); border-color: rgba(74, 222, 128, .4); }
.sf-st.er { color: var(--bad); border-color: rgba(255, 107, 107, .4); }

/* Barra fixa de envio (.dock) */
.sf-dock {
  position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-top: 6px; padding: 14px 20px; background: rgba(18, 18, 26, .93);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.sf-dock .sf-btn.lg { padding: 14px 28px; font-size: 1.02rem; min-width: 210px; }
.sf-dock .sf-btn.gold:not(:disabled) { animation: sfPronto 2.6s ease-out infinite; }
@keyframes sfPronto { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 31, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(255, 210, 31, 0); } }
.sf-nums { display: flex; gap: 24px; }
.sf-nums div { text-align: center; }
.sf-nums b { display: block; font: 800 1.5rem/1 var(--f-title); color: var(--gold); }
.sf-nums span { font-size: .72rem; color: var(--text-muted); }
.sf-msgw { flex: 1; min-width: 220px; }
.sf-msg { color: var(--text-muted); font-size: .85rem; }
.sf-msg.ready { color: var(--ok); }
.sf-plan { margin-top: 3px; font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.sf-plan b { color: var(--text-primary); font-weight: 600; }
.sf-plan .w { color: var(--gold); }
.sf-lnk { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; font: inherit; font-weight: 600; cursor: pointer; }
.sf-spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: sfGira .7s linear infinite; }
@keyframes sfGira { to { transform: rotate(360deg); } }

/* Com a barra fixa na tela, a bolinha da IA e o convite sobem acima dela
   (--lift, medido pelo JS da tela) — no redesign nenhum dos dois a cobre. */
.hotier-bolha { bottom: calc(20px + var(--lift, 0px) + env(safe-area-inset-bottom, 0px)) !important; }
.hotier-nudge { bottom: calc(21px + var(--lift, 0px) + env(safe-area-inset-bottom, 0px)) !important; }
.promo-mail-a2, .promo-mail-a3 { bottom: calc(86px + var(--lift, 0px)) !important; }

/* Janela própria (no lugar de confirm/alert) e aviso rápido */
.sf-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; animation: sfFade .25s ease-out; }
@keyframes sfFade { from { opacity: 0; } }
.sf-win {
  width: min(560px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); padding: 24px;
}
.sf-win h2 { font: 800 1.3rem var(--f-title); margin: 0 0 8px; }
.sf-win p { color: var(--text-muted); margin: 0; }
.sf-win .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
/* Janela de APAGAR: vermelha, com quem sai e a palavra a digitar */
.sf-win.perigo { border-color: rgba(255, 107, 107, .45); box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 107, 107, .12); }
.sf-win.perigo h2 { color: var(--bad); display: flex; align-items: center; gap: 10px; }
.sf-win-det { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.sf-win-det dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.sf-win-det dt { color: var(--text-muted); font-weight: 500; }
.sf-win-det dd { margin: 0; color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
.sf-win-digitar { display: block; margin-top: 14px; font-size: .9rem; color: var(--text-muted); }
.sf-win-digitar strong { color: var(--text-primary); user-select: all; }
.sf-win-digitar input {
  display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text-primary); font: inherit;
}
.sf-win-digitar input:focus { outline: none; border-color: rgba(255, 107, 107, .6); box-shadow: 0 0 0 3px rgba(255, 107, 107, .15); }
.sf-btn.apagar { background: var(--bad); border-color: var(--bad); color: #1a0000; font-weight: 700; }
.sf-btn.apagar:hover:not(:disabled) { filter: brightness(1.08); }
@media (max-width: 480px) { .sf-win-det dl { grid-template-columns: 1fr; gap: 2px; } .sf-win-det dd { margin-bottom: 6px; } }
.sf-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2100;
  background: var(--bg2); border: 1px solid rgba(255, 210, 31, .5); border-radius: 12px; padding: 11px 18px;
  font-size: .9rem; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); animation: sfPin .3s ease-out; color: var(--text-primary);
}
@keyframes sfPin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }

@media (max-width: 1100px) { .sf-cols2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .sf-dock { position: static; padding: 14px 16px; }
  .sf-dock .sf-btn.lg { width: 100%; }
}
@media (max-width: 560px) {
  .sf-g2, .sf-sw { grid-template-columns: 1fr; }
  .sf-opts.three { grid-template-columns: 1fr; }
  .sf-opts.three .sf-opt { flex-direction: row; text-align: left; }
  .sf-form .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sf-dock .sf-btn.gold, .sf-modal, .sf-toast { animation: none; } }

/* Subtítulo no título da página ("Composer" + "Publicação em massa"). */
.top-bar .page-title small { display: block; font: 500 .82rem var(--f-body); color: var(--text-muted); letter-spacing: 0; margin-top: 2px; }


/* ═══════════════════════════════════════════════════════════════════════════
   TELAS DE ACESSO NO FORMATO DO REDESIGN (redesign/Entrar)
   ───────────────────────────────────────────────────────────────────────────
   Entrar, cadastro, senha, 2FA, acesso vencido e renovação. Vale tanto para
   as classes novas (auth-kick, auth-sub, auth-err…) quanto para as antigas
   que as telas ainda usam (page-kicker, text-muted, auth-link).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fundo: o mesmo do painel (pontos que andam + manchas + brilho do mouse).
   A aurora e a grade de diamantes antigas saem. */
body.auth-page::before, body.auth-page::after { display: none !important; }
body.auth-page .diamond-rain { display: none; }
body.auth-page { min-height: 100vh; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 90px;
  max-width: none;
}
.auth-shell > * { width: min(420px, 100%); }

/* Marca grande: estrela + SIRIÚS em degradê dourado + FLOW */
.marca-g {
  display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 22px;
  filter: drop-shadow(0 0 22px rgba(255, 210, 31, .25));
  animation: authRise .6s cubic-bezier(.2, .8, .2, 1) both;
}
.marca-g-estrela { width: 62px; height: 72px; display: block; }
.marca-g-nome {
  display: flex; align-items: center; gap: 8px; padding-top: .12em;
  font: 800 2.5rem/1.3 var(--f-title); letter-spacing: .02em;
  background: linear-gradient(90deg, #fecb40, #fff275, #fecb3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.marca-g-nome i {
  font: 800 .66rem var(--f-body); font-style: normal; letter-spacing: 0;
  background: var(--gold); color: var(--ink); -webkit-text-fill-color: var(--ink);
  border-radius: 5px; padding: 2px 7px;
}

/* O card: opaco, com a luz dourada percorrendo a borda */
body.auth-page .auth-card {
  position: relative;
  max-width: none;
  background: var(--bg2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  padding: 30px 28px 26px !important;
  box-shadow: 0 0 70px rgba(255, 210, 31, .06), 0 24px 60px rgba(0, 0, 0, .4) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: authRise .6s cubic-bezier(.2, .8, .2, 1) .08s both;
}
body.auth-page .auth-card::after { display: none !important; }
body.auth-page .auth-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0deg, transparent 215deg, rgba(255, 210, 31, .2) 285deg, #ffd21f 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  filter: drop-shadow(0 0 6px rgba(255, 210, 31, .55));
  animation: sfBorda 5s linear infinite;
  opacity: 1;
}
@keyframes authRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Cabeçalho do card */
.auth-card .auth-kick,
.auth-card .page-kicker {
  display: block; margin: 0 0 2px; text-align: center;
  color: var(--text-muted); font-size: .9rem; font-weight: 400; letter-spacing: 0; text-transform: none;
}
.auth-card h1 { text-align: center; font: 800 1.7rem/1.2 var(--f-title); letter-spacing: -.02em; margin: 0 0 2px; }
.auth-card .auth-sub { margin: 6px 0 20px; text-align: center; color: var(--text-muted); font-size: .92rem; }
.auth-card .text-center > p.text-muted { margin-top: 6px; font-size: .92rem; }
.auth-card .text-center.mb-4 { margin-bottom: 20px !important; }

/* Campos */
.auth-card .form-label {
  display: flex; align-items: center; gap: 7px; margin: 14px 0 6px;
  font-size: .82rem; font-weight: 700; color: var(--text-muted);
}
.auth-card .form-label i { font-size: .85rem; color: var(--text-muted) !important; margin: 0 !important; }
.auth-card .form-control { padding: 11px 12px; font-size: .95rem; margin-bottom: 0 !important; }
.auth-card .form-control.mb-3 + .form-label,
.auth-card .pw-field + .form-label { margin-top: 14px; }
.auth-card .pw-field { position: relative; margin-bottom: 0 !important; }
.auth-card .pw-field .form-control { padding-right: 44px; }
.auth-card .pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; color: var(--text-muted);
  border-radius: 8px; display: grid; place-items: center;
}
.auth-card .pw-toggle:hover { color: var(--text-primary); background: var(--bg3); }

/* Erro dentro do card, embaixo dos campos */
.auth-err { min-height: 1.3em; margin: 10px 0 0; color: var(--bad); font-size: .88rem; }
.auth-err:empty { min-height: 1.3em; }
.auth-card .alert-danger {
  --bs-alert-bg: rgba(255, 107, 107, .08); --bs-alert-border-color: rgba(255, 107, 107, .35);
  --bs-alert-color: var(--bad); border-radius: 10px; font-size: .88rem;
}

/* Botão principal: dourado, largura toda */
body.auth-page .auth-card .btn-primary,
body.auth-page .auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 10px; padding: 12px 16px; border-radius: 10px;
  font-weight: 700; font-size: 1rem;
}
body.auth-page .auth-card .btn-primary .sf-star { width: 16px; height: 16px; }
body.auth-page .auth-card .btn-primary .sf-star g { stroke: currentColor; }
body.auth-page .auth-card .btn-primary:disabled { opacity: .75; cursor: wait; }
body.auth-page .auth-card .btn-outline-secondary { width: 100%; padding: 11px 16px; border-radius: 10px; }
/* O botão antigo do login tinha borda cônica e brilho próprios: saem. */
body.auth-page .btn-entrar::before, body.auth-page .btn-entrar::after,
body.auth-page .btn-primary::after { display: none !important; }
body.auth-page .sf-spin { border-color: rgba(26, 21, 0, .3); border-top-color: var(--ink); border-right-color: rgba(26, 21, 0, .3); }

/* Links do rodapé do card */
.auth-links, .auth-card .auth-link { margin-top: 14px; text-align: center; font-size: .9rem; color: var(--text-muted); }
.auth-links a:not(.go) { color: var(--text-muted); font-size: .86rem; text-decoration: none; }
.auth-links a:not(.go):hover { color: var(--text-primary); }
.auth-links p { margin: 12px 0 0; }
.auth-links .auth-mini { margin-top: 6px; font-size: .82rem; }
.auth-links .go, .auth-card .auth-link a.text-purple {
  color: var(--gold) !important; font-weight: 700; text-decoration: none;
}
.auth-links .go:hover, .auth-card .auth-link a.text-purple:hover { text-decoration: underline; }
.auth-card details summary { color: var(--text-muted); }
.auth-card details summary:hover { color: var(--text-primary); }

/* Mensagens do servidor nas telas sem lugar próprio no card */
.auth-msgs { display: grid; gap: 8px; margin-bottom: 14px; }
.auth-msg {
  padding: 10px 14px; border-radius: 10px; font-size: .88rem;
  background: rgba(255, 210, 31, .08); border: 1px solid rgba(255, 210, 31, .3); color: var(--text-secondary);
}
.auth-msg.error { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); color: var(--bad); }
.auth-msg.success { background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .35); color: var(--ok); }

/* Selo de sucesso (✓) do redesign */
.auth-tick {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: rgba(74, 222, 128, .12); border: 1px solid rgba(74, 222, 128, .4); color: var(--ok); font-size: 1.5rem;
}
.auth-tick.warn { background: rgba(255, 210, 31, .10); border-color: rgba(255, 210, 31, .45); color: var(--gold); }
.auth-tick.bad  { background: rgba(255, 107, 107, .10); border-color: rgba(255, 107, 107, .45); color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  .marca-g, body.auth-page .auth-card { animation: none; }
  body.auth-page .auth-card::before { animation: none; }
}
@media (max-width: 420px) {
  .marca-g-nome { font-size: 2rem; }
  body.auth-page .auth-card { padding: 24px 18px 20px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GESTÃO NO FORMATO DO REDESIGN
   A gestão usa a mesma casca do painel: menu na lateral (MENU_GESTAO em
   apps/accounts/menu.py), abas no topo, cards com .ct. Aqui só o que é dela.
   ═══════════════════════════════════════════════════════════════════════════ */
.side-area {
  display: inline-block; margin: -4px 0 6px 2px; padding: 2px 8px; border-radius: 999px;
  font: 700 .68rem var(--f-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(255, 210, 31, .35); background: rgba(255, 210, 31, .08);
}
.sidebar.collapsed .side-area { display: none; }
.side-links .nav-selo {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: .72rem; font-weight: 800;
  background: var(--bad); color: #fff;
}

/* As telas da gestão (e as do laboratório, que ficam fora do git) foram
   escritas com Bootstrap puro: selos coloridos, ícones em bolinha, cabeçalho
   de card, cores ciano/verde/roxo. Aqui elas falam a língua do redesign sem
   reescrever cada uma: o selo vira .sf-tag, o cabeçalho vira .sf-ch, a paleta
   vira dourado + ok/bad. */
:is(.gestao, .sf-bs) .card { background: var(--bg2) !important; border: 1px solid var(--line) !important; border-radius: 14px; }
:is(.gestao, .sf-bs) .card-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; background: transparent !important; border-bottom: 1px solid var(--line) !important;
}
:is(.gestao, .sf-bs) .card-header h5, :is(.gestao, .sf-bs) .card-header h6, :is(.gestao, .sf-bs) .card-title {
  font: 800 1.05rem var(--f-title); letter-spacing: -.01em; color: var(--text-primary) !important; margin: 0;
}
:is(.gestao, .sf-bs) .card-footer { background: transparent; border-top: 1px solid var(--line); }
:is(.gestao, .sf-bs) h2, :is(.gestao, .sf-bs) h3, :is(.gestao, .sf-bs) h4 { font-family: var(--f-title); }
:is(.gestao, .sf-bs) .display-6 { font: 800 2.1rem/1.1 var(--f-title); letter-spacing: -.02em; }

/* Paleta: o que era ciano, roxo e azul vira dourado; verde e vermelho ficam
   só para estado (ok / problema), como no redesign. */
:is(.gestao, .sf-bs) .text-info, :is(.gestao, .sf-bs) .text-primary, :is(.gestao, .sf-bs) .text-purple { color: var(--gold) !important; }
:is(.gestao, .sf-bs) .text-warning { color: #ffb020 !important; }
:is(.gestao, .sf-bs) .text-success { color: var(--ok) !important; }
:is(.gestao, .sf-bs) .text-danger { color: var(--bad) !important; }
:is(.gestao, .sf-bs) .text-white { color: var(--text-primary) !important; }
:is(.gestao, .sf-bs) .text-white-50 { color: var(--text-muted) !important; }
:is(.gestao, .sf-bs) .bg-black, :is(.gestao, .sf-bs) .bg-dark { background: var(--bg) !important; }

/* Ícone em bolinha → ícone dourado em quadrado, como .sf-ico */
:is(.gestao, .sf-bs) .icon-shape {
  width: 38px; height: 38px; padding: 0 !important; border-radius: 10px !important;
  display: grid; place-items: center; background: rgba(255, 210, 31, .1) !important; color: var(--gold) !important;
}
:is(.gestao, .sf-bs) .icon-shape i { font-size: 1.1rem !important; }

/* Selos: fundo transparente, borda e texto na cor do estado (.sf-tag) */
:is(.gestao, .sf-bs) .badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 700 .68rem var(--f-body); letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-hover);
  background: transparent !important; color: var(--text-secondary) !important;
}
:is(.gestao, .sf-bs) .badge.bg-warning, :is(.gestao, .sf-bs) .badge.bg-primary, :is(.gestao, .sf-bs) .badge.bg-info, :is(.gestao, .sf-bs) .badge.bg-purple { color: var(--gold) !important; border-color: rgba(255, 210, 31, .45) !important; }
:is(.gestao, .sf-bs) .badge.bg-success { color: var(--ok) !important; border-color: rgba(74, 222, 128, .4) !important; }
:is(.gestao, .sf-bs) .badge.bg-danger { color: var(--bad) !important; border-color: rgba(255, 107, 107, .45) !important; }
:is(.gestao, .sf-bs) .badge.bg-secondary { color: var(--text-muted) !important; border-color: var(--line-hover) !important; }
/* Selo dentro de botão ou link é CONTADOR: mantém o fundo */
:is(.gestao, .sf-bs) :is(.btn, a, .nav-link) .badge.bg-danger { background: var(--bad) !important; color: #fff !important; border-color: var(--bad) !important; }
:is(.gestao, .sf-bs) :is(.btn, a, .nav-link) .badge.bg-warning { background: var(--gold) !important; color: var(--ink) !important; border-color: var(--gold) !important; }

/* Tabelas: cabeçalho discreto em caixa alta, linhas finas */
:is(.gestao, .sf-bs) .table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(255, 255, 255, .025); margin: 0; }
:is(.gestao, .sf-bs) .table > thead, :is(.gestao, .sf-bs) .table-light, :is(.gestao, .sf-bs) .table-dark { --bs-table-bg: transparent; }
:is(.gestao, .sf-bs) .table > thead th {
  font: 700 .7rem var(--f-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted) !important; background: transparent !important;
  border-bottom: 1px solid var(--line) !important; padding: 12px 16px; white-space: nowrap;
}
:is(.gestao, .sf-bs) .table > tbody td { padding: 12px 16px; border-color: var(--line) !important; }
:is(.gestao, .sf-bs) .table-sm > tbody td, :is(.gestao, .sf-bs) .table-sm > thead th { padding: 8px 12px; }

/* Botões contornados coloridos → neutros (o vermelho fica: é ação perigosa) */
:is(.gestao, .sf-bs) .btn-outline-info, :is(.gestao, .sf-bs) .btn-outline-primary, :is(.gestao, .sf-bs) .btn-outline-light,
:is(.gestao, .sf-bs) .btn-outline-success, :is(.gestao, .sf-bs) .btn-outline-warning {
  --bs-btn-color: var(--text-secondary); --bs-btn-border-color: var(--line-hover);
  --bs-btn-hover-color: var(--gold); --bs-btn-hover-bg: rgba(255, 210, 31, .08); --bs-btn-hover-border-color: rgba(255, 210, 31, .5);
  --bs-btn-active-color: var(--gold); --bs-btn-active-bg: rgba(255, 210, 31, .12); --bs-btn-active-border-color: rgba(255, 210, 31, .5);
}
:is(.gestao, .sf-bs) .btn-link { color: var(--gold); text-decoration: none; }
:is(.gestao, .sf-bs) .btn-link:hover { text-decoration: underline; }

/* Avisos no formato .sf-al */
:is(.gestao, .sf-bs) .alert { border-radius: 12px; font-size: .9rem; background: var(--bg3); border: 1px solid var(--line); color: var(--text-secondary); }
:is(.gestao, .sf-bs) .alert-warning { background: rgba(255, 210, 31, .07); border-color: rgba(255, 210, 31, .35); }
:is(.gestao, .sf-bs) .alert-danger { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); }
:is(.gestao, .sf-bs) .alert-success { background: rgba(74, 222, 128, .07); border-color: rgba(74, 222, 128, .35); }

:is(.gestao, .sf-bs) .progress { background: var(--bg3); border-radius: 999px; height: 8px; }
:is(.gestao, .sf-bs) .progress-bar { background: var(--gold); }
:is(.gestao, .sf-bs) .list-group-item { background: transparent; border-color: var(--line); color: var(--text-primary); }
.sf-ico.bad, .sf-d.bad { color: var(--bad); }
a.metric-card.sf-stat { color: inherit; text-decoration: none; }
a.metric-card.sf-stat:hover { border-color: var(--line-hover); }
/* O olho de privacidade é do painel do cliente (para print e gravação). Na
   gestão não há o botão para desligá-lo, e o admin precisa ler os nomes. */
html.privado .gestao .sf-row .sf-av,
html.privado .gestao .sf-row b,
html.privado .gestao .sf-row .sf-m { filter: none; user-select: auto; }
/* Botões contornados com a cara do .sf-btn (fundo escuro, borda fina) */
:is(.gestao, .sf-bs) .btn[class*="btn-outline-"] { background: var(--bg3); border-color: var(--line); }
:is(.gestao, .sf-bs) .btn[class*="btn-outline-"]:hover:not(:disabled) { border-color: rgba(255, 210, 31, .5); }
:is(.gestao, .sf-bs) .btn-outline-danger:hover:not(:disabled) { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .08); color: var(--bad); }
:is(.gestao, .sf-bs) .btn:disabled { opacity: .4; }
/* Botão de ação perigosa (excluir, remover) no formato .sf-btn */
.sf-btn.bad { color: var(--bad); }
.sf-btn.bad:hover:not(:disabled) { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .08); color: var(--bad); }

/* A camada acima vale também para telas do cliente ainda em Bootstrap puro:
   basta envolver o conteúdo (e as janelas, que o app.js move para o <body>)
   com .sf-bs. */

/* Janela aberta: o convite do Sirius Mail e a bolinha da Sirius saem da
   frente — ficavam por cima do fundo escurecido. */
body.modal-open .promo-mail, body.modal-open .hotier-bolha, body.modal-open .hotier-nudge { display: none !important; }

/* Abas de situação (Na fila / Publicados / Falhas…) e pílulas de filtro */
.sf-abas { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--bg3); border: 1px solid var(--line); border-radius: 12px; }
.sf-abas a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; color: var(--text-muted); font-weight: 700; font-size: .82rem; text-decoration: none; }
.sf-abas a:hover { color: var(--text-primary); }
.sf-abas a.on { background: var(--gold); color: var(--ink); }
.sf-abas em { font-style: normal; font-size: .7rem; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.sf-abas a.on em { background: rgba(26, 21, 0, .15); }
.sf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--text-secondary);
  font-size: .82rem; font-weight: 600; text-decoration: none; transition: border-color .15s, color .15s;
}
.sf-pill:hover { border-color: var(--line-hover); color: var(--text-primary); }
.sf-pill.on { background: rgba(255, 210, 31, .12); border-color: rgba(255, 210, 31, .55); color: var(--gold); }
.sf-pill em { font-style: normal; font-size: .7rem; color: var(--text-muted); }
.sf-pill.on em { color: var(--gold); }
.sf-filtro { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px 14px; align-items: start; }
.sf-filtro > .sf-lab { margin: 6px 0 0; }
@media (max-width: 600px) { .sf-filtro { grid-template-columns: minmax(0, 1fr); } .sf-filtro > .sf-lab { margin: 4px 0 -4px; } }
/* Botão dentro do estado vazio: o ícone dele não herda o ícone grande. */
.sf-vazio .sf-btn i { font-size: inherit; display: inline; margin: 0; opacity: 1; }

/* Cartão de conta: ajustes de rotina recolhidos (Pasta, Modelo, Forçar, Pausar, Limite) */
.acct-ajustes { border: 1px solid var(--line); border-radius: 10px; background: var(--bg3); margin-bottom: 12px; }
.acct-ajustes > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
  font-size: .82rem; font-weight: 700; color: var(--text-secondary);
}
.acct-ajustes > summary::-webkit-details-marker { display: none; }
.acct-ajustes > summary:hover { color: var(--text-primary); }
.acct-ajustes > summary > .bi-sliders { color: var(--gold); }
.acct-ajustes-resumo { margin-left: auto; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.acct-ajustes-resumo .sf-tag { font-size: .6rem; padding: 2px 7px; }
.acct-chev { transition: transform .2s; color: var(--text-muted); }
.acct-ajustes[open] .acct-chev { transform: rotate(180deg); }
.acct-ajustes-corpo { padding: 4px 12px 2px; border-top: 1px solid var(--line); animation: sfAbre .22s ease-out; }
.acct-ajustes-corpo > form:first-child { margin-top: 10px; }
@keyframes sfAbre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .acct-ajustes-corpo { animation: none; } .acct-chev { transition: none; } }

/* Pílula de pasta com o "x" de excluir dentro (Biblioteca, Contas) */
.pasta-pill { padding: 3px 4px 3px 12px; }
.pasta-pill a { color: inherit; text-decoration: none; }
.pasta-pill form { display: inline; margin: 0; }
.pasta-x { border: 0; background: transparent; color: var(--text-muted) !important; width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0; }
.pasta-x:hover { background: var(--line); color: var(--bad) !important; }
button.sf-pill { font-family: inherit; cursor: pointer; }
/* A janela de confirmação respeita as quebras de linha do texto (listas de @). */
.sf-win p { white-space: pre-line; }
.acct-ajustes .conta-modelo-form { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.acct-ajustes .conta-modelo-form > span { white-space: nowrap; min-width: 64px; display: inline-flex; align-items: center; gap: 5px; }
.acct-ajustes .conta-modelo-form select, .acct-ajustes .conta-modelo-form input { flex: 1; min-width: 0; }

/* Avisos que usam as classes de fundo do Bootstrap (bg-info bg-opacity-10…):
   elas têm !important, então a camada também precisa. */
:is(.gestao, .sf-bs) .alert.bg-info, :is(.gestao, .sf-bs) .alert.bg-primary, :is(.gestao, .sf-bs) .alert.alert-info {
  background: rgba(255, 210, 31, .06) !important; border: 1px solid rgba(255, 210, 31, .3) !important; color: var(--text-secondary) !important;
}
:is(.gestao, .sf-bs) .alert.bg-warning { background: rgba(255, 210, 31, .07) !important; border: 1px solid rgba(255, 210, 31, .35) !important; }
:is(.gestao, .sf-bs) .alert.bg-danger { background: rgba(255, 107, 107, .08) !important; border: 1px solid rgba(255, 107, 107, .35) !important; }
:is(.gestao, .sf-bs) .alert.bg-success { background: rgba(74, 222, 128, .07) !important; border: 1px solid rgba(74, 222, 128, .35) !important; }
:is(.gestao, .sf-bs) .alert .bi:first-child { color: var(--gold); }

/* Painel lateral aberto: convite e bolinha da Sirius saem da frente */
body:has(.offcanvas.show) .promo-mail, body:has(.offcanvas.show) .hotier-bolha, body:has(.offcanvas.show) .hotier-nudge { display: none !important; }
/* Régua (input range): a trilha sumia no tema escuro — só a bolinha aparecia. */
[data-bs-theme="dark"] .form-range::-webkit-slider-runnable-track { background: var(--line-hover); height: 6px; border-radius: 999px; }
[data-bs-theme="dark"] .form-range::-moz-range-track { background: var(--line-hover); height: 6px; border-radius: 999px; }
[data-bs-theme="dark"] .form-range::-webkit-slider-thumb { margin-top: -5px; }
