:root {
  --bg: #0b0e14;
  --bg-soft: #10141c;
  --card: #151a24;
  --card-2: #1a202c;
  --border: #232a37;
  --border-soft: #1c222e;
  --text: #e7ecf4;
  --muted: #8a94a6;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --sidebar-w: 250px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content { padding: 24px; flex: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
}
.brand-logo svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }

.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--border); }
.version { color: var(--muted); font-size: 12px; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(16, 20, 28, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-title { font-size: 18px; flex: 1; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 700;
  object-fit: cover;
  flex: 0 0 34px;
}
.profile-avatar-preview { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 13px; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
  width: fit-content;
}

.role-owner   { background: #7c3aed22; color: #a78bfa; }
.role-admin   { background: var(--primary-soft); color: var(--primary); }
.role-seller  { background: var(--success-soft); color: var(--success); }
.role-client  { background: var(--warning-soft); color: var(--warning); }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn svg { width: 18px; height: 18px; }

.sidebar-toggle { display: none; }

/* Seletor de idioma */
.language-picker { position: relative; }
.language-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.language-trigger svg { width: 14px; height: 14px; color: var(--muted); }
.language-flag { width: 28px; height: 20px; flex: 0 0 28px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 340px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.language-menu[hidden] { display: none; }
.language-menu h2 { font-size: 18px; }
.language-menu > p { margin: 3px 0 14px; color: var(--muted); font-size: 12px; }
.language-search { position: relative; display: block; margin-bottom: 10px; }
.language-search svg { position: absolute; top: 11px; left: 10px; width: 16px; height: 16px; color: var(--muted); }
.language-search input {
  width: 100%;
  padding: 9px 10px 9px 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.language-options { max-height: 255px; overflow-y: auto; }
.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.language-option[hidden] { display: none; }
.language-option:hover, .language-option.selected { background: var(--card-2); }
.language-option-text { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.language-option-text strong { font-size: 12px; }
.language-option-text small { color: var(--muted); font-size: 10px; }
.language-option > svg { width: 15px; height: 15px; color: var(--primary); }
.language-note { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 50;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.dropdown-item:hover { background: var(--card); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item svg { width: 16px; height: 16px; }

/* ---------- Cards / Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--primary); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue   { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red    { background: var(--danger-soft); color: var(--danger); }
.stat-icon.violet { background: #7c3aed22; color: #a78bfa; }

.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-size: 16px; }

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

.chart-box { position: relative; height: 260px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s, opacity .15s, border-color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: var(--card-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.loading .spinner { display: inline-block; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--card-2); }
.table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.st-UNUSED   { background: var(--primary-soft); color: var(--primary); }
.st-ACTIVE   { background: var(--success-soft); color: var(--success); }
.st-EXPIRED  { background: var(--warning-soft); color: var(--warning); }
.st-BANNED   { background: var(--danger-soft); color: var(--danger); }
.st-REVOKED  { background: #6b728033; color: #9ca3af; }
.st-active   { background: var(--success-soft); color: var(--success); }
.st-banned   { background: var(--danger-soft); color: var(--danger); }
.st-suspended{ background: var(--warning-soft); color: var(--warning); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions .icon-btn { width: 32px; height: 32px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); }
.textarea { resize: vertical; min-height: 90px; }
.select { appearance: none; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap > svg {
  position: absolute;
  left: 12px;
  width: 17px; height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.input-wrap .input { padding-left: 38px; }
.input-action {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px;
}
.input-action:hover { color: var(--text); }
.input-action svg { width: 17px; height: 17px; }

.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.checkbox input { accent-color: var(--primary); width: 15px; height: 15px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; }
.filter-bar .search { flex: 1; min-width: 200px; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty svg { width: 44px; height: 44px; margin-bottom: 12px; opacity: .6; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Auth (login) ---------- */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 20% -10%, rgba(59,130,246,.16), transparent),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-logo {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-title { text-align: center; font-size: 22px; }
.auth-subtitle { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 16px; }
.auth-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--border); }
.btn-google { border-color: var(--border); background: #fff; color: #202124; }
.btn-google:hover { background: #f3f4f6; }
.google-mark { font-size: 17px; font-weight: 800; color: #4285f4; }
.error-card { text-align: center; }
.error-code { margin-bottom: 8px; color: var(--primary); font-size: 56px; font-weight: 800; line-height: 1; }
.error-card .auth-subtitle { margin-bottom: 24px; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.key-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--card-2);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.toastify { z-index: 9999; }

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

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
}

@media (max-width: 520px) {
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 20px; }
  .filter-bar .search { min-width: 100%; }
  .language-menu { position: fixed; top: 74px; left: 12px; right: 12px; width: auto; }
  .language-trigger { padding: 8px; }
}

/* ===================================================================
   SweetAlert2 — tema escuro (combina com o painel)
   =================================================================== */
.swal2-container { font-family: 'Inter', system-ui, sans-serif !important; }
.swal2-container.swal2-backdrop-show { background: rgba(5, 8, 13, 0.74) !important; }

.swal2-popup {
  position: relative !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
  padding: 26px 26px 22px !important;
  font-size: 14px !important;
}
.swal2-popup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  pointer-events: none;
}

/* Barras de rolagem discretas (a barra clara do Windows destoa no tema escuro) */
html { scrollbar-width: thin; scrollbar-color: #2c3646 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2c3646;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #3b4759; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.swal2-title {
  color: var(--text) !important;
  font-weight: 700 !important;
  font-size: 20px !important;
}
.swal2-html-container {
  color: var(--muted) !important;
  margin-top: 6px !important;
}

/* Campos */
.swal2-input,
.swal2-select,
.swal2-textarea,
.swal2-file,
.swal2-range {
  background: var(--card-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-family: 'Inter', sans-serif !important;
  width: 100% !important;
  margin: 0 0 10px !important;
}
.swal2-input:focus,
.swal2-select:focus,
.swal2-textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
  outline: none !important;
}
.swal2-input::placeholder,
.swal2-textarea::placeholder { color: var(--muted) !important; }
.swal2-select option { background: var(--card-2); color: var(--text); }

/* Rótulos customizados (usados nos modais) */
.swal2-label {
  display: block;
  text-align: left;
  margin: 10px 0 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Mensagem de validação */
.swal2-validation-message {
  background: var(--danger-soft) !important;
  color: #fca5a5 !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

/* Botões */
.swal2-actions { gap: 10px !important; margin-top: 20px !important; }
.swal2-styled {
  border-radius: 10px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 10px 20px !important;
  box-shadow: none !important;
}
.swal2-confirm { background: var(--primary) !important; color: #fff !important; }
.swal2-confirm:hover { background: var(--primary-2) !important; }
.swal2-cancel {
  background: var(--card-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.swal2-cancel:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.swal2-deny { background: var(--danger-soft) !important; color: var(--danger) !important; }

/* Ícone de fechar */
.swal2-close { color: var(--muted) !important; }
.swal2-close:hover { color: var(--text) !important; }

/* Toast */
.swal2-popup.swal2-toast {
  background: var(--card-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  padding: 10px 14px !important;
  max-height: none !important;
  overflow: visible !important;
}
.swal2-toast .swal2-title { color: var(--text) !important; font-size: 13.5px !important; }
.swal2-timer-progress-bar { background: var(--primary) !important; }

/* Prompt (input inline) */
.swal2-input-label { color: var(--muted) !important; }

/* ===================================================================
   Auth v2 — layout em duas colunas (login, cadastro, recuperação)
   =================================================================== */
.auth-body {
  display: block;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(59,130,246,.18), transparent),
    radial-gradient(900px 500px at 110% 110%, rgba(99,102,241,.12), transparent),
    var(--bg);
}
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(59,130,246,.25), transparent),
    radial-gradient(500px 400px at 90% 90%, rgba(99,102,241,.2), transparent),
    var(--bg-soft);
}
.auth-hero-inner { max-width: 420px; }
.auth-hero-logo {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  margin-bottom: 24px;
}
.auth-hero-logo svg { width: 30px; height: 30px; }
.auth-hero-title { font-size: 34px; line-height: 1.1; margin-bottom: 12px; }
.auth-hero-sub { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 28px; }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 14px; }
.auth-features svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }

.auth-panel { display: grid; place-items: center; padding: 32px 24px; min-height: 100vh; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.auth-logo {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-title { text-align: center; font-size: 22px; }
.auth-subtitle { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 16px; gap: 10px; }
.auth-link { color: var(--primary); font-weight: 600; font-size: 13px; }
.auth-link:hover { text-decoration: underline; }
.auth-footer-link { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.auth-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #fca5a5;
  font-size: 13px;
}
.auth-success {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ===================================================================
   Créditos, pacotes e pagamento PIX
   =================================================================== */
.credits-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(99,102,241,.10));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.balance-label { color: var(--muted); font-size: 13px; }
.balance-value { font-size: 34px; font-weight: 800; line-height: 1.1; }
.balance-value span { font-size: 15px; font-weight: 600; color: var(--muted); }

.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.package-card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s, border-color .15s;
}
.package-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.package-name { font-weight: 700; font-size: 16px; }
.package-credits { font-size: 24px; font-weight: 800; color: var(--primary); }
.package-credits span { font-size: 13px; font-weight: 600; color: var(--muted); }
.package-price { font-size: 18px; font-weight: 700; }
.package-desc { color: var(--muted); font-size: 12.5px; }
.package-card .btn { margin-top: auto; }

.pix-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.pix-qr-wrap {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: center;
}
.pix-qr { width: 100%; max-width: 250px; height: auto; border-radius: 10px; background: #fff; padding: 8px; }
.pix-info { display: flex; flex-direction: column; }
.pix-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.pix-line > span:first-child { color: var(--muted); }
.credit-plus { color: var(--success); }
.pix-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; margin-top: 4px; }
.pix-success { text-align: center; padding: 28px 10px; }
.pix-success svg { width: 56px; height: 56px; color: var(--success); margin-bottom: 10px; }
.pix-success h3 { color: var(--success); margin-bottom: 6px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--warning); }

.os-pending { background: var(--warning-soft); color: var(--warning); }
.os-approved { background: var(--success-soft); color: var(--success); }
.os-expired { background: #6b728033; color: #9ca3af; }
.os-cancelled { background: var(--danger-soft); color: var(--danger); }
.os-rejected { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 760px) {
  .pix-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   Produtos, loja e resgate de keys
   =================================================================== */
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }

.product-cell { display: flex; align-items: center; gap: 12px; }
.product-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--card-2);
  flex-shrink: 0;
}
.product-thumb.placeholder { display: grid; place-items: center; color: var(--muted); }
.product-thumb.placeholder svg { width: 20px; height: 20px; }

.file-cell { display: flex; align-items: center; gap: 8px; }
.file-ext {
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 7px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
}

.icon-btn.success { color: var(--success); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.success:hover { background: var(--success-soft); }
.icon-btn.danger:hover { background: var(--danger-soft); }

.st-inactive { background: #6b728033; color: #9ca3af; }
.st-pending,
.st-blocked { background: var(--warning-soft); color: var(--warning); }
.st-paid,
.st-available { background: var(--success-soft); color: var(--success); }
.st-cancelled,
.st-expired { background: #6b728033; color: #9ca3af; }
.st-redeemed { background: var(--primary-soft); color: var(--primary); }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.store-card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, border-color .15s;
}
.store-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.store-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(99,102,241,.10));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.store-cover img { width: 100%; height: 100%; object-fit: cover; }
.store-cover-empty { color: var(--muted); }
.store-cover-empty svg { width: 42px; height: 42px; }
.store-days-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(11, 14, 20, .78);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.store-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.store-name { font-size: 16px; }
.store-version { color: var(--muted); font-size: 11.5px; }
.store-desc {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.store-price-row { display: flex; align-items: baseline; justify-content: space-between; }
.store-price { font-size: 19px; font-weight: 800; }
.store-price small { font-size: 12px; font-weight: 600; color: var(--muted); }
.days-row { display: flex; align-items: center; gap: 8px; }
.days-row .icon-btn { width: 32px; height: 32px; flex-shrink: 0; }
.days-input { width: 70px; text-align: center; padding-left: 8px; padding-right: 8px; }
.store-total { margin-left: auto; font-weight: 800; color: var(--primary); font-size: 15px; }
.store-card .btn { margin-top: auto; }

.inactive-list { display: flex; flex-direction: column; gap: 10px; }
.inactive-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}
.inactive-item p { margin: 4px 0 0; font-size: 12.5px; }

.claim-box { display: flex; justify-content: center; margin: 16px 0; }
.claim-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  letter-spacing: .12em;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  padding: 12px 18px;
  word-break: break-all;
}
.claim-input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  letter-spacing: .12em;
  font-weight: 700;
  text-transform: uppercase;
}
.claim-code-small { font-size: 11.5px; }

.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; }
.steps-list p { margin: 2px 0 0; font-size: 12.5px; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 800; font-size: 12px;
  flex-shrink: 0;
}

.notice-card { display: flex; align-items: center; gap: 12px; border-color: var(--warning); }
.notice-card svg { width: 20px; height: 20px; color: var(--warning); flex-shrink: 0; }
.notice-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* Formulário dentro do SweetAlert (novo/editar produto) */
.swal-form { text-align: left; max-height: 62vh; overflow-y: auto; padding: 2px 4px 0; }
.swal-form .swal2-label { display: block; margin: 12px 0 6px; text-align: left; }
.swal-form .swal2-input,
.swal-form .swal2-textarea,
.swal-form .swal2-select,
.swal-form .swal2-file { width: 100%; margin: 0; }
.swal-form .swal2-textarea { min-height: 62px; }
.swal-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-image-preview {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.form-file-info { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.upload-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
  margin: 18px 0 8px;
}
#uploadBar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  transition: width .2s;
}

@media (max-width: 900px) {
  .stat-grid-3 { grid-template-columns: 1fr; }
  .swal-form-2col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .store-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   Widget de saldo na topbar (seller)
   =================================================================== */
.topbar-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-balance:hover { border-color: var(--warning); color: var(--warning); }
.topbar-balance svg { width: 16px; height: 16px; color: var(--warning); flex-shrink: 0; }
.topbar-balance-add {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--warning);
  color: #000;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  border: none;
  margin-left: 2px;
  flex-shrink: 0;
  transition: background .15s;
}
.topbar-balance:hover .topbar-balance-add { background: #d97706; }

/* ===================================================================
   Tela de depósito de saldo
   =================================================================== */
.deposit-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.deposit-form-card { margin-bottom: 0; }
.deposit-hint { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }

.deposit-amount-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.deposit-amount-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s;
}
.deposit-amount-wrap:focus-within { border-color: var(--primary); }
.deposit-currency {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.deposit-amount-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 28px;
  font-weight: 800;
  padding: 12px 14px;
  outline: none;
  min-width: 0;
  -moz-appearance: textfield;
}
.deposit-amount-input::-webkit-outer-spin-button,
.deposit-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.deposit-flag {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-left: 1px solid var(--border);
}

.deposit-min-hint { color: var(--muted); font-size: 11.5px; margin: 6px 0 20px; }

.deposit-label-row {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.deposit-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.deposit-preset {
  flex: 1 0 calc(33.33% - 10px);
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  transition: border-color .15s, background .15s, color .15s;
  text-align: center;
}
.deposit-preset:hover { border-color: var(--primary); color: var(--primary); }
.deposit-preset.active {
  border-color: var(--warning);
  background: rgba(245,158,11,.12);
  color: var(--warning);
  position: relative;
}
.deposit-preset.active::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  color: var(--warning);
}

/* Coluna direita — resumo */
.deposit-summary-wrap { display: flex; flex-direction: column; gap: 12px; }
.deposit-summary { margin-bottom: 0; }
.deposit-summary-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}
.deposit-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--muted);
}
.deposit-summary-row strong { color: var(--text); }
.deposit-summary-divider { border-top: 1px solid var(--border); margin: 12px 0; }
.deposit-summary-total-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.deposit-summary-total {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
}
.deposit-summary-credits {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.deposit-summary-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.deposit-rule-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.deposit-rule-card svg { flex-shrink: 0; margin-top: 1px; }
.deposit-rule-card strong { color: var(--text); }

@media (max-width: 860px) {
  .deposit-layout { grid-template-columns: 1fr; }
  .deposit-presets .deposit-preset { flex: 1 0 calc(50% - 10px); }
}
@media (max-width: 480px) {
  .deposit-presets .deposit-preset { flex: 1 0 100%; }
  .topbar-balance span { display: none; }
}

/* ===================================================================
   Página de downloads do cliente
   =================================================================== */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.dl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, border-color .15s;
}
.dl-card:hover { transform: translateY(-3px); border-color: var(--primary); }

.dl-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(99,102,241,.10));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.dl-cover img { width: 100%; height: 100%; object-fit: cover; }
.dl-cover-empty { color: var(--muted); }
.dl-cover-empty svg { width: 42px; height: 42px; }

.dl-ext-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(11,14,20,.78);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.dl-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.dl-name { font-size: 16px; font-weight: 700; }
.dl-version { color: var(--muted); font-size: 11.5px; }
.dl-desc {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.dl-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11.5px;
}
.dl-meta-item svg { width: 13px; height: 13px; }
.dl-filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--card-2);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-key-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  margin-top: 4px;
}
.dl-btn { margin-top: auto; }

@media (max-width: 600px) {
  .downloads-grid { grid-template-columns: 1fr; }
}




/* ── Popup de anúncio ───────────────────────────────────────────────────── */
.ann-popup-img { width:100%; max-height:160px; object-fit:cover; border-radius:10px; margin:12px 0; }
.ann-popup-link { display:inline-flex; align-items:center; gap:6px; margin-top:12px; padding:8px 16px; border-radius:8px; background:var(--primary); color:#fff; font-weight:600; font-size:13px; text-decoration:none; }
.ann-popup-link:hover { background:var(--primary-2); }
.ann-swal-popup { border:1px solid var(--border,#232a37) !important; border-radius:var(--radius,14px) !important; }
