/* ============================================================
   Portal de Ativações Cinivia — Estilos (cores Teleplay)
   ============================================================ */

:root {
  --bg:          #0a0a0a;
  --bg-card:     #111216;
  --bg-input:    #16171c;
  --bg-hover:    #1d1e24;
  --primary:     #FFB000;
  --secondary:   #FF7A00;
  --tertiary:    #FF4D00;
  --gradient:    linear-gradient(135deg, #FFB000, #FF7A00, #FF4D00);
  --text:        #ffffff;
  --text-muted:  #9a9aa3;
  --border:      rgba(255, 180, 0, 0.12);
  --border-soft: rgba(255, 180, 0, 0.18);
  --danger:      #ff4d4d;
  --success:     #22c55e;
  --warning:     #FFB000;
  --info:        #3B82F6;
  --purple:      #8b5cf6;
  --radius:      18px;
  --radius-lg:   26px;
  --radius-sm:   12px;
  --shadow:      0 12px 40px rgba(0,0,0,0.55);
  --glow:        0 0 0 3px rgba(255, 176, 0, 0.12);
  --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

img { max-width: 100%; }

/* ── Fundo com partículas ────────────────────────────────── */
#canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Layout principal ────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ── Portal container (card + botão + notif abaixo) ──────── */
.portal-container {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Card central ────────────────────────────────────────── */
.card-main {
  position: relative;
  background: rgba(17, 18, 22, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  padding: 36px;
  box-shadow: var(--shadow);
}

/* ── Header do card ──────────────────────────────────────── */
.card-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(255, 176, 0, 0.25);
}
.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.logo-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-yt {
  position: absolute;
  top: 0;
  left: 0;
  height: 36px;
  padding: 0 14px 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-yt:hover { border-color: var(--danger); }
.btn-yt .yt-icon {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  background: #FF0000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
}
.btn-yt .yt-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Logado: o botão vira só o ícone circular do YouTube, sem texto */
body.scope-auth .btn-yt {
  width: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
body.scope-auth .btn-yt .yt-text { display: none; }

.btn-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: linear-gradient(to bottom right, #F97316, #EA580C);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}
.btn-menu .menu-icon { width: 14px; height: 14px; color: #fff; stroke-width: 2; flex-shrink: 0; }
.btn-menu:hover { opacity: 0.92; transform: translateY(-1px) scale(1.03); }

/* ── Dropdown menu (posicionado relativo ao .card-main, contido nele) ── */
.menu-dropdown {
  position: absolute;
  top: 64px;
  right: 24px;
  background: #18191e;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  min-width: 200px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 100;
  display: none;
  animation: fadeDown 0.18s ease;
}
.menu-dropdown.open { display: block; }

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

.menu-user {
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border);
}
.menu-user strong { display: block; font-size: 12px; color: var(--text); line-height: 1.2; }
.menu-user span { font-size: 10px; color: var(--text-muted); }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
/* Ícone: SEMPRE cinza, em qualquer estado e em qualquer item — nunca herda
   a cor do texto (nem nos itens especiais, nem no hover). */
.menu-item .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #7C8494;
  stroke: currentColor;
  transition: var(--transition);
}
.menu-item:hover { background: rgba(255, 176, 0, 0.07); color: var(--text); }
.menu-item:hover .icon { color: #7C8494; }
.menu-item:hover .chevron { color: var(--text-muted); }

/* Itens com cor própria fixa no TEXTO — o ícone continua cinza sempre */
.menu-item.suporte { color: var(--success); }
.menu-item.suporte:hover { background: rgba(34, 197, 94, 0.08); color: #4ade80; }

.menu-item.comunidade { color: var(--secondary); }
.menu-item.comunidade:hover { background: rgba(255, 122, 0, 0.08); color: #ff9233; }

.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(255, 77, 77, 0.08); color: #ff7373; }

.menu-item .badge {
  background: var(--secondary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

/* ── Visibilidade por estado de login (guest vs autenticado) ── */
body.scope-guest [data-scope="auth"] { display: none !important; }
body.scope-auth  [data-scope="guest"] { display: none !important; }

.chevron {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
  opacity: 0.4;
  flex-shrink: 0;
  line-height: 1;
}

.btn-suporte-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.btn-suporte-opt:hover { border-color: var(--primary); transform: translateX(4px); }
/* ícone SVG nos botões de suporte/opção (substitui .suporte-icon emoji) */
.suporte-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: var(--transition);
}
.suporte-icon-wrap svg { width: 20px; height: 20px; }
.btn-suporte-opt:hover .suporte-icon-wrap { background: rgba(255,176,0,0.08); color: var(--primary); }
.suporte-icon-wrap.orange { background: rgba(255,122,0,0.12); color: var(--secondary); }
/* fallback: mantém emoji antigo se houver */
.btn-suporte-opt .suporte-icon { font-size: 24px; flex-shrink: 0; }
.btn-suporte-opt .suporte-info { flex: 1; }
.btn-suporte-opt .suporte-info strong { display: block; }
.btn-suporte-opt .suporte-info span { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.btn-suporte-opt.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.btn-suporte-opt.disabled:hover { border-color: var(--border); transform: none; }
.em-breve-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 20px;
}

/* ── Corpo do card (2 colunas) ───────────────────────────── */
.card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.col-left {
  padding: 0;
}

.col-right {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--secondary);
  border-radius: 2px;
}

/* ── Saldo / créditos ────────────────────────────────────── */
.balance-bar {
  display: flex;
  align-items: center;
  width: fit-content;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.balance-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  white-space: nowrap;
}
.balance-icon { width: 14px; height: 14px; flex-shrink: 0; }
.balance-chip.credits .balance-icon { color: var(--primary); }
.balance-chip.saldo .balance-icon { color: var(--success); }
.balance-chip .label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.balance-chip.credits .label { color: var(--primary); }
.balance-chip.saldo .label { color: var(--success); }
.balance-chip .value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Courier New', monospace;
}

/* ── Dropdown de apps ────────────────────────────────────── */
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 8px 16px;
}

.app-select-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.app-select-btn {
  width: 100%;
  min-height: 46px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  user-select: none;
}
.app-select-btn:hover, .app-select-btn.open {
  border-color: var(--primary);
  box-shadow: var(--glow);
}

/* Texto do app selecionado (ou placeholder) */
.app-select-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
/* Input de busca inline (oculto por padrão, visível quando .open) */
.app-select-search {
  display: none;
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  cursor: text;
}
.app-select-search::placeholder { color: var(--text-muted); }
.app-select-btn.open .app-select-search { display: block; }
.app-select-btn.open .app-select-text  { display: none; }
/* Seta animada */
.app-select-arrow {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  line-height: 1;
}
.app-select-btn.open .app-select-arrow { transform: rotate(180deg); }

/* Pulso sutil guiando o usuário a selecionar um app — some assim que ele escolhe um */
.app-select-btn.guide-pulse { animation: guide-pulse 2s ease-in-out infinite; }
.app-select-btn.guide-pulse:hover,
.app-select-btn.guide-pulse.open { animation: none; }
@keyframes guide-pulse {
  0%, 100% { box-shadow: rgba(255, 176, 0, 0) 0 0 0 1px; }
  50% { box-shadow: rgba(255, 176, 0, 0.4) 0 0 0 1px, rgba(255, 176, 0, 0.12) 0 0 12px; }
}

.app-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #15161a;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  z-index: 50;
  display: none;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeDown 0.18s ease;
}
.app-dropdown.open { display: block; }

/* .app-search removido — busca agora é inline no app-select-btn */

.app-filter-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 8px 12px;
  padding: 2px;
  background: #0a0a0c;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  color: #6B7280;
}
.filter-btn svg {
  width: 10px;
  height: 10px;
  color: currentColor;
  stroke-width: 1.5;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Cor própria por filtro (independente de estar ativo ou não) */
.filter-btn[data-sort="az"],
.filter-btn[data-sort="preco"] { color: #6B7280; }
.filter-btn[data-sort="az"]:hover,
.filter-btn[data-sort="preco"]:hover { color: var(--text); }

.filter-btn[data-sort="popular"] { color: #FB923C; }
.filter-btn[data-sort="popular"]:hover { color: #fdba74; }

.filter-btn[data-sort="favoritos"] { color: #EAB308; }
.filter-btn[data-sort="favoritos"]:hover { color: #facc15; }

/* Estado ativo (qualquer filtro): fundo laranja sólido + texto branco */
.filter-btn.active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 122, 0, 0.3);
}

.app-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
}
/* Scrollbar premium: fina, laranja, arredondada */
.app-list::-webkit-scrollbar { width: 3px; }
.app-list::-webkit-scrollbar-track { background: transparent; }
.app-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 6px; opacity: 0.7; }
.app-list::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

.app-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: var(--transition);
}
.app-item:last-child { margin-bottom: 0; }
.app-item:hover { background: var(--bg-hover); }
.app-item img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}
.app-item-info { flex: 1; min-width: 0; }
.app-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.app-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.35;
  flex-shrink: 0;
}
.app-item-price .price-reais  { font-size: 11px; font-weight: 700; color: var(--success); }
.app-item-price .price-creditos { font-size: 9px; color: var(--text-muted); opacity: 0.8; }

/* ── Campos de credencial (MAC / Device ID / E-mail / Key / Senha) ── */
.mac-input-wrapper {
  position: relative;
  margin-bottom: 14px;
}
.mac-input-wrapper input {
  width: 100%;
  height: 46px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 16px 0 42px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0;
}
.mac-input-wrapper input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  font-family: inherit;
  letter-spacing: 0;
}
.mac-input-wrapper input:focus { border-color: var(--primary); box-shadow: var(--glow); }

/* Ícone genérico centralizado — usado em todos os tipos de campo */
.cred-icon,
.mac-input-wrapper .icon-mac {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}
.mac-input-wrapper:focus-within .cred-icon,
.mac-input-wrapper:focus-within .icon-mac,
.mac-input-wrapper:hover .cred-icon,
.mac-input-wrapper:hover .icon-mac { color: var(--primary); }

.field-hint {
  font-size: 11px;
  color: var(--primary);
  margin-top: 5px;
  padding: 5px 10px;
  background: rgba(255, 176, 0, 0.07);
  border-left: 2px solid var(--primary);
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

.auto-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auto-note::before { content: '⚡'; color: var(--primary); }

/* ── Coluna direita — Preview e Pagamento ────────────────── */
.app-preview-empty {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.02), transparent);
  border: 1px dashed rgba(255,180,0,0.12);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.app-preview-empty .icon-phone { width: 36px; height: 36px; color: var(--text-muted); opacity: 0.5; }

.app-preview-card {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: none;
}
.app-preview-card.visible { display: block; }
.app-preview-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-right: 26px; /* espaço pra estrela não sobrepor o texto */
}
.app-preview-top img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}
.app-preview-name { font-size: 16px; font-weight: 700; }
.app-preview-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 2px;
}

