/* ==========================================================================
   Android+WhatsApp — Design System Premium 2026 (Estilo Zap Studio / Templat 2)
   Inspirado no Tio Patinhas Cloud Flow & Studio Interativo
   ========================================================================== */

:root,
[data-theme="dark"] {
  --aw-bg-base: #06090e;
  --aw-bg-surface: #0b101b;
  --aw-bg-card: #101726;
  --aw-bg-card-hover: #151e32;
  --aw-bg-input: #090e18;
  --aw-border: #1a2438;
  --aw-border-highlight: #283754;
  --aw-border-accent: rgba(16, 185, 129, 0.35);
  
  --aw-primary: #10b981;
  --aw-primary-hover: #059669;
  --aw-primary-rgb: 16, 185, 129;
  --aw-primary-glow: rgba(16, 185, 129, 0.2);
  
  --aw-accent-cyan: #06b6d4;
  --aw-accent-amber: #f59e0b;
  --aw-accent-purple: #8b5cf6;
  --aw-accent-red: #ef4444;
  
  --aw-text-main: #f1f5f9;
  --aw-text-muted: #94a3b8;
  --aw-text-dim: #64748b;
  
  --aw-radius-sm: 6px;
  --aw-radius-md: 10px;
  --aw-radius-lg: 16px;
  --aw-radius-full: 9999px;
  
  --aw-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"],
[data-theme="light"] .aw-layout,
.aw-layout[data-theme="light"],
[data-theme="light"] .aw-workspace-wrapper {
  color-scheme: light;
  --aw-bg-base: #f4f7fb;
  --aw-bg-surface: #ffffff;
  --aw-bg-card: #ffffff;
  --aw-bg-card-hover: #f1f5f9;
  --aw-bg-input: #ffffff;
  --aw-border: #d8e1ec;
  --aw-border-highlight: #cbd5e1;
  --aw-border-accent: rgba(5, 150, 105, 0.45);
  
  --aw-primary: #059669;
  --aw-primary-hover: #047857;
  --aw-primary-rgb: 5, 150, 105;
  --aw-primary-glow: rgba(5, 150, 105, 0.15);
  
  --aw-accent-cyan: #0284c7;
  --aw-accent-amber: #d97706;
  --aw-accent-purple: #7c3aed;
  --aw-accent-red: #dc2626;
  
  --aw-text-main: #132033;
  --aw-text-muted: #475569;
  --aw-text-dim: #64748b;
}

/* Habilita rolagem vertical expansiva e barras de rolagem fluidas */
body:has(.android-whatsapp-module),
body:has(.aw-layout),
body:has(.aw-workspace-wrapper) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body:has(.android-whatsapp-module) #app,
body:has(.aw-layout) #app,
body:has(.aw-workspace-wrapper) #app {
  height: auto !important;
  min-height: 100% !important;
}

.service-module.android-whatsapp-module {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

/* Container do Workspace */
.aw-workspace-wrapper {
  width: 100%;
  min-height: calc(100vh - 72px);
  height: auto;
  background: var(--aw-bg-base);
  overflow-x: hidden;
  overflow-y: visible;
}

/* Estrutura Principal: Rail Lateral + Área de Trabalho */
.aw-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  height: auto;
  background: var(--aw-bg-base);
  color: var(--aw-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: visible;
}

/* ==========================================
   Barra Lateral Esquerda (Left Rail)
   ========================================== */
.aw-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--aw-bg-surface);
  border-right: 1px solid var(--aw-border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
}

.aw-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.aw-brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--aw-radius-md);
  background: linear-gradient(135deg, #10b981, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px var(--aw-primary-glow);
}

.aw-brand-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--aw-text-main);
  letter-spacing: -0.01em;
}

.aw-brand-info span {
  font-size: 0.75rem;
  color: var(--aw-text-muted);
}

.aw-sidebar-cta {
  width: 100%;
  background: var(--aw-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.65rem 1rem;
  border-radius: var(--aw-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--aw-transition);
  box-shadow: 0 4px 14px var(--aw-primary-glow);
}

.aw-sidebar-cta:hover {
  background: var(--aw-primary-hover);
  transform: translateY(-1px);
}

.aw-nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aw-text-dim);
  padding: 0 0.5rem;
  margin-bottom: 0.35rem;
}

.aw-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.aw-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: var(--aw-radius-md);
  color: var(--aw-text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--aw-transition);
}

.aw-nav-item:hover {
  background: var(--aw-bg-card);
  color: var(--aw-text-main);
}

