/* ============================================================
   WOOR Ads — Estilos Principais
   ============================================================ */

:root {
  --wa-ink: #0f172a;
  --wa-blue: #2563eb;
  --wa-blue-soft: #eff6ff;
  --wa-blue-card: #eaf3ff;
  --wa-border: #dbe5f1;
  --wa-muted: #52627a;
  --wa-success: #10B981;
  --wa-warning: #F59E0B;
  --wa-danger: #EF4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: var(--wa-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--wa-blue);
  outline-offset: 2px;
}

/* ============================================================
   LAYOUT GLOBAL
   ============================================================ */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--wa-ink);
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 50;
  color: white;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--wa-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  color: #60a5fa;
  font-weight: 400;
}

.topbar-clock {
  display: none;
  align-items: center;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #94a3b8;
}

@media (min-width: 768px) {
  .topbar-clock { display: flex; }
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.demo-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Sphere switcher */
.sphere-switcher {
  display: flex;
  background: #1e293b;
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}

.sphere-btn {
  padding: 0.375rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sphere-btn:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}

.sphere-btn.active {
  background: var(--wa-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Main layout */
.main-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Public site */
.public-site {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Public nav */
.public-nav {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 40;
}

.public-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.public-nav-links {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .public-nav-links { display: flex; }
}

.public-nav-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.public-nav-links a:hover,
.public-nav-links a.active {
  color: white;
}

.mobile-menu-toggle {
  display: flex;
  padding: 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-toggle { display: none; }
}

.public-nav-actions {
  display: flex;
  gap: 0.75rem;
}

.public-nav-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--wa-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
}

.btn-secondary:hover:not(:disabled) {
  background: #334155;
}

.btn-ghost {
  background: transparent;
  color: #64748b;
}

.btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--wa-ink);
}

.btn-success {
  background: var(--wa-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--wa-danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 0.5rem;
}

/* Public content */
.public-content {
  flex: 1;
  width: 100%;
}

.pub-page-section {
  display: none;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.pub-page-section.active {
  display: block;
}

/* Home hero */
#pub-home {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: #071a2e;
  background-image:
    linear-gradient(90deg,
      rgba(5, 17, 35, 0.62) 0%,
      rgba(7, 26, 46, 0.40) 43%,
      rgba(7, 26, 46, 0.12) 100%),
    linear-gradient(0deg, rgba(7, 26, 46, 0.28), rgba(7, 26, 46, 0.04));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

#pub-home .hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: white;
  margin-bottom: 1.5rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.125rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Value props */
.value-props {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

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

.value-prop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.value-prop:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.4);
}

.value-prop-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.value-prop-icon.blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.value-prop-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.value-prop-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.value-prop h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.value-prop p {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
}

/* Section header */
.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--wa-border);
}

.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--wa-ink);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--wa-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* Format cards */
.formats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .formats-grid { grid-template-columns: repeat(2, 1fr); }
}

.format-card {
  position: relative;
  border-radius: 1rem;
  padding: 1.5rem;
  overflow: hidden;
}