/* ── Estrela de favorito ──────────────────────────────────── */
.app-fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.app-fav-btn:hover { color: var(--primary); transform: scale(1.1); }
.app-fav-btn svg { width: 19px; height: 19px; transition: var(--transition); }
.app-fav-btn.active { color: var(--primary); }
.app-fav-btn.active svg { fill: var(--primary); }

.pay-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
  transition: var(--transition);
}
.pay-option:hover, .pay-option.selected {
  border-color: var(--primary);
  background: rgba(255, 176, 0, 0.06);
  box-shadow: var(--glow);
}
.pay-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: var(--transition);
}
.pay-option-icon svg { width: 13px; height: 13px; stroke-width: 2; }
.pay-option:hover .pay-option-icon,
.pay-option.selected .pay-option-icon {
  background: var(--primary);
  color: #fff;
}
.pay-option-label { font-size: 13px; flex: 1; line-height: 1; }
.pay-option-value { font-size: 14px; font-weight: 700; color: var(--primary); flex-shrink: 0; line-height: 1; }

/* ── Botão ativar (fora do card) ─────────────────────────── */
.btn-ativar {
  width: 100%;
  padding: 16px;
  background: linear-gradient(90deg, #FFB000, #FF7A00, #FF4D00);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  letter-spacing: 1px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(255,122,0,0.2);
}
.btn-ativar:hover { opacity: 0.92; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,122,0,0.45); }
.btn-ativar:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ativar-icon { display: flex; align-items: center; justify-content: center; }
.btn-ativar-icon svg { width: 18px; height: 18px; color: #fff; stroke: #fff; fill: #fff; stroke-width: 2; }

.notif-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.notif-link:hover { color: var(--primary); }
.notif-icon { width: 14px; height: 14px; }
.notif-link .badge {
  color: var(--primary);
  font-weight: 700;
}

/* ── Modal genérico ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp 0.22s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h2 .icon { color: var(--primary); }
.modal-header h2 svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.comprovante-header h2 svg { color: var(--success); }
.btn-close {
  background: var(--bg-input);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-close:hover { color: var(--text); }

.modal-body { padding: 20px; overflow-y: auto; }

/* ── Modal de Comprar Créditos ───────────────────────────── */
.credit-package {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
}
.credit-package:hover { border-color: var(--primary); transform: translateX(4px); }
.credit-package.featured {
  position: relative;
  border-color: var(--border-soft);
  background: linear-gradient(135deg, rgba(255,176,0,0.08), rgba(255,77,0,0.04));
}
.credit-package.featured::after {
  content: 'MAIS POPULAR';
  position: absolute;
  top: -9px;
  right: 14px;
  background: var(--gradient);
  color: var(--bg);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 20px;
}
.credit-qty {
  width: 44px;
  height: 44px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--bg);
  flex-shrink: 0;
}
.credit-info { flex: 1; }
.credit-info strong { font-size: 14px; display: block; }
.credit-info span { font-size: 12px; color: var(--text-muted); }
.economia-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 20px;
}
.credit-price {
  text-align: right;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.credit-price small { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* ── Modal Login/Cadastro ────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--gradient);
  color: var(--bg);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  box-sizing: border-box;
}
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg-card); color: var(--text); }
.form-group textarea { resize: none; min-height: 120px; line-height: 1.6; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: var(--glow); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group .field-error {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--gradient);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary:hover { opacity: 0.9; }

/* ── Valores rápidos (Adicionar Saldo) ───────────────────── */
.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.quick-amount-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.quick-amount-btn:hover, .quick-amount-btn.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 176, 0, 0.08);
}

