@import url('./tokens/_variables.css?v=85');
@import url('./base/_globals.css?v=85');
@import url('./base/_motion.css?v=85');
@import url('./components/_enhancements.css?v=85');

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--surface-border);
  background: var(--header-bg);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.65rem 0.875rem;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--foreground);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  text-decoration: none;
}
.brand:hover { color: var(--foreground); }
.brand-text { display: none; }
.brand img {
  border-radius: 0.65rem;
  box-shadow: var(--shadow-sm);
}
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
  padding: 0 0.5rem;
}
.desktop-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #a1a1aa;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.desktop-nav .nav-icon {
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.85;
}
.desktop-nav .nav-link.active {
  color: #fff;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(61, 207, 122, 0.32);
}
.desktop-nav .nav-link:hover:not(.active) {
  color: #e4e4e7;
  background: var(--surface-hover);
}

.page-main { padding-bottom: calc(5.5rem + var(--safe-bottom)); overflow-x: hidden; max-width: 100%; }
.page-container {
  max-width: var(--page-narrow);
  margin: 0 auto;
  padding: 1rem 0.75rem 2rem;
  overflow-x: hidden;
  width: 100%;
}
.page-container-wide {
  max-width: min(100%, 96rem);
}
@media (min-width: 900px) {
  .page-container-wide {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Cards */
.glass-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, transparent 42%);
}
.glass-card-hover {
  display: block;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
@media (hover: hover) {
  .glass-card-hover:hover {
    border-color: var(--surface-border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
}

/* Buttons */
.btn-brand, .btn-secondary, .btn-danger, .btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 1.125rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}
.btn-brand {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-brand:hover { color: white; background: var(--accent-hover); }
.btn-brand:active { transform: scale(0.98); }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: #e4e4e7;
}
.btn-secondary:hover { color: white; background: var(--surface-hover); }
.btn-success {
  background: #16a34a;
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}
.btn-success:hover { color: white; background: #22c55e; }
.btn-success:active { transform: scale(0.98); }
.btn-danger {
  background: var(--danger-dim);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-sm { min-height: 36px; padding: 0.4rem 0.875rem; font-size: 0.8125rem; }
.btn-xs {
  min-height: 26px;
  padding: 0.2rem 0.45rem;
  font-size: 0.6875rem;
  border-radius: 0.4rem;
  font-weight: 600;
}
.input-xs {
  width: 2.5rem;
  padding: 0.2rem 0.3rem;
  font-size: 0.6875rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color: #fafafa;
  text-align: center;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Page head */
.page-head-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-head-row-solo {
  margin-bottom: 1rem;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
}
.page-head-row h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
  font-family: var(--font-display);
}
.subtitle { margin: 0.35rem 0 0; color: var(--muted-dim); font-size: 0.8125rem; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
.page-actions .btn-sm { flex: 1 1 auto; min-width: 0; white-space: nowrap; }

/* Setup banner — compacto */
.setup-banner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
  border-color: var(--surface-border-strong);
  background: var(--background-elevated);
}
.setup-banner-icon { font-size: 1.25rem; }
.setup-banner-text { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.875rem; }
.setup-banner-text strong { color: #e4e4e7; }

/* Hero + metrics */
.summary-grid {
  display: grid;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  padding: 1.5rem 1.35rem;
  text-align: left;
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  box-shadow: var(--shadow-sm);
}
.hero-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.hero-success {
  border-color: rgba(34, 197, 94, 0.2);
}
.hero-success::before { background: #22c55e; }
.hero-danger {
  border-color: rgba(239, 68, 68, 0.2);
}
.hero-danger::before { background: #ef4444; }
.hero-kicker {
  position: relative;
  margin: 0;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-value {
  position: relative;
  margin: 0.4rem 0 0.25rem;
  font-size: clamp(1.85rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hero-success .hero-value { color: #4ade80; }
.hero-danger .hero-value { color: #f87171; }
.hero-trend {
  position: relative;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.hero-trend-up { color: #4ade80; }
.hero-trend-down { color: #f87171; }
.hero-trend-label {
  font-weight: 500;
  color: var(--muted-dim);
  font-size: 0.75rem;
}
.hero-sub { position: relative; margin: 0; font-size: 0.8125rem; color: var(--muted-dim); }
.section-rifas { margin-bottom: 1.25rem; }

/* Painel recolhível — Rifas */
.rifas-panel {
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rifas-panel[open] {
  border-color: var(--surface-border-strong);
  box-shadow: var(--shadow-md);
}
.rifas-panel-trigger {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1rem;
  user-select: none;
  transition: background 0.15s;
}
.rifas-panel-trigger::-webkit-details-marker { display: none; }
.rifas-panel-trigger:hover { background: var(--surface-hover); }
.rifas-panel-trigger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.rifas-panel-trigger .section-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rifas-panel-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.rifas-panel-count {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 207, 122, 0.22);
  color: var(--accent-hover);
}
.rifas-panel-chevron {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -0.15rem;
  transition: transform 0.2s ease;
  opacity: 0.85;
}
.rifas-panel[open] .rifas-panel-chevron {
  transform: rotate(-135deg);
  margin-top: 0.1rem;
}
.rifas-panel-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-dim);
}
.rifas-panel[open] .rifas-panel-hint { display: none; }
.rifas-panel-expand {
  padding: 0 0.75rem 0.9rem;
  border-top: 1px solid var(--surface-border);
}
.rifas-panel:not([open]) .rifas-panel-expand { display: none; }
.rifas-panel-expand .rifas-grid { margin-top: 0.85rem; }
@media (min-width: 768px) {
  .rifas-panel-trigger { padding: 1rem 1.15rem; }
  .rifas-panel-trigger .section-title { font-size: 1.25rem; }
  .rifas-panel-expand { padding: 0 1.15rem 1.15rem; }
}

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.metric-card {
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  padding: 0.875rem 1rem;
  min-height: 5.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
@media (hover: hover) {
  .metric-card:hover {
    border-color: var(--surface-border-strong);
    box-shadow: var(--shadow-sm);
  }
}
.metric-top { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; }
.metric-icon {
  font-size: 0.7rem;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.metric-label { margin: 0; font-size: 0.6875rem; color: #71717a; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.metric-value { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.metric-sub { margin: 0.2rem 0 0; font-size: 0.6875rem; color: #52525b; }
.variant-success { border-left: 3px solid var(--success); }
.variant-success .metric-icon { background: var(--success-dim); color: #34d399; }
.variant-success .metric-value { color: #34d399; }
.variant-danger { border-left: 3px solid var(--danger); }
.variant-danger .metric-icon { background: var(--danger-dim); color: #f87171; }
.variant-danger .metric-value { color: #f87171; }
.variant-default { border-left: 3px solid rgba(61, 207, 122, 0.45); }

/* Period + status */
.top-grid { display: grid; gap: 0.875rem; margin-bottom: 1.25rem; }
.top-aside { display: flex; flex-direction: column; gap: 0.625rem; }
.refresh-hint { margin: 0; font-size: 0.75rem; color: #52525b; }
.refresh-link { color: var(--accent-hover); font-weight: 600; text-decoration: none; }
.refresh-link:hover { text-decoration: underline; }
.form-fast button[disabled] { opacity: 0.6; cursor: wait; }

.periodo-filter { padding: 1.125rem; }
.periodo-label { margin: 0 0 0.75rem; font-size: 0.8125rem; color: #a1a1aa; font-weight: 500; }
.periodo-chips { display: flex; gap: 0.4rem; padding-bottom: 0.25rem; }
.chip {
  flex-shrink: 0;
  padding: 0.45rem 0.875rem;
  border-radius: 999px;
  background: var(--background-elevated);
  border: 1px solid var(--surface-border);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s;
}
.chip:hover { color: #e4e4e7; border-color: var(--surface-border-strong); }
.chip.active {
  background: var(--accent-soft);
  color: #fff;
  border-color: rgba(61, 207, 122, 0.35);
  box-shadow: none;
}
.periodo-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8125rem;
  color: #71717a;
}

.status-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-status {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(39, 39, 42, 0.9);
  color: #a1a1aa;
  border: 1px solid rgba(255,255,255,0.06);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chip-status.ok { background: var(--success-dim); color: #34d399; border-color: rgba(16,185,129,0.25); }
.chip-status.warn { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.25); }

/* Sections */
.section { margin-bottom: 2rem; }
.section-title { font-size: 1.125rem; font-weight: 700; margin: 0 0 1rem; letter-spacing: -0.02em; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head .section-title { margin: 0; }

/* Rifa cards */
.rifas-grid { display: grid; gap: 0.75rem; }
.rifa-card { padding: 1.125rem; }
.rifa-card-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.rifa-card-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.rifa-site { margin: 0.2rem 0 0; font-size: 0.75rem; color: #52525b; }
.rifa-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.875rem; padding-top: 0.875rem; border-top: 1px solid rgba(255,255,255,0.06); }
.rifa-metrics .lbl { display: block; font-size: 0.65rem; color: #71717a; text-transform: uppercase; letter-spacing: 0.04em; }
.rifa-metrics .val { font-weight: 700; font-size: 0.875rem; }
.rifa-foot { margin: 0.75rem 0 0; font-size: 0.75rem; color: #52525b; }
.success { color: var(--success); }
.danger { color: #f87171; }

.badge { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 999px; }
.badge-ok { background: var(--success-dim); color: #34d399; }
.badge-muted { background: rgba(39,39,42,0.9); color: #71717a; }

/* Campanhas */
.campanha-row { margin-bottom: 0.5rem; padding: 0.875rem 1rem; overflow: hidden; max-width: 100%; }
.campanha-row-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; min-width: 0; }
.campanha-nome {
  margin: 0;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Vincular rifa — compacto */
.rifa-fixa { display: flex; flex-direction: column; gap: 0.2rem; max-width: 100%; }
.rifa-fixa-nome {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e4e4e7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.rifa-trocar, .rifa-pick { position: relative; }
.rifa-trocar summary, .btn-pick-rifa {
  list-style: none;
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-hover);
  user-select: none;
}
.rifa-trocar summary::-webkit-details-marker, .rifa-pick summary::-webkit-details-marker { display: none; }
.btn-pick-rifa {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(61, 207, 122, 0.3);
  background: var(--accent-soft);
  color: var(--accent-hover);
  white-space: nowrap;
}
.rifa-trocar[open] .vincular-rifa-form,
.rifa-pick[open] .vincular-rifa-form {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 0;
  width: min(18rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  padding: 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: #141418;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.campanha-vincular-wrap { margin-bottom: 0.5rem; max-width: 100%; overflow: hidden; }
.vincular-rifa-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}
.vincular-rifa-form .select-sm {
  width: 100%;
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: 0.8125rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color: #fafafa;
}
.vincular-rifa-form .btn-block { width: 100%; justify-content: center; }
.campanha-rifa-cell {
  position: relative;
  vertical-align: middle;
  max-width: 13.5rem;
  width: 13.5rem;
}
.campanha-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.campanha-metrics-row-4 { grid-template-columns: repeat(2, 1fr); }
.campanha-metrics-row-6 { grid-template-columns: repeat(2, 1fr); }
.campanha-metrics-row .lbl { display: block; font-size: 0.65rem; color: #71717a; text-transform: uppercase; font-weight: 600; }
.campanha-metrics-row .val { display: block; font-size: 0.875rem; font-weight: 700; margin-top: 0.15rem; word-break: break-word; overflow-wrap: anywhere; line-height: 1.25; }
.table-wrap td.success { color: var(--success); font-weight: 600; }
.table-wrap td.danger { color: var(--danger); font-weight: 600; }
.campanha-rifa, .campanha-id { margin: 0.15rem 0 0; font-size: 0.75rem; color: #71717a; }
.campanha-gasto { margin: 0; font-weight: 700; color: #f87171; font-size: 1.05rem; }
.campanha-lucro { font-size: 0.6875rem; color: #52525b; margin-top: 0.1rem; }

.desktop-only { display: none; }
.table-wrap { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-campanhas { table-layout: fixed; min-width: 58rem; }
.table-campanhas .td-campanha { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-campanhas th:nth-child(1), .table-campanhas .td-campanha { width: 10%; }
.table-campanhas th:nth-child(2), .table-campanhas .campanha-rifa-cell { width: 13%; }
.table-campanhas th:nth-child(3), .table-campanhas .td-gasto { width: 9%; }
.table-campanhas th:nth-child(4), .table-campanhas .td-cpp { width: 10%; }
.table-campanhas th:nth-child(5), .table-campanhas .td-resultado { width: 10%; }
.table-campanhas th:nth-child(6), .table-campanhas .td-roas { width: 6%; }
.table-campanhas th:nth-child(7), .table-campanhas .td-orcamento { width: 10%; }
.table-campanhas th:nth-child(8), .table-campanhas .campanha-acoes-cell { width: 26%; }
.td-gasto, .td-resultado { font-weight: 600; white-space: nowrap; font-size: 0.8125rem; }
.table-campanhas .td-cpp,
.table-campanhas .th-cpp {
  text-align: right;
  vertical-align: middle;
  padding-right: 0.5rem;
}
.val-cpp {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: #e4e4e7;
}
.cpp-compras-count {
  display: block;
  font-size: 0.5625rem;
  font-weight: 600;
  color: #71717a;
  margin-top: 0.1rem;
}
.campanha-metrics-row .cpp-compras-count {
  display: block;
  font-size: 0.625rem;
  color: #71717a;
  margin-top: 0.1rem;
}
.campanha-metrics-row .val-cpp {
  font-size: 0.875rem;
}
.table-campanhas .td-roas,
.table-campanhas .th-roas {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  padding-right: 0.65rem;
}
.val-roas {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Tabela — orçamento compacto, sem vazar p/ coluna Ações */
.table-campanhas .td-orcamento {
  vertical-align: middle;
  padding: 0.5rem 0.45rem;
  overflow: hidden;
}
.table-campanhas .td-orcamento .meta-budget-editor {
  display: block;
  width: 100%;
  max-width: 6.75rem;
}
.table-campanhas .td-orcamento .meta-budget-field {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.22rem 0.35rem;
  min-height: 32px;
  gap: 0.1rem;
}
.table-campanhas .td-orcamento .meta-budget-input {
  width: 0;
  min-width: 0;
  flex: 1 1 0;
  max-width: none;
  text-align: left;
  font-size: 0.75rem;
}
.table-campanhas .td-orcamento .meta-budget-prefix {
  flex-shrink: 0;
  font-size: 0.625rem;
}
.table-campanhas .td-orcamento .meta-budget-suffix {
  flex-shrink: 0;
  font-size: 0.5625rem;
}
.table-campanhas .td-orcamento .meta-budget-status {
  display: none;
}

/* Tabela — barra de ações alinhada */
.campanha-acoes-cell {
  min-width: 0;
  vertical-align: middle;
  padding: 0.5rem 0.45rem;
  overflow: hidden;
}
.campanha-acoes-cell .campanha-actions-table {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  width: 100%;
}
.campanha-acoes-cell .campanha-actions-table .inline-form {
  display: flex;
  margin: 0;
  flex-shrink: 0;
}
.campanha-acoes-cell .campanha-actions-table button {
  min-height: 32px;
  height: 32px;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  border-radius: 0.45rem;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.campanha-acoes-cell .campanha-actions-table .btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
}
.campanha-acoes-cell .campanha-actions-table .btn-success:hover {
  box-shadow: none;
  filter: brightness(1.06);
}
.campanha-acoes-cell .campanha-actions-table .btn-auto-toggle {
  min-height: 32px;
  height: 32px;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.campanha-acoes-cell .inline-form button { width: auto; flex-shrink: 0; }
.campanha-acoes-cell .btn-pause { white-space: nowrap; }

/* Orçamento inline — estilo Meta Ads Manager */
.meta-budget-editor {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.meta-budget-field {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.meta-budget-editor.is-focused .meta-budget-field,
.meta-budget-field:focus-within {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
  background: rgba(15, 23, 42, 0.85);
}
.meta-budget-editor.is-saving .meta-budget-field {
  border-color: rgba(245, 158, 11, 0.45);
}
.meta-budget-editor.is-saved .meta-budget-field {
  border-color: rgba(16, 185, 129, 0.45);
}
.meta-budget-prefix,
.meta-budget-suffix {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #71717a;
  white-space: nowrap;
  user-select: none;
}
.meta-budget-input {
  width: 4.25rem;
  min-width: 3rem;
  max-width: 5.5rem;
  padding: 0.1rem 0.15rem;
  border: none;
  background: transparent;
  color: #f4f4f5;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}
.meta-budget-input.is-error {
  color: #f87171;
}
.meta-budget-status {
  font-size: 0.625rem;
  font-weight: 700;
  color: #71717a;
  min-width: 2.75rem;
  white-space: nowrap;
}
.meta-budget-status.is-saving { color: #fbbf24; }
.meta-budget-status.is-saved { color: #34d399; }
.meta-budget-status.is-error { color: #f87171; }
.campanha-metrics-row .meta-budget-editor {
  margin-top: 0.15rem;
}
.campanha-metrics-row .meta-budget-field {
  width: 100%;
  max-width: 9rem;
}
.campanha-head .meta-budget-editor {
  margin-top: 0.45rem;
}

/* Toast notifications */
.ads-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.ads-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}
.ads-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.ads-toast-ok { border-color: rgba(16, 185, 129, 0.35); }
.ads-toast-erro { border-color: rgba(239, 68, 68, 0.35); }
.ads-toast-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.ads-toast-ok .ads-toast-icon { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ads-toast-erro .ads-toast-icon { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.ads-toast-body { flex: 1; min-width: 0; }
.ads-toast-title {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.ads-toast-msg {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f4f4f5;
  line-height: 1.35;
  word-break: break-word;
}
.ads-toast-msg-full {
  margin-top: 0.35rem;
  font-weight: 500;
  font-size: 0.75rem;
  color: #a1a1aa;
  line-height: 1.45;
}
.ads-toast-more {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ads-toast-more:hover { text-decoration: underline; }
.ads-toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #71717a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
@media (hover: hover) {
  .ads-toast-close:hover { color: #fff; }
}
@media (max-width: 640px) {
  .ads-toast-stack {
    top: auto;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

.hint-sm { font-size: 0.75rem; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.875rem 1.125rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #71717a; background: rgba(0,0,0,0.25); }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-campanhas tbody tr.row-roi-bom { background: rgba(16, 185, 129, 0.14); }
.table-campanhas tbody tr.row-roi-bom:hover { background: rgba(16, 185, 129, 0.2); }
.table-campanhas tbody tr.row-roi-medio { background: rgba(245, 158, 11, 0.14); }
.table-campanhas tbody tr.row-roi-medio:hover { background: rgba(245, 158, 11, 0.2); }
.table-campanhas tbody tr.row-roi-ruim { background: rgba(239, 68, 68, 0.14); }
.table-campanhas tbody tr.row-roi-ruim:hover { background: rgba(239, 68, 68, 0.2); }
.table-campanhas tbody tr.row-roi-neutro { background: rgba(255, 255, 255, 0.02); }
.campanha-row.row-roi-bom {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(24, 24, 27, 0.85));
}
.campanha-row.row-roi-medio {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(24, 24, 27, 0.85));
}
.campanha-row.row-roi-ruim {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(24, 24, 27, 0.85));
}
.campanha-row.row-roi-neutro {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  border-top: 1px solid var(--surface-border);
  background: rgba(6, 6, 10, 0.94);
  backdrop-filter: blur(16px);
  z-index: 50;
  padding-bottom: var(--safe-bottom);
}
.mobile-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 0.25rem;
  color: #71717a;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.mobile-nav a.active { color: var(--accent-hover); }
.mobile-nav .icon { font-size: 1.35rem; line-height: 1; }

/* Forms & misc */
input, select, textarea {
  color-scheme: dark;
  font-size: 16px;
  font-family: inherit;
  background: rgba(9, 9, 11, 0.9);
  border: 1px solid rgba(63, 63, 70, 0.8);
  color: white;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s;
}
input:focus, select:focus { outline: none; border-color: #7c3aed; }

.scroll-x-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-x-mobile::-webkit-scrollbar { display: none; }

.flash {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.flash.ok { background: var(--success-dim); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.flash.erro, .erro { color: #f87171; }
.erro-sm { font-size: 0.8rem; color: #f87171; }
.hint, .hint-box { color: #71717a; font-size: 0.875rem; line-height: 1.6; }
.hint-box { padding: 1rem; }
.empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; line-height: 1; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
  flex: 1;
  text-align: center;
  padding: 0.65rem;
  border-radius: 0.75rem;
  background: rgba(39,39,42,0.9);
  color: #a1a1aa;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.tab.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.tab-actions { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.back-link { font-weight: 600; font-size: 0.875rem; color: var(--accent-hover); }
.mt { margin-top: 0.75rem; }

.form-card { display: grid; gap: 1rem; margin-bottom: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field span { font-size: 0.75rem; color: #a1a1aa; font-weight: 600; }
.field input, .field select { width: 100%; }
.form-hint { margin: 0; font-size: 0.8125rem; color: #71717a; }

.campanha-card {
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  padding: 1.125rem;
  margin-bottom: 0.75rem;
}
.campanha-head { display: flex; justify-content: space-between; gap: 1rem; }
.campanha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  align-items: center;
}
.campanha-actions-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.campanha-acoes-cell .campanha-actions-compact {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex-wrap: wrap;
}
.btn-pause { white-space: nowrap; }
.inline-form { display: inline; }
.budget-form { display: flex; gap: 0.35rem; align-items: center; margin-left: auto; }
.input-sm { width: 4.5rem; padding: 0.35rem 0.5rem; font-size: 0.8125rem; }
.badge-status { display: inline-block; margin-top: 0.35rem; font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: #27272a; color: #a1a1aa; }
.badge-status.status-active { background: var(--success-dim); color: #34d399; }
.badge-status.status-paused { background: rgba(245,158,11,0.12); color: #fbbf24; }
.orcamento { display: block; font-size: 0.75rem; color: #52525b; margin-top: 0.25rem; }

.config-wrap { max-width: 36rem; display: grid; gap: 1rem; }
.config-status { display: flex; align-items: center; justify-content: space-between; }
.help-box summary { cursor: pointer; font-weight: 600; color: #d4d4d8; }
.help-box ol { margin: 1rem 0 0; padding-left: 1.25rem; color: #71717a; font-size: 0.875rem; }

.venda-valor { margin: 0; font-weight: 700; color: var(--success); }
.venda-meta, .venda-utm { margin: 0.15rem 0 0; font-size: 0.8rem; color: #71717a; }
.venda-liq { margin: 0; font-size: 0.85rem; color: #a1a1aa; }
.venda-row { margin-bottom: 0.5rem; }

.site-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.sites-forms-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .desktop-nav { display: flex; }
  .header-user { display: flex; }
  .sites-forms-grid { grid-template-columns: 1fr 1fr; }
}
.code-block {
  margin: 0.75rem 0 0;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: #0a0a0c;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8125rem;
  overflow-x: auto;
  color: #d4d4d8;
}
.sites-list { display: grid; gap: 0.5rem; }

/* Login — Nery Ads */
.login-body {
  --login-lime: #b8f25a;
  --login-lime-hot: #d4ff7a;
  --login-ink: #000000;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
}
[data-theme="light"] .login-body {
  --login-lime: #1fa855;
  --login-lime-hot: #18964a;
  --login-ink: #ffffff;
}
[data-theme="light"] .login-mesh {
  background:
    radial-gradient(ellipse 70% 55% at 8% 12%, rgba(31, 168, 85, 0.1), transparent 58%),
    radial-gradient(ellipse 55% 45% at 92% 88%, rgba(31, 168, 85, 0.08), transparent 60%),
    linear-gradient(165deg, #ffffff 0%, #f5f7f6 45%, #eef2f0 100%);
}
[data-theme="light"] .login-watermark { color: rgba(12, 18, 16, 0.04); }
[data-theme="light"] .login-logo,
[data-theme="light"] .login-logo:hover { color: var(--foreground); }
.login-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 8% 12%, rgba(184, 242, 90, 0.16), transparent 58%),
    radial-gradient(ellipse 55% 45% at 92% 88%, rgba(61, 207, 122, 0.12), transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 18%, rgba(184, 242, 90, 0.05), transparent 55%),
    linear-gradient(165deg, #0c100c 0%, #080a08 45%, #050605 100%);
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.55;
  animation: login-orb-drift 18s var(--ease-out) infinite alternate;
}
.login-orb-a {
  width: min(42vw, 28rem);
  height: min(42vw, 28rem);
  top: -12%;
  left: -8%;
  background: rgba(184, 242, 90, 0.22);
}
.login-orb-b {
  width: min(38vw, 24rem);
  height: min(38vw, 24rem);
  right: -6%;
  bottom: -10%;
  background: rgba(61, 207, 122, 0.18);
  animation-delay: -6s;
  animation-duration: 22s;
}
.login-orb-c {
  width: min(28vw, 16rem);
  height: min(28vw, 16rem);
  top: 42%;
  left: 48%;
  background: rgba(184, 242, 90, 0.08);
  animation-delay: -12s;
  animation-duration: 26s;
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 242, 90, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 242, 90, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 30%, black 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 40% 30%, black 10%, transparent 72%);
}
.login-watermark {
  position: absolute;
  right: -2%;
  bottom: -6%;
  font-family: var(--font-body);
  font-size: clamp(7rem, 22vw, 14rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.8;
  color: rgba(244, 247, 242, 0.035);
  user-select: none;
  animation: login-watermark-in 1.2s var(--ease-out) both;
}
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
}
.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2rem;
  animation: login-rise 0.7s var(--ease-out) both;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--foreground);
  text-decoration: none;
}
.login-logo:hover { color: var(--foreground); }
.login-logo img {
  border-radius: 0.65rem;
  box-shadow: 0 0 0 1px rgba(184, 242, 90, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.login-logo-text {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-logo-text em {
  font-style: normal;
  color: var(--login-lime);
}
.login-layout {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 1.75rem 2rem;
  width: 100%;
}
.login-hero {
  flex: 1 1 16rem;
  max-width: 20rem;
  animation: login-rise 0.8s var(--ease-out) 0.08s both;
}
.login-kicker {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 242, 90, 0.45);
  color: var(--login-lime);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(184, 242, 90, 0.06);
}
.login-headline {
  margin: 0;
  font-family: var(--font-body) !important;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em !important;
  line-height: 1.18;
  color: #fff;
}
.login-headline span {
  color: var(--login-lime);
  display: inline;
}
.login-lead {
  margin: 0.85rem 0 0;
  max-width: 19rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(232, 240, 230, 0.68);
  font-weight: 500;
}
.login-panel {
  flex: 0 1 20rem;
  width: 100%;
  max-width: 20rem;
  animation: login-rise 0.85s var(--ease-out) 0.16s both;
}
.login-card {
  position: relative;
  padding: 1.75rem 1.6rem 1.6rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(184, 242, 90, 0.18);
  background: rgba(16, 20, 16, 0.72);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(184, 242, 90, 0.06);
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, transparent 42%);
}
.login-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.login-card-head h2 {
  margin: 0;
  font-family: var(--font-body) !important;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em !important;
  color: #fff;
}
.login-card-hint {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--login-lime);
  opacity: 0.9;
}
.login-alert {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(240, 113, 103, 0.12);
  border: 1px solid rgba(240, 113, 103, 0.35);
  color: #fca5a5;
  font-size: 0.8125rem;
}
.login-form { display: grid; gap: 1.05rem; }
.login-field { display: grid; gap: 0.4rem; }
.login-field span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(244, 247, 242, 0.88);
}
.login-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.38);
  color: #fafafa;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s;
}
.login-field input::placeholder { color: rgba(255, 255, 255, 0.28); }
.login-field input:hover { border-color: rgba(184, 242, 90, 0.28); }
.login-field input:focus {
  outline: none;
  border-color: rgba(184, 242, 90, 0.75);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(184, 242, 90, 0.14), 0 0 24px rgba(184, 242, 90, 0.08);
}
.login-submit {
  margin-top: 0.35rem;
  width: 100%;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(105deg, var(--login-lime) 0%, var(--login-lime-hot) 55%, #9fe84a 100%);
  background-size: 140% 100%;
  color: #101410;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(184, 242, 90, 0.22);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background-position 0.35s var(--ease-out);
}
.login-submit-icon {
  transition: transform 0.2s var(--ease-out);
}
@media (hover: hover) {
  .login-submit:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow: 0 14px 40px rgba(184, 242, 90, 0.32);
  }
  .login-submit:hover .login-submit-icon {
    transform: translate(2px, -2px);
  }
}
.login-submit:active { transform: scale(0.985); }
.login-foot {
  margin: clamp(2rem, 5vh, 3rem) 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(244, 247, 242, 0.32);
  letter-spacing: 0.01em;
  animation: login-rise 0.9s var(--ease-out) 0.22s both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.06); }
}
@keyframes login-watermark-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 860px) {
  .login-layout {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1.75rem;
  }
  .login-card { padding: 1.5rem 1.4rem 1.4rem; }
}

@media (max-width: 859px) {
  .login-shell { padding-bottom: 1.75rem; max-width: 24rem; }
  .login-layout { align-content: start; }
  .login-hero { max-width: none; flex-basis: 100%; }
  .login-lead { max-width: none; }
  .login-panel { max-width: 100%; margin-left: 0; flex-basis: 100%; }
  .login-watermark { font-size: clamp(6rem, 42vw, 12rem); right: -8%; bottom: -4%; }
}

@media (prefers-reduced-motion: reduce) {
  .login-orb,
  .login-watermark,
  .login-top,
  .login-hero,
  .login-panel,
  .login-foot {
    animation: none;
  }
  .login-submit,
  .login-submit-icon,
  .login-field input {
    transition: none;
  }
}

/* Header usuário + contas FB */
.header-user {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.header-fb-count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #93c5fd;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.header-fb-count:hover {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.5);
}
.header-fb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  font-family: system-ui, sans-serif;
  line-height: 1;
}
.header-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}
.header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
}
.header-user-name {
  font-size: 0.75rem;
  color: #e4e4e7;
  font-weight: 600;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-header-logout {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #a1a1aa;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.btn-header-logout:hover {
  color: #fafafa;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}
.mobile-contas-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mobile-contas-info strong {
  font-size: 0.8125rem;
  color: #e4e4e7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.campanha-head-text { min-width: 0; max-width: 100%; }
.campanha-conta-tag {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-campanha .campanha-conta-tag { display: block; margin-top: 0.15rem; }
.conta-switcher-form { margin: 0; }
.conta-switcher {
  max-width: 9rem; padding: 0.35rem 0.5rem; font-size: 0.75rem; font-weight: 600;
  border-radius: 0.5rem; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35); color: #e4e4e7; cursor: pointer;
}

.config-wrap-wide { max-width: 42rem; }
.hint-inline { display: block; font-size: 0.75rem; color: #71717a; margin-top: 0.15rem; }
.field-check { display: flex; align-items: center; gap: 0.5rem; flex-direction: row; }
.field-check input { width: auto; }
.fb-contas-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.fb-contas-saldo-hint { margin: -0.35rem 0 0.75rem; }
.fb-conta-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1rem; border-radius: 0.65rem;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2);
}
.fb-conta-item.fb-conta-ativa { border-color: rgba(124, 58, 237, 0.4); background: rgba(124, 58, 237, 0.08); }
.fb-conta-info { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.65rem; min-width: 0; }
.fb-conta-info strong { font-size: 0.9375rem; }
.fb-conta-id { font-size: 0.75rem; color: #71717a; font-family: ui-monospace, monospace; }
.fb-conta-saldo {
  text-align: right;
  min-width: 5.5rem;
  flex-shrink: 0;
}
.fb-conta-saldo-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
}
.fb-conta-saldo-valor {
  display: block;
  font-size: 0.9375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.fb-conta-saldo-valor.owes { color: #fbbf24; }
.fb-conta-saldo-valor.clear { color: #34d399; }
.fb-conta-saldo-note {
  display: block;
  font-size: 0.625rem;
  color: #34d399;
  font-weight: 600;
}
.fb-conta-saldo-muted {
  font-size: 0.75rem;
  color: #52525b;
}
.fb-conta-pay-btn {
  display: inline-flex;
  margin-top: 0.35rem;
  white-space: nowrap;
  text-decoration: none;
}
.fb-conta-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; justify-content: flex-end; }
.badge-sm { font-size: 0.6rem; padding: 0.12rem 0.4rem; }
.badge-warn { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* Mobile — evita estourar a tela */
.mobile-top-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--surface-border);
  background: rgba(6, 6, 10, 0.92);
}
.mobile-conta-form {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.mobile-conta-label {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
}
.mobile-conta-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
}
.mobile-logout {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #a1a1aa;
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .page-head-row h1 { font-size: 1.5rem; }
  .brand { font-size: 1rem; min-width: 0; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
  .brand img { width: 32px; height: 32px; }
  .site-header { padding: 0.65rem 0.75rem; }
  .glass-card { padding: 0.875rem; max-width: 100%; }
  .hero-card { padding: 1.125rem 1rem; min-height: 7.5rem; }
  .hero-value { font-size: clamp(1.65rem, 8vw, 2.25rem); }
  .metric-card { padding: 0.75rem; min-height: 0; }
  .metric-value { font-size: 0.9375rem; }
  .metric-label { font-size: 0.625rem; }
  .campanha-row { padding: 0.75rem; }
  .campanha-metrics-row { gap: 0.5rem; }
  .campanha-row .campanha-actions-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }
  .campanha-row .campanha-actions-compact .inline-form,
  .campanha-row .campanha-actions-compact .budget-form-compact {
    display: flex;
    width: 100%;
    margin: 0;
    gap: 0.35rem;
  }
  .campanha-row .campanha-actions-compact .inline-form button {
    width: 100%;
    min-height: 38px;
  }
  .campanha-row .campanha-actions-compact .budget-form-compact {
    flex-wrap: nowrap;
  }
  .campanha-row .campanha-actions-compact .budget-form-compact .input-sm {
    flex: 0 0 4rem;
    min-width: 0;
  }
  .campanha-row .campanha-actions-compact .budget-form-compact button {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .periodo-filter { padding: 0.875rem; overflow: hidden; }
  .periodo-chips { margin: 0 -0.25rem; padding: 0 0.25rem 0.25rem; }
  .periodo-custom {
    flex-direction: column;
    align-items: stretch;
  }
  .periodo-custom span { display: none; }
  .periodo-custom input[type="date"] { width: 100%; max-width: 100%; }
  .periodo-custom .btn-sm { width: 100%; }
  .setup-banner { flex-wrap: wrap; padding: 0.75rem; }
  .setup-banner-text { font-size: 0.8125rem; word-break: break-word; }
  .status-chips { gap: 0.35rem; }
  .chip-status { font-size: 0.625rem; padding: 0.3rem 0.55rem; }
  .fb-conta-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .fb-conta-saldo { text-align: left; }
  .fb-conta-actions { width: 100%; justify-content: flex-start; }
  .hint-inline { display: block; margin-top: 0.2rem; }
}

@media (min-width: 768px) {
  .site-header-inner { padding: 0.75rem 1.5rem; }
  .brand-text { display: inline; font-size: 1.125rem; }
  .desktop-nav { display: flex; }
  .header-user { display: flex; }
  .header-user-name { max-width: 7rem; }
  .mobile-top-bar { display: none; }
  .mobile-nav { display: none; }
  .campanha-metrics-row-6 { grid-template-columns: repeat(3, 1fr); }
  .campanha-row .campanha-actions-compact {
    flex-direction: row;
    align-items: center;
  }
  .rifa-fixa-nome { max-width: 13rem; }
  .page-main { padding-bottom: 0; }
  .page-container { max-width: 80rem; padding: 2rem 1.75rem 3rem; }
  .page-head-row { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .page-head-row h1 { font-size: 2rem; }
  .page-container-wide .summary-grid { grid-template-columns: 2fr 3fr; gap: 1.25rem; align-items: stretch; }
  .summary-grid { grid-template-columns: 2fr 3fr; gap: 1.25rem; align-items: stretch; }
  .hero-card { text-align: left; padding: 1.75rem; min-height: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; height: 100%; }
  .metric-card { min-height: 0; flex: 1; }
  .top-grid { grid-template-columns: 1fr auto; align-items: start; }
  .top-aside { align-items: flex-end; text-align: right; }
  .rifas-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .campanhas-mobile { display: none; }
  .desktop-only { display: block; }
  .vendas-mobile { display: none; }
  input, select { font-size: 14px; }
  .btn-brand:hover { transform: translateY(-1px); }
  .hint-inline { display: inline; margin-top: 0; }
}

@media (min-width: 1280px) {
  .rifas-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Loader de página (dashboard) */
.ads-page-loader {
  --loader-lime: #b8f25a;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c0a;
  transition: opacity 0.45s var(--ease-out), visibility 0.45s var(--ease-out);
}
.ads-page-loader--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.ads-loader-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ads-loader-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: ads-loader-orb 10s ease-in-out infinite alternate;
}
.ads-loader-orb-a {
  width: min(50vw, 22rem);
  height: min(50vw, 22rem);
  top: 18%;
  left: 50%;
  transform: translateX(-60%);
  background: rgba(184, 242, 90, 0.18);
}
.ads-loader-orb-b {
  width: min(42vw, 18rem);
  height: min(42vw, 18rem);
  bottom: 12%;
  left: 50%;
  transform: translateX(-30%);
  background: rgba(61, 207, 122, 0.14);
  animation-delay: -4s;
}
.ads-loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 242, 90, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 242, 90, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 55% 50% at 50% 48%, black 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 48%, black 8%, transparent 72%);
}
.ads-loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  padding: 1.5rem;
  animation: ads-loader-enter 0.55s var(--ease-out) both;
}
.ads-loader-mark {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}
.ads-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(184, 242, 90, 0.12);
  border-top-color: var(--loader-lime);
  border-right-color: rgba(184, 242, 90, 0.45);
  animation: ads-loader-spin 0.9s linear infinite;
  box-shadow: 0 0 24px rgba(184, 242, 90, 0.12);
}
.ads-loader-logo {
  position: relative;
  z-index: 1;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
  animation: ads-logo-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(184, 242, 90, 0.22));
}
.ads-loader-brand {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.ads-loader-brand em {
  font-style: normal;
  color: var(--loader-lime);
}
.ads-loader-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(232, 240, 230, 0.62);
  letter-spacing: 0.01em;
}
.ads-loader-bar {
  width: 9.5rem;
  height: 3px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(184, 242, 90, 0.06);
}
.ads-loader-bar span {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ed63a, var(--loader-lime), #d4ff7a);
  box-shadow: 0 0 12px rgba(184, 242, 90, 0.45);
  animation: ads-loader-slide 1.15s var(--ease-out) infinite;
}
@keyframes ads-logo-pulse {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes ads-loader-spin {
  to { transform: rotate(360deg); }
}
@keyframes ads-loader-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
@keyframes ads-loader-orb {
  from { opacity: 0.4; }
  to { opacity: 0.7; }
}
@keyframes ads-loader-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ads-loader-ring,
  .ads-loader-logo,
  .ads-loader-bar span,
  .ads-loader-orb,
  .ads-loader-inner {
    animation: none;
  }
}

.val-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.lucro-tendencia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}
.lucro-tendencia-up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
}
.lucro-tendencia-down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.18);
}

.campanhas-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.dash-rifas-filtro {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.dash-rifas-panel[open].dash-rifas-filtro {
  border-color: var(--surface-border-strong);
  box-shadow: var(--shadow-md);
}
.dash-rifas-trigger {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 0.95rem;
  user-select: none;
  transition: background 0.15s;
}
.dash-rifas-trigger::-webkit-details-marker { display: none; }
.dash-rifas-trigger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-rifas-trigger-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.dash-rifas-trigger:hover { background: var(--surface-hover); }
.dash-rifas-panel[open] .dash-rifas-trigger {
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 0;
}
.dash-rifas-chevron {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform 0.2s ease;
  opacity: 0.85;
}
.dash-rifas-panel[open] .dash-rifas-chevron {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}
.dash-rifas-expand {
  position: relative;
  z-index: 1;
  padding: 0 0.9rem 0.95rem;
  border-top: 1px solid var(--surface-border);
}
.dash-rifas-panel:not([open]) .dash-rifas-expand { display: none; }
.dash-rifas-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.dash-rifas-panel:not([open]) .dash-rifas-logo-ring {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
}
.dash-rifas-panel:not([open]) .dash-rifas-logo-ring img {
  width: 1.65rem;
  height: 1.65rem;
}
.dash-rifas-logo-ring {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.9rem;
  background: var(--background-elevated);
  border: 1px solid var(--surface-border);
}
.dash-rifas-logo-ring img {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
}
.dash-rifas-head-text { min-width: 0; }
.dash-rifas-brand-name {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.dash-rifas-title {
  margin: 0.05rem 0 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f4f4f5;
}
.dash-rifas-panel[open] .dash-rifas-title { font-size: 1.125rem; }
.dash-rifas-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #71717a;
}
.dash-rifas-panel[open] .dash-rifas-sub { font-size: 0.8125rem; color: #a1a1aa; }
.dash-rifas-sub strong { color: var(--accent-hover); font-weight: 600; }
.dash-rifas-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 207, 122, 0.25);
  color: var(--accent-hover);
}
.dash-rifas-panel[open] .dash-rifas-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}
.dash-rifas-form {
  position: relative;
  z-index: 1;
  margin-top: 0.75rem;
}
.dash-rifas-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(38vh, 300px);
  overflow-y: auto;
  margin-bottom: 0.85rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: var(--background-elevated);
  border: 1px solid var(--surface-border);
}
.dash-rifa-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.dash-rifa-item:hover {
  background: var(--accent-soft);
  border-color: rgba(61, 207, 122, 0.12);
}
.dash-rifa-item.is-checked,
.dash-rifa-item:has(input:checked) {
  background: rgba(61, 207, 122, 0.14);
  border-color: rgba(61, 207, 122, 0.28);
}
.dash-rifa-item input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}
.dash-rifa-label { line-height: 1.35; color: #e4e4e7; }
.dash-rifas-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.btn-dash-rifas-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, background 0.15s;
}
.btn-dash-rifas-apply:hover {
  background: var(--accent-hover);
}
.btn-dash-rifas-apply:active { transform: scale(0.98); }
.dash-rifas-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
}
.dash-rifas-chips--compact {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-rifas-panel[open] .dash-rifas-chips--compact {
  display: none;
}
.chip-rifa-ativa {
  white-space: nowrap;
  font-size: 0.8125rem;
  background: var(--accent-soft);
  border-color: rgba(61, 207, 122, 0.28);
  color: #c7d2fe;
}
@media (min-width: 768px) {
  .dash-rifas-trigger { padding: 0.75rem 1.1rem; }
  .dash-rifas-expand { padding: 0 1.1rem 1.1rem; }
  .dash-rifas-panel[open] .dash-rifas-title { font-size: 1.25rem; }
  .dash-rifas-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    max-height: min(36vh, 280px);
  }
}
@media (max-width: 520px) {
  .dash-rifas-trigger-meta .dash-rifas-badge { display: none; }
}

.campanhas-resumo-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.resumo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8125rem;
}
.resumo-chip strong { font-weight: 800; }
.resumo-verde { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.resumo-amarelo { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.resumo-vermelho { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.resumo-neutro { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.resumo-total { margin-left: auto; font-size: 0.8125rem; }
.campanhas-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip-filtro { font-size: 0.8125rem; }
.campanhas-busca-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.campanhas-busca-input {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.btn-auto-toggle {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
  color: #94a3b8;
  border-radius: 0.45rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-auto-toggle.auto-on {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}
.btn-auto-toggle.auto-off {
  opacity: 0.75;
}
.auto-toggle-form { margin: 0; }
.auto-pausa-fields { margin-top: 0.5rem; }

.auto-horarios-section { margin-top: 1rem; }
.auto-horarios-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.85rem 0 0.65rem;
}
.auto-horario-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.auto-horario-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.auto-horario-field-valor { flex: 1; min-width: 8rem; }
.auto-horario-field-valor input { width: 100%; max-width: 12rem; }
.auto-horario-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-horario-time {
  min-width: 7rem;
  padding: 0.45rem 0.55rem;
}
.auto-horarios-actions { margin-bottom: 0.5rem; }
.auto-horario-camp-toolbar { margin-top: 0.85rem; }
.auto-horario-camp-list {
  max-height: 16rem;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

/* Assistente IA */
.ia-test-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ia-run-form { margin: 0; }
.ia-result-card { margin-top: 1rem; padding: 0; overflow: hidden; }
.ia-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ia-result-head h2 { margin: 0; font-size: 1.05rem; }
.ia-result-body {
  padding: 0.85rem 1rem 1.15rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #d4d4d8;
}

/* Relatório IA — seções */
.ia-report {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ia-report-sec {
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.22);
  overflow: hidden;
}
.ia-report-sec-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ia-sec-icon { font-size: 1.15rem; line-height: 1; }
.ia-report-sec-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f4f4f5;
}
.ia-report-sec-body { padding: 0.75rem 0.85rem 0.85rem; }
.ia-sec-resumo { border-color: rgba(59, 130, 246, 0.28); }
.ia-sec-resumo .ia-report-sec-head { background: rgba(59, 130, 246, 0.1); }
.ia-sec-bom { border-color: rgba(52, 211, 153, 0.28); }
.ia-sec-bom .ia-report-sec-head { background: rgba(16, 185, 129, 0.1); }
.ia-sec-risco { border-color: rgba(248, 113, 113, 0.28); }
.ia-sec-risco .ia-report-sec-head { background: rgba(239, 68, 68, 0.1); }
.ia-sec-valid { border-color: rgba(251, 191, 36, 0.28); }
.ia-sec-valid .ia-report-sec-head { background: rgba(245, 158, 11, 0.1); }
.ia-sec-prior { border-color: rgba(167, 139, 250, 0.32); }
.ia-sec-prior .ia-report-sec-head { background: rgba(139, 92, 246, 0.12); }
.ia-report-p {
  margin: 0 0 0.65rem;
  color: #e4e4e7;
  line-height: 1.6;
}
.ia-report-p:last-child { margin-bottom: 0; }
.ia-report-ul, .ia-report-ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ia-report-ul li, .ia-report-ol li {
  position: relative;
  padding: 0.55rem 0.65rem 0.55rem 1.75rem;
  margin-bottom: 0.35rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  line-height: 1.45;
  font-size: 0.875rem;
}
.ia-report-ul li:last-child, .ia-report-ol li:last-child { margin-bottom: 0; }
.ia-report-ul li::before {
  content: '•';
  position: absolute;
  left: 0.65rem;
  color: #94a3b8;
  font-weight: 700;
}
.ia-report-ol { counter-reset: ia-prior; }
.ia-report-ol li { counter-increment: ia-prior; padding-left: 2.1rem; }
.ia-report-ol li::before {
  content: counter(ia-prior);
  position: absolute;
  left: 0.55rem;
  top: 0.52rem;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1.25rem;
  text-align: center;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}
.ia-sec-bom .ia-report-ul li { border-color: rgba(52, 211, 153, 0.12); }
.ia-sec-bom .ia-report-ul li::before { color: #34d399; }
.ia-sec-risco .ia-report-ul li { border-color: rgba(248, 113, 113, 0.15); background: rgba(239, 68, 68, 0.06); }
.ia-sec-risco .ia-report-ul li::before { color: #f87171; content: '!'; font-size: 0.75rem; }
.ia-item-nome {
  display: block;
  font-weight: 700;
  color: #f4f4f5;
  margin-bottom: 0.2rem;
}
.ia-item-detalhe {
  display: block;
  color: #a1a1aa;
  font-size: 0.8125rem;
}
.ia-action-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.25rem;
}
.ia-badge-pause { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.ia-badge-reduce { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.ia-badge-scale { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }
.ia-badge-link { background: rgba(96, 165, 250, 0.2); color: #93c5fd; }
.ia-badge-hold { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.ia-report-table-wrap {
  overflow-x: auto;
  margin: 0.25rem 0;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.ia-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.ia-report-table th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  background: rgba(255,255,255,0.05);
  color: #a1a1aa;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ia-report-table td {
  padding: 0.55rem 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
  color: #d4d4d8;
}
.ia-report-table tr:hover td { background: rgba(255,255,255,0.02); }
.ia-table-camp { font-weight: 600; color: #f4f4f5; }
.ia-inline-code {
  font-size: 0.8125em;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(255,255,255,0.08);
  color: #e4e4e7;
}

.ia-md-h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #f4f4f5;
  margin: 1rem 0 0.35rem;
}
.ia-md-h3:first-child { margin-top: 0; }
.ia-md-h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
}
.ia-md-ul {
  margin: 0.35rem 0 0.75rem 1.1rem;
  padding: 0;
}
.ia-md-ul li { margin-bottom: 0.35rem; }
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.section-head-row .section-title { margin: 0; }
.ia-dash-link { white-space: nowrap; }
.ia-provider-row {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .ia-provider-row { grid-template-columns: 1fr 1fr; }
}
.ia-provider-card { cursor: pointer; }

/* IA — tela pronta + animação robô */
.ia-ready-card {
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.ia-ready-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.22), transparent 55%);
  pointer-events: none;
}
.ia-ready-card { position: relative; overflow: hidden; }
.ia-ready-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.ia-ready-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.5));
}
.ia-ready-top h2 {
  margin: 0;
  font-size: 1.25rem;
}
.ia-ready-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.ia-ready-chip {
  font-size: 0.8125rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.btn-ia-analyze {
  width: 100%;
  max-width: 22rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-ia-analyze:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55);
}
.btn-ia-analyze:disabled { opacity: 0.5; cursor: not-allowed; }
.ia-config-toggle {
  margin-top: 1.25rem;
  text-align: left;
}
.ia-config-toggle summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: #94a3b8;
  list-style: none;
}
.ia-config-toggle summary::-webkit-details-marker { display: none; }
.ia-config-toggle[open] summary { margin-bottom: 1rem; color: #c4b5fd; }
.ia-config-inner { padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.06); }
.ia-test-inline { margin-top: 0.75rem; }
.ia-result-empty { text-align: center; padding: 1.25rem; }

.ia-robot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.ia-robot-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ia-robot-scene { width: min(400px, 92vw); text-align: center; }
.ia-robot-stage {
  position: relative;
  height: 210px;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.45) 0%, rgba(10, 10, 18, 0.9) 100%);
  border: 1px solid rgba(139, 92, 246, 0.28);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(139, 92, 246, 0.08);
}
.ia-robot-floor {
  position: absolute;
  bottom: 32px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
}
.ia-robot-pc {
  position: absolute;
  right: 10%;
  bottom: 34px;
  width: 88px;
  z-index: 2;
}
.ia-pc-screen {
  position: relative;
  height: 58px;
  border-radius: 0.35rem 0.35rem 0 0;
  background: #0f172a;
  border: 2px solid #334155;
  overflow: hidden;
  transition: box-shadow 0.5s;
}
.ia-robot-stage.analyzing .ia-pc-screen {
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.45), inset 0 0 12px rgba(52, 211, 153, 0.15);
  border-color: #34d399;
}
.ia-pc-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 8px 10px 6px;
}
.ia-pc-chart span {
  flex: 1;
  max-width: 10px;
  height: var(--h, 40%);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #34d399, #059669);
  opacity: 0.35;
  transition: opacity 0.4s;
}
.ia-robot-stage.analyzing .ia-pc-chart span {
  opacity: 1;
  animation: ia-chart-pulse 1.2s ease-in-out infinite;
}
.ia-pc-chart span:nth-child(2) { animation-delay: 0.1s; }
.ia-pc-chart span:nth-child(3) { animation-delay: 0.2s; }
.ia-pc-chart span:nth-child(4) { animation-delay: 0.15s; }
.ia-pc-chart span:nth-child(5) { animation-delay: 0.25s; }
@keyframes ia-chart-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.15); }
}
.ia-pc-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(52, 211, 153, 0.8);
  top: 0;
  opacity: 0;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.ia-robot-stage.analyzing .ia-pc-scan {
  opacity: 1;
  animation: ia-scan 1.8s linear infinite;
}
@keyframes ia-scan {
  0% { top: 0; }
  100% { top: 100%; }
}
.ia-pc-base {
  height: 8px;
  margin: 0 auto;
  width: 36px;
  background: #475569;
  border-radius: 0 0 4px 4px;
}
.ia-robot-bot {
  position: absolute;
  bottom: 34px;
  left: 8%;
  width: 52px;
  height: 72px;
  z-index: 3;
  animation: ia-bot-walk 2.8s ease-in-out forwards;
}
@keyframes ia-bot-walk {
  0% { left: 8%; }
  42% { left: 54%; }
  100% { left: 54%; }
}
.ia-bot-antenna {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: #94a3b8;
  transform: translateX(-50%);
}
.ia-bot-antenna::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f472b6;
  transform: translateX(-50%);
  animation: ia-antenna-blink 1s ease-in-out infinite;
}
@keyframes ia-antenna-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #f472b6; }
  50% { opacity: 0.4; box-shadow: none; }
}
.ia-bot-head {
  width: 36px;
  height: 28px;
  margin: 0 auto;
  background: linear-gradient(180deg, #64748b, #475569);
  border-radius: 0.5rem 0.5rem 0.25rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid #334155;
}
.ia-bot-eye {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  animation: ia-eye-blink 3s step-end infinite;
}
@keyframes ia-eye-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}
.ia-bot-body {
  width: 28px;
  height: 22px;
  margin: 2px auto 0;
  background: linear-gradient(180deg, #7c3aed, #5b21b6);
  border-radius: 0.35rem;
  border: 2px solid #6d28d9;
}
.ia-bot-arm {
  position: absolute;
  top: 32px;
  width: 14px;
  height: 4px;
  background: #64748b;
  border-radius: 2px;
}
.ia-bot-arm-l { left: 2px; transform-origin: right center; animation: ia-arm-l 0.4s ease-in-out infinite; }
.ia-bot-arm-r { right: 2px; transform-origin: left center; animation: ia-arm-r 0.4s ease-in-out infinite; }
.ia-robot-stage.analyzing .ia-bot-arm-l { animation: ia-arm-type 0.6s ease-in-out infinite; }
.ia-robot-stage.analyzing .ia-bot-arm-r { animation: ia-arm-type 0.6s ease-in-out infinite 0.15s; }
@keyframes ia-arm-l {
  0%, 100% { transform: rotate(25deg); }
  50% { transform: rotate(-15deg); }
}
@keyframes ia-arm-r {
  0%, 100% { transform: rotate(-25deg); }
  50% { transform: rotate(15deg); }
}
@keyframes ia-arm-type {
  0%, 100% { transform: rotate(-30deg) translateY(0); }
  50% { transform: rotate(-10deg) translateY(2px); }
}
.ia-bot-legs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}
.ia-bot-legs span {
  width: 8px;
  height: 14px;
  background: #475569;
  border-radius: 0 0 3px 3px;
  transform-origin: top center;
  animation: ia-leg-walk 0.35s ease-in-out infinite;
}
.ia-bot-legs span:nth-child(2) { animation-delay: 0.175s; }
.ia-robot-stage.analyzing .ia-bot-legs span { animation: none; transform: rotate(0); }
@keyframes ia-leg-walk {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(18deg); }
}
.ia-robot-sparks {
  position: absolute;
  right: 22%;
  bottom: 90px;
  opacity: 0;
  pointer-events: none;
}
.ia-robot-stage.analyzing .ia-robot-sparks {
  opacity: 1;
}
.ia-robot-sparks span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
  animation: ia-spark 1.2s ease-out infinite;
}
.ia-robot-sparks span:nth-child(1) { left: 0; animation-delay: 0s; }
.ia-robot-sparks span:nth-child(2) { left: 12px; top: -8px; animation-delay: 0.4s; }
.ia-robot-sparks span:nth-child(3) { left: 24px; animation-delay: 0.8s; }
@keyframes ia-spark {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  30% { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.3); }
}
.ia-robot-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f4f4f5;
}
.ia-robot-msg {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  min-height: 1.25rem;
}
.ia-robot-bar {
  width: 8rem;
  height: 3px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.ia-robot-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #7c3aed, #2563eb);
  border-radius: inherit;
  animation: ads-loader-slide 1.2s ease-in-out infinite;
}

/* Automação inteligente */
.auto-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.auto-card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.auto-rules-list {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
  line-height: 1.55;
}
.auto-rules-list li + li { margin-top: 0.35rem; }
.auto-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.auto-status-badge.auto-on {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}
.auto-status-badge.auto-off {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}
.auto-form .check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}
.form-grid-2 label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
}
.form-grid-2 .field-span-2 {
  grid-column: 1 / -1;
}
.copy-page-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.copy-page-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
}
.copy-page-toolbar .btn-sm {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}
.copy-page-detected {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(61, 207, 122, 0.12);
  border: 1px solid rgba(61, 207, 122, 0.28);
  color: #86efac;
  font-size: 0.84rem;
}
.copy-page-detected.is-loading {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
.copy-page-override {
  margin-top: 0.35rem;
}
.copy-page-override summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}
#copy-target-page-manual {
  margin-top: 0.35rem;
}
.form-actions-row { margin-top: 0.85rem; }
.auto-run-form { margin-top: 0.65rem; }
.cron-snippet {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.hint-warn { color: #b45309; }
.chip-auto {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
}
.chip-auto.chip-scale { background: rgba(34, 197, 94, 0.18); color: #166534; }
.chip-auto.chip-reduce { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.chip-auto.chip-hold { background: rgba(148, 163, 184, 0.2); color: #475569; }
.chip-auto.chip-reset { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.chip-auto.chip-pause { background: rgba(249, 115, 22, 0.18); color: #ea580c; }
.chip-auto.chip-ciclo { background: rgba(139, 92, 246, 0.18); color: #7c3aed; }

/* Painel de status + feed de alterações */
.auto-status-panel {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid rgba(148, 163, 184, 0.45);
}
.auto-status-panel.auto-status-ok { border-left-color: #22c55e; }
.auto-status-panel.auto-status-warn { border-left-color: #eab308; }
.auto-status-panel.auto-status-late { border-left-color: #ef4444; }
.auto-status-panel.auto-status-off { border-left-color: rgba(148, 163, 184, 0.35); }

.auto-status-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.auto-status-indicator {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
}
.auto-status-pulse {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #94a3b8;
}
.auto-status-ok .auto-status-pulse {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: auto-pulse 2s infinite;
}
.auto-status-warn .auto-status-pulse { background: #eab308; }
.auto-status-late .auto-status-pulse {
  background: #ef4444;
  animation: auto-pulse-warn 1.2s infinite;
}
.auto-status-off .auto-status-pulse { background: #64748b; opacity: 0.6; }

@keyframes auto-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes auto-pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.auto-status-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 0.2rem;
}
.auto-status-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #fafafa;
}
.auto-status-hint {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.45;
}

.auto-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 640px) {
  .auto-status-grid { grid-template-columns: repeat(3, 1fr); }
}
.auto-status-item .lbl {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.15rem;
}
.auto-status-item strong {
  font-size: 0.9375rem;
  color: #f1f5f9;
}

.auto-stats-hoje {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.auto-stat-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.auto-stat-chip.stat-scale { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.auto-stat-chip.stat-reduce { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.auto-stat-chip.stat-pause { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
.auto-stat-chip.stat-reset { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.auto-stat-chip.stat-horario { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; }
.auto-stat-chip.stat-hold { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.auto-stat-chip.stat-total { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; }

.auto-run-row-inline { margin-bottom: 0; }

.auto-feed-live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auto-feed-auto-refresh { margin: 0; font-size: 0.8125rem; }
.auto-feed-refresh-status { flex: 1; min-width: 8rem; }
.auto-feed-refresh-status.auto-feed-status-new { color: #7dd3fc; font-weight: 600; }
.auto-feed-content.auto-feed-flash { animation: auto-feed-flash 0.6s ease; }
@keyframes auto-feed-flash {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}
.auto-horario-somente-sel {
  margin: 0;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.auto-feed-section { margin-bottom: 1rem; }
.auto-feed-head {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .auto-feed-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}
.auto-feed-head h2 { margin: 0 0 0.25rem; }
.auto-feed-filtros {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.auto-feed-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.55);
}
.auto-feed-empty .empty-icon { font-size: 2rem; margin: 0 0 0.5rem; }

.auto-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(70vh, 720px);
  overflow-y: auto;
  padding-right: 0.15rem;
}
.auto-feed-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(148, 163, 184, 0.35);
}
.auto-feed-item.auto-acao-scale { border-left-color: #22c55e; }
.auto-feed-item.auto-acao-reduce { border-left-color: #ef4444; }
.auto-feed-item.auto-acao-pause { border-left-color: #f97316; }
.auto-feed-item.auto-acao-reset { border-left-color: #3b82f6; }
.auto-feed-item.auto-acao-hold { border-left-color: #64748b; }
.auto-feed-item.auto-acao-ciclo,
.auto-feed-item.auto-feed-sistema { border-left-color: #8b5cf6; background: rgba(139, 92, 246, 0.06); }

.auto-feed-item-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
}
.auto-feed-item-body { flex: 1; min-width: 0; }
.auto-feed-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.auto-feed-item-head time {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.auto-feed-campanha {
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0 0 0.2rem;
  color: #f1f5f9;
}
.auto-feed-orc {
  font-size: 0.8125rem;
  color: #c4b5fd;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.auto-feed-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.25rem;
}
.auto-feed-metrics .pos { color: #86efac; }
.auto-feed-metrics .neg { color: #fca5a5; }
.auto-feed-motivo {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.45;
}

.auto-config-toggle {
  margin-bottom: 1rem;
  overflow: hidden;
}
.auto-config-toggle summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1rem;
  list-style: none;
  user-select: none;
}
.auto-config-toggle summary::-webkit-details-marker { display: none; }
.auto-config-toggle-inner {
  padding: 0 1rem 1rem;
}
.auto-config-toggle-inner .auto-grid { margin-bottom: 0; }

.auto-cron-setup { margin-bottom: 1rem; }
.auto-page-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.auto-panel-toggle-active {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.15);
  color: #e9d5ff;
}
.auto-tool-warn {
  border-color: rgba(234, 179, 8, 0.5);
  color: #fde047;
}
.auto-panel-hidden {
  display: none;
}
.auto-panel-hidden.auto-panel-open {
  display: block;
}
.auto-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.5rem;
}
.auto-panel-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.auto-panel-head-inset {
  margin-bottom: 0.65rem;
  border-radius: 0.75rem;
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  line-height: 1;
}
@media (hover: hover) {
  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
}
.auto-cron-setup-inner { padding: 0 1rem 1rem; }
.auto-cron-steps { margin: 0.75rem 0 1rem; }
.auto-cron-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.cron-url-input {
  flex: 1;
  min-width: 12rem;
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #cbd5e1;
}
.auto-cron-msg {
  margin: -0.35rem 0 0.85rem 3.35rem;
  padding-left: 0.15rem;
}

/* Robô automação — inline + anúncios */
.auto-robot-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
}
.auto-robot-stage-inline {
  flex: 0 0 auto;
  width: min(280px, 100%);
  height: 140px;
  margin: 0;
  border-radius: 0.75rem;
}
.auto-robot-stage-inline .ia-robot-bot,
.auto-robot-bot-seated {
  left: 18% !important;
  animation: none !important;
  transform: scale(0.92);
  transform-origin: bottom center;
}
.auto-robot-stage-inline.analyzing .ia-bot-head {
  animation: auto-bot-look 2.4s ease-in-out infinite;
}
@keyframes auto-bot-look {
  0%, 100% { transform: rotate(-4deg) translateX(2px); }
  50% { transform: rotate(2deg) translateX(-1px); }
}
.auto-robot-stage-inline.analyzing .ia-bot-eye {
  animation: auto-eye-scan 2s ease-in-out infinite;
}
@keyframes auto-eye-scan {
  0%, 100% { transform: translateX(0) scaleY(1); box-shadow: 0 0 8px #22d3ee; }
  25% { transform: translateX(2px) scaleY(1); }
  50% { transform: translateX(-2px) scaleY(1); box-shadow: 0 0 12px #34d399; }
  75% { transform: translateX(1px) scaleY(0.1); }
}
.auto-robot-pc-wide {
  right: 6% !important;
  width: 110px !important;
}
.auto-robot-pc-wide .ia-pc-screen {
  height: 64px;
}
.auto-ads-screen {
  background: linear-gradient(180deg, #0c1222 0%, #1e293b 100%) !important;
}
.auto-ads-scroll {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 5px;
  height: 100%;
  overflow: hidden;
  animation: auto-ads-scroll 4s linear infinite;
}
@keyframes auto-ads-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.auto-ad-card {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 2px 4px;
  white-space: nowrap;
}
.auto-ad-thumb {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  flex-shrink: 0;
}
.auto-ad-thumb.green { background: linear-gradient(135deg, #34d399, #059669); }
.auto-ad-thumb.blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.auto-ad-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.auto-ad-float {
  position: absolute;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgba(196, 181, 253, 0.85);
  animation: auto-float-up 2.5s ease-in-out infinite;
  opacity: 0;
}
.auto-ad-float:nth-child(1) { left: 55%; bottom: 45%; animation-delay: 0s; }
.auto-ad-float:nth-child(2) { left: 70%; bottom: 55%; animation-delay: 0.8s; color: #86efac; }
.auto-ad-float:nth-child(3) { left: 62%; bottom: 65%; animation-delay: 1.6s; color: #fde047; }
@keyframes auto-float-up {
  0% { opacity: 0; transform: translateY(8px) scale(0.8); }
  20% { opacity: 1; }
  80% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-20px) scale(1); }
}
.auto-robot-caption {
  flex: 1;
  min-width: 10rem;
}
.auto-robot-live-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #f1f5f9;
}
.auto-robot-live-msg {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(196, 181, 253, 0.95);
  animation: auto-msg-pulse 2s ease-in-out infinite;
}
@keyframes auto-msg-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.auto-feed-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
}
.auto-panel-head .auto-feed-filtros {
  margin: 0;
}
@media (max-width: 640px) {
  .auto-robot-banner { flex-direction: column; align-items: stretch; }
  .auto-robot-stage-inline { width: 100%; }
  .auto-feed-head-actions { flex-wrap: wrap; }
}

.auto-campanhas-section { margin-bottom: 1rem; }
.auto-modo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .auto-modo-grid { grid-template-columns: 1fr 1fr; }
}
.auto-modo-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.auto-modo-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.auto-modo-card strong { font-size: 0.9375rem; color: #fafafa; }
.auto-modo-card.selected {
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.12);
}
.auto-campanhas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.auto-campanhas-toolbar .input-search {
  flex: 1;
  min-width: 10rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: #f1f5f9;
}
.auto-camp-count { margin-left: auto; font-size: 0.8125rem; }
.auto-campanhas-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(50vh, 420px);
  overflow-y: auto;
  margin-bottom: 0.85rem;
  padding-right: 0.15rem;
}
.auto-camp-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}
.auto-camp-row:hover { background: rgba(255, 255, 255, 0.06); }
.auto-camp-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #8b5cf6;
}
.auto-camp-info { flex: 1; min-width: 0; }
.auto-camp-nome {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: #f1f5f9;
}
.auto-camp-meta { font-size: 0.75rem; }
.auto-camp-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.auto-camp-badge.on {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.auto-camp-badge.off {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.auto-camp-empty { padding: 1.5rem 1rem; text-align: center; }

.auto-log-table .motivo-cell { max-width: 16rem; font-size: 0.8125rem; }
.auto-log-mobile { display: flex; flex-direction: column; gap: 0.65rem; }
.auto-log-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
}
.auto-log-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.auto-log-card time { font-size: 0.75rem; color: #64748b; }
.auto-log-nome { font-weight: 600; font-size: 0.875rem; margin: 0 0 0.25rem; }
.auto-log-metrics {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}
.auto-log-metrics .pos { color: #15803d; }
.auto-log-metrics .neg { color: #b91c1c; }

.auto-config-section { margin-bottom: 1rem; }
.auto-run-row { margin-bottom: 1rem; }
.auto-card-wide { grid-column: 1 / -1; }
.auto-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0.85rem 0 0.5rem;
  color: rgba(255, 255, 255, 0.55);
}
.auto-perfil-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.auto-perfil-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  color: var(--foreground);
}
@media (hover: hover) {
  .auto-perfil-card:hover {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(255, 255, 255, 0.08);
  }
}
.auto-perfil-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.auto-perfil-card strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fafafa;
}
.auto-perfil-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}
.auto-perfil-meta {
  font-size: 0.75rem;
  color: #c4b5fd;
  font-weight: 600;
  margin-top: 0.1rem;
}
.auto-perfil-badge {
  align-self: flex-start;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
.auto-perfil-badge.muted {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}
.auto-perfil-card.selected {
  border-color: rgba(139, 92, 246, 0.75);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 8px 24px rgba(124, 58, 237, 0.2);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.18) 0%, rgba(59, 130, 246, 0.1) 100%);
}
.auto-perfil-card.selected strong { color: #fff; }
.auto-perfil-card.selected .auto-perfil-desc { color: rgba(255, 255, 255, 0.88); }
.auto-perfil-card.selected .auto-perfil-meta { color: #e9d5ff; }
.auto-fields-wrap.auto-fields-locked {
  opacity: 0.92;
}
.auto-fields-wrap.auto-fields-locked input.readonly-field {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .auto-grid { grid-template-columns: 1fr 1.2fr; }
  .auto-perfil-grid { grid-template-columns: repeat(2, 1fr); }
  .auto-log-mobile { display: none; }
}
@media (min-width: 1024px) {
  .auto-perfil-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .auto-log-table { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .mobile-nav { grid-template-columns: repeat(3, 1fr); }
  .mobile-nav a span:not(.icon) { font-size: 0.625rem; }
}

/* Anúncios — criar / copiar */
.anuncios-page .anuncios-tabs { margin-bottom: 1rem; }
.anuncios-form .select-full,
.anuncios-form textarea,
.anuncios-form .input-file {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--surface-border);
  background: var(--background-elevated);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.875rem;
}
.anuncios-form textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.45;
}
.anuncios-form .field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}
.anuncios-form .field-check input { margin-top: 0.15rem; flex-shrink: 0; }

/* Job progress log (cópia / criação / reparo Meta) */
.ads-job-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}
.ads-job-panel {
  width: min(42rem, 100%);
  max-height: min(88vh, 36rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
}
.ads-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ads-job-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.ads-job-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(61, 207, 122, 0.25);
  border-top-color: var(--accent, #3dcf7a);
  border-radius: 50%;
  animation: ads-loader-spin 0.85s linear infinite;
  flex-shrink: 0;
}
.ads-job-status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground, #94a3b8);
}
.ads-job-status.is-ok { color: #3dcf7a; }
.ads-job-status.is-error { color: #f87171; }
.ads-job-status.is-warn { color: #fcd34d; }
.ads-job-log {
  flex: 1;
  min-height: 10rem;
  max-height: 18rem;
  overflow: auto;
  padding: 0.65rem 0.7rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--surface-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}
.ads-job-log-line {
  display: grid;
  grid-template-columns: 4.2rem 1rem 1fr;
  gap: 0.35rem 0.45rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ads-job-log-line.is-running { color: #cbd5e1; }
.ads-job-log-line.is-ok { color: #86efac; }
.ads-job-log-line.is-warn { color: #fcd34d; }
.ads-job-log-line.is-error { color: #fca5a5; font-weight: 600; }
.ads-job-log-detail {
  grid-column: 2 / -1;
  opacity: 0.92;
  word-break: break-word;
}
.ads-job-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.ads-job-overlay.is-error .ads-job-panel {
  border-color: rgba(248, 113, 113, 0.35);
}
.ads-job-overlay.is-warn .ads-job-panel {
  border-color: rgba(252, 211, 77, 0.35);
}

.ads-preflight-panel {
  max-width: 36rem;
  width: min(96vw, 36rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.ads-preflight-hint {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0 0 0.65rem;
  line-height: 1.45;
}
.ads-preflight-list {
  flex: 1;
  min-height: 6rem;
  max-height: 22rem;
  overflow: auto;
  margin-bottom: 0.75rem;
  padding: 0.35rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.22);
}
.ads-preflight-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.5rem;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}
.ads-preflight-row.is-ok { color: #86efac; }
.ads-preflight-row.is-warn { color: #fcd34d; }
.ads-preflight-row.is-fail { color: #fca5a5; }
.ads-preflight-badge {
  grid-row: span 2;
  align-self: start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
}
.ads-preflight-name { font-weight: 600; color: #e2e8f0; }
.ads-preflight-meta { color: #94a3b8; font-size: 0.76rem; }
.ads-preflight-detail {
  grid-column: 2;
  color: inherit;
  opacity: 0.92;
  word-break: break-word;
}
.ads-preflight-more {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  text-align: center;
}
.ads-job-status.is-warn { color: #fcd34d; }

/* ==========================================================================
   POLIMENTO PROFISSIONAL  ·  camada de refinamento (v80)
   Refina cores, profundidade e estados sem alterar a estrutura existente.
   ========================================================================== */

/* -- Base: renderização e ritmo tipográfico -------------------------------- */
body {
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}
h1, h2, h3, .section-title, .hero-value, .metric-value {
  letter-spacing: -0.025em;
}

/* -- Header: vidro mais elegante e borda de luz ---------------------------- */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg,
      transparent, rgba(61, 207, 122, 0.28), rgba(180, 220, 195, 0.14), transparent) 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 24px rgba(0, 0, 0, 0.28);
}
.brand img {
  border-radius: 0.7rem;
  box-shadow: 0 0 0 1px rgba(61, 207, 122, 0.2), 0 6px 16px rgba(61, 207, 122, 0.18);
}
.desktop-nav .nav-link { transition: color .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.desktop-nav .nav-link.active {
  background: var(--accent-grad-soft);
  box-shadow: inset 0 0 0 1px rgba(61, 207, 122, 0.34), 0 2px 10px rgba(61, 207, 122, 0.12);
}

/* -- Cards de vidro: profundidade + realce de luz no topo ------------------ */
.glass-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 46%),
    var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--card-highlight);
  transition: border-color .22s var(--ease-out), box-shadow .22s var(--ease-out), transform .18s var(--ease-out);
}
@media (hover: hover) {
  .glass-card-hover:hover {
    border-color: var(--surface-border-strong);
    box-shadow: var(--shadow-md), var(--card-highlight), 0 0 0 1px rgba(61, 207, 122, 0.08);
    transform: translateY(-2px);
  }
}

/* -- Botões: gradiente sutil, sombra colorida e foco acessível ------------- */
.btn-brand, .btn-secondary, .btn-danger, .btn-success {
  border-radius: 0.8rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: transform .12s var(--ease-out), box-shadow .18s var(--ease-out),
              background .18s var(--ease-out), filter .18s var(--ease-out);
}
.btn-brand {
  background: var(--accent-grad);
  color: #04140b;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, var(--shadow-accent);
}
.btn-brand:hover { background: var(--accent-grad); color: #04140b; filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 10px 30px rgba(61,207,122,0.36); }
.btn-brand:active { transform: translateY(1px) scale(0.99); }
.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--surface-border-strong);
  box-shadow: var(--card-highlight);
}
.btn-secondary:hover { background: var(--surface-hover); box-shadow: var(--shadow-sm), var(--card-highlight); }
.btn-success {
  background: linear-gradient(135deg, #2fbf68, #24a656);
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 8px 22px rgba(34, 197, 94, 0.24);
}
.btn-success:hover { background: linear-gradient(135deg, #38d074, #2bb862); filter: brightness(1.04); }
.btn-brand:focus-visible, .btn-secondary:focus-visible, .btn-success:focus-visible,
.btn-danger:focus-visible, .chip:focus-visible, .nav-link:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* -- Hero: barra de acento em gradiente e brilho ambiente ------------------ */
.hero-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--card-highlight);
}
.hero-card::before { width: 4px; border-radius: 4px; }
.hero-success::before { background: linear-gradient(180deg, #5ae08f, #22c55e); box-shadow: 0 0 18px rgba(61, 207, 122, 0.5); }
.hero-danger::before { background: linear-gradient(180deg, #f8a29b, #ef4444); box-shadow: 0 0 18px rgba(239, 68, 68, 0.4); }
.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.04), transparent 55%);
}
.hero-success .hero-value { color: #5ae08f; }
.hero-kicker { letter-spacing: 0.1em; }

/* -- Métricas: rótulos harmonizados com o tema ---------------------------- */
.metric-card { border-radius: var(--radius); box-shadow: var(--card-highlight); }
.metric-label { color: var(--muted); letter-spacing: 0.05em; }
.metric-sub { color: var(--muted-dim); }
.metric-icon { border-radius: 0.6rem; }

/* -- Chips, status e badges: contornos mais nítidos ----------------------- */
.chip { transition: color .16s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out); }
.chip.active {
  background: var(--accent-grad-soft);
  border-color: rgba(61, 207, 122, 0.4);
  box-shadow: inset 0 0 0 1px rgba(61, 207, 122, 0.12);
}
.chip-status { border-radius: 999px; }
.badge { letter-spacing: 0.02em; }

/* -- Campos de formulário: foco esmeralda (corrige o roxo antigo) ---------- */
input, select, textarea {
  background: rgba(6, 12, 9, 0.72);
  border: 1px solid var(--surface-border-strong);
  border-radius: 0.65rem;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  background: rgba(6, 12, 9, 0.9);
}
input::placeholder, textarea::placeholder { color: var(--muted-dim); }
.field span { color: var(--muted); }
.subtitle { color: var(--muted); }

/* -- Mensagens flash: mais legíveis --------------------------------------- */
.flash { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.flash.ok { background: linear-gradient(135deg, rgba(61,207,122,0.16), rgba(61,207,122,0.06)); border: 1px solid rgba(61,207,122,0.3); }

/* -- Tabela do gerenciador de anúncios: linhas mais limpas ----------------- */
.ads-manager-table thead th {
  color: var(--muted);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--surface-border-strong);
}
.ads-manager-table tbody tr { transition: background .14s var(--ease-out); }
@media (hover: hover) {
  .ads-manager-table tbody tr:hover { background: rgba(61, 207, 122, 0.045); }
}

/* -- Barra de rolagem sutil (desktop) ------------------------------------- */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: rgba(180, 220, 195, 0.22) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb {
    background: rgba(180, 220, 195, 0.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  *::-webkit-scrollbar-thumb:hover { background: rgba(180, 220, 195, 0.32); background-clip: padding-box; }
  *::-webkit-scrollbar-track { background: transparent; }
}

/* -- Foco global acessível para navegação por teclado --------------------- */
:focus-visible { outline: none; }

/* -- Harmonização de cor: remove resquícios roxo/azul do tema antigo ------- */
.header-avatar {
  background: var(--accent-grad);
  color: #04140b;
  box-shadow: 0 0 0 1px rgba(61, 207, 122, 0.28), 0 4px 12px rgba(61, 207, 122, 0.22);
}
.campanha-conta-tag { color: var(--accent-hover); }
.btn-ia-analyze {
  background: var(--accent-grad);
  color: #04140b;
  box-shadow: 0 8px 32px rgba(61, 207, 122, 0.4);
}
.ia-bot-body {
  background: linear-gradient(180deg, #45d982, #2fb968);
  border-color: #2fb968;
}
.ia-robot-bar span { background: linear-gradient(90deg, #5ae08f, #3dcf7a); }
.auto-feed-item.auto-feed-sistema { border-left-color: var(--accent); background: rgba(61, 207, 122, 0.06); }

/* ==== Hosting override: fundo preto + tema (não depende só do @import) ==== */
html[data-theme="dark"],
html:not([data-theme="light"]) {
  color-scheme: dark;
}
html[data-theme="dark"] body,
html:not([data-theme="light"]) body {
  background: #000000 !important;
  color: #f3f3f3;
}
html[data-theme="dark"] .app-bg-base,
html:not([data-theme="light"]) .app-bg-base {
  background: #000000 !important;
}
html[data-theme="dark"] .app-bg-vignette,
html:not([data-theme="light"]) .app-bg-vignette {
  display: none !important;
}
html[data-theme="dark"] .app-bg-grid,
html:not([data-theme="light"]) .app-bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) !important;
  opacity: 0.4;
  animation: none !important;
}
html[data-theme="light"] body {
  background: #ffffff !important;
  color: #0c1210;
}
html[data-theme="light"] .app-bg-base {
  background: #ffffff !important;
}
html[data-theme="light"] .app-bg-vignette {
  display: none !important;
}

.theme-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.25rem !important;
  height: 2.25rem !important;
  min-width: 2.25rem;
  padding: 0 !important;
  margin: 0;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: #141414 !important;
  color: #f3f3f3 !important;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0 !important;
  overflow: hidden !important;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none !important;
  font-size: 0 !important;
}
.theme-toggle:hover {
  background: #1c1c1c !important;
}
.theme-toggle .theme-toggle-icon {
  width: 1rem !important;
  height: 1rem !important;
  display: none !important;
  flex-shrink: 0;
}
html:not([data-theme="light"]) .theme-toggle .theme-toggle-icon-moon {
  display: block !important;
}
html[data-theme="light"] .theme-toggle {
  background: #f0f0f0 !important;
  color: #111 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
html[data-theme="light"] .theme-toggle .theme-toggle-icon-sun {
  display: block !important;
}
html[data-theme="light"] .theme-toggle .theme-toggle-icon-moon {
  display: none !important;
}
.theme-toggle-label {
  display: none !important;
}