.format-card.available {
  background: linear-gradient(145deg, #eff6ff 0%, #fff 74%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.format-card.available:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
}

.format-card.roadmap {
  background: linear-gradient(145deg, #f8fafc 0%, #fff 74%);
  border: 1px solid #e2e8f0;
  opacity: 0.8;
}

.format-card::before {
  content: '';
  display: block;
  height: 7px;
  margin: -1.5rem -1.5rem 1.5rem;
}

.format-card.available:nth-child(1)::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.format-card.available:nth-child(2)::before { background: linear-gradient(90deg, #059669, #6ee7b7); }
.format-card.roadmap:nth-child(3)::before { background: linear-gradient(90deg, #ea580c, #fdba74); }
.format-card.roadmap:nth-child(4)::before { background: linear-gradient(90deg, #7c3aed, #c4b5fd); }

.format-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.format-status.available {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.format-status.roadmap {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.format-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wa-ink);
  margin-bottom: 0.75rem;
}

.format-card h3 i {
  width: 1.25rem;
  height: 1.25rem;
}

.format-card.available h3 i { color: var(--wa-blue); }
.format-card.roadmap h3 i { color: var(--wa-warning); }

.format-card p {
  font-size: 0.875rem;
  color: var(--wa-muted);
  margin-bottom: 1rem;
}

.format-specs {
  background: #f8fafc;
  border: 1px solid var(--wa-border);
  border-radius: 0.75rem;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.8;
}

/* How it works */
.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

.how-card {
  background: linear-gradient(145deg, #eff6ff, #fff);
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 1.5rem;
}

.how-card:nth-child(2) { background: linear-gradient(145deg, #ecfdf5, #fff); border-color: #a7f3d0; }
.how-card:nth-child(3) { background: linear-gradient(145deg, #f5f3ff, #fff); border-color: #ddd6fe; }

.how-model {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.how-model.cpc { color: var(--wa-blue); }
.how-model.cpm { color: var(--wa-success); }
.how-model.cpa { color: #7c3aed; }

.how-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--wa-ink);
  margin-bottom: 0.75rem;
}

.how-card p {
  font-size: 0.875rem;
  color: var(--wa-muted);
  margin: 0;
}

/* Policies & FAQ */
.policy-card, .faq-item {
  background: linear-gradient(120deg, #eff6ff, #fff);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.policy-card h3, .faq-item h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--wa-ink);
  margin-bottom: 0.75rem;
}

.policy-card h3 i { color: var(--wa-blue); }
.policy-card h3 i.green { color: var(--wa-success); }

.faq-item {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.faq-item h4 { font-size: 1rem; }
.faq-item p { font-size: 0.875rem; color: var(--wa-muted); margin: 0; }

/* Footer */
.public-footer {
  background: #f8fafc;
  border-top: 1px solid var(--wa-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

.public-footer p { margin: 0.25rem 0; }

/* ============================================================
   PORTAL LAYOUT
   ============================================================ */
.portal-layout {
  display: none;
  flex: 1;
  flex-direction: row;
  overflow: hidden;
}

.portal-layout.active {
  display: flex;
}

/* Portal sidebar */
.portal-sidebar {
  width: 16rem;
  background: var(--wa-ink);
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #1e293b;
}

.account-badge {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #60a5fa;
  font-size: 0.875rem;
}

.account-info {
  overflow: hidden;
}

.account-name {
  font-weight: 700;
  font-size: 0.8125rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: #64748b;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-left: 3px solid var(--wa-blue);
}

.nav-item i {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.5);
}

.balance-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.balance-label .utc-tag {
  font-size: 0.5625rem;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
}

.balance-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wa-success);
  margin-bottom: 0.25rem;
}

.balance-reserved {
  font-size: 0.625rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.sidebar-footer .btn {
  width: 100%;
}

/* Portal main */
.portal-main {
  flex: 1;
  background: #ffffff;
  overflow-y: auto;
  padding: 2rem;
}

.portal-page {
  display: none;
  max-width: 100%;
}

.portal-page.active {
  display: block;
}

.portal-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--wa-border);
}

.portal-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--wa-ink);
  margin: 0;
}

.portal-page-header p {
  font-size: 0.8125rem;
  color: var(--wa-muted);
  margin: 0.25rem 0 0;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi-card {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.25rem;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--wa-muted);
  margin-bottom: 0.5rem;
}

.kpi-header i { color: var(--wa-blue); }

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wa-ink);
}

.kpi-delta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  margin-top: 0.5rem;
}

.kpi-delta.positive { color: var(--wa-success); }
.kpi-delta.neutral { color: var(--wa-muted); }

/* Charts section */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .charts-grid { grid-template-columns: 2fr 1fr; }
}

.chart-card, .activity-card {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.25rem;
}

.chart-header, .activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chart-header h3, .activity-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wa-ink);
}

.chart-header h3 i { color: var(--wa-blue); }
.activity-header h3 i { color: var(--wa-warning); }

.chart-header .utc-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--wa-muted);
}

.chart-container {
  min-height: 220px;
  position: relative;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.75rem;
  padding: 0.875rem;
}

.activity-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.activity-title {
  font-weight: 600;
  font-size: 0.8125rem;
}

.activity-title.success { color: var(--wa-success); }
.activity-title.warning { color: var(--wa-warning); }
.activity-title.info { color: var(--wa-blue); }

.activity-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--wa-muted);
}

.activity-item p {
  font-size: 0.75rem;
  color: #475569;
  margin: 0;
}

/* Campaigns table */
.campaigns-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
}