/* ── Modal Pix ───────────────────────────────────────────── */
.pix-modal-box { max-width: 380px; }
.pix-subtitle {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}
.pix-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.pix-timer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.pix-timer-suffix { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.pix-timer-bar svg { width: 15px; height: 15px; flex-shrink: 0; }

.pix-value-block { display: flex; flex-direction: column; gap: 2px; }
.pix-value-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.pix-value-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.pix-qr-wrap {
  display: flex;
  justify-content: center;
}
.pix-qr-wrap img {
  width: 190px;
  height: 190px;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  display: block;
}

.pix-code-block { text-align: left; }
.pix-code-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pix-code-row {
  display: flex;
  gap: 8px;
}
.pix-code-field {
  flex: 1;
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: var(--transition);
}
.pix-code-field:hover { border-color: var(--primary); }
.pix-copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  background: var(--gradient);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg);
  cursor: pointer;
  transition: var(--transition);
}
.pix-copy-btn svg { width: 13px; height: 13px; }
.pix-copy-btn:hover { opacity: 0.9; }

.pix-instructions {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
}

.pix-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  padding: 9px;
}
.pix-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pix-status-blink 1.4s ease-in-out infinite;
}
@keyframes pix-status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.pix-status.expired {
  color: var(--danger);
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.2);
}
.pix-status.expired .pix-status-dot { display: none; }