.aw-nav-item.active {
  background: rgba(var(--aw-primary-rgb), 0.12);
  color: var(--aw-primary);
  border-color: var(--aw-border-accent);
  font-weight: 600;
}

.aw-nav-item-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.aw-nav-counter {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--aw-radius-full);
  background: var(--aw-border);
  color: var(--aw-text-muted);
}

.aw-nav-item.active .aw-nav-counter {
  background: var(--aw-primary);
  color: #fff;
  font-weight: 700;
}

.aw-sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--aw-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.aw-connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--aw-bg-card);
  border-radius: var(--aw-radius-md);
  font-size: 0.75rem;
  color: var(--aw-text-muted);
}

.aw-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aw-primary);
  box-shadow: 0 0 8px var(--aw-primary);
}

.aw-status-dot.danger {
  background: var(--aw-accent-red);
  box-shadow: 0 0 8px var(--aw-accent-red);
}

/* ==========================================
   Área Principal de Conteúdo
   ========================================== */
.aw-content-area {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 6rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: visible;
}

/* Banner de Topo / Hero */
.aw-hero-card {
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 70%), var(--aw-bg-surface);
  border: 1px solid var(--aw-border-highlight);
  border-radius: var(--aw-radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.aw-hero-info h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--aw-text-main);
  letter-spacing: -0.02em;
}

.aw-hero-info p {
  margin: 0;
  color: var(--aw-text-muted);
  font-size: 0.9rem;
  max-width: 680px;
  line-height: 1.45;
}

.aw-hero-actions {
  display: flex;
  gap: 0.75rem;
}

/* Grid de Métricas Principais */
.aw-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.aw-metric-card {
  background: var(--aw-bg-card);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: var(--aw-transition);
}

.aw-metric-card:hover {
  border-color: var(--aw-border-highlight);
  transform: translateY(-2px);
}

.aw-metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--aw-border);
}

.aw-metric-card.accent-emerald::before { background: var(--aw-primary); }
.aw-metric-card.accent-amber::before { background: var(--aw-accent-amber); }
.aw-metric-card.accent-cyan::before { background: var(--aw-accent-cyan); }
.aw-metric-card.accent-red::before { background: var(--aw-accent-red); }

.aw-metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--aw-text-dim);
}

.aw-metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--aw-text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.aw-metric-value small {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--aw-text-dim);
}

/* Banner de Alerta para Contas Banidas */
.aw-ban-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--aw-radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.aw-ban-alert-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aw-ban-alert-icon {
  font-size: 1.5rem;
}

.aw-ban-alert strong {
  color: #fca5a5;
  font-size: 0.95rem;
}

.aw-ban-alert p {
  margin: 0.15rem 0 0 0;
  color: #f87171;
  font-size: 0.825rem;
}

/* Cards de Ações Rápidas */
.aw-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.aw-quick-tile {
  background: var(--aw-bg-card);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--aw-transition);
  text-align: left;
}

.aw-quick-tile:hover {
  background: var(--aw-bg-card-hover);
  border-color: var(--aw-border-accent);
  transform: translateY(-2px);
}

.aw-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--aw-radius-md);
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.aw-quick-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--aw-text-main);
  margin-bottom: 0.2rem;
}

.aw-quick-text span {
  font-size: 0.75rem;
  color: var(--aw-text-muted);
}

/* ==========================================
   Catálogo de Aparelhos Tio Patinhas & Configurações
   ========================================== */
.aw-vmos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.aw-vmos-card {
  background: var(--aw-bg-card);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  transition: var(--aw-transition);
  position: relative;
}

.aw-vmos-card:hover {
  border-color: var(--aw-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.aw-vmos-card.highlight {
  border-color: var(--aw-border-accent);
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 80%), var(--aw-bg-card);
}

.aw-vmos-badge-popular {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--aw-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--aw-radius-full);
  text-transform: uppercase;
}

.aw-vmos-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--aw-text-main);
}

.aw-vmos-header .model-tag {
  font-size: 0.75rem;
  color: var(--aw-primary);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--aw-radius-sm);
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.aw-vmos-specs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--aw-text-muted);
}

.aw-vmos-specs div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aw-vmos-price {
  margin: 0.75rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.aw-vmos-price .price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--aw-text-main);
}

.aw-vmos-price .period {
  font-size: 0.8rem;
  color: var(--aw-text-dim);
}

/* Espelho / Reflexo de Tela do Aparelho Virtual */
.aw-screen-mirror-wrapper {
  background: #020408;
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  scroll-margin-top: 90px;
  margin-bottom: 3rem;
}