.search-wrapper input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--wa-ink);
}

.search-wrapper input:focus {
  border-color: var(--wa-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.status-filter {
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--wa-ink);
}

.table-wrapper {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  overflow: hidden;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.table-wrapper thead {
  background: #dbeafe;
  color: #1e3a8a;
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.875rem 1rem;
  text-align: left;
}

.table-wrapper tbody tr {
  border-top: 1px solid var(--wa-border);
  transition: background 0.15s;
}

.table-wrapper tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.campaign-name {
  font-weight: 600;
  color: var(--wa-ink);
}

.campaign-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--wa-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
}

.status-badge.ativa { background: rgba(16, 185, 129, 0.15); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.submetido,
.status-badge.em-revisao { background: rgba(245, 158, 11, 0.15); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge.pausada { background: rgba(148, 163, 184, 0.15); color: #475569; border: 1px solid rgba(148, 163, 184, 0.3); }
.status-badge.rejeitada { background: rgba(239, 68, 68, 0.15); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-badge.rascunho { background: rgba(148, 163, 184, 0.15); color: #475569; border: 1px solid rgba(148, 163, 184, 0.3); }
.status-badge.aprovado { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-badge.expirado { background: rgba(148, 163, 184, 0.15); color: #475569; border: 1px solid rgba(148, 163, 184, 0.3); }

.model-bid {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.model-bid .model { font-weight: 700; color: var(--wa-blue); }
.model-bid .bid { color: var(--wa-muted); }

.metric-cell { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--wa-ink); }

.action-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: 1px solid var(--wa-border);
  background: #fff;
  color: var(--wa-ink);
}

.action-btn:hover { background: #f1f5f9; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--wa-muted);
}

.empty-state i {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  color: var(--wa-border);
}

.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--wa-ink); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; margin: 0; }

/* Analytics cards */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.analytics-card {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.25rem;
}

.analytics-label { font-size: 0.75rem; color: var(--wa-muted); margin-bottom: 0.25rem; }
.analytics-value { font-family: 'JetBrains Mono', monospace; font-size: 2rem; font-weight: 700; }
.analytics-value.blue { color: var(--wa-blue); }
.analytics-value.green { color: var(--wa-success); }
.analytics-value.purple { color: #7c3aed; }
.analytics-benchmark { font-size: 0.6875rem; color: var(--wa-muted); margin-top: 0.25rem; }

/* Financial */
.financial-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .balance-grid { grid-template-columns: 1fr 1fr; }
}

.balance-card {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.balance-card h3 { font-size: 0.875rem; font-weight: 700; color: var(--wa-ink); margin-bottom: 1rem; }

.balance-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.balance-item {
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.balance-item-label { font-size: 0.6875rem; color: var(--wa-muted); margin-bottom: 0.375rem; }
.balance-item-value { font-family: 'JetBrains Mono', monospace; font-size: 1.25rem; font-weight: 700; }
.balance-item-value.available { color: var(--wa-success); }
.balance-item-value.reserved { color: var(--wa-blue); }

.credit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  justify-content: space-between;
}

.credit-form .input-group { flex: 1; }
.credit-form label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--wa-ink); margin-bottom: 0.5rem; }
.credit-form input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--wa-ink);
}

.credit-form input:focus { border-color: var(--wa-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.transactions-table {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  overflow: hidden;
}

.transactions-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--wa-border);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--wa-ink);
}

.transactions-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.transactions-table thead { background: #dbeafe; color: #1e3a8a; }
.transactions-table th, .transactions-table td { padding: 0.75rem 1.25rem; text-align: left; }
.transactions-table tbody tr { border-top: 1px solid var(--wa-border); }
.transactions-table .date-col { font-family: 'JetBrains Mono', monospace; color: var(--wa-muted); }
.transactions-table .type-badge { font-size: 0.625rem; font-weight: 600; padding: 0.125rem 0.375rem; border-radius: 9999px; }
.type-badge.recarga { background: rgba(16, 185, 129, 0.15); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.type-badge.consumo { background: rgba(239, 68, 68, 0.15); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.3); }
.transactions-table .amount { font-family: 'JetBrains Mono', monospace; font-weight: 600; text-align: right; }
.transactions-table .amount.positive { color: var(--wa-success); }
.transactions-table .amount.negative { color: var(--wa-danger); }

/* Settings */
.settings-card {
  background: var(--wa-blue-soft);
  border: 1px solid var(--wa-border);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 48rem;
}

.settings-card h3 { font-size: 0.875rem; font-weight: 700; color: var(--wa-ink); padding-bottom: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--wa-border); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

.form-field label { display: block; font-size: 0.75rem; color: var(--wa-muted); margin-bottom: 0.375rem; }
.form-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--wa-ink);
}