/* Botão cinza neutro (não usa o gradiente laranja, igual ao modelo) */
.pix-verify-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.pix-verify-btn:hover { border-color: var(--text-muted); background: var(--bg-input); }
.pix-verify-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pix-verify-btn svg { width: 15px; height: 15px; color: var(--text-muted); }

/* ── Modal: Comprovante de Ativação ──────────────────────── */
.comprovante-modal-box { max-width: 430px; }

.comprovante-header {
  background: linear-gradient(135deg, rgba(34,197,94,0.14) 0%, rgba(16,185,129,0.08) 100%);
  border-bottom: 1px solid rgba(34,197,94,0.25);
}
.comprovante-header h2 {
  color: var(--success);
  font-size: 15px;
  letter-spacing: 0.2px;
}
.comprovante-subtitle {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(34,197,94,0.75);
  margin-top: 3px;
  letter-spacing: 0.3px;
}

.comprovante-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  padding: 20px 20px 20px;
}

/* Ícone de check animado */
.comprovante-check-wrap {
  margin-bottom: 14px;
}
.comprovante-check-ring {
  width: 64px;
  height: 64px;
  color: var(--success);
  filter: drop-shadow(0 0 12px rgba(34,197,94,0.35));
  animation: comprovante-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.comprovante-check-ring svg { width: 64px; height: 64px; }
@keyframes comprovante-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.comprovante-success-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: 0.1px;
}

/* Card de dados */
.comprovante-card {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 16px;
  overflow: hidden;
}
.comprovante-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
}
.comprovante-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
  opacity: 0.5;
}
.comprovante-row-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,176,0,0.1);
  border-radius: 8px;
  color: var(--primary);
}
.comprovante-row-icon svg { width: 15px; height: 15px; }
.comprovante-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comprovante-row-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.comprovante-row-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comprovante-footer {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Botões */
.comprovante-actions { display: flex; gap: 10px; width: 100%; }
.comprovante-btn-copy,
.comprovante-btn-done {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--transition);
  letter-spacing: 0.2px;
}
.comprovante-btn-copy {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
}
.comprovante-btn-copy:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}
.comprovante-btn-done {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}
.comprovante-btn-done:hover {
  box-shadow: 0 4px 12px rgba(34,197,94,0.45);
  transform: translateY(-1px);
}