.aw-phone-frame {
  width: min(340px, 100%);
  height: auto;
  aspect-ratio: 17 / 32;
  background: #000;
  border: 12px solid #1a2234;
  border-radius: 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 2px var(--aw-border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.aw-phone-notch {
  width: 120px;
  height: 20px;
  background: #1a2234;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 10;
}

.aw-phone-display {
  flex: 1;
  background: #090e18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
}

.aw-phone-display img.live-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Tela Android em Tempo Real */
.aw-android-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0b1528 0%, #030712 100%);
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Status Bar do Android */
.aw-android-statusbar {
  height: 28px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #e2e8f0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.4);
}

.aw-android-statusbar-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
}

/* Launcher / Área de Trabalho do Android */
.aw-android-desktop {
  flex: 1;
  padding: 24px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

/* Widget de Status e Proxy */
.aw-android-widget {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aw-android-widget-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
}

.aw-android-widget-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.3;
}

.aw-android-widget-proxy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: #34d399;
  font-family: monospace;
}

/* Grade de Aplicativos */
.aw-android-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  margin: 12px 0;
}

.aw-android-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease;
  text-decoration: none;
}

.aw-android-app:hover {
  transform: scale(1.08);
}

.aw-android-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.aw-android-app-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  border-radius: 10px;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
}

.aw-android-app-name {
  font-size: 0.62rem;
  color: #f1f5f9;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 54px;
}

/* Barra de Navegação Inferior do Android */
.aw-android-navbar {
  height: 40px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.aw-android-nav-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.aw-android-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Tela do WhatsApp dentro do Android */
.aw-android-wa-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #111b21;
}

.aw-android-wa-header {
  background: #202c33;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e9edef;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aw-android-wa-tabs {
  background: #202c33;
  display: flex;
  border-bottom: 2px solid #00a884;
}

.aw-android-wa-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #00a884;
  text-transform: uppercase;
}

.aw-android-wa-chats {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.aw-android-wa-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.aw-android-wa-chat-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.aw-android-wa-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00a884;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.aw-android-wa-chat-info {
  flex: 1;
  min-width: 0;
}

.aw-android-wa-chat-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e9edef;
}

.aw-android-wa-chat-msg {
  font-size: 0.65rem;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toolbar de Controles Externos do Espelho */
.aw-mirror-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1rem;
  width: 100%;
}

/* ==========================================
   Studio de Templates (Carrossel, Botões, Mídia)
   ========================================== */
.aw-studio-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

.aw-studio-editor {
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.aw-studio-preview {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Simulador WhatsApp no Preview */
.aw-wa-chat-simulator {
  width: 320px;
  background: #0b141a;
  border: 1px solid #202c33;
  border-radius: var(--aw-radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  font-family: inherit;
}

.aw-wa-chat-header {
  background: #202c33;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aw-wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #00a884;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.aw-wa-bubble {
  background: #005c4b;
  color: #e9edef;
  border-radius: 8px 0px 8px 8px;
  padding: 0.75rem;
  margin: 1rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
}

.aw-wa-bubble-header {
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.aw-wa-bubble-footer {
  font-size: 0.7rem;
  color: #8696a0;
  margin-top: 0.35rem;
}

.aw-wa-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.4rem;
}

.aw-wa-btn-preview {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #53bdeb;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Visualização Carrossel no WhatsApp */
.aw-wa-carousel-track {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0.75rem 1rem 0.75rem;
  scrollbar-width: thin;
}

.aw-wa-carousel-card {
  min-width: 200px;
  max-width: 200px;
  background: #1f2c34;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.aw-wa-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #111b21;
}

.aw-wa-card-body {
  padding: 0.6rem;
  font-size: 0.78rem;
  color: #d1d7db;
  flex: 1;
}

.aw-wa-card-body strong {
  display: block;
  color: #fff;
  margin-bottom: 0.2rem;
}

/* ==========================================
   Tabelas, Formulários e Componentes Gerais
   ========================================== */
.aw-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.aw-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.aw-form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aw-text-muted);
}

.aw-input, .aw-select, .aw-textarea {
  background: var(--aw-bg-input);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--aw-text-main);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--aw-transition);
}

.aw-input:focus, .aw-select:focus, .aw-textarea:focus {
  outline: none;
  border-color: var(--aw-primary);
  box-shadow: 0 0 0 3px var(--aw-primary-glow);
}