.form-field input:focus { border-color: var(--wa-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-field input:disabled { background: #f1f5f9; color: var(--wa-muted); }

.form-actions { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--wa-border); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--wa-ink);
  border: 1px solid #1e293b;
  border-radius: 1rem;
  width: 100%;
  max-width: 42rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #1e293b;
}

.modal-header h3 { font-size: 1.125rem; font-weight: 700; color: white; margin: 0; }
.modal-header p { font-size: 0.75rem; color: #64748b; margin: 0.25rem 0 0; }

.modal-close { color: #64748b; background: none; border: none; padding: 0.25rem; cursor: pointer; }
.modal-close:hover { color: white; }

.modal-body { padding: 1.5rem; }

.modal-form { display: flex; flex-direction: column; gap: 1rem; }

.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .modal-form .form-row { grid-template-columns: repeat(2, 1fr); }
}

.modal-form label { display: block; font-size: 0.75rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.375rem; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: white;
}

.modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus {
  border-color: var(--wa-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-form textarea { min-height: 80px; resize: vertical; }

.form-hint {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.6875rem;
  color: #93c5fd;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid #1e293b;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--wa-ink);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast i { width: 1.25rem; height: 1.25rem; color: #60a5fa; flex-shrink: 0; }
.toast-message { font-size: 0.8125rem; font-weight: 500; color: #e2e8f0; }

/* Loading states */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.375rem;
}

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

.skeleton-text { height: 1rem; }
.skeleton-title { height: 1.5rem; width: 60%; }
.skeleton-value { height: 2rem; width: 40%; font-family: 'JetBrains Mono', monospace; }

/* Error state */
.error-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.error-state i { width: 3rem; height: 3rem; margin: 0 auto 1rem; color: var(--wa-danger); }
.error-state h3 { font-size: 1rem; font-weight: 600; color: var(--wa-ink); margin-bottom: 0.5rem; }
.error-state p { font-size: 0.875rem; color: var(--wa-muted); margin-bottom: 1rem; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-card {
  width: 100%;
  max-width: 28rem;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  padding: 2.5rem;
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header .brand { justify-content: center; margin-bottom: 1.5rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; color: white; margin: 0 0 0.5rem; }
.login-header p { font-size: 0.875rem; color: #94a3b8; margin: 0; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-form label { font-size: 0.75rem; font-weight: 600; color: #e2e8f0; }
.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: white;
}

.login-form input:focus { border-color: var(--wa-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.login-form .btn { margin-top: 0.5rem; }

.login-footer { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #1e293b; }
.login-footer a { color: #60a5fa; text-decoration: none; font-size: 0.8125rem; }
.login-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 767px) {
  .portal-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .portal-sidebar.open { transform: translateX(0); }
  
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    display: none;
  }
  .sidebar-overlay.open { display: block; }
  
  .portal-main { padding: 1rem; }
  
  .kpi-grid { grid-template-columns: 1fr; }
}