/* ── Histórico (lista em cards) ──────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 36px; opacity: 0.35; margin-bottom: 10px; }
.empty-state .empty-icon svg { width: 36px; height: 36px; color: var(--text-muted); }
.empty-state .empty-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state .empty-sub { font-size: 12px; }

/* ── Modal Histórico (HM) ─────────────────────────────────── */
.hm-box {
  max-width: 600px;
  padding: 0;
  overflow: hidden;
  background: #161616;
  border: 1px solid #252525;
}

/* Cabeçalho — usa .modal-header/.icon-action-btn compartilhados (mesmo padrão do modal de Logs) */

/* Card total */
.hm-total-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 14px 0;
  padding: 12px 16px;
  background: #231000;
  border: 1px solid rgba(255,130,0,0.3);
  border-radius: 12px;
}
.hm-total-icon {
  width: 36px; height: 36px;
  background: rgba(255,130,0,0.18);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.hm-total-icon svg { width: 18px; height: 18px; }
.hm-total-label { flex: 1; font-size: 13px; color: #aaa; font-weight: 500; }
.hm-total-num   { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }

/* Busca */
.hm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 14px 0;
  padding: 9px 13px;
  background: #1a1a1a;
  border: 1px solid #282828;
  border-radius: 10px;
}
.hm-search svg { width: 14px; height: 14px; color: #555; flex-shrink: 0; }
.hm-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: #ccc;
}
.hm-search input::placeholder { color: #555; }

/* Lista */
.hm-list {
  margin: 12px 0 0;
  max-height: 420px;
  overflow-y: auto;
  padding: 0 14px 4px;
}
.hm-list::-webkit-scrollbar { width: 3px; }
.hm-list::-webkit-scrollbar-track { background: transparent; }
.hm-list::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
.hm-list::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Item (linha da lista) */
.hm-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  background: #1c1c1c;
  border: 1px solid #242424;
  border-radius: 10px;
  margin-bottom: 6px;
  transition: border-color 0.12s;
}
.hm-item:last-child { margin-bottom: 0; }
.hm-item:hover { border-color: #333; }

/* Logo */
.hm-item-logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #252525;
}
.hm-item-logo-ph {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: #252525;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #444;
}
.hm-item-logo-ph svg { width: 18px; height: 18px; }

/* Coluna info (nome + mac) */
.hm-item-info { flex: 1; min-width: 0; }
.hm-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-item-mac {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-item-mac svg { width: 11px; height: 11px; flex-shrink: 0; color: #555; }

/* Status visual no histórico — apenas para ativações com falha */
.hm-item--falha { border-left: 3px solid rgba(255,77,77,.4); }
.hm-status-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
}
.hm-status-erro         { background: rgba(255,77,77,.15);  color: #ff4d4d; }
.hm-status-indisponivel { background: rgba(255,176,0,.12);  color: var(--primary); }

/* Coluna meta (data + pagamento) */
.hm-item-meta {
  flex-shrink: 0;
  text-align: right;
  min-width: 130px;
}
.hm-item-date, .hm-item-pay {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  color: #777;
}
.hm-item-date { margin-bottom: 4px; }
.hm-item-date svg, .hm-item-pay svg { width: 11px; height: 11px; color: #555; }

/* Coluna direita (valor + botões) */
.hm-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hm-item-value {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

/* Botões ícone quadrado */
.hm-icon-btn {
  width: 30px; height: 30px;
  background: #252525;
  border: 1px solid #303030;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #777;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.hm-icon-btn svg { width: 13px; height: 13px; }
.hm-icon-btn:hover { background: #2e2e2e; border-color: #444; color: #ccc; }
.hm-icon-btn.has-nota { color: var(--primary); border-color: rgba(255,130,0,0.35); }
.hm-icon-btn.has-nota:hover { background: rgba(255,130,0,0.08); }

/* Nota salva inline */
.hm-item-nota-saved {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 12px 8px;
  padding: 7px 10px;
  background: #1a1a1a;
  border-left: 2px solid var(--primary);
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: #999;
  line-height: 1.45;
}
.hm-item-nota-saved svg { width: 12px; height: 12px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

/* Editor de nota inline */
.hm-nota-editor {
  margin: 0 12px 8px;
}
.hm-nota-editor textarea {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #ccc;
  resize: none;
  min-height: 64px;
  outline: none;
  font-family: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}
.hm-nota-editor textarea:focus { border-color: var(--primary); }
.hm-nota-editor textarea::placeholder { color: #444; }
.hm-nota-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
}
.hm-nota-counter { font-size: 10px; color: #555; }
.hm-nota-btns { display: flex; gap: 6px; }
.hm-nota-cancel {
  padding: 4px 12px;
  font-size: 11px; font-weight: 600;
  border-radius: 6px;
  border: 1px solid #2e2e2e;
  background: none;
  color: #777;
  cursor: pointer;
}
.hm-nota-cancel:hover { color: #ccc; border-color: #444; }
.hm-nota-save {
  padding: 4px 14px;
  font-size: 11px; font-weight: 700;
  border-radius: 6px;
  border: none;
  background: var(--primary);
  color: #111;
  cursor: pointer;
}
.hm-nota-save:hover { opacity: 0.88; }

/* Paginação */
.hm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 14px;
  border-top: 1px solid #222;
}
.hm-page-prev, .hm-page-next {
  background: none;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.12s;
}
.hm-page-prev:not(:disabled):hover,
.hm-page-next:not(:disabled):hover { color: #ccc; }
.hm-page-prev:disabled,
.hm-page-next:disabled { opacity: 0.3; cursor: default; }
.hm-page-nums { display: flex; align-items: center; gap: 6px; }
.hm-page-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  border: none;
  background: #242424;
  color: #888;
  transition: background 0.12s, color 0.12s;
}
.hm-page-num:hover { background: #2e2e2e; color: #ccc; }
.hm-page-num.active { background: var(--primary); color: #111; }

/* Empty state — usa .empty-state/.empty-icon compartilhados (mesmo padrão do resto do portal) */

/* Responsivo mobile */
@media (max-width: 480px) {
  .hm-box { max-width: 96vw; }
  .hm-item-meta { min-width: 100px; }
  .hm-item-meta { display: none; }
  .hm-list { max-height: 52vh; }
}

/* ── Logs de Atividade (cards premium) ───────────────────────── */
.modal-box-logs { max-width: 480px; }
.modal-box-logs .modal-header { align-items: flex-start; gap: 12px; }
.logs-user-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-action-btn {
  background: var(--bg-input); border: 1px solid var(--border);
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition); flex-shrink: 0;
}
.icon-action-btn:hover { color: var(--primary); border-color: var(--border-soft); }
.icon-action-btn svg { width: 15px; height: 15px; }
.icon-action-btn.green { background: rgba(37,211,102,0.1); color: #25D366; border-color: rgba(37,211,102,0.2); }
.icon-action-btn.green:hover { background: rgba(37,211,102,0.18); color: #25D366; border-color: rgba(37,211,102,0.35); }

.logs-search-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 20px 12px; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.logs-search-bar svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.logs-search-bar input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 13px; font-family: inherit; width: 100%;
}
.logs-search-bar input::placeholder { color: var(--text-muted); }

.logs-body { padding-top: 0; max-height: 360px; }
.logs-body::-webkit-scrollbar { width: 5px; }
.logs-body::-webkit-scrollbar-track { background: transparent; }
.logs-body::-webkit-scrollbar-thumb { background: rgba(255,176,0,0.3); border-radius: 4px; }
.logs-body::-webkit-scrollbar-thumb:hover { background: rgba(255,176,0,0.5); }

.log-card {
  padding: 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; transition: var(--transition);
}
.log-card:last-child { margin-bottom: 0; }
.log-card:hover { border-color: var(--border-soft); background: var(--bg-hover); }
.log-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 6px; margin-bottom: 8px;
  color: var(--log-color); background: var(--log-bg);
}
.log-card-desc { font-size: 12.5px; color: var(--text); line-height: 1.6; }
.log-card-time { font-size: 10px; color: var(--text-muted); opacity: 0.7; margin-top: 8px; }

.logs-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
  font-size: 11px; color: var(--text-muted);
}
.logs-pagination-nav { display: flex; align-items: center; gap: 10px; }
.logs-pagination-nav button {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
  width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.logs-pagination-nav button:hover:not(:disabled) { color: var(--primary); border-color: var(--border-soft); }
.logs-pagination-nav button:disabled { opacity: 0.35; cursor: default; }
.logs-pagination-nav button svg { width: 13px; height: 13px; }

/* ── Indique e Ganhe ──────────────────────────────────────── */
.ref-how-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.ref-how-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.ref-how-title svg { width: 14px; height: 14px; color: var(--primary); }
.ref-how-steps { display: flex; flex-direction: column; gap: 10px; }
.ref-how-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ref-how-num {
  min-width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--bg);
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ref-how-info { display: flex; flex-direction: column; gap: 2px; }
.ref-how-info strong { font-size: 13px; color: var(--text); font-weight: 600; }
.ref-how-info span { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.ref-hl { color: var(--primary); font-weight: 700; }

.ref-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ref-stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.ref-stat-value { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.ref-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.btn-whatsapp-share {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #25D366;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-whatsapp-share:hover { opacity: 0.9; }
.btn-whatsapp-share svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Toast notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--primary); }
.toast .toast-icon { font-size: 16px; }

/* ── Banner: Instale nosso app (PWA) — clone pixel-perfect da referência ── */
.pwa-install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 448px;
  margin: 0 auto;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
.pwa-banner-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #F97316;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pwa-banner-icon svg { width: 22px; height: 22px; color: #fff; stroke-width: 2.2; }
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.pwa-banner-sub { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.pwa-banner-sub-small { font-size: 10px; color: var(--text-muted); opacity: 0.7; margin-top: 2px; }
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-banner-close {
  padding: 8px;
  background: none;
  border: none;
  border-radius: 12px;
  color: #6B7280;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  transition: var(--transition);
}
.pwa-banner-close:hover { opacity: 0.7; }
.pwa-banner-install {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(to right, #F97316, #EA580C);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.pwa-banner-install:hover { opacity: 0.92; }
.pwa-banner-install:active { transform: scale(0.95); }
.pwa-banner-install svg { width: 14px; height: 14px; }
body.modal-open .pwa-install-banner { display: none !important; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Aviso Importante (consentimento obrigatório) ────────── */
.consent-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.consent-card:last-of-type { margin-bottom: 0; }
.consent-card .consent-icon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
/* ícone SVG no card de consentimento */
.consent-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255,176,0,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.consent-icon-wrap svg { width: 16px; height: 16px; }
.consent-icon-wrap.orange { background: rgba(255,122,0,0.12); color: var(--secondary); }
.consent-card strong { display: block; font-size: 12.5px; color: var(--text); margin-bottom: 3px; }
.consent-card p { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

.btn-consent-decline {
  flex: 1;
  padding: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-consent-decline:hover { border-color: var(--danger); color: var(--danger); }
#consent-actions .btn-primary { flex: 1.4; }

/* ── Responsivo ──────────────────────────────────────────── */

/* Tablet (768–1024px): mantém 2 colunas, só refina padding/gap */
@media (min-width: 768px) and (max-width: 1024px) {
  .card-main { padding: 28px; }
  .card-body { gap: 28px; }
}

/* Phones e phablets até 767px (cobre 360/375/390/414/430 e landscape) */
@media (max-width: 767px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
  .app-wrapper { padding: 12px; }
  .card-main { padding: 20px; border-radius: 22px; }
  .card-header { margin-bottom: 24px; }
  .card-body { grid-template-columns: 1fr; gap: 24px; }
  .col-left  { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .logo-icon { width: 42px; height: 42px; }
  .logo-text h1 { font-size: 16px; }
  .logo-text p { font-size: 11px; }
  .btn-yt, .header-actions { position: static; }
  .card-header { flex-direction: column; gap: 12px; }
  .header-logo { order: 1; }
  .header-actions { order: 2; }
  .btn-yt { order: 3; }
  .menu-dropdown {
    top: 180px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    max-width: 90vw;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
  }

  /* Modais: nunca mais que 95% da largura, header/body com respiro menor */
  .modal-box { max-width: 95vw; max-height: 85vh; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .quick-amounts { grid-template-columns: repeat(2, 1fr); }
  .ref-stats { grid-template-columns: 1fr 1fr; }
  #consent-actions { flex-direction: column; }

  /* Inputs com font-size >=16px pra não disparar zoom automático no Safari iOS */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .mac-input-wrapper input,
  .app-select-search { font-size: 16px; }

  /* Alvos de toque maiores (mínimo ~44px de altura) */
  .app-select-btn { min-height: 48px; }
  .btn-primary { padding: 14px; }
  .pay-option { padding: 11px 12px; }
  .pix-code-field, .pix-copy-btn { height: 42px; }

  /* QR code centralizado e levemente menor pra caber com folga */
  .pix-qr-wrap img { width: 170px; height: 170px; }
}

/* ── Minha Conta (Perfil) ──────────────────────────────── */
.perfil-section { margin-bottom: 6px; }
.perfil-section-title {
  display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px;
}
.perfil-section-title svg { width: 13px; height: 13px; color: var(--primary); }
.perfil-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Tickets — modal container ────────────────────────── */
.modal-box-tickets {
  display: flex; flex-direction: column;
  max-height: 86vh; padding: 0 !important; overflow: hidden;
}
.modal-box-tickets .modal-header { padding: 16px 20px; flex-shrink: 0; }
.modal-box-tickets .modal-body   { flex: 1; overflow-y: auto; min-height: 0; }
.tickets-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-card);
}

/* Loading / empty */
.ticket-loading { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }
.ticket-empty   { padding: 36px 20px; text-align: center; color: var(--text-muted); }
.ticket-empty svg { width: 36px; height: 36px; margin-bottom: 12px; opacity: .5; }
.ticket-empty p   { font-size: 13px; margin: 4px 0; }

/* Lista */
.ticket-item {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; transition: background var(--transition);
}
.ticket-item:hover { background: var(--bg-hover); }
.ticket-item:last-child { border-bottom: none; }
.ticket-item-head    { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.ticket-item-assunto { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.4; }
.ticket-item-meta    { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }

/* Badges */
.ticket-id { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.ticket-status-badge, .ticket-pri-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.status-aberto          { background: rgba(255,176,0,.13);  color: var(--primary); }
.status-em_atendimento  { background: rgba(59,130,246,.13); color: var(--info); }
.status-resolvido       { background: rgba(34,197,94,.13);  color: var(--success); }
.status-fechado         { background: rgba(154,154,163,.12);color: var(--text-muted); }
.pri-baixa { background: rgba(34,197,94,.12); color: var(--success); }
.pri-media { background: rgba(255,176,0,.12); color: var(--primary); }
.pri-alta  { background: rgba(255,77,77,.12); color: var(--danger); }

/* Botão voltar */
.ticket-back-btn {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none;
  color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 0 0 14px; transition: var(--transition);
}
.ticket-back-btn:hover { color: var(--secondary); }
.ticket-back-btn svg { width: 14px; height: 14px; }

/* Detalhe */
.ticket-detail-head   { margin-bottom: 14px; }
.ticket-detail-title  { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.ticket-detail-assunto{ font-size: 14px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.ticket-detail-meta   { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); align-items: center; }

/* Thread */
.ticket-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ticket-msg {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px;
}
.ticket-msg.admin { background: rgba(255,176,0,.05); border-color: rgba(255,176,0,.2); }
.ticket-msg-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 7px; flex-wrap: wrap; gap: 4px;
}
.ticket-msg-author { font-size: 12px; font-weight: 700; color: var(--text); }
.ticket-msg.admin .ticket-msg-author { color: var(--primary); }
.ticket-msg-time   { font-size: 11px; color: var(--text-muted); }
.ticket-msg-body   { font-size: 13px; color: var(--text); line-height: 1.6; word-break: break-word; }

/* Reply */
.ticket-reply-box { display: flex; flex-direction: column; gap: 10px; }
.ticket-reply-input {
  width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 72px; transition: var(--transition);
}
.ticket-reply-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
.ticket-closed-note {
  text-align: center; font-size: 12px; color: var(--text-muted);
  padding: 12px; background: var(--bg-input); border-radius: var(--radius-sm);
}

/* Botão novo ticket */
.btn-new-ticket {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 12px; border-radius: var(--radius-sm); background: var(--gradient);
  color: #fff; font-size: 13px; font-weight: 700; border: none; cursor: pointer;
  transition: var(--transition);
}
.btn-new-ticket:hover { opacity: .92; }
.btn-new-ticket svg { width: 15px; height: 15px; }

/* Phones menores (360–414px): aperta mais um pouco */
@media (max-width: 420px) {
  .app-wrapper { padding: 8px; }
  .card-main { padding: 16px; border-radius: 18px; }
  .modal-header h2 { font-size: 14px; }
  .pix-value-amount { font-size: 22px; }
  .app-item { padding: 9px 10px; gap: 10px; }
  .pay-option-label { font-size: 12px; }

  /* Barra de filtros: aperta um pouco e permite rolagem horizontal só dela
     (não da página) se ainda assim não couber, em vez de quebrar o texto em 2 linhas */
  .app-filter-bar { overflow-x: auto; }
  .app-filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { padding: 4px 6px; font-size: 10px; gap: 3px; }
}