.aw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--aw-radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--aw-transition);
}

.aw-btn-primary {
  background: var(--aw-primary);
  color: #fff;
}

.aw-btn-primary:hover {
  background: var(--aw-primary-hover);
}

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

.aw-btn-secondary:hover {
  background: var(--aw-bg-card-hover);
  border-color: var(--aw-border-highlight);
}

.aw-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.aw-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.aw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--aw-radius-full);
  font-size: 0.725rem;
  font-weight: 600;
}

.aw-badge-online { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.aw-badge-offline { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
.aw-badge-warming { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.aw-badge-banned { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

/* Tabela Padrão 2026 */
.aw-table-card {
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-lg);
  overflow-x: auto;
  overflow-y: visible;
}

.aw-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.aw-table th {
  background: var(--aw-bg-card);
  color: var(--aw-text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--aw-border);
}

.aw-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--aw-border);
  color: var(--aw-text-muted);
}

.aw-table td strong {
  color: var(--aw-text-main);
}

.aw-table tr:hover td {
  background: var(--aw-bg-card-hover);
  color: var(--aw-text-main);
}

/* Utilitários Estritos para CSP */
.aw-flex-between { display: flex; justify-content: space-between; align-items: center; }
.aw-flex-end { display: flex; justify-content: flex-end; }
.aw-flex-end-mt { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.aw-flex-col { display: flex; flex-direction: column; gap: 1rem; }
.aw-flex-col-lg { display: flex; flex-direction: column; gap: 1.25rem; }
.aw-flex-row { display: flex; gap: 0.75rem; }
.aw-flex-center-gap { display: flex; align-items: center; gap: 0.5rem; }
.aw-flex-1 { flex: 1; }
.aw-flex-1-5 { flex: 1.5; }
.aw-flex-2 { flex: 2; }
.aw-w-full { width: 100%; }
.aw-hidden { display: none !important; }
.aw-text-center { text-align: center; }
.aw-empty-td { text-align: center; padding: 2.5rem; color: var(--aw-text-dim); }
.aw-center-pad { text-align: center; padding: 2rem; }
.aw-pad-lg { padding: 1.5rem; }
.aw-card-form { max-width: 680px; padding: 1.75rem; }
.aw-card-mirror-header { display: flex; justify-content: space-between; width: 100%; max-width: 340px; }
.aw-card-mirror-header strong { color: var(--aw-text-main); }
.aw-box-status { background: var(--aw-bg-input); padding: 1rem; border-radius: 8px; border: 1px solid var(--aw-border); }
.aw-badge-otp { font-size: 1.1rem; font-weight: 800; color: #10b981; letter-spacing: 0.1em; background: #064e3b; padding: 0.2rem 0.5rem; border-radius: 4px; }
.aw-badge-header { font-size: 0.75rem; font-weight: 700; color: var(--aw-primary); letter-spacing: 0.05em; text-transform: uppercase; }
.aw-title-section { margin: 0 0 0.25rem 0; color: var(--aw-text-main); }
.aw-desc-section { margin: 0; color: var(--aw-text-muted); font-size: 0.9rem; }
.aw-title-sub { margin: 1rem 0 0.75rem 0; color: var(--aw-text-main); }
.aw-device-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}
.aw-device-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-lg);
  background: var(--aw-bg-card);
}
.aw-device-card.highlight {
  border-color: var(--aw-border-accent);
  box-shadow: 0 0 0 1px var(--aw-border-accent);
}
.aw-device-badge-popular {
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: var(--aw-radius-full);
  background: var(--aw-primary-glow);
  color: var(--aw-primary);
  font-size: 0.72rem;
  font-weight: 700;
}
.aw-device-header h3 { margin: 0 0 0.35rem; color: var(--aw-text-main); font-size: 1.05rem; }
.aw-device-header .model-tag { color: var(--aw-text-muted); font-size: 0.78rem; }
.aw-device-specs { display: grid; gap: 0.55rem; margin-top: 1rem; color: var(--aw-text-muted); font-size: 0.82rem; }
.aw-device-specs > div { display: flex; align-items: flex-start; gap: 0.45rem; }
.aw-device-price { display: flex; align-items: baseline; gap: 0.25rem; margin-bottom: 0.8rem; }
.aw-device-price .price { color: var(--aw-text-main); font-size: 1.35rem; font-weight: 750; }
.aw-device-price .period { color: var(--aw-text-muted); font-size: 0.78rem; }
.aw-connect-qr {
  display: none;
  width: min(280px, 100%);
  height: auto;
  margin: 1rem auto;
  border: 8px solid #fff;
  border-radius: 8px;
}
@media (max-width: 1100px) {
  .aw-device-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .aw-device-catalog-grid { grid-template-columns: 1fr; }
}
.aw-title-h3 { margin: 0 0 0.85rem 0; font-size: 1.05rem; color: var(--aw-text-main); }
.aw-mb-sm { margin-bottom: 0.5rem; }
.aw-mb-none { margin: 0 0 1rem 0; }
.aw-text-dim { color: var(--aw-text-dim); }
.aw-text-muted { color: var(--aw-text-muted); }
.aw-text-emerald { color: var(--aw-primary); }
.aw-text-wa { color: #00a884; }
.aw-text-red { color: var(--aw-accent-red); }
.aw-text-white { color: var(--aw-text-main); font-size: 0.85rem; }
.aw-btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }
.aw-btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.aw-icon-lg { font-size: 2.5rem; }
.aw-caption-sm { font-size: 0.75rem; color: var(--aw-text-dim); text-align: center; }
.aw-status-online { color: var(--aw-primary); font-size: 0.85rem; }
.aw-status-desc { margin: 0.25rem 0 0 0; font-size: 0.775rem; color: var(--aw-text-muted); }
.aw-mirror-desc { margin: 1rem 0 0 0; font-size: 0.85rem; color: var(--aw-text-muted); }
.aw-truncate-col { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-desc-col { max-width: 280px; font-size: 0.8rem; color: var(--aw-text-muted); }
.aw-label-strong { font-size: 0.8rem; font-weight: 600; color: var(--aw-text-muted); margin-bottom: 0.4rem; display: block; }
.aw-label-upper { font-size: 0.8rem; font-weight: 700; color: var(--aw-text-dim); text-transform: uppercase; }
.aw-progress-track { flex: 1; height: 6px; background: var(--aw-border); border-radius: 3px; overflow: hidden; }
.aw-progress-fill { height: 100%; background: var(--aw-primary); }
.aw-banner-red { color: var(--aw-accent-red); }

.aw-layout code {
  background: var(--aw-bg-card-hover);
  color: var(--aw-primary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--aw-radius-sm);
  font-family: monospace;
  font-size: 0.85em;
  border: 1px solid var(--aw-border);
}

/* ==========================================================================
   Android+WhatsApp — Adaptações Específicas do Tema Claro [data-theme="light"]
   ========================================================================== */

[data-theme="light"] .aw-layout {
  background: var(--aw-bg-base);
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-sidebar {
  background: var(--aw-bg-surface);
  border-right-color: var(--aw-border);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .aw-nav-item {
  color: var(--aw-text-muted);
}

[data-theme="light"] .aw-nav-item:hover {
  background: #f1f5f9;
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-nav-item.active {
  background: rgba(5, 150, 105, 0.1);
  color: var(--aw-primary);
  border-color: rgba(5, 150, 105, 0.35);
}

[data-theme="light"] .aw-nav-counter {
  background: #e2e8f0;
  color: var(--aw-text-muted);
}

[data-theme="light"] .aw-nav-item.active .aw-nav-counter {
  background: var(--aw-primary);
  color: #fff;
}

[data-theme="light"] .aw-connection-status {
  background: #f8fafc;
  border: 1px solid var(--aw-border);
  color: var(--aw-text-muted);
}

[data-theme="light"] .aw-caption-sm {
  color: var(--aw-text-dim);
}

[data-theme="light"] .aw-caption-sm strong {
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-hero-card {
  background: radial-gradient(circle at top right, rgba(5, 150, 105, 0.08), transparent 70%), #ffffff;
  border-color: var(--aw-border-highlight);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .aw-metric-card {
  background: #ffffff;
  border-color: var(--aw-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .aw-metric-card:hover {
  border-color: var(--aw-border-highlight);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .aw-quick-tile {
  background: #ffffff;
  border-color: var(--aw-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .aw-quick-tile:hover {
  background: #f8fafc;
  border-color: var(--aw-border-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .aw-quick-icon {
  background: #f1f5f9;
  border-color: var(--aw-border);
}

[data-theme="light"] .aw-vmos-card {
  background: #ffffff;
  border-color: var(--aw-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .aw-vmos-card:hover {
  border-color: var(--aw-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .aw-vmos-card.highlight {
  background: radial-gradient(circle at top right, rgba(5, 150, 105, 0.06), transparent 80%), #ffffff;
  border-color: var(--aw-border-accent);
}

[data-theme="light"] .aw-ban-alert {
  background: #fef2f2;
  border-color: #fecaca;
}

[data-theme="light"] .aw-ban-alert strong {
  color: #991b1b;
}

[data-theme="light"] .aw-ban-alert p {
  color: #dc2626;
}

[data-theme="light"] .aw-screen-mirror-wrapper {
  background: #f8fafc;
  border-color: var(--aw-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .aw-card-mirror-header strong {
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-phone-frame {
  border-color: #0f172a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 2px #cbd5e1;
}

[data-theme="light"] .aw-studio-editor {
  background: #ffffff;
  border-color: var(--aw-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .aw-wa-chat-simulator {
  background: #efeae2;
  border-color: #d1d7db;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .aw-wa-chat-header {
  background: #008069;
}

[data-theme="light"] .aw-wa-chat-header strong {
  color: #ffffff;
}

[data-theme="light"] .aw-wa-chat-header small {
  color: #d1f4ec;
}

[data-theme="light"] .aw-wa-bubble {
  background: #ffffff;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .aw-wa-bubble-header {
  color: #111b21;
}

[data-theme="light"] .aw-wa-bubble-footer {
  color: #667781;
}

[data-theme="light"] .aw-wa-buttons-list {
  border-top-color: #e9edef;
}

[data-theme="light"] .aw-wa-btn-preview {
  background: #f0f2f5;
  color: #00a884;
}

[data-theme="light"] .aw-wa-btn-preview:hover {
  background: #e4e7eb;
}

[data-theme="light"] .aw-wa-carousel-card {
  background: #ffffff;
  border: 1px solid #e9edef;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .aw-wa-card-body {
  color: #3b4a54;
}

[data-theme="light"] .aw-wa-card-body strong {
  color: #111b21;
}

[data-theme="light"] .aw-table-card {
  background: #ffffff;
  border-color: var(--aw-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .aw-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .aw-table td {
  border-bottom-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .aw-table td strong {
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-table tr:hover td {
  background: #f8fafc;
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-empty-td {
  color: var(--aw-text-dim);
}

[data-theme="light"] .aw-input,
[data-theme="light"] .aw-select,
[data-theme="light"] .aw-textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--aw-text-main);
}

[data-theme="light"] .aw-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

[data-theme="light"] .aw-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

[data-theme="light"] .aw-btn-danger:hover {
  background: #fee2e2;
}

[data-theme="light"] .aw-badge-online { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
[data-theme="light"] .aw-badge-offline { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .aw-badge-warming { background: #fffbeb; color: #b45309; border-color: #fde68a; }
[data-theme="light"] .aw-badge-banned { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

[data-theme="light"] .aw-badge-otp {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] .aw-progress-track {
  background: #e2e8f0;
}

[data-theme="light"] .aw-box-status {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .aw-status-online {
  color: #059669;
}

[data-theme="light"] .aw-status-desc {
  color: #475569;
}

[data-theme="light"] .aw-layout code {
  background: #f1f5f9;
  color: #059669;
  border-color: #e2e8f0;
}

/* ==========================================================================
   Loja de Aplicativos (App Store) — Grid, Cards, Dropdowns e Modais
   ========================================================================== */

.aw-appstore-header-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.aw-notice-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 0.75rem 1.25rem;
  border-radius: var(--aw-radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}

[data-theme="light"] .aw-notice-banner {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.aw-subtabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--aw-border);
  padding-bottom: 0.25rem;
}

.aw-subtab-btn {
  background: transparent;
  border: none;
  color: var(--aw-text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--aw-radius-sm) var(--aw-radius-sm) 0 0;
  cursor: pointer;
  transition: var(--aw-transition);
  position: relative;
}

.aw-subtab-btn:hover {
  color: var(--aw-text-main);
}

.aw-subtab-btn.active {
  color: var(--aw-primary);
}

.aw-subtab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.35rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--aw-primary);
  border-radius: var(--aw-radius-full);
}

.aw-appstore-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
  background: var(--aw-bg-card);
  border: 1px solid var(--aw-border);
  padding: 1rem 1.25rem;
  border-radius: var(--aw-radius-md);
}

.aw-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aw-filter-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aw-text-dim);
}

.aw-filter-search {
  flex: 1;
  min-width: 280px;
}

.aw-search-input-wrap {
  display: flex;
  gap: 0.5rem;
}

.aw-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.aw-app-card {
  background: var(--aw-bg-card);
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--aw-transition);
}

.aw-app-card:hover {
  border-color: var(--aw-border-highlight);
  background: var(--aw-bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.aw-app-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
}

.aw-app-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.aw-app-info {
  flex: 1;
  min-width: 0;
}

.aw-app-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--aw-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aw-app-version {
  font-size: 0.75rem;
  color: var(--aw-accent-cyan);
  font-weight: 500;
}

.aw-app-dropdown-wrap {
  position: relative;
}

.aw-btn-operation {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #3b82f6;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--aw-radius-sm);
  cursor: pointer;
  transition: var(--aw-transition);
}

.aw-btn-operation:hover {
  background: rgba(37, 99, 235, 0.2);
}

.aw-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  width: 220px;
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border-highlight);
  border-radius: var(--aw-radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  overflow: hidden;
}

.aw-dropdown-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--aw-text-main);
  border-radius: var(--aw-radius-sm);
  cursor: pointer;
  transition: var(--aw-transition);
}

.aw-dropdown-item:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--aw-primary);
}

.aw-app-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--aw-border);
  padding-top: 0.75rem;
}

.aw-badge-preinstall {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--aw-text-dim);
}

.aw-badge-preinstall.active {
  color: var(--aw-primary);
  font-weight: 700;
}

.aw-app-cat-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: var(--aw-radius-sm);
  color: var(--aw-text-muted);
}

/* Botões de Ação na Tabela de Aparelhos */
.aw-actions-cell {
  white-space: nowrap;
}

.aw-btn-group-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.aw-btn-xs {
  font-size: 0.75rem !important;
  padding: 0.3rem 0.6rem !important;
  border-radius: 4px !important;
}

/* Modais Padronizados */
.aw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.aw-modal-backdrop.aw-hidden {
  display: none !important;
}

.aw-modal-box {
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border-highlight);
  border-radius: var(--aw-radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 1.75rem;
}

.aw-modal-mirror-box {
  background: var(--aw-bg-surface);
  border: 1px solid var(--aw-border-highlight);
  border-radius: var(--aw-radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.aw-modal-mirror-box .aw-card-mirror-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--aw-border);
  margin-bottom: 0.5rem;
}

.aw-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--aw-border);
  padding-bottom: 0.75rem;
}

.aw-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aw-text-main);
}

.aw-btn-close-modal {
  background: transparent;
  border: none;
  color: var(--aw-text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.aw-btn-close-modal:hover {
  color: var(--aw-text-main);
}

.aw-devices-selection-list {
  border: 1px solid var(--aw-border);
  border-radius: var(--aw-radius-md);
  overflow: hidden;
}

.aw-select-all-bar {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--aw-border);
}

.aw-checkboxes-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.aw-device-check-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.aw-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--aw-bg-card);
  padding: 1rem;
  border-radius: var(--aw-radius-md);
  border: 1px solid var(--aw-border);
}

.aw-check-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--aw-text-main);
  cursor: pointer;
}

.aw-input-with-action {
  display: flex;
  gap: 0.5rem;
}

.aw-code-block {
  background: #000000;
  color: #10b981;
  padding: 0.75rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* 4. AQUECIMENTO & DEMONSTRAÇÃO DO FLUXO (WARMUP PIPELINE) */
.aw-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
}

.aw-stage-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aw-stage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.aw-flow-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--aw-border);
  transition: background 0.15s ease;
}

.aw-flow-tag:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.aw-progress-fill.completed {
  background: #10b981 !important;
}

.aw-batch-bar {
  animation: awFadeSlideDown 0.2s ease-out;
}

@keyframes awFadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="light"] .aw-warmup-flow-panel {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .aw-stage-card {
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .aw-chip-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

[data-theme="light"] .aw-batch-bar {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}


/* Tela em Tempo Real: classes no lugar de style inline (bloqueado pelo CSP style-src 'self'). */
.aw-rtc-view,
.aw-live-canvas-container {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}
.aw-live-canvas-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
}
.aw-live-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.aw-live-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #10b981;
  font-size: 0.65rem;
  pointer-events: none;
}
.aw-live-indicator-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.aw-tap-ripple {
  display: none;
  position: absolute;
  z-index: 20;
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.2s ease-out, opacity 0.25s ease-out;
}
.aw-screen-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  padding: 20px;
  color: #94a3b8;
  text-align: center;
}
.aw-screen-state-icon { font-size: 2.5rem; }
.aw-screen-state-title { margin: 0; color: #f8fafc; font-weight: 600; }
.aw-screen-state-detail { color: #64748b; }
.aw-screen-state-error { color: #fca5a5; }
.aw-rtc-stage {
  position: relative;
  width: 100%;
  height: 100%;
}
.aw-rtc-overlay {
  position: absolute;
  inset: 0;
  background: #0b1120;
}
.aw-health-box { border-left: 4px solid #64748b; }
.aw-health-box.aw-health-ok { border-left-color: #10b981; }
.aw-health-box.aw-health-warn { border-left-color: #f59e0b; }
.aw-health-box.aw-health-error { border-left-color: #ef4444; }
.aw-health-list { margin: 0.5rem 0 0; padding-left: 1.1rem; color: #94a3b8; font-size: 0.8rem; line-height: 1.5; }
.aw-plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.aw-segmented { display: inline-flex; border: 1px solid var(--aw-border, #1e293b); border-radius: 8px; overflow: hidden; }
.aw-seg-btn { background: transparent; border: 0; color: #94a3b8; padding: 0.45rem 0.8rem; font-size: 0.8rem; cursor: pointer; }
.aw-seg-btn + .aw-seg-btn { border-left: 1px solid var(--aw-border, #1e293b); }
.aw-seg-btn.active { background: rgba(16, 185, 129, 0.15); color: #10b981; font-weight: 600; }
.aw-check-row { display: flex; align-items: center; gap: 0.6rem; }
.aw-check-row.aw-hidden { display: none !important; }
.aw-check-row input[type="checkbox"],
.aw-check-row input[type="radio"] { width: auto; min-width: 0; flex: 0 0 auto; margin: 0; }
.aw-check-row { justify-content: flex-start; text-align: left; }
.aw-check-row span { flex: 1 1 auto; text-align: left; }
.aw-number-prices-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; }
.aw-number-prices-head small { display: block; margin-top: 0.2rem; }
.aw-number-prices-head .aw-select { width: auto; min-width: 16rem; }
.aw-number-prices-empty { padding: 0.75rem 1rem; margin: 0; }
.aw-number-chooser .aw-modal-box { max-width: 640px; }
.aw-chooser-title { margin: 1rem 0 0.4rem; font-size: 0.9rem; color: #e2e8f0; }
.aw-number-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; max-height: 220px; overflow-y: auto; }
.aw-number-list em { color: #94a3b8; font-style: normal; }
.aw-number-chooser .aw-select { width: auto; flex: 1 1 auto; }
.aw-number-chooser .aw-check-row span { flex: 0 1 auto; font-weight: 400; }
.aw-number-chooser .aw-check-row strong { font-weight: 600; }

/* O workspace ocupa a largura disponível sem cortar cards ou a prévia. */
.aw-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.aw-quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.aw-vmos-catalog-grid,
.aw-apps-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.aw-filter-search,
.aw-form-group,
.aw-studio-editor,
.aw-studio-preview {
  min-width: 0;
}

.aw-wa-chat-simulator {
  width: min(320px, 100%);
}

@media (max-width: 1100px) {
  .aw-studio-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .aw-studio-preview {
    position: static;
  }
}

@media (max-width: 900px) {
  .aw-layout {
    flex-direction: column;
  }

  .aw-sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }

  .aw-sidebar-nav {
    flex-direction: row;
    flex: none;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.35rem;
  }

  .aw-nav-item {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  .aw-nav-section-label {
    display: none;
  }

  .aw-sidebar-cta {
    width: fit-content;
  }

  .aw-sidebar-footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 0.625rem;
  }

  .aw-content-area {
    width: 100%;
    padding: 1.25rem clamp(0.875rem, 3vw, 2rem) 4rem;
  }

  .aw-subtabs-nav {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .aw-subtab-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) {
  .aw-hero-card,
  .aw-ban-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .aw-hero-actions {
    flex-wrap: wrap;
  }

  .aw-form-row {
    flex-direction: column;
  }

  .aw-appstore-filters-bar > .aw-filter-item {
    flex: 1 1 100%;
    min-width: 0;
  }

  .aw-layout .aw-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .aw-modal-backdrop {
    padding: 0.75rem;
  }

  .aw-modal-box,
  .aw-modal-mirror-box,
  .aw-card-form {
    padding: 1rem;
  }

  .aw-number-prices-head .aw-select {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .aw-layout .aw-quick-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .aw-search-input-wrap {
    flex-direction: column;
  }

  .aw-hero-actions > *,
  .aw-search-input-wrap > * {
    width: 100%;
  }
}